:root {
    color-scheme: light;
    --navy: #10233f;
    --navy-2: #19385e;
    --ink: #1d2b3d;
    --muted: #748197;
    --line: #e6ebf2;
    --surface: #fff;
    --background: #f3f6fa;
    --teal: #32c6a4;
    --teal-dark: #138b72;
    --red: #b54747;
    font-family: "DM Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.page-shell { max-width: 1240px; margin: 0 auto; padding: 0 34px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 12px; align-items: center; color: var(--navy); text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: var(--navy); color: #fff; font: 800 14px Manrope, sans-serif; letter-spacing: -.5px; }
.brand strong, .brand small { display: block; }
.brand strong { font: 800 14px Manrope, sans-serif; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.topbar-note { display: inline-flex; gap: 9px; align-items: center; color: #627186; font-size: 12px; font-weight: 600; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px #dff6f0; }
.hero { position: relative; overflow: hidden; min-height: 263px; display: flex; justify-content: space-between; align-items: center; padding: 38px 54px; border-radius: 22px; background: linear-gradient(112deg, #10233f 0%, #1a3b62 68%, #245677 100%); color: #fff; }
.hero:after { content: ""; position: absolute; width: 380px; height: 380px; right: 12%; top: -225px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.02); pointer-events: none; }
.hero-copy, .hero-card { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 10px; color: #169b82; font-size: 10px; font-weight: 700; letter-spacing: 1.65px; }
.hero .eyebrow { color: #72dfc4; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font: 800 clamp(29px, 4vw, 40px)/1.13 Manrope, sans-serif; letter-spacing: -1.6px; }
h1 span { color: #72dfc4; }
.hero-text { max-width: 500px; margin-bottom: 18px; color: #c4cfde; font-size: 13px; line-height: 1.65; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.hero-tags span { padding: 6px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 20px; color: #e4eaf2; font-size: 10px; }
.hero-card { width: 242px; display: flex; gap: 12px; padding: 16px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.08); backdrop-filter: blur(8px); }
.hero-card-icon { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #72dfc4; color: var(--navy); font-size: 13px; font-weight: 700; }
.hero-card strong { display: block; margin: 2px 0 6px; font: 700 12px Manrope, sans-serif; }
.hero-card p { margin: 0; color: #c4cfde; font-size: 11px; line-height: 1.55; }
.workspace { margin-top: 27px; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 13px; }
.tab { display: flex; gap: 12px; align-items: center; padding: 14px 17px; border: 1px solid #e4eaf1; border-radius: 13px; background: #fff; text-align: left; color: var(--ink); transition: .18s ease; }
.tab:hover { border-color: #b8c8d6; transform: translateY(-1px); }
.tab.is-active { border-color: var(--navy); background: var(--navy); color: #fff; box-shadow: 0 6px 14px rgba(16,35,63,.12); }
.tab-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #eff3f8; color: #718198; font: 700 11px Manrope, sans-serif; }
.tab.is-active .tab-icon { background: rgba(114,223,196,.16); color: #72dfc4; }
.tab strong, .tab small { display: block; }
.tab strong { font: 700 12px Manrope, sans-serif; }
.tab small { margin-top: 4px; color: #8d99a9; font-size: 10px; }
.tab.is-active small { color: #bac6d5; }
.panel { padding: 31px 36px 29px; border: 1px solid #e5eaf0; border-radius: 16px; background: var(--surface); box-shadow: 0 3px 14px rgba(25,48,76,.035); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 23px; border-bottom: 1px solid var(--line); }
.section-heading h2 { margin: 0 0 5px; font: 800 23px Manrope, sans-serif; letter-spacing: -.5px; }
.section-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 12px; }
.pill { padding: 7px 10px; border: 1px solid #cceee4; border-radius: 30px; background: #f0fbf7; color: #16856f; font-size: 10px; font-weight: 700; white-space: nowrap; }
.calculator-form { padding-top: 23px; }
.form-section-title { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.form-section-title > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #eff3f8; color: var(--navy-2); font: 700 10px Manrope, sans-serif; }
.form-section-title strong, .form-section-title small { display: block; }
.form-section-title strong { font: 700 12px Manrope, sans-serif; }
.form-section-title small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.item-list { display: grid; gap: 10px; }
.item-card { padding: 14px 15px 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.item-card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; }
.item-card-heading strong { color: #53637a; font: 700 11px Manrope, sans-serif; }
.remove-item { padding: 4px 7px; border: 0; background: transparent; color: #9a6a6a; font-size: 10px; }
.remove-item:hover { color: var(--red); }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.item-fields { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { color: #66758a; font-size: 10px; font-weight: 600; }
.field input, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid #dfe5ec; border-radius: 8px; outline: 0; background: #fff; color: var(--ink); font-size: 12px; transition: .16s ease; }
.field input:focus, .field textarea:focus { border-color: #2b9b84; box-shadow: 0 0 0 3px rgba(50,198,164,.12); }
.field input::placeholder, .field textarea::placeholder { color: #aab4c1; }
.field textarea { min-height: 150px; resize: vertical; font: 11px/1.55 Consolas, monospace; }
.field-wide { grid-column: span 2; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid transparent; border-radius: 8px; font-size: 11px; font-weight: 700; transition: .16s ease; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button-primary { background: var(--navy); color: #fff; }
.button-primary:hover:not(:disabled) { background: #1b3c64; transform: translateY(-1px); }
.button-primary span { color: #75ddc3; font-size: 16px; }
.button-quiet { background: #f0f4f8; color: #53647b; }
.button-quiet:hover:not(:disabled) { background: #e6edf4; }
.button-outline { border-color: #dce4ec; background: #fff; color: #52647a; }
.button-outline:hover:not(:disabled) { border-color: #9eafbf; background: #fafbfd; }
#add-regular-item { margin-top: 10px; }
#add-regular-item span { color: #148970; font-size: 16px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.message { min-height: 0; margin-top: 10px; font-size: 11px; }
.message:empty { display: none; }
.message.is-error { padding: 10px 12px; border: 1px solid #f1d2d2; border-radius: 8px; background: #fff7f7; color: var(--red); }
.message.is-success { color: var(--teal-dark); }
.results { margin-top: 22px; padding: 19px; border: 1px solid #dfe9e8; border-radius: 12px; background: #fcfefd; }
.results-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 13px; }
.results-heading h3 { margin: 0; font: 700 15px Manrope, sans-serif; }
.results-heading .eyebrow { margin-bottom: 5px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; white-space: nowrap; }
th { padding: 10px; background: #f3f6f9; color: #607087; font-size: 9px; font-weight: 700; }
td { padding: 10px; border-bottom: 1px solid #edf0f4; color: #43536a; }
td.cell-emphasis { color: var(--teal-dark); font-weight: 700; }
tfoot td { border-top: 1px solid #dce5e7; border-bottom: 0; color: var(--navy); font-weight: 700; }
.result-note { margin: 12px 0 0; color: #8995a4; font-size: 10px; line-height: 1.5; }
.tutorial { margin-top: 22px; border-top: 1px solid var(--line); }
.tutorial summary { display: flex; align-items: center; gap: 9px; padding: 16px 0 4px; cursor: pointer; color: #45566d; font: 700 11px Manrope, sans-serif; list-style: none; }
.tutorial summary::-webkit-details-marker { display: none; }
.tutorial summary:after { content: "＋"; margin-left: auto; color: #149078; font-size: 16px; }
.tutorial[open] summary:after { content: "−"; }
.tutorial-icon { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; background: #eaf8f4; color: #148970; font: 700 11px Manrope, sans-serif; }
.tutorial-content { padding: 8px 0 3px 30px; color: #69788c; font-size: 11px; line-height: 1.8; }
.tutorial-content ol { padding-left: 17px; }
.tutorial-content p { margin-bottom: 0; }
.file-picker { display: flex; align-items: center; gap: 11px; width: max-content; max-width: 100%; margin-bottom: 15px; padding: 11px 15px; border: 1px dashed #bdcbd8; border-radius: 10px; background: #fbfcfe; cursor: pointer; }
.file-picker:hover { border-color: #23957e; background: #f5fbf9; }
.file-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.file-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #e6f7f2; color: #148970; font-size: 18px; }
.file-picker strong, .file-picker small { display: block; }
.file-picker strong { color: #43536a; font-size: 11px; }
.file-picker small { margin-top: 4px; color: #8a97a8; font-size: 9px; }
.document-preview { margin-bottom: 15px; padding: 20px; border: 1px solid #dfe5ec; border-radius: 10px; background: #fff; }
.document-preview-heading { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 2px solid var(--navy); color: var(--navy); font: 700 12px Manrope, sans-serif; }
.document-preview-heading span { color: #66758a; font-size: 11px; }
.document-fields { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; padding-top: 15px; }
.document-field { min-width: 0; }
.document-field span, .document-field strong { display: block; overflow-wrap: anywhere; }
.document-field span { margin-bottom: 5px; color: #8591a0; font-size: 9px; }
.document-field strong { color: #39495e; font-size: 11px; line-height: 1.5; }
.footer { display: flex; justify-content: space-between; gap: 15px; padding: 20px 2px 25px; color: #8a96a5; font-size: 10px; }
[hidden] { display: none !important; }

@media (max-width: 800px) {
    .page-shell { padding: 0 20px; }
    .hero { align-items: flex-start; gap: 20px; padding: 31px; }
    .hero-card { width: 210px; }
    .item-fields { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .tabs { gap: 7px; }
    .tab { gap: 8px; padding: 11px 10px; }
    .tab-icon { width: 29px; height: 29px; }
    .tab strong { font-size: 10px; }
}
@media (max-width: 600px) {
    .page-shell { padding: 0 13px; }
    .topbar { height: 67px; }
    .topbar-note { font-size: 0; }
    .hero { display: block; min-height: 0; padding: 25px 22px; border-radius: 16px; }
    .hero-card { width: 100%; margin-top: 17px; }
    .hero-text { font-size: 12px; }
    .tabs { grid-template-columns: 1fr; }
    .tab { padding: 10px 13px; }
    .tab strong { font-size: 11px; }
    .panel { padding: 23px 17px; }
    .section-heading { align-items: flex-start; }
    .section-heading h2 { font-size: 20px; }
    .section-heading p:not(.eyebrow) { max-width: 275px; line-height: 1.5; }
    .pill { font-size: 9px; }
    .form-grid, .item-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .field-wide { grid-column: 1 / -1; }
    .results { padding: 14px; }
    .results-heading { align-items: flex-start; }
    .results-heading .button { padding: 0 9px; font-size: 9px; }
    .document-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .footer { display: block; line-height: 1.7; }
}
@media print {
    body { background: #fff; }
    .page-shell { max-width: none; padding: 0; }
    .topbar, .hero, .tabs, .calculator-form, .message, .tutorial, .footer, .results-heading .button { display: none !important; }
    .workspace { margin: 0; }
    .panel { padding: 0; border: 0; box-shadow: none; }
    .section-heading { display: none; }
    .results { display: block !important; margin: 0; padding: 0; border: 0; }
    .results-heading { display: flex !important; }
    .results-heading .eyebrow { display: none; }
    .result-note { color: #555; }
    .document-preview { break-inside: avoid; }
}
