/* Hallmark · shape: app screen · genre: modern-minimal · theme: Lightfield (GradientDeck) · redesign: full · v2.0.0
   Signature: editable print-run ledger with a compact annual budget above it.
   Critique: carry teal and copper through the figures and use frosted surfaces above the paper ledger. */
:root {
  color-scheme: light;
  --ink: #252525;
  --ink-soft: #4d5557;
  --muted: #505659;
  --neutral-status: #454545;
  --paper: #ffffff;
  --canvas: #f4f6f8;
  --mist: #efefef;
  --rule: #dbdbdb;
  --rule-soft: #ededed;
  --rule-strong: #bcbcbc;
  --obsidian: #0d0d0d;
  --ice: #80bfff;
  --harbor: #063769;
  --blue-wash: #eaf5ff;
  --blue-hover: #f5faff;
  --teal: #086762;
  --teal-pressed: #064e49;
  --teal-wash: #e4f5f2;
  --teal-ambient: rgba(62, 185, 172, 0.31);
  --copper: #91451f;
  --copper-wash: #fff0e5;
  --copper-ambient: rgba(244, 156, 106, 0.34);
  --glass-nav: rgba(255, 255, 255, 0.64);
  --glass-summary: rgba(255, 255, 255, 0.58);
  --glass-edge: rgba(255, 255, 255, 0.94);
  --glass-shadow: rgba(32, 65, 75, 0.12);
  --green: #245d36;
  --green-wash: #e8f4eb;
  --amber: #6d5206;
  --amber-wash: #fbf4df;
  --amber-rule: #e8dbad;
  --red: #8b2731;
  --red-wash: #f9e9eb;
  --red-rule: #e8c6cb;
  --field-rule: #8d8d8d;
  --field-focus: rgba(128, 191, 255, 0.65);
  --wash-white: #fafafa;
  --soft-white: #f7f7f7;
  --warm-white: #fff8f8;
  --button-text: #ffffff;
  --focus: #063769;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background-color: var(--canvas);
  background-image:
    radial-gradient(ellipse at 14% 4%, var(--teal-ambient), transparent 62%),
    radial-gradient(ellipse at 86% 16%, var(--copper-ambient), transparent 64%);
  background-repeat: no-repeat;
  background-size: 100% 39rem;
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink-soft); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 3px var(--ice); }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.skip-link { position: fixed; z-index: 20; top: 0.75rem; left: 0.75rem; padding: 0.65rem 0.9rem; color: var(--button-text); background: var(--obsidian); border-radius: 4px; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.topbar { position: relative; z-index: 2; color: var(--ink); background: var(--paper); border-bottom: 1px solid var(--rule); }
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; max-width: 1440px; min-height: 64px; margin: 0 auto; padding: 0 1.5rem; }
.brand { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 0.65rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: 0 0 32px; width: 32px; height: 32px; background: var(--teal); border-radius: 6px; }
.brand-mark i { display: block; width: 3px; background: var(--paper); border-radius: 2px; }
.brand-mark i:first-child { height: 14px; }
.brand-mark i:last-child { height: 19px; }
.brand-copy strong { color: var(--ink); font-size: 0.94rem; font-weight: 600; line-height: 1.2; }
.account-tools { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; min-width: 0; margin-left: auto; }
.account-name { color: var(--ink); font-size: 0.78rem; }
.logout-form { margin: 0; }
.org-switch { display: flex; gap: 4px; max-width: min(380px, 45vw); padding: 4px; overflow: auto; background: var(--canvas); border: 1px solid var(--rule); border-radius: 6px; }
.org-choice { display: inline-flex; align-items: center; min-height: 32px; max-width: 180px; padding: 0.3rem 0.55rem; overflow: hidden; color: var(--ink-soft); border-radius: 3px; font-size: 0.72rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.org-choice.is-current { color: var(--ink); background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.quiet-button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 0.42rem 0.7rem; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; cursor: pointer; font-size: 0.76rem; font-weight: 600; text-decoration: none; }
.quiet-button:hover { color: var(--ink); background: var(--mist); border-color: var(--rule-strong); }

.layout-frame { max-width: 1440px; min-height: calc(100vh - 64px); margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }
.layout-frame-wide { max-width: 1100px; }
.workspace-nav { display: flex; align-items: center; gap: 4px; }
.workspace-nav a { display: flex; align-items: center; min-height: 40px; padding: 0.5rem 0.75rem; color: var(--ink); border-radius: 4px; font-size: 0.82rem; text-decoration: none; }
.workspace-nav a:hover { color: var(--ink); background: var(--mist); }
.workspace-nav a.is-current { color: var(--teal-pressed); background: var(--teal-wash); font-weight: 600; }
.main-content { min-width: 0; outline: none; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: 0 0 0.8rem; color: var(--muted); font-size: 0.76rem; }
.breadcrumbs a { color: var(--ink); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 0 0 1.15rem; }
.page-heading h1 { margin: 0; color: var(--ink); font-size: 2rem; font-weight: 500; letter-spacing: -0.035em; line-height: 1.14; text-wrap: balance; }
.page-heading.compact-heading h1 { font-size: 1.85rem; }
.eyebrow { margin: 0 0 0.35rem; color: var(--ink-soft); font-size: 0.76rem; font-weight: 500; }
.heading-deck { max-width: 68ch; margin: 0.5rem 0 0; color: var(--ink-soft); font-size: 0.88rem; }
.heading-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.75rem; margin-top: 0.7rem; color: var(--muted); font-size: 0.76rem; }
.heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem; }
.heading-actions form { margin: 0; }
.demo-mark { display: inline-flex; align-items: center; min-height: 28px; padding: 0.25rem 0.55rem; color: var(--amber); background: var(--amber-wash); border: 1px solid var(--amber-rule); border-radius: 4px; font-size: 0.71rem; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0.56rem 0.82rem; color: var(--ink); border: 1px solid transparent; border-radius: 4px; cursor: pointer; font-size: 0.78rem; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.button-primary { color: var(--button-text); background: var(--teal); border-color: var(--teal); }
.button-primary:hover { color: var(--button-text); background: var(--teal-pressed); border-color: var(--teal-pressed); }
.button-secondary { color: var(--ink); background: var(--paper); border-color: var(--field-rule); }
.button-secondary:hover { color: var(--ink); background: var(--mist); border-color: var(--rule-strong); }
.button:active, .quiet-button:active, .icon-action:active { transform: translateY(1px); }
.button-small { min-height: 34px; padding: 0.42rem 0.62rem; font-size: 0.74rem; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }
.text-action, .icon-action { color: var(--harbor); font-size: 0.76rem; font-weight: 600; text-decoration: none; }
.text-action { display: inline-flex; align-items: center; min-height: 32px; }
.text-action:hover, .icon-action:hover { text-decoration: underline; }
.row-action { text-align: right; white-space: nowrap; }
.line-actions { white-space: nowrap; }
.line-actions form { display: inline-block; margin: 0 0 0 0.35rem; }
.icon-action { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 0.25rem 0.32rem; background: transparent; border: 0; cursor: pointer; }
.danger-action { color: var(--red); }

.work-section { min-width: 0; margin: 0 0 1rem; padding: 1.05rem 1.1rem 1.15rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.8rem; }
.section-heading h2, .create-panel h2, .form-sheet h2 { margin: 0; color: var(--ink); font-size: 1.15rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.section-heading p { margin: 0.24rem 0 0; color: var(--muted); font-size: 0.76rem; }
.section-count { flex: 0 0 auto; color: var(--muted); font-size: 0.74rem; }
.section-stack { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 0.15rem; }
.line-section { padding: 0.95rem 1rem 1rem; }
.ledger-section { border-color: var(--rule-strong); }
.ledger-section .section-heading h2 { font-size: 1.2rem; }
.table-scroll { position: relative; width: 100%; min-width: 0; max-width: 100%; overflow: auto; border: 1px solid var(--rule); border-radius: 4px; scrollbar-color: var(--rule-strong) transparent; overscroll-behavior-inline: contain; }
.table-scroll:focus-visible { outline-offset: 2px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; text-align: left; }
.data-table th, .data-table td { padding: 0.58rem 0.65rem; vertical-align: middle; border-bottom: 1px solid var(--rule-soft); }
.data-table thead th { color: var(--ink-soft); background: var(--soft-white); font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.data-table tbody tr:last-child th, .data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--blue-hover); }
.data-table tbody th { color: var(--ink); font-weight: 500; }
.version-table { min-width: 560px; }
.line-table, .import-table { min-width: 1040px; }
.books-table { min-width: 700px; }
.month-table { min-width: 640px; }
.comparison-table { min-width: 560px; }
.table-link { color: var(--ink); text-decoration: none; }
.table-link:hover { color: var(--harbor); text-decoration: underline; }
.status-pill { display: inline-flex; align-items: center; min-height: 23px; padding: 0.18rem 0.48rem; color: var(--ink-soft); background: var(--mist); border-radius: 4px; font-size: 0.69rem; font-weight: 600; white-space: nowrap; }
.status-draft { color: var(--neutral-status); background: var(--mist); }
.status-review { color: var(--amber); background: var(--amber-wash); }
.status-approved { color: var(--green); background: var(--green-wash); }
.row-title { display: block; min-width: 125px; max-width: 240px; overflow-wrap: anywhere; }
.number-cell { text-align: right; font-variant-numeric: tabular-nums; }
.amount-cell { color: var(--harbor); font-weight: 600; white-space: nowrap; }
.missing-value { color: var(--red); font-size: 0.76rem; font-weight: 500; }
.deadline-cell { min-width: 110px; color: var(--ink); font-size: 0.74rem; white-space: nowrap; }
.deadline-cell div { display: grid; gap: 0.05rem; margin: 0.08rem 0; }
.deadline-cell span { color: var(--muted); font-size: 0.75rem; }
.line-table small { color: var(--muted); font-size: 0.75rem; }
.line-table .release-type { display: inline-block; margin-top: 4px; padding: 0 8px; color: var(--copper); background: var(--copper-wash); border-radius: 4px; line-height: 1.65; }
.note-cell { min-width: 120px; max-width: 210px; color: var(--ink-soft); }
.month-value-cell { display: grid; gap: 0.35rem; min-width: 115px; }
.month-meter { display: block; width: 100%; max-width: 150px; height: 6px; overflow: hidden; background: var(--mist); border-radius: 3px; }
.month-meter i { display: block; height: 100%; background: var(--harbor); border-radius: inherit; }
.month-meter--sales i { background: var(--teal); }
.month-meter--costs i { background: var(--copper); }
.section-empty { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.85rem; color: var(--muted); background: var(--wash-white); border: 1px dashed var(--rule-strong); font-size: 0.82rem; }
.section-empty a { flex: 0 0 auto; color: var(--harbor); font-weight: 600; text-decoration: none; }
.empty-sheet { padding: 1.4rem 1rem; text-align: center; }
.empty-sheet h2, .empty-sheet h3 { margin: 0; color: var(--ink); font-size: 1rem; font-weight: 600; }
.empty-sheet p { max-width: 500px; margin: 0.45rem auto 0.9rem; color: var(--muted); font-size: 0.84rem; }
.empty-rule { display: block; width: 44px; height: 2px; margin: 0 auto 0.9rem; background: var(--obsidian); }

.version-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 0.75rem; }
.version-jump a { display: inline-flex; align-items: center; min-height: 36px; padding: 0.25rem 0.75rem; color: var(--ink-soft); border-radius: 4px; font-size: 0.8125rem; text-decoration: none; white-space: nowrap; }
.version-jump a:hover { color: var(--harbor); background: var(--blue-wash); }
.summary-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0 0 0.75rem; overflow: hidden; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.summary-item { display: grid; align-content: center; gap: 0.25rem; min-height: 68px; padding: 0.65rem 0.75rem; border-right: 1px solid var(--rule); }
.summary-item:last-child { border-right: 0; }
.summary-item span { color: var(--muted); font-size: 0.75rem; }
.summary-item strong { overflow-wrap: anywhere; color: var(--harbor); font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.summary-item--sales { background: var(--teal-wash); }
.summary-item--sales strong { color: var(--teal-pressed); }
.summary-item--production { background: var(--copper-wash); }
.summary-item--production strong { color: var(--copper); }
.summary-incomplete { background: var(--warm-white); }
.summary-incomplete span, .summary-incomplete strong { color: var(--red); }

@supports (backdrop-filter: blur(1px)) {
  .topbar {
    background: var(--glass-nav);
    border-bottom-color: var(--glass-edge);
    backdrop-filter: blur(18px) saturate(145%);
  }
  .summary-strip {
    background: var(--glass-summary);
    border-color: var(--glass-edge);
    box-shadow: inset 0 1px 0 var(--glass-edge), 0 4px 14px var(--glass-shadow);
    backdrop-filter: blur(20px) saturate(140%);
  }
  .summary-item--sales { background: color-mix(in srgb, var(--teal-wash) 44%, transparent); }
  .summary-item--production { background: color-mix(in srgb, var(--copper-wash) 72%, transparent); }
}

@media (prefers-reduced-transparency: reduce) {
  .topbar, .summary-strip { background: var(--paper); border-color: var(--rule); box-shadow: none; backdrop-filter: none; }
  .summary-item--sales { background: var(--teal-wash); }
  .summary-item--production { background: var(--copper-wash); }
}
.workbook-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0 0 1.1rem; }
.workbook-facts div { display: grid; gap: 0.25rem; padding: 0.65rem; background: var(--wash-white); border: 1px solid var(--rule); border-radius: 4px; }
.workbook-facts dt { color: var(--muted); font-size: 0.7rem; }
.workbook-facts dd { margin: 0; color: var(--ink); font-size: 0.84rem; font-weight: 600; overflow-wrap: anywhere; }
.duplicate-notice { display: grid; gap: 0.2rem; }
.sample-heading { margin: 1.25rem 0 0.65rem; color: var(--ink); font-size: 1rem; font-weight: 600; }
.event-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.event-list li { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(120px, 0.5fr); align-items: baseline; gap: 1rem; padding: 0.75rem 0.25rem; border-top: 1px solid var(--rule-soft); font-size: 0.81rem; }
.event-list time, .event-actor { color: var(--muted); font-size: 0.75rem; }

