:root {
  color-scheme: light;
  --ink: #172435;
  --muted: #647083;
  --navy: #19324d;
  --navy-2: #244765;
  --teal: #2a8c73;
  --teal-soft: #e9f5f1;
  --blue-soft: #eef4f8;
  --line: #dbe2e8;
  --surface: #ffffff;
  --canvas: #f3f6f8;
  --shadow: 0 18px 55px rgba(25, 50, 77, .10);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; color: #fff; background: linear-gradient(180deg, var(--navy), #122638); }
.brand { display: flex; align-items: center; justify-content: center; padding: 0 4px 26px; }
.brand-logo { display: block; width: 100%; max-width: 194px; height: auto; border-radius: 12px; background: #fff; box-shadow: 0 10px 30px rgba(4, 18, 31, .18); }
.brand-mark { width: 42px; height: 42px; display: none; place-items: center; border-radius: 12px; color: var(--navy); background: #fff; font-weight: 800; font-size: 1.2rem; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 1.08rem; letter-spacing: .01em; }
.brand span { margin-top: 2px; color: #b9c9d6; font-size: .82rem; }
nav { display: grid; gap: 6px; }
.nav-item { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 11px; color: #ccd7df; background: transparent; text-align: left; font-size: .95rem; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { color: #fff; background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 #6bc5ad; }
.nav-icon { width: 22px; text-align: center; font-size: 1.2rem; }
.nav-count { margin-left: auto; min-width: 27px; padding: 3px 7px; border-radius: 999px; color: #d8e7ee; background: rgba(255,255,255,.10); font-size: .75rem; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 16px 12px 4px; color: #dbe5eb; font-size: .86rem; }
.sidebar-footer small { display: block; margin: 5px 0 0 18px; color: #95a9b8; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #62c4a9; box-shadow: 0 0 0 4px rgba(98,196,169,.13); }

main { min-width: 0; }
.topbar { height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); }
.eyebrow, .step-label { margin: 0 0 4px; color: var(--teal); font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.9rem; line-height: 1.1; }
h2 { margin-bottom: 8px; font-size: 1.28rem; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--navy); font-size: .78rem; font-weight: 800; }
.user-chip strong, .user-chip small { display: block; }
.user-chip strong { font-size: .9rem; }
.user-chip small { margin-top: 2px; color: var(--muted); font-size: .75rem; }

.workspace { width: 100%; max-width: 1240px; min-width: 0; margin: 0 auto; padding: 28px 38px 48px; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 0 0 28px; padding: 0; list-style: none; }
.steps li { position: relative; display: flex; align-items: center; gap: 8px; color: #8994a2; font-size: .82rem; }
.steps li:not(:last-child)::after { content: ""; height: 1px; margin: 0 12px; flex: 1; background: #d5dde3; }
.steps span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #cbd4dc; border-radius: 50%; background: #fff; }
.steps .current { color: var(--ink); }
.steps .current span { border-color: var(--teal); color: #fff; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .8fr); gap: 22px; align-items: start; }
.wizard-panel[hidden], .auxiliary-view[hidden] { display: none !important; }
.wide-card { max-width: 980px; margin: 0 auto; }
.card { min-width: 0; max-width: 100%; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.form-card { padding: 30px; }
.summary-card { padding: 26px; }
.card-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.card-heading p:not(.step-label) { margin-bottom: 0; color: var(--muted); line-height: 1.5; }
.autosave { align-self: flex-start; padding: 7px 10px; border-radius: 999px; color: #557063; background: var(--teal-soft); font-size: .75rem; white-space: nowrap; }
label { display: block; margin-bottom: 8px; font-weight: 700; font-size: .9rem; }
.search-field { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border: 1px solid #bfcad3; border-radius: 10px; background: #fff; }
.search-field:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(42,140,115,.12); }
.search-field span { color: var(--muted); font-size: 1.35rem; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 1rem; }
.company-list { display: grid; gap: 9px; margin-top: 16px; }
.company-option { min-height: 67px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 26px; align-items: center; gap: 12px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; text-align: left; }
.company-option:hover { border-color: #9fb1bf; background: #fbfcfd; }
.company-option.selected { border-color: var(--teal); background: #f7fcfa; box-shadow: 0 0 0 2px rgba(42,140,115,.08); }
.company-option strong, .company-option small { display: block; }
.company-option small { margin-top: 4px; color: var(--muted); font-size: .79rem; }
.company-monogram { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--teal); font-weight: 800; }
.company-monogram.blue { background: #446e98; }
.company-monogram.amber { background: #a87528; }
.check { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid #ccd5dc; border-radius: 50%; color: transparent; font-size: .72rem; }
.selected .check { border-color: var(--teal); color: #fff; background: var(--teal); }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.button { min-height: 44px; padding: 0 18px; border-radius: 9px; font-weight: 750; }
.button.secondary { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.button.primary { border: 1px solid var(--navy); color: #fff; background: var(--navy); }
.button.danger { border: 1px solid #a73e3e; color: #fff; background: #a73e3e; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.action-group { display: flex; gap: 12px; }
.text-button { align-self: flex-start; border: 0; padding: 7px 0; color: var(--teal); background: transparent; font-weight: 750; }
.provider-badge, .rules-badge { align-self: flex-start; padding: 8px 11px; border-radius: 8px; color: var(--navy); background: var(--blue-soft); font-size: .76rem; font-weight: 750; white-space: nowrap; }
.steps .completed span { border-color: var(--teal); color: var(--teal); background: #fff; }

.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.upload-card { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 22px 16px; border: 1px dashed #adbac5; border-radius: 13px; background: #fbfcfd; text-align: center; transition: .15s ease; }
.upload-card:hover { border-color: var(--teal); background: #f7fcfa; }
.upload-card.has-file { border-style: solid; border-color: var(--teal); background: #f3fbf8; }
.upload-card input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.upload-card small, .upload-card b { display: block; }
.upload-card small { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.upload-card b { margin-top: 6px; color: var(--teal); font-size: .8rem; overflow-wrap: anywhere; }
.upload-icon { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 5px; border-radius: 11px; color: var(--navy); background: var(--blue-soft); font-size: .85rem; font-weight: 800; }
.manual-entry-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 16px 18px; border: 1px solid #cbdce7; border-radius: 12px; background: var(--blue-soft); }
.manual-entry-row strong, .manual-entry-row small { display: block; }
.manual-entry-row small { margin-top: 4px; color: var(--muted); line-height: 1.45; }
.manual-entry-row .button { flex: 0 0 auto; }
.privacy-row { display: flex; gap: 12px; margin-top: 18px; padding: 15px 17px; border-left: 3px solid var(--teal); background: #f7faf9; }
.privacy-row > span { color: var(--teal); }
.privacy-row strong, .privacy-row small { display: block; }
.privacy-row small { margin-top: 4px; color: var(--muted); line-height: 1.45; }

.details-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field input:not([type="checkbox"]), .field select, .field textarea, .table-search input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #bfcad3; border-radius: 9px; color: var(--ink); background: #fff; outline: none; }
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(42,140,115,.11); }
.field input.invalid { border-color: #b65353; background: #fff9f9; }
.field-hint { display: block; min-height: 18px; margin-top: 5px; color: var(--muted); font-size: .75rem; }
.field-hint.error { color: #a83f3f; }
.field-hint.ok { color: var(--teal); }
.check-field { display: flex; align-items: flex-start; gap: 11px; padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.check-field input { width: 19px; height: 19px; margin-top: 1px; accent-color: var(--teal); }
.check-field strong, .check-field small { display: block; }
.check-field small { margin-top: 5px; color: var(--muted); font-weight: 400; line-height: 1.4; }

.review-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 22px; align-items: start; }
.validation-summary { display: grid; gap: 9px; }
.validation-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 9px; line-height: 1.4; }
.validation-item.error { color: #783131; background: #fff0f0; }
.validation-item.warning { color: #705825; background: #fff8e8; }
.validation-item.success { color: #28614f; background: var(--teal-soft); }
.review-data { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 22px; margin-top: 22px; }
.review-data div { padding-bottom: 9px; border-bottom: 1px solid #edf0f2; }
.review-data span, .review-data strong { display: block; }
.review-data span { color: var(--muted); font-size: .75rem; }
.review-data strong { margin-top: 4px; font-size: .9rem; }
.generated-documents { margin-top: 22px; padding: 18px; border: 1px solid #cfe5dd; border-radius: 12px; background: #f7fcfa; }
.generated-documents h3 { margin: 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 1.15rem; }
.generated-documents > p { margin: 6px 0 14px; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.generated-document-list { display: grid; gap: 9px; }
.generated-document-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 10px 12px; border: 1px solid #d8e7e1; border-radius: 9px; color: var(--navy); background: #fff; text-decoration: none; font-size: .84rem; font-weight: 750; }
.generated-document-link:hover { border-color: var(--teal); background: var(--teal-soft); }
.generated-document-link span:last-child { color: var(--teal); white-space: nowrap; }
.document-checklist { display: grid; gap: 12px; margin: 20px 0; padding: 0; list-style: none; }
.document-checklist li { display: grid; grid-template-columns: 42px 1fr; gap: 2px 10px; align-items: center; }
.document-checklist li > span { grid-row: 1 / 3; display: grid; place-items: center; width: 42px; height: 32px; border-radius: 6px; color: var(--navy); background: var(--blue-soft); font-size: .62rem; font-weight: 800; }
.document-checklist b { font-size: .84rem; }
.document-checklist em { color: var(--muted); font-size: .72rem; font-style: normal; }
.server-note { margin: 18px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.companies-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .55fr); gap: 22px; align-items: start; }
.companies-card { overflow: hidden; }
.table-search { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-bottom: 1px solid var(--line); }
.table-search input { max-width: 420px; }
.table-search span { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.companies-table { display: grid; }
.company-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) 1fr 1fr 90px; gap: 18px; align-items: center; padding: 17px 20px; border-bottom: 1px solid #edf0f2; }
.company-row:last-child { border-bottom: 0; }
.company-row strong, .company-row small { display: block; }
.company-row small { margin-top: 3px; color: var(--muted); }
.company-row .active-label { justify-self: end; padding: 5px 9px; border-radius: 999px; color: #28614f; background: var(--teal-soft); font-size: .72rem; font-weight: 750; }
.companies-guide { padding: 25px; }
.companies-guide h2 { margin-bottom: 10px; font-family: Georgia, "Times New Roman", serif; font-size: 1.38rem; }
.companies-guide > p:not(.step-label) { color: var(--muted); font-size: .84rem; line-height: 1.55; }
.companies-guide .button { width: 100%; margin-top: 8px; }
.company-empty { padding: 34px 20px; color: var(--muted); text-align: center; }
.simple-page { max-width: 780px; padding: 30px; }
.simple-page p { color: var(--muted); line-height: 1.65; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; padding: 13px 17px; border-radius: 9px; color: #fff; background: var(--navy); box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: .18s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

.current-plan-chip { padding: 9px 12px; border: 1px solid #cfe5dd; border-radius: 999px; color: #416458; background: var(--teal-soft); font-size: .8rem; white-space: nowrap; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .55fr); gap: 22px; align-items: start; }
.subscription-section { padding: 28px; }
.subscription-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 22px; }
.subscription-heading p:last-child { max-width: 280px; margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.45; text-align: right; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.plan-card { display: flex; flex-direction: column; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.plan-card.featured { border-color: #8eb7d0; background: linear-gradient(180deg, #f7fbfe, #fff 46%); }
.plan-card.active { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(42, 140, 115, .10); }
.plan-topline { min-height: 25px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-badge, .plan-active-label { display: inline-flex; align-items: center; min-height: 25px; padding: 0 8px; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.plan-active-label[hidden] { display: none; }
.plan-badge.internal { color: #506170; background: #eef1f4; }
.plan-badge.professional { color: #285477; background: #e5f1f9; }
.plan-active-label { color: #28614f; background: var(--teal-soft); }
.plan-card h3 { margin: 18px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 1.42rem; }
.plan-audience { min-height: 45px; margin-bottom: 18px; color: var(--muted); font-size: .83rem; line-height: 1.45; }
.plan-price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 18px; }
.plan-price strong { color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 1.85rem; }
.plan-price span { color: var(--muted); font-size: .78rem; }
.plan-features { display: grid; gap: 10px; margin: 0 0 22px; padding: 0; list-style: none; }
.plan-features li { position: relative; padding-left: 24px; font-size: .84rem; line-height: 1.4; }
.plan-features li::before { content: "✓"; position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: var(--teal); font-size: .65rem; font-weight: 900; }
.plan-button { width: 100%; margin-top: auto; }
.plan-card > small { display: block; min-height: 35px; margin-top: 10px; color: var(--muted); font-size: .72rem; line-height: 1.4; text-align: center; }
.billing-note { display: flex; align-items: flex-start; gap: 9px; margin: 20px 0 0; padding: 13px 15px; border-radius: 10px; color: #526475; background: var(--blue-soft); font-size: .78rem; line-height: 1.5; }
.billing-note > span { width: 20px; height: 20px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #fff; background: var(--navy-2); font-family: Georgia, serif; font-weight: 800; }
.infrastructure-card { max-width: none; padding: 25px; }
.infrastructure-card dl { margin-top: 18px; }
.subscription-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 20px 0; padding: 18px; border-radius: 12px; background: var(--blue-soft); }
.subscription-summary > span { color: var(--muted); font-size: .84rem; }
.subscription-summary > strong { color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; white-space: nowrap; }
.subscription-summary small { font-family: Inter, "Segoe UI", Arial, sans-serif; font-size: .72rem; font-weight: 500; }
.billing-dialog-note { margin: 0; padding: 13px 15px; border-left: 3px solid var(--teal); color: var(--muted); background: #f7faf9; font-size: .8rem; line-height: 1.5; }

.template-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 22px; align-items: start; }
.template-library { overflow: hidden; }
.template-library-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 26px 20px; border-bottom: 1px solid var(--line); }
.template-library-heading p { margin: 5px 0 0; color: var(--muted); font-size: .86rem; }
.storage-badge { padding: 7px 10px; border-radius: 999px; color: #557063; background: var(--teal-soft); font-size: .75rem; font-weight: 750; white-space: nowrap; }
.template-list { display: grid; }
.template-item { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 19px 22px; border-bottom: 1px solid #edf0f2; }
.template-item:last-child { border-bottom: 0; }
.template-doc-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 11px; color: var(--navy); background: var(--blue-soft); font-size: .69rem; font-weight: 850; }
.template-info { min-width: 0; }
.template-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.template-title-line h3 { margin: 0; font-size: .97rem; overflow-wrap: anywhere; }
.template-default-badge { padding: 4px 7px; border-radius: 999px; color: #28614f; background: var(--teal-soft); font-size: .68rem; font-weight: 800; }
.template-info p { margin: 6px 0 0; color: var(--muted); font-size: .79rem; line-height: 1.45; overflow-wrap: anywhere; }
.template-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.template-action { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: .78rem; font-weight: 700; text-decoration: none; }
.template-action:hover { border-color: #9fb1bf; background: #fbfcfd; }
.template-action.danger-text { color: #9a3838; }
.template-action:disabled { cursor: default; opacity: .45; }
.template-empty { padding: 48px 26px; text-align: center; }
.template-empty > span { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 15px; border-radius: 14px; color: var(--navy); background: var(--blue-soft); font-size: 1.4rem; }
.template-empty h3 { margin: 0 0 7px; }
.template-empty p { max-width: 480px; margin: 0 auto 18px; color: var(--muted); line-height: 1.55; }
.template-guide { padding: 25px; }
.template-guide ol { display: grid; gap: 17px; margin: 22px 0 0; padding: 0; list-style: none; }
.template-guide li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 11px; align-items: start; }
.template-guide li > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--teal); background: var(--teal-soft); font-size: .76rem; font-weight: 850; }
.template-guide strong, .template-guide small { display: block; }
.template-guide small { margin-top: 4px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.template-guide code { padding: 2px 5px; border-radius: 4px; color: var(--navy); background: var(--blue-soft); font-size: .74rem; }

.app-dialog { width: min(640px, calc(100% - 28px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(12, 31, 49, .28); }
.app-dialog::backdrop { background: rgba(15, 31, 47, .52); backdrop-filter: blur(2px); }
.app-dialog form { max-height: calc(100vh - 40px); overflow-y: auto; padding: 26px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { margin-bottom: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.55rem; }
.dialog-close { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; font-size: 1.45rem; line-height: 1; }
.dialog-intro, .confirm-dialog p { margin: 14px 0 22px; color: var(--muted); line-height: 1.55; }
.dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.template-file-picker { display: flex; align-items: center; gap: 12px; min-height: 76px; margin: 0; padding: 12px 14px; border: 1px dashed #aab8c4; border-radius: 10px; background: #fbfcfd; cursor: pointer; }
.template-file-picker:hover { border-color: var(--teal); background: #f7fcfa; }
.template-file-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.template-file-picker strong, .template-file-picker small { display: block; }
.template-file-picker strong { overflow-wrap: anywhere; }
.template-file-picker small { margin-top: 4px; color: var(--muted); font-weight: 400; }
.confirm-dialog { width: min(480px, calc(100% - 28px)); }
.import-dialog { width: min(860px, calc(100% - 28px)); }
.template-download-link { display: inline-flex; margin: -8px 0 16px; color: var(--teal); font-size: .83rem; font-weight: 750; }
.company-file-picker { margin-bottom: 8px; }
.import-preview { margin-top: 20px; }
.import-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.import-stat { padding: 7px 10px; border-radius: 999px; color: #526475; background: #eef3f6; font-size: .75rem; font-weight: 750; }
.import-stat.ready { color: #28614f; background: var(--teal-soft); }
.import-stat.issue { color: #7a5521; background: #fff4d9; }
.import-table-wrap { max-height: 300px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.import-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.import-table th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; color: #fff; background: var(--navy); text-align: left; }
.import-table td { padding: 10px 12px; border-bottom: 1px solid #edf0f2; vertical-align: top; }
.import-table tr:last-child td { border-bottom: 0; }
.import-table .row-ready { color: #28614f; font-weight: 700; }
.import-table .row-issue { color: #8a4b2b; }
.fns-status { min-height: 44px; margin-top: 18px; padding: 12px 14px; border-radius: 10px; color: #526475; background: #f1f5f7; font-size: .82rem; line-height: 1.45; }
.fns-status.error { color: #8a3b3b; background: #fff0f0; }
.fns-status.success { color: #28614f; background: var(--teal-soft); }
.fns-result { margin-top: 12px; padding: 14px; border: 1px solid #cfe5dd; border-radius: 10px; background: #fbfefd; }
.fns-result strong, .fns-result span { display: block; }
.fns-result span { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.fns-note { margin: 14px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

.summary-card h2 { font-family: Georgia, "Times New Roman", serif; font-size: 1.45rem; }
dl { margin: 22px 0 0; }
dl div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf0f2; }
dt { color: var(--muted); font-size: .78rem; }
dd { margin: 0; font-size: .87rem; font-weight: 650; line-height: 1.4; }
.package-preview { margin-top: 22px; padding: 18px; border-radius: 12px; background: var(--blue-soft); }
.package-preview strong { font-size: .86rem; }
.package-preview ul { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.package-preview li { display: flex; align-items: center; gap: 9px; font-size: .84rem; }
.package-preview li span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--teal); font-size: .7rem; font-weight: 800; }
.package-preview .conditional { color: #69593c; }
.package-preview .conditional span { background: #a87528; }

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  .brand { padding-inline: 8px; justify-content: center; }
  .brand-logo { display: none; }
  .brand-mark { display: grid; }
  .nav-item:not(.active) .nav-count, .nav-item { font-size: 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-icon { font-size: 1.25rem; }
  .sidebar-footer { text-align: center; font-size: 0; }
  .sidebar-footer small { display: none; }
  .status-dot { margin: 0; }
  .content-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
  .template-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; }
  .brand { padding: 0; }
  .brand-mark { width: 38px; height: 38px; }
  nav { display: flex; margin-left: auto; }
  .nav-item { width: 42px; min-height: 42px; }
  .nav-item:not(.active) { display: none; }
  .sidebar-footer { display: none; }
  .topbar { height: 78px; padding: 0 18px; }
  .user-chip div { display: none; }
  h1 { font-size: 1.55rem; }
  .workspace { padding: 20px 16px 32px; }
  .steps { overflow-x: auto; padding: 5px 3px 10px; }
  .steps li { min-width: 86px; }
  .steps b { display: none; }
  .steps li:not(:last-child)::after { min-width: 20px; }
  .form-card, .summary-card { padding: 20px; }
  .card-heading { display: block; }
  .autosave { display: inline-block; margin-top: 10px; }
  .form-actions { flex-direction: column-reverse; }
  .action-group { flex-direction: column-reverse; }
  .button { width: 100%; }
  .manual-entry-row { align-items: stretch; flex-direction: column; }
  .upload-grid, .details-form, .review-data { grid-template-columns: 1fr; }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { justify-content: stretch; }
  .toolbar-actions .button { flex: 1; }
  .companies-layout { grid-template-columns: 1fr; }
  .template-library-heading { align-items: stretch; flex-direction: column; }
  .storage-badge { align-self: flex-start; }
  .template-item { grid-template-columns: 44px minmax(0, 1fr); }
  .template-doc-icon { width: 44px; height: 44px; }
  .template-actions { grid-column: 1 / -1; justify-content: stretch; }
  .template-action { flex: 1 1 auto; }
  .dialog-grid { grid-template-columns: 1fr; }
  .dialog-grid .field.full { grid-column: auto; }
  .dialog-actions { flex-direction: column-reverse; }
  .current-plan-chip { align-self: flex-start; }
  .subscription-section { padding: 20px; }
  .subscription-heading { display: block; }
  .subscription-heading p:last-child { max-width: none; margin-top: 8px; text-align: left; }
  .plan-grid { grid-template-columns: 1fr; }
  .plan-audience { min-height: 0; }
  .field.full { grid-column: auto; }
  .company-row { grid-template-columns: 1fr auto; }
  .company-row > span:not(.active-label) { display: none; }
}
