/* EzyForms – structure and states for every Ezytrail form (design/FORMS.md).
   Theme it by overriding the --ef-* variables on a parent (e.g. :root or .lead-band).
   Defaults = the forms showcase (design/forms/). Never put white text on --ef-btn-bg orange. */
:root {
  --ef-font: inherit;
  --ef-text: #111614;          /* input text */
  --ef-label: #111614;         /* labels, legends, check text */
  --ef-help: #5d6366;          /* hints, (optional), notices */
  --ef-placeholder: #6b7270;
  --ef-title: #194b45;         /* form titles, dialog title, step titles */
  --ef-line: #d9dddb;          /* hairlines */
  --ef-field-bg: #fff;
  --ef-field-border: #8a9290;
  --ef-field-border-hover: #111614;
  --ef-field-radius: 10px;
  --ef-field-h: 48px;          /* inputs and selects; buttons keep --ef-btn-h */
  --ef-field-disabled-bg: #f1f2f1;
  --ef-error: #ad1419;
  --ef-error-bg: #fbeeee;
  --ef-success: #194b45;
  --ef-success-bg: #e8efed;    /* recap box, checked choice */
  --ef-focus: #194b45;
  --ef-focus-gap: #fff;
  --ef-btn-bg: #f7941d;
  --ef-btn-bg-hover: #e5830c;
  --ef-btn-bg-active: #d07508;
  --ef-btn-fg: #111614;
  --ef-btn-radius: 999px;
  --ef-btn-h: 52px;            /* every button: primary, ghost, text */
  --ef-btn-weight: 600;
  --ef-btn2-fg: #111614;       /* outlined secondary */
  --ef-btn2-border: #111614;
  --ef-link: #111614;          /* text buttons and links */
  --ef-link-underline: #f7941d;
  --ef-panel-bg: transparent;  /* background behind the form itself */
  --ef-panel-fg: inherit;
  --ef-scrim: rgba(17, 22, 20, .28);
  --ef-dialog-bg: #fff;
  --ef-dialog-fg: #111614;
  --ef-dialog-radius: 16px;
  --ef-dialog-shadow: 0 2px 6px rgba(17, 22, 20, .08), 0 24px 64px -16px rgba(17, 22, 20, .32);
  --ef-scrim-blur: 3px;
  --ef-scrim-solid: rgba(17, 22, 20, .40); /* when blur is unavailable */
  --ef-gap: 12px;              /* between rows of fields */
  --ef-ease: cubic-bezier(.16, 1, .3, 1);
}
@media (max-width: 720px) {
  :root { --ef-btn-h: 48px; }
}

.ef-form, .ef-done, .ef-dialog { font-family: var(--ef-font); }
/* two columns when each can hold a one-line message (216px), else one; never more than two */
.ef-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(216px, calc(50% - 8px)), 1fr)); gap: var(--ef-gap) 16px; background: var(--ef-panel-bg); color: var(--ef-panel-fg); }
.ef-form[hidden], .ef-form [hidden], .ef-done[hidden] { display: none !important; }
.ef-form > :is(.ef-full, fieldset, .ef-summary, .ef-alert, .ef-submit, .ef-notice, .ef-turnstile, .ef-check, .ef-title, .ef-sub, .ef-head, .ef-steps, .ef-step, .ef-step-nav, .ef-result, .ef-live) { grid-column: 1 / -1; }
.ef-form.ef-one { grid-template-columns: 1fr; }
.ef-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ef-icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ef-form :is(p, h2, h3, h4, ul, ol, fieldset) { margin: 0; }

.ef-title { font-size: 22px; line-height: 1.2; font-weight: 700; color: var(--ef-title); }
.ef-sub { margin-top: 4px !important; color: var(--ef-help); font-size: 15px; line-height: 1.45; }
.ef-form > .ef-sub { margin-top: -8px !important; }