.notice { display: flex; align-items: flex-start; gap: 0.7rem; margin: 0 0 1.1rem; padding: 0.85rem 1rem; border: 1px solid var(--rule); border-radius: 4px; font-size: 0.84rem; }
.notice p { margin: 0; }
.notice-demo { color: var(--amber); background: var(--amber-wash); border-color: var(--amber-rule); }
.notice-error { display: block; color: var(--red); background: var(--red-wash); border-color: var(--red-rule); }
.notice-error ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.notice-symbol { display: inline-grid; flex: 0 0 21px; width: 21px; height: 21px; place-items: center; color: var(--button-text); background: var(--amber); border-radius: 50%; font-size: 0.82rem; font-weight: 600; }
.message-stack { display: grid; gap: 0.55rem; margin: 0 0 1.1rem; }
.message { padding: 0.75rem 1rem; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; font-size: 0.875rem; }
.message.success { color: var(--green); background: var(--green-wash); }
.message.error { color: var(--red); background: var(--red-wash); border-color: var(--red-rule); }
.message.warning { color: var(--amber); background: var(--amber-wash); border-color: var(--amber-rule); }

.create-panel { margin: 0.9rem 0 0; padding: 1rem 1.1rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.create-copy { display: flex; align-items: center; gap: 0.85rem; margin-bottom: 0.8rem; }
.create-glyph { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; color: var(--button-text); background: var(--obsidian); border-radius: 4px; font-size: 1.2rem; line-height: 1; }
.create-panel h2 { font-size: 1.05rem; }
.create-panel p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.77rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 1rem; }
.field-wrap { min-width: 0; }
.field-wrap label { display: block; margin-bottom: 0.38rem; color: var(--ink); font-size: 0.76rem; font-weight: 600; }
.field-wrap input, .field-wrap select, .field-wrap textarea, .catalog-search input { display: block; width: 100%; min-height: 42px; padding: 0.58rem 0.7rem; color: var(--ink); background: var(--paper); border: 1px solid var(--field-rule); border-radius: 4px; }
.field-wrap textarea { min-height: 104px; resize: vertical; }
.field-wrap input[type="checkbox"], .field-wrap input[type="radio"] { display: inline-block; width: auto; min-height: 0; margin-right: 0.4rem; accent-color: var(--harbor); }
.field-wrap input[type="file"] { min-height: 42px; padding: 0.45rem; }
.field-wrap input:focus, .field-wrap select:focus, .field-wrap textarea:focus, .catalog-search input:focus { border-color: var(--harbor); outline: 2px solid var(--field-focus); outline-offset: 1px; }
.field-wrap.has-errors input, .field-wrap.has-errors select, .field-wrap.has-errors textarea { border-color: var(--red); }
.field-help { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.75rem; line-height: 1.45; }
.field-error { margin: 0.3rem 0 0; color: var(--red); font-size: 0.76rem; }
.field-errors, .form-alert { grid-column: 1 / -1; padding: 0.65rem 0.75rem; color: var(--red); background: var(--red-wash); border: 1px solid var(--red-rule); border-radius: 4px; font-size: 0.8rem; }
.field-errors ul, .form-alert ul { margin: 0; padding-left: 1.1rem; }
.required-mark { margin-left: 0.2rem; color: var(--harbor); }
.form-submit { display: flex; align-items: flex-end; }
.form-sheet { max-width: 790px; padding: 1.3rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.form-sheet > h2 { margin-bottom: 0.5rem; }
.inline-helper { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.45rem; margin: 0 0 1rem; padding: 0.7rem 0.8rem; color: var(--ink-soft); background: var(--soft-white); border-left: 2px solid var(--ice); font-size: 0.8rem; }
.inline-helper a { color: var(--harbor); font-weight: 600; text-decoration: none; }
.stacked-form { display: grid; gap: 1rem; }
.stacked-form .field-wrap { max-width: 100%; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.55rem; margin-top: 0.35rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.section-intro { margin: 0 0 1rem; color: var(--ink-soft); font-size: 0.84rem; }
.import-sheet { margin-bottom: 1.2rem; }
.import-sheet > h2 { margin-bottom: 0.35rem; }
.import-preview { margin-top: 1.2rem; }
.import-preview .section-heading { align-items: flex-start; }
.import-preview .section-heading h2 { overflow-wrap: anywhere; }
.confirm-import-form { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.confirm-import-form p { margin: 0; color: var(--ink-soft); font-size: 0.82rem; }
.confirm-import-form .form-actions { margin: 0; padding: 0; border: 0; }

.dataset-list { border-top: 1px solid var(--rule); }
.books-heading { margin-bottom: 0.75rem; }
.catalog-search { display: grid; gap: 0.35rem; max-width: 600px; margin: 0 0 1rem; }
.catalog-search label { color: var(--ink); font-size: 0.77rem; font-weight: 600; }
.catalog-search-controls { display: flex; gap: 0.45rem; }
.catalog-search input { flex: 1 1 auto; min-width: 0; }
.catalog-search button { flex: 0 0 auto; }
.dataset-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 0.25rem; border-bottom: 1px solid var(--rule-soft); }
.dataset-row:last-child { border-bottom: 0; }
.dataset-main { display: flex; align-items: flex-start; gap: 0.75rem; min-width: 0; }
.dataset-symbol { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; color: var(--harbor); background: var(--blue-wash); border-radius: 4px; font-size: 1.08rem; }
.dataset-main h3 { margin: 0; color: var(--ink); font-size: 0.89rem; font-weight: 600; }
.dataset-main p { max-width: 520px; margin: 0.25rem 0 0; color: var(--muted); font-size: 0.78rem; }
.dataset-meta { display: flex; gap: 2rem; margin: 0; }
.dataset-meta div { display: grid; gap: 0.15rem; }
.dataset-meta dt { color: var(--muted); font-size: 0.69rem; }
.dataset-meta dd { margin: 0; color: var(--ink); font-size: 0.79rem; font-weight: 600; white-space: nowrap; }
.code-value { color: var(--ink-soft); font-family: var(--mono); font-size: 0.77rem; }
.reference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.reference-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0.85rem; background: var(--wash-white); border: 1px solid var(--rule); border-radius: 4px; font-size: 0.82rem; }
.reference-list strong { color: var(--ink-soft); }
.org-picker { max-width: 850px; }
.org-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.org-list li { border-bottom: 1px solid var(--rule-soft); }
.org-list a { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 42px; padding: 0.7rem 0.35rem; color: var(--ink); font-size: 0.92rem; font-weight: 500; text-decoration: none; }
.org-list a:hover, .org-arrow { color: var(--harbor); }
.org-arrow { font-size: 1rem; }
.login-sheet { width: min(100%, 460px); margin: 5vh auto 0; padding: 1.7rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; }
.login-signature { margin-bottom: 1.25rem; }
.login-sheet h1 { margin: 0; color: var(--ink); font-size: 1.85rem; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; }
.login-intro { margin: 0.55rem 0 1.4rem; color: var(--ink-soft); font-size: 0.86rem; }
.login-submit { width: 100%; margin-top: 0.2rem; }
.login-form { gap: 0.95rem; }
.org-picker + .page-footer { margin-top: 4rem; }
.page-footer { color: var(--muted); font-size: 0.75rem; }

@media (max-width: 1100px) {
  .topbar-inner { padding-right: 1.2rem; padding-left: 1.2rem; }
  .org-switch { max-width: 220px; }
  .org-choice { max-width: 110px; }
  .layout-frame { padding-right: 1.2rem; padding-left: 1.2rem; }
  .summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-item:nth-child(3) { border-right: 0; }
  .summary-item:nth-child(n+4) { border-top: 1px solid var(--rule-soft); }
}
@media (max-width: 800px) {
  .topbar-inner { flex-wrap: wrap; gap: 0.5rem 1rem; padding-top: 0.65rem; padding-bottom: 0.65rem; }
  .account-tools { flex-wrap: wrap; }
  .org-switch { max-width: 100%; }
  .layout-frame { min-height: 0; padding-top: 1rem; }
  .workspace-nav { flex: 1 0 100%; order: 1; }
  .heading-actions { justify-content: flex-start; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .topbar-inner { align-items: flex-start; padding-right: 0.9rem; padding-left: 0.9rem; }
  .brand { gap: 0.55rem; }
  .brand-copy strong { font-size: 0.9rem; }
  .account-tools { gap: 0.45rem; }
  .account-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .layout-frame { padding: 0.85rem 0.7rem 2rem; }
  .page-heading { display: block; margin-bottom: 0.9rem; }
  .page-heading h1, .page-heading.compact-heading h1 { font-size: 1.75rem; }
  .page-heading .demo-mark, .page-heading > .status-pill { display: inline-flex; margin-top: 0.7rem; }
  .heading-actions { margin-top: 0.8rem; }
  .heading-actions .button { flex: 1 1 auto; }
  .version-jump { gap: 0; }
  .version-jump a { padding: 0.25rem 0.5rem; }
  .work-section { padding: 0.9rem 0.7rem 0.95rem; }
  .line-section { padding: 0.8rem 0.65rem 0.75rem; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 1.05rem; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-item { min-height: 56px; padding: 0.5rem 0.625rem; border-top: 0; border-right: 0; }
  .summary-item:nth-child(n+3) { border-top: 1px solid var(--rule-soft); }
  .summary-item:nth-child(odd) { border-right: 1px solid var(--rule-soft); }
  .summary-item strong { font-size: 0.92rem; }
  .button { min-height: 44px; }
  .icon-action, .quiet-button, .workspace-nav a, .version-jump a, .org-choice { min-height: 44px; }
  .line-table { display: block; min-width: 0; }
  .line-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .line-table tbody { display: block; }
  .line-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; padding: 1rem; border-bottom: 1px solid var(--rule); }
  .line-table tr:last-child { border-bottom: 0; }
  .line-table th, .line-table td { padding: 0; border: 0; }
  .line-table th[scope="row"], .line-table .line-actions { grid-column: 1 / -1; }
  .line-table td { min-width: 0; overflow-wrap: anywhere; }
  .line-table td[data-label]::before { display: block; margin-bottom: 4px; color: var(--muted); content: attr(data-label); font-size: 0.75rem; font-weight: 400; }
  .line-table .number-cell, .line-table .amount-cell { text-align: left; white-space: normal; }
  .line-table .deadline-cell { min-width: 0; white-space: normal; }
  .line-table .note-cell { min-width: 0; }
  .line-table .line-actions { border-top: 1px solid var(--rule); }
  .month-table, .comparison-table { min-width: 0; table-layout: fixed; }
  .month-table th, .month-table td, .comparison-table th, .comparison-table td { padding: 0.5rem 0.25rem; overflow-wrap: anywhere; white-space: normal; }
  .month-value-cell { min-width: 0; }
  .event-list li { grid-template-columns: 1fr; gap: 0.2rem; }
  .dataset-row { display: block; }
  .dataset-meta { margin: 0.75rem 0 0 2.7rem; gap: 1.3rem; }
  .reference-list { grid-template-columns: 1fr; }
  .workbook-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .form-submit .button { width: 100%; }
  .form-sheet { padding: 1rem 0.8rem; }
  .form-actions { justify-content: stretch; }
  .form-actions .button { flex: 1 1 130px; }
  .confirm-import-form { display: block; }
  .confirm-import-form .form-actions { margin-top: 0.75rem; }
  .login-sheet { margin-top: 2vh; padding: 1.3rem 1rem; }
  .page-footer { display: grid; gap: 0.25rem; margin-top: 2.3rem; }
  .section-empty { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
