/* Filing and order workspaces. Shared controls and color roles live in styles.css. */
.container.wide.filing-page,
.container.wide.order-page { max-width: 1380px; padding: 30px 32px 72px; }
.workspace-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin: 0 12px 23px; }
.workspace-heading h2 { margin: 0; font-size: 25px; font-weight: 500; letter-spacing: var(--heading-tracking); }
.workspace-progress { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.starter-notice { margin: 0 0 20px; }

/* A quiet navigation rail surrounds one continuous writing surface. */
.app-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 20px; align-items: start; padding: 18px; border: 1px solid var(--border); border-radius: 40px; background: var(--workspace, var(--surface-sunken)); }
.app-side { position: sticky; top: 96px; min-width: 0; padding: 15px 8px; }
.app-main { min-width: 0; max-width: none; min-height: 620px; padding: 34px 38px; border-radius: 32px; background: var(--surface-card); }
.side-label { margin-bottom: 12px; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.service-switch { margin-bottom: 29px; }
.app-side .segmented { width: 100%; }
.app-side .segmented button { flex: 1; height: 42px; padding: 0 10px; min-width: 0; font-size: 13px; line-height: 1.2; }
.app-side .segmented .thumb { background: var(--selection, var(--selected)); box-shadow: none; }
.app-side .segmented.has-thumb button[aria-pressed="true"] { color: var(--selection-ink, #252c2b); }
.stepper { display: grid; gap: 5px; list-style: none; margin: 0; padding: 0; }
.stepper li { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 45px; padding: 7px 12px; border-radius: 17px; color: var(--text-3); font-size: 14px; line-height: 1.4; cursor: default; }
.stepper .n { width: 25px; height: 25px; flex: none; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--text-3); font-size: 13px; line-height: 1; font-variant-numeric: tabular-nums; }
.stepper li.done { color: var(--text-2); cursor: pointer; }
.stepper li.done:hover { background: var(--hover); }
.stepper li.done .n { color: var(--ok); border-color: transparent; background: var(--surface-card); }
.stepper .n svg { display: block; flex: none; width: 14px; height: 14px; stroke-width: 2.5; }
.stepper li.active { background: var(--selection, var(--selected)); color: var(--selection-ink, #252c2b); font-weight: 600; }
.stepper li.active .n { background: #252c2b; border-color: #252c2b; color: #fffefa; }
.side-note { margin-top: 29px; padding: 23px 8px 0; border-top: 1px solid var(--border); color: var(--text-2); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.side-note b { display: inline-block; margin-bottom: 4px; color: var(--text); font-weight: 500; }
.app-side .autosave { padding: 0 8px; font-size: 13px; }

.step-head { margin-bottom: 31px; }
.step-head .kicker { margin-bottom: 12px; color: var(--text-3); font-size: 13px; letter-spacing: .035em; }
.step-head h1 { margin-bottom: 12px; font-size: 32px; font-weight: 500; letter-spacing: var(--heading-tracking); line-height: 1.3; }
.step-head p { max-width: 66ch; margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.75; }
.app-main .step > .panel { padding: 0; border-radius: 0; background: transparent; box-shadow: none; }
.step > .panel + .panel { margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--border); }
.step > .panel + .notice, .step > .notice + .panel { margin-top: 24px; }
.group-title { margin: 0 0 15px; color: var(--text-2); font-size: 14px; font-weight: 600; line-height: 1.65; }
.questions .group-title { color: var(--text); font-size: 15px; }
.questions .q-sep { margin: 25px 0; }
.filing-page .option { padding: 17px 18px; min-height: 80px; gap: 12px; }
.filing-page .option b { font-size: 14px; font-weight: 500; }
.filing-page .option small { margin-top: 4px; line-height: 1.6; }
.filing-page .step .actions { position: static; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 32px 0 0; padding: 23px 0 0; border-top: 1px solid var(--border); background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.actions .spacer { flex: 1; }
.actions .btn { min-height: 48px; }
.actions .btn.primary { min-width: 154px; }
.filing-page .form-grid { gap: 24px 18px; }
.filing-page #deadline { align-self: end; }
.filing-page .deadline-slot { min-height: 54px; }
.filing-page .deadline-slot .notice { min-height: 54px; }
.filing-page .step .pages { max-height: 680px; }
.local-badge { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding: 17px 20px; border-radius: 20px; background: var(--surface-sunken); }
.local-badge .lp-trust-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; color: var(--text-2); }
.local-badge .lp-trust-icon svg { display: block; width: 22px; height: 22px; }
.local-badge b { display: block; color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.5; }
.local-badge small { display: block; margin-top: 3px; color: var(--text-2); font-size: 13px; line-height: 1.6; }
.preview-restored { margin-bottom: 24px; }

.tx-list { display: grid; gap: 12px; margin-top: 18px; }
.tx-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 135px 40px; gap: 10px; align-items: start; }
.tx-row .icon-btn { min-height: 54px; }
.tx-row .field { min-width: 0; }
.tx-row .field input { height: var(--h-field, 54px); }
.tx-empty { padding: 20px; border: 1px dashed var(--border-strong); border-radius: 18px; color: var(--text-3); font-size: 13px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 34px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-0); color: var(--text-2); font: 400 12px/1.45 var(--font-sans); text-align: start; cursor: pointer; }
.chip::before { content: "+"; margin-right: 6px; color: var(--text); }
.chip:hover { background: var(--selection, var(--selected)); color: var(--selection-ink, #252c2b); }
.sig-pad { position: relative; border-radius: var(--r-input); background: #fff; box-shadow: inset 0 0 0 1px var(--border-strong); touch-action: none; overflow: hidden; }
.sig-pad::before { content: ""; position: absolute; left: 24px; right: 24px; bottom: 44px; border-bottom: 1px dashed #d4d4d0; pointer-events: none; }
.sig-pad canvas { display: block; position: relative; width: 100%; height: 200px; cursor: crosshair; }
.sig-pad .hint { position: absolute; left: 24px; bottom: 16px; color: #767671; font-size: 13px; pointer-events: none; }
.sig-pad.invalid { box-shadow: inset 0 0 0 1px var(--danger), 0 0 0 3px var(--danger-subtle); }
dl.kv { display: grid; grid-template-columns: minmax(120px, 28%) minmax(0, 1fr); margin: 0; font-size: 14px; }
dl.kv dt, dl.kv dd { margin: 0; padding: 13px 0; border-top: 1px solid var(--border); }
dl.kv dt:first-of-type, dl.kv dd:first-of-type { border-top: 0; }
dl.kv dt { padding-right: 18px; color: var(--text-3); }
dl.kv dd { overflow-wrap: anywhere; }
.doc-list { display: grid; gap: 0; list-style: none; margin: 0; padding: 0; }
.doc-list li { display: flex; align-items: center; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.doc-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.doc-list .doc-icon { flex: none; width: 38px; height: 44px; border: 1px solid var(--border-strong); border-radius: 5px; display: grid; place-items: center; color: var(--text-2); font: 500 9px/1 var(--font-mono); }
.doc-list b { font-weight: 500; }
.doc-list small { display: block; margin-top: 3px; color: var(--text-3); font-size: 13px; line-height: 1.6; }

/* Plans belong to the document/checkout task, not to the global card system. */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.plan { position: relative; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--border); border-radius: 25px; background: var(--surface-0); }
.plan.featured { border-color: color-mix(in srgb, var(--selection, var(--selected)) 75%, var(--text-3)); background: color-mix(in srgb, var(--selection, var(--selected)) 15%, var(--surface-card)); }
.plan-label { margin-bottom: 9px; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.plan h3 { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.4; }
.plan .price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; margin: 18px 0 4px; font-size: 34px; font-weight: 500; line-height: 1.15; letter-spacing: var(--heading-tracking); }
.plan .price small { color: var(--text-3); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.plan ul { flex: 1; display: grid; gap: 10px; list-style: none; margin: 20px 0 24px; padding: 0; color: var(--text-2); font-size: 13px; line-height: 1.65; }
.plan li { display: flex; gap: 9px; }
.plan li::before { content: "·"; color: var(--text-3); }
.plan .btn { width: 100%; min-height: 48px; }

/* The order has an action column and a separate document reading surface. */
.order-head { padding: 4px 12px 25px; }
.order-heading-row { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 20px; }
.order-identity { min-width: 0; }
.order-service { margin-bottom: 10px; color: var(--text-2); font-size: 13px; }
.order-head h1 { max-width: 950px; margin-bottom: 12px; overflow-wrap: anywhere; font-size: 36px; font-weight: 500; line-height: 1.25; letter-spacing: var(--heading-tracking); }
.order-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--text-3); font-size: 13px; line-height: 1.75; }
.order-head .meta > span { display: inline-flex; align-items: center; gap: 5px; }
.order-head .badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.order-locked { max-width: 280px; color: var(--text-3); font-size: 13px; line-height: 1.6; }
.order-page #flash > div { margin-bottom: 20px; }
.order-page .progress { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-bottom: 22px; padding: 5px; border-radius: 25px; background: var(--workspace, var(--surface-sunken)); box-shadow: none; }
.progress > div { min-width: 0; padding: 14px 19px; border-radius: 20px; background: var(--surface-card); box-shadow: none; }
.progress .kicker { margin-bottom: 5px; color: var(--text-3); font-size: 13px; line-height: 1.5; }
.progress b { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; line-height: 1.5; }
.progress .todo { background: transparent; }
.progress .todo b { color: var(--text-3); font-weight: 400; }
.order-workbench { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 18px; align-items: start; padding: 18px; border: 1px solid var(--border); border-radius: 40px; background: var(--workspace, var(--surface-sunken)); }
.order-controls { display: grid; gap: 18px; min-width: 0; }
.order-controls > .panel + .panel { margin-top: 0; }
.order-controls > .panel { min-width: 0; padding: 28px; border-radius: 32px; }
.order-controls .panel-head h2 { font-size: 23px; font-weight: 500; letter-spacing: var(--heading-tracking); }
.order-controls .panel-head h3 { font-size: 19px; font-weight: 500; }
.order-controls .plans { grid-template-columns: minmax(0, 1fr); }
.order-controls .plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; padding: 22px; }
.order-controls .plan-label { grid-column: 1; margin-bottom: 4px; }
.order-controls .plan h3 { grid-column: 1; }
.order-controls .plan .price { grid-column: 2; grid-row: 1 / 3; align-self: center; justify-content: end; margin: 0; max-width: 150px; font-size: 32px; }
.order-controls .plan .price small { width: 100%; text-align: end; }
.order-controls .plan ul { grid-column: 1 / -1; margin: 17px 0 20px; }
.order-controls .plan .btn { grid-column: 1 / -1; }
.order-page .download-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.order-page #upgrade { background: color-mix(in srgb, var(--selection, var(--selected)) 15%, var(--surface-card)); }
.order-page #upgrade .panel-head, .order-page #next .panel-head, .order-page #erased .panel-head, .order-page #erase .panel-head { flex-direction: column; align-items: stretch; }
.order-page #upgrade .btn, .order-page #next .btn, .order-page #erased .btn { align-self: start; }
.order-page .erase-panel .btn { align-self: start; }
.order-page .erase-panel { background: transparent; box-shadow: none; }
.order-page #faxBody > p { font-size: 14px; line-height: 1.75; }
.timeline { list-style: none; margin: 0 0 22px; padding: 0; }
.timeline li { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 0; color: var(--text-3); font-size: 14px; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; top: calc(50% + 7px); left: 2.5px; width: 1px; height: calc(100% - 14px); background: var(--border-strong); }
.timeline li.done, .timeline li.current { color: var(--text); }
.timeline li.done:not(:last-child)::after { background: var(--ok); }
.order-document.panel { position: sticky; top: 92px; min-width: 0; margin: 0; padding: 26px 22px 22px; border-radius: 32px; box-shadow: none; }
.order-document .panel-head { align-items: center; margin-bottom: 20px; padding: 0 4px; }
.order-document h2 { font-size: 21px; font-weight: 500; }
.order-document #pageCount { font-size: 13px; text-align: end; }
.order-document .pages { max-height: calc(100dvh - 208px); padding: 12px; border-radius: 20px; box-shadow: none; }
.order-workbench[data-state="erased"] { grid-template-columns: minmax(0, 1fr); }
.order-workbench[data-state="erased"] .order-controls { max-width: 820px; }
.order-page[data-state="error"] .order-head { padding: 45px; border-radius: 32px; background: var(--surface-card); }

@media (max-width: 1100px) {
  .container.wide.filing-page, .container.wide.order-page { padding-right: 24px; padding-left: 24px; }
  .app-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 12px; padding: 14px; }
  .app-main { padding: 29px; }
  .app-side { padding-right: 4px; padding-left: 4px; }
  .tx-row { grid-template-columns: 135px minmax(0, 1fr) 110px 36px; gap: 8px; }
  .order-workbench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 14px; gap: 14px; }
  .order-controls > .panel { padding: 24px; }
  .order-controls .plan { display: flex; padding: 20px; }
  .order-controls .plan .price { align-self: start; justify-content: start; max-width: none; margin: 15px 0 0; }
  .order-controls .plan .price small { width: auto; text-align: start; }
}

@media (max-width: 900px) {
  .workspace-heading { align-items: start; flex-direction: column; gap: 7px; margin-left: 5px; margin-right: 5px; }
  .workspace-heading h2 { font-size: 23px; }
  .app-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .app-side { position: static; padding: 7px 12px 12px; }
  .service-switch { display: flex; align-items: center; gap: 20px; margin-bottom: 19px; }
  .service-switch .side-label { flex: none; margin: 0; }
  .app-side .segmented { width: auto; max-width: 100%; min-width: 0; }
  .app-side .segmented button { min-width: 110px; }
  .stepper-label, .side-note { display: none; }
  .stepper { grid-template-columns: repeat(var(--step-count, 7), minmax(0, 1fr)); gap: 6px; }
  .stepper li { min-height: 39px; justify-content: center; padding: 6px 3px; }
  .stepper .step-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .app-side .autosave { margin-top: 13px; padding: 0 2px; }
  .app-main { min-height: 0; padding: 29px; }
  .order-workbench { grid-template-columns: minmax(0, 1fr); }
  .order-controls .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-document.panel { position: static; }
  .order-document .pages { max-height: 760px; }
}

@media (max-width: 640px) {
  .container.wide.filing-page, .container.wide.order-page { padding: 22px 12px 42px; }
  .workspace-heading { margin-bottom: 19px; }
  .workspace-heading h2 { font-size: 21px; line-height: 1.4; }
  .workspace-progress { font-size: 13px; }
  .app-layout { padding: 9px; border-radius: 29px; }
  .app-side { padding: 10px 8px 8px; }
  .service-switch { gap: 12px; justify-content: space-between; margin-bottom: 10px; }
  .service-switch .side-label { font-size: 13px; }
  .app-side .segmented button { min-width: 0; height: 40px; padding: 0 14px; font-size: 13px; }
  .stepper { gap: 4px; }
  .stepper li { min-height: 37px; border-radius: 13px; }
  .stepper .n { width: 25px; height: 25px; }
  .app-main { padding: 20px; border-radius: 23px; }
  .step-head { margin-bottom: 25px; }
  .step-head .kicker { display: none; }
  .step-head h1 { margin-bottom: 11px; font-size: 26px; line-height: 1.35; }
  .step-head p { font-size: 14px; }
  .filing-page .options.two { grid-template-columns: minmax(0, 1fr); }
  .filing-page .option { min-height: 70px; padding: 15px; }
  .filing-page .form-grid { gap: 21px 12px; }
  .filing-page .step .actions { margin-top: 27px; padding-top: 21px; }
  .actions .btn.primary { flex: 1; min-width: 0; }
  .actions .spacer { display: none; }
  .tx-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
  .tx-row .desc { grid-column: 1 / -1; order: -1; }
  .tx-row + .tx-row { padding-top: 16px; border-top: 1px solid var(--border); }
  dl.kv { grid-template-columns: minmax(0, 1fr); }
  dl.kv dt { padding: 15px 0 5px; }
  dl.kv dd { padding: 0 0 12px; border-top: 0; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan { padding: 21px; }
  .order-head { padding: 0 8px 23px; }
  .order-head h1 { font-size: 29px; }
  .order-head .meta { display: grid; gap: 4px; font-size: 13px; }
  .order-head .badges { gap: 7px; }
  .order-head .badge { max-width: 100%; height: auto; min-height: 26px; white-space: normal; line-height: 1.5; padding-top: 4px; padding-bottom: 4px; }
  .order-page .progress { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 4px; border-radius: 23px; }
  .progress > div { padding: 12px; border-radius: 18px; }
  .progress b { align-items: baseline; font-size: 13px; }
  .progress .status-dot { flex-shrink: 0; }
  .order-workbench { gap: 12px; padding: 9px; border-radius: 29px; }
  .order-controls { gap: 12px; }
  .order-controls > .panel { padding: 24px 20px; border-radius: 23px; }
  .order-controls .panel-head h2 { font-size: 22px; }
  .order-controls .plans { grid-template-columns: minmax(0, 1fr); }
  .order-page .download-actions { flex-direction: column; align-items: stretch; }
  .order-document.panel { padding: 23px 13px 13px; border-radius: 23px; }
  .order-document .panel-head { align-items: start; flex-direction: row; gap: 10px; }
  .order-document h2 { font-size: 20px; }
  .order-document .pages { max-height: 620px; padding: 8px; border-radius: 16px; }
  .order-page[data-state="error"] .order-head { padding: 28px; border-radius: 25px; }
}