/* fields */
.ef-field { display: flex; flex-direction: column; min-width: 0; border: 0; padding: 0; }
.ef-field > label, .ef-form legend { font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--ef-label); padding: 0; }
.ef-opt { color: var(--ef-help); font-weight: 400; }
.ef-hint { margin-top: 4px !important; font-size: 13px; line-height: 18px; color: var(--ef-help); }
.ef-field > :is(label, .ef-hint) + :is(.ef-input, .ef-select, .ef-textarea, .ef-affix) { margin-top: 6px; }
/* half-width fields: label / control / message on rows shared with the neighbour (subgrid),
   so controls in one row always share a top edge, whatever wraps or errors */
:is(.ef-form, .ef-step, .ef-more-body) > .ef-field:not(.ef-full, fieldset) { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
:is(.ef-form, .ef-step, .ef-more-body) > .ef-field:not(.ef-full, fieldset) > label { align-self: end; }
.ef-input, .ef-select, .ef-textarea {
  box-sizing: border-box; width: 100%; height: var(--ef-field-h); padding: 0 16px;
  font: inherit; font-size: 16px; color: var(--ef-text); background: var(--ef-field-bg);
  border: 1px solid var(--ef-field-border); border-radius: var(--ef-field-radius);
  transition: border-color .15s, box-shadow .15s; appearance: none; caret-color: var(--ef-focus);
}
.ef-input::placeholder, .ef-textarea::placeholder { color: var(--ef-placeholder); opacity: 1; }
.ef-input:hover, .ef-select:hover, .ef-textarea:hover { border-color: var(--ef-field-border-hover); }
.ef-input:focus-visible, .ef-select:focus-visible, .ef-textarea:focus-visible, .ef-is-focus .ef-input {
  outline: none; border-color: var(--ef-focus);
  box-shadow: 0 0 0 1px var(--ef-focus), 0 0 0 4px color-mix(in srgb, var(--ef-focus) 22%, transparent);
}
.ef-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px #fff8ee inset; -webkit-text-fill-color: var(--ef-text); }
.ef-select { padding-right: 44px; cursor: pointer; background: var(--ef-field-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111614' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 20px; }
.ef-select.ef-empty { color: var(--ef-placeholder); }
.ef-select option { color: #111614; }
.ef-textarea { height: auto; min-height: 96px; padding: 12px 16px; resize: vertical; line-height: 1.5; }
.ef-input[readonly], .ef-textarea[readonly] { background: color-mix(in srgb, var(--ef-field-bg) 94%, #8a9290); }
.ef-input:disabled, .ef-select:disabled, .ef-textarea:disabled { background: var(--ef-field-disabled-bg); border-color: #c5cac8; color: #6b7270; cursor: not-allowed; }
.ef-input[type="file"] { height: auto; padding: 12px 16px; font-size: 15px; }
.ef-counter { margin-top: 6px !important; font-size: 14px; color: var(--ef-help); text-align: right; font-variant-numeric: tabular-nums; }
.ef-affix { position: relative; display: flex; }
.ef-affix > span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 17px; color: var(--ef-help); pointer-events: none; }
.ef-affix .ef-input { padding-left: 32px; font-variant-numeric: tabular-nums; }
.ef-mono { font-variant-numeric: tabular-nums; letter-spacing: .06em; }

/* errors: colour only (border colour + ring). The box never changes size. */
.ef-invalid :is(.ef-input, .ef-select, .ef-textarea), :is(.ef-input, .ef-select, .ef-textarea)[aria-invalid="true"] { border-color: var(--ef-error); box-shadow: 0 0 0 1px var(--ef-error); }
/* the message slot (FORMS.md 4.2): always present and exactly one 13px/18px line, so showing,
   changing or clearing a message never moves anything. Help, error and suggestion share it. */
.ef-msg { display: grid; height: 18px; margin-top: 4px; font-size: 13px; line-height: 18px; }
.ef-msg > :is(.ef-hint, .ef-error, .ef-suggest) { grid-area: 1 / 1; margin: 0 !important; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: inherit; line-height: inherit; }
.ef-msg.ef-on > :not(.ef-error), .ef-msg:has(> .ef-suggest) > .ef-hint { visibility: hidden; }
.ef-msg-out { grid-column: 1 / -1; margin-top: -6px; }
:is(.ef-form, .ef-step, .ef-more-body) > .ef-msg-out { margin-top: calc(-1 * var(--ef-gap) - 4px); }
.ef-error { display: flex; gap: 5px; align-items: center; margin-top: 6px !important; font-size: 13px; font-weight: 500; line-height: 18px; color: var(--ef-error); }
.ef-error > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ef-error .ef-icon { width: 14px; height: 14px; }
.ef-error[hidden] { display: none; }
.ef-suggest { margin-top: 6px !important; font-size: 13px; line-height: 18px; color: var(--ef-label); }
.ef-suggest button { font: inherit; font-weight: 600; color: var(--ef-focus); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* choices (segmented radios) – same height as buttons */
.ef-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ef-choices.ef-stack { flex-direction: column; }
.ef-choice { position: relative; }
.ef-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ef-choice span { display: flex; align-items: center; min-height: var(--ef-btn-h); box-sizing: border-box; padding: 8px 16px; border: 1px solid var(--ef-field-border); border-radius: var(--ef-field-radius); background: var(--ef-field-bg); color: var(--ef-text); font-size: 15px; line-height: 1.3; transition: border-color .15s, background .15s; }
.ef-choice input:hover + span { border-color: var(--ef-field-border-hover); }
.ef-choice input:checked + span { border: 2px solid var(--ef-success); padding: 7px 15px; background: var(--ef-success-bg); font-weight: 500; }
.ef-choice input:focus-visible + span { box-shadow: 0 0 0 2px var(--ef-focus-gap), 0 0 0 5px var(--ef-focus); }
.ef-invalid .ef-choice span { border-color: var(--ef-error); }
.ef-term { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 6px; }
.ef-term .ef-choice span { justify-content: center; padding: 0; height: var(--ef-btn-h); }
.ef-term .ef-choice input:checked + span { padding: 0; }
.ef-check { display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 0; cursor: pointer; font-size: 14px; line-height: 1.4; color: var(--ef-label); }
.ef-check input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--ef-success); cursor: pointer; }
.ef-check a { color: inherit; }

/* summary, alerts, turnstile */
/* one compact line, directly above the actions (FORMS.md 4.3) */
.ef-summary { padding: 10px 14px; border-radius: 10px; background: var(--ef-error-bg); border: 1px solid color-mix(in srgb, var(--ef-error) 35%, transparent); color: var(--ef-error); font-size: 14px; line-height: 1.45; }
.ef-summary p { display: flex; gap: 8px; align-items: flex-start; }
.ef-summary .ef-icon { width: 16px; height: 16px; margin-top: 2px; }
.ef-summary b { font-weight: 600; }
.ef-summary a { color: inherit; font-weight: 500; text-underline-offset: 3px; }
.ef-alert { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 12px; background: var(--ef-error-bg); border: 1px solid color-mix(in srgb, var(--ef-error) 30%, transparent); color: #111614; font-size: 16px; line-height: 1.5; }
.ef-alert .ef-icon { width: 22px; height: 22px; color: var(--ef-error); margin-top: 1px; }
.ef-alert a { color: inherit; font-weight: 600; white-space: nowrap; }
.ef-turnstile { display: grid; gap: 8px; }
.ef-ts-lead { font-size: 15px; color: var(--ef-help); }
.ef-ts-box { display: flex; align-items: center; gap: 14px; width: 300px; max-width: 100%; height: 65px; padding: 0 14px; box-sizing: border-box; border: 1px solid #d0d4d2; border-radius: 6px; background: #fafafa; color: #111614; font-size: 15px; }
.ef-ts-box input { width: 24px; height: 24px; accent-color: var(--ef-success); }
.ef-ts-box small { margin-left: auto; font-size: 12px; color: #5d6366; text-align: right; line-height: 1.3; }

/* buttons: one height everywhere (DESIGN-STANDARD.md 四) */
.ef-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.ef-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; box-sizing: border-box;
  height: var(--ef-btn-h); padding: 0 28px; white-space: nowrap;
  font: inherit; font-size: 17px; font-weight: var(--ef-btn-weight); line-height: 1; text-decoration: none;
  color: var(--ef-btn-fg); background: var(--ef-btn-bg); border: 0; border-radius: var(--ef-btn-radius); cursor: pointer;
  transition: background .15s, transform .1s;
}
.ef-btn:hover { background: var(--ef-btn-bg-hover); }
.ef-btn:active { background: var(--ef-btn-bg-active); transform: translateY(1px); }
.ef-btn[aria-busy="true"], .ef-btn:disabled { cursor: progress; background: color-mix(in srgb, var(--ef-btn-bg) 55%, #fff); }
.ef-btn .ef-icon { width: 20px; height: 20px; }
.ef-btn[aria-busy="true"] .ef-icon { animation: ef-spin .9s linear infinite; }
.ef-btn-ghost { background: transparent; color: var(--ef-btn2-fg); border: 1.5px solid var(--ef-btn2-border); }
.ef-btn-ghost:hover { background: color-mix(in srgb, var(--ef-btn2-border) 6%, transparent); }
.ef-btn-block { width: 100%; }
.ef-link { display: inline-flex; align-items: center; height: var(--ef-btn-h); padding: 0 2px; font: inherit; font-size: 16px; font-weight: 500; color: var(--ef-link); background: none; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--ef-link-underline); text-decoration-thickness: 2px; text-underline-offset: 4px; }
:is(.ef-btn, .ef-link, .ef-d-close):focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ef-focus-gap), 0 0 0 5px var(--ef-focus); }
.ef-call { font-size: 15px; color: var(--ef-help); }
.ef-call a { color: var(--ef-label); font-weight: 500; white-space: nowrap; }
.ef-notice { font-size: 13px; line-height: 1.45; color: var(--ef-help); }
/* opt-in beside the button on desktop, above it on phones (DOM: check, [summary], button). The error
   summary goes under that row on desktop and between the two on phones, so nothing above it moves. */
.ef-submit:not(.ef-cta):has(> .ef-check) { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "btn check" "sum sum"; gap: 12px 24px; }
.ef-submit:not(.ef-cta):has(> .ef-check) > .ef-btn { grid-area: btn; }
.ef-submit:not(.ef-cta) > .ef-check { grid-area: check; }
.ef-submit:not(.ef-cta) > .ef-summary { grid-area: sum; }
/* optional fields behind a disclosure that expands in place (FORMS.md 3.8) */
.ef-more { grid-column: 1 / -1; }
.ef-more > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ef-link); text-decoration: underline; text-decoration-color: var(--ef-link-underline); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ef-more > summary::-webkit-details-marker { display: none; }
.ef-more > summary::before { content: "+"; display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 15px; line-height: 1; text-decoration: none; }
.ef-more[open] > summary::before { content: "−"; }
.ef-more > summary:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ef-focus-gap), 0 0 0 4px var(--ef-focus); border-radius: 4px; }
.ef-more-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(216px, calc(50% - 8px)), 1fr)); gap: var(--ef-gap) 16px; padding-top: 4px; }
.ef-more-body > :is(.ef-full, fieldset, .ef-check) { grid-column: 1 / -1; }
.ef-more.ef-section { border-top: 1px solid var(--ef-line); }
.ef-section > summary { display: flex; justify-content: space-between; width: 100%; min-height: 48px; font-size: 16px; font-weight: 600; color: var(--ef-title); text-decoration: none; }
.ef-section > summary::before { content: none; }
.ef-section > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .15s; }
.ef-section[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.ef-section > .ef-more-body { padding: 4px 0 16px; }
.ef-notice a { color: inherit; text-decoration-thickness: 1px; }
@keyframes ef-spin { to { transform: rotate(360deg); } }
@keyframes ef-rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .ef-btn[aria-busy="true"] .ef-icon, .ef-done { animation: none; } }

/* cards in one row: CTA on a shared baseline (DESIGN-STANDARD.md 四) */
.ef-card { display: flex; flex-direction: column; }
.ef-card .ef-form { flex: 1; display: flex; flex-direction: column; gap: var(--ef-gap); }
.ef-cta { margin-top: auto; display: grid; gap: 12px; }
.ef-cta > :is(.ef-notice, .ef-call) { min-height: 44px; }

/* multi-step */
.ef-steps { display: flex; gap: 6px; }
.ef-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--ef-line); }
.ef-steps i.ef-on { background: var(--ef-success); }
.ef-step { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(216px, calc(50% - 8px)), 1fr)); gap: var(--ef-gap) 16px; }
.ef-step > :is(.ef-step-title, fieldset, .ef-check, .ef-full) { grid-column: 1 / -1; }
.ef-step-title { font-size: 20px; font-weight: 600; color: var(--ef-title); }
.ef-step-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* calculator */
.ef-calc-result { padding: 22px 24px; border-radius: 14px; background: var(--ef-success); color: #fff; }
.ef-calc-result > span { font-size: 15px; opacity: .85; }
.ef-calc-result b { display: block; font-size: 40px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.ef-calc-result b small { font-size: 18px; font-weight: 500; opacity: .85; }
.ef-calc-result p { margin: 10px 0 0; font-size: 14px; line-height: 1.5; opacity: .85; }

/* inline results */
.ef-done { display: flex; gap: 14px; align-items: flex-start; padding: 20px 0; border-top: 2px solid var(--ef-success); animation: ef-rise .5s var(--ef-ease) both; }
.ef-done > .ef-icon { width: 28px; height: 28px; color: var(--ef-success); margin-top: 2px; }
.ef-done h3 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 700; color: var(--ef-title); }
.ef-done p { margin: 4px 0 0; font-size: 16px; color: var(--ef-label); }
.ef-done-links { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 4px; }
.ef-result { display: flex; gap: 12px; padding-top: 18px; border-top: 1px solid var(--ef-line); }
.ef-result .ef-icon { width: 22px; height: 22px; color: var(--ef-success); margin-top: 2px; }
.ef-result p { font-size: 15px; color: var(--ef-help); margin-top: 2px; }
.ef-result a { color: inherit; }
/* programmatic focus targets (tabindex=-1): no ring, even if the page styles :focus-visible globally */
:is(.ef-done h3, .ef-result b, .ef-summary p, .ef-step-title, .ef-d-title, .ef-alert):is(:focus, :focus-visible) { outline: none; box-shadow: none; }

/* result dialog (FORMS.md 5.4.2). Visual refinements: design/OVERLAYS.md */
html.ef-lock { overflow: hidden; }
.ef-dialog { box-sizing: border-box; width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 40px 40px 32px; border: 0; border-radius: var(--ef-dialog-radius); background: var(--ef-dialog-bg); color: var(--ef-dialog-fg); box-shadow: var(--ef-dialog-shadow); overflow: auto; }
.ef-dialog[open] { animation: ef-open 240ms var(--ef-ease) both; }
.ef-dialog::backdrop { background: var(--ef-scrim-solid); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ef-dialog::backdrop { background: var(--ef-scrim); -webkit-backdrop-filter: blur(var(--ef-scrim-blur)); backdrop-filter: blur(var(--ef-scrim-blur)); }
}
@media (prefers-reduced-transparency: reduce) {
  .ef-dialog::backdrop { background: var(--ef-scrim-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@keyframes ef-open { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes ef-sheet { from { transform: translateY(100%); } }
@keyframes ef-fade { from { opacity: 0; } }
.ef-d-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.ef-d-close:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.ef-d-close .ef-icon { width: 22px; height: 22px; }
/* body: 8px grid. head (icon + title) → lead 8 → panel 24 → steps 24 → actions 32 → footer 16 */
.ef-d-body { display: block; }
.ef-d-head { display: flex; gap: 10px; align-items: flex-start; padding-right: 24px; }
.ef-d-icon { width: 24px !important; height: 24px !important; margin-top: 2px; color: var(--ef-success); stroke-width: 2; }
.ef-d-title { margin: 0; font-size: 21px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; color: var(--ef-title); text-wrap: pretty; }
.ef-d-lead { margin: 8px 0 0; font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.ef-d-panel { margin-top: 24px; border-radius: 12px; background: var(--ef-success-bg); font-size: 15px; line-height: 1.4; }
.ef-d-recap { display: grid; gap: 8px; margin: 0; padding: 16px 20px; }
.ef-d-recap > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
.ef-d-recap dt { color: var(--ef-help); }
.ef-d-recap dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ef-d-recap dd small { display: block; margin-top: 2px; font-weight: 400; font-size: 14px; color: var(--ef-help); }
.ef-d-note { margin: 0; padding: 12px 20px; border-top: 1px solid color-mix(in srgb, var(--ef-title) 12%, transparent); font-size: 14px; color: var(--ef-help); }
.ef-d-note:only-child { border-top: 0; }
.ef-d-note a { color: var(--ef-label); font-weight: 500; white-space: nowrap; }
.ef-d-next { margin-top: 24px; }
.ef-d-next h3 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ef-label); }
.ef-d-steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(var(--ef-steps, 3), minmax(0, 1fr)); gap: 16px; counter-reset: ef-s; font-size: 14px; line-height: 1.4; color: var(--ef-help); }
.ef-d-steps li { counter-increment: ef-s; position: relative; display: grid; gap: 8px; align-content: start; }
.ef-d-steps li::before { content: counter(ef-s); width: 24px; height: 24px; border-radius: 50%; background: var(--ef-success); color: #fff; font-weight: 600; font-size: 13px; line-height: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.ef-d-steps li:not(:last-child)::after { content: ""; position: absolute; top: 12px; left: 32px; right: -8px; height: 1px; background: color-mix(in srgb, var(--ef-success) 30%, transparent); }
.ef-d-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px; margin-top: 32px; }
.ef-d-actions .ef-btn { padding: 0 16px; font-size: 16px; }
.ef-d-phone { margin: 16px 0 0; font-size: 14px; color: var(--ef-help); }
.ef-d-phone a { color: var(--ef-label); font-weight: 500; }

@media (max-width: 720px) {
  /* FORMS.md 3.7: one column on phones, except First + Last name, which stay side by side */
  .ef-form, .ef-step, .ef-more-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :is(.ef-form, .ef-step, .ef-more-body) > * { grid-column: 1 / -1; }
  :is(.ef-form, .ef-step, .ef-more-body) > .ef-field:has(> [name="firstName"]):has(+ .ef-field > [name="lastName"]),
  :is(.ef-form, .ef-step, .ef-more-body) > .ef-field:has(> [name="firstName"]) + .ef-field:has(> [name="lastName"]) { grid-column: auto; }
  .ef-submit:not(.ef-cta):has(> .ef-check) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "check" "sum" "btn"; gap: 8px; }
  .ef-submit .ef-btn, .ef-step-nav .ef-btn { width: 100%; }
  .ef-step-nav { flex-direction: column-reverse; align-items: stretch; }
  .ef-step-nav .ef-link { justify-content: center; }
  .ef-term { grid-template-columns: repeat(4, 1fr); }
  .ef-calc-result b { font-size: 34px; }
  .ef-dialog { width: 100%; max-width: none; margin: auto 0 0; border-radius: var(--ef-dialog-radius) var(--ef-dialog-radius) 0 0; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); max-height: 92dvh; }
  .ef-dialog[open] { animation: ef-sheet 320ms var(--ef-ease) both; }
  .ef-d-title { font-size: 20px; }
  .ef-d-head { padding-right: 48px; } /* clears the 44px close button at 16px */
  .ef-d-panel { margin-top: 16px; }
  .ef-d-recap { padding: 12px 16px; }
  .ef-d-recap > div { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .ef-d-note { padding: 10px 16px; }
  .ef-d-next { margin-top: 16px; }
  .ef-d-steps { grid-template-columns: 1fr; gap: 8px; margin-top: 8px; }
  .ef-d-steps li { grid-template-columns: 24px 1fr; gap: 10px; align-items: center; }
  .ef-d-steps li:not(:last-child)::after { display: none; }
  .ef-d-actions { margin-top: 24px; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .ef-dialog[open] { animation: ef-fade 120ms linear both; }
}
