/* BF Labs GEO: warm paper, precise utility, orange reserved for the next action. */
:root {
  color-scheme: light;
  --canvas: #fbfaf7;
  --surface: #ffffff;
  --sidebar: #eeede7;
  --ink: #20211e;
  --muted: #6f7169;
  --faint: #999a92;
  --line: #dedfd6;
  --line-strong: #c9cbc0;
  --accent: #ba3c15;
  --accent-bright: #ed5b25;
  --accent-tint: #fff0e7;
  --success: #386445;
  --success-tint: #edf3ea;
  --danger: #a33428;
  --danger-tint: #fbefeb;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r1: 4px; --r2: 8px; --r3: 12px; --pill: 999px;
  --sidebar-width: 238px;
  --page-gutter: 48px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; font-size: 14px; line-height: 1.75; }
button,input,select,textarea { font: inherit; }
button,a,input,select,textarea { -webkit-tap-highlight-color: transparent; }
button,a { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 4px; }
h1,h2,h3,p { margin: 0; }
h1 { font-size: 30px; line-height: 1.5; font-weight: 650; text-wrap: balance; }
h2 { font-size: 19px; line-height: 1.6; font-weight: 650; text-wrap: balance; }
h3 { font-size: 15px; line-height: 1.75; font-weight: 600; }
small { font-size: 12px; }
dl,ol,ul { margin: 0; padding: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; background: var(--ink); color: white; padding: 12px 18px; transform: translateY(-150%); border-radius: var(--r1); }
.skip-link:focus { transform: translateY(0); }
.muted,.hint { color: var(--muted); }
.hint { font-size: 13px; line-height: 1.8; }
.mono,.code-input { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.danger-text { color: var(--danger) !important; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .1em; line-height: 1.6; margin-bottom: var(--s2); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: var(--r1); background: transparent; color: var(--ink); font-size: 13px; line-height: 1.6; font-weight: 550; white-space: nowrap; transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
.button:hover { background: var(--sidebar); border-color: #a8ab9d; }
.button:active:not(:disabled) { transform: scale(.97); }
.button.primary { background: var(--accent); color: #fffaf7; border-color: var(--accent); }
.button.primary:hover { background: #9d3211; border-color: #9d3211; }
.button.dark { background: var(--ink); color: #f7f6f0; border-color: var(--ink); }
.button.dark:hover { background: #37392f; }
.button.quiet { border-color: transparent; background: transparent; padding-inline: 10px; }
.button.quiet:hover { background: #e7e7de; }
.button.secondary { background: var(--surface); }
.button.secondary:hover { background: var(--sidebar); }
.inline-actions,.actions,.heading-actions,.form-actions { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.text-link { color: var(--accent); overflow-wrap: anywhere; text-underline-offset: 4px; }
.text-link:hover { text-decoration: underline; }
.badge { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 24px; padding: 2px 8px; color: #686c60; background: #efefe8; border-radius: var(--r1); font-size: 11px; line-height: 1.5; font-weight: 550; }
.badge.success { color: var(--success); background: var(--success-tint); }
.badge.accent { color: var(--accent); background: var(--accent-tint); }
.badge.danger { color: var(--danger); background: var(--danger-tint); }
.notice { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); background: var(--success-tint); color: var(--success); border: 1px solid #d3e1cc; border-radius: var(--r1); padding: var(--s3) var(--s4); margin-bottom: var(--s5); font-size: 13px; }
.notice p { flex: 1; }
.notice.danger,.error { color: var(--danger); background: var(--danger-tint); border-color: #edd6cf; }
.notice a { text-decoration: underline; font-weight: 600; }
.notice .button { min-height: 30px; padding-block: 3px; color: inherit; }
.boot-state { min-height: 100vh; display: flex; justify-content: center; align-items: center; flex-direction: column; gap: var(--s5); color: var(--muted); }
.brand { display: flex; align-items: center; gap: var(--s3); }
.brand-mark { display: inline-flex; justify-content: center; align-items: center; width: 38px; height: 38px; background: var(--accent-bright); color: white; border-radius: var(--r2); font-size: 27px; font-weight: 800; font-family: -apple-system,BlinkMacSystemFont,sans-serif; line-height: 1; }
.brand strong { font-size: 17px; font-weight: 700; line-height: 1.4; display: block; }
.brand strong span { font-weight: 450; }
.brand small { color: var(--muted); font-size: 11px; display: block; line-height: 1.6; }
.sidebar { background: var(--sidebar); width: var(--sidebar-width); position: fixed; inset: 0 auto 0 0; border-right: 1px solid var(--line); padding: var(--s6) 22px var(--s5); z-index: 20; display: flex; flex-direction: column; }
.sidebar-brand { flex-shrink: 0; }
.sidebar-content { display: flex; flex-direction: column; flex: 1; min-height: 0; padding-top: var(--s7); }
.mobile-menu { display: none; }
.project-picker label { display: block; color: var(--muted); font-size: 11px; margin-bottom: var(--s2); }
.project-picker select { background: #f8f8f3; width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r1); padding: 10px; font-size: 13px; color: var(--ink); }
.primary-nav { margin-top: var(--s5); display: flex; flex-direction: column; gap: var(--s1); }
.nav-item { min-height: 44px; display: flex; align-items: center; gap: 14px; padding: 8px 10px; border-radius: var(--r1); font-size: 13px; color: #606359; transition: background-color .15s ease; }
.nav-item:hover { background: #e4e4da; color: var(--ink); }
.nav-item.active { background: #dcdfd0; color: var(--ink); font-weight: 650; }
.nav-item[aria-disabled="true"] { opacity: .45; cursor: default; }
.nav-index { font-variant-numeric: tabular-nums; font-size: 10px; opacity: .7; }
.nav-count { margin-left: auto; font-size: 10px; min-width: 18px; text-align: center; background: #cbd0bc; padding-inline: 4px; border-radius: var(--r1); }
.sidebar-tools { border-top: 1px solid var(--line-strong); margin-top: var(--s6); padding-top: var(--s4); }
.sidebar-tools .nav-item { justify-content: space-between; }
.new-project { width: 100%; justify-content: flex-start; color: var(--accent); margin-top: var(--s2); }
.sidebar-bottom { margin-top: auto; padding-top: var(--s6); }
.preview-label { margin-bottom: var(--s5); }
.preview-label p { margin-top: var(--s2); font-size: 11px; line-height: 1.8; color: var(--muted); }
.account { display: flex; align-items: center; gap: var(--s2); border-top: 1px solid var(--line-strong); padding-top: var(--s4); }
.avatar { width: 28px; height: 28px; flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: var(--pill); display: flex; align-items: center; justify-content: center; background: var(--canvas); color: #62675a; font-size: 12px; }
.account > div { min-width: 0; flex: 1; }
.account strong { display: block; font-weight: 600; font-size: 12px; overflow-wrap: anywhere; }
.account small { display: block; color: var(--muted); font-size: 10px; }
.account .button { font-size: 11px; padding-inline: 4px; }
.workspace { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; }
.workspace-bar { height: 65px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding-inline: var(--page-gutter); flex-shrink: 0; }
.workspace-bar > p { display: flex; align-items: center; gap: var(--s2); color: var(--muted); font-size: 12px; min-width: 0; overflow-wrap: anywhere; }
.bar-actions { display: flex; gap: var(--s2); flex-shrink: 0; }
.bar-actions .button { font-size: 12px; min-height: 34px; }
.status-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-bright); flex-shrink: 0; }
.bar-preview { border: 1px solid var(--line); padding-inline: 6px; border-radius: var(--r1); font-size: 10px; white-space: nowrap; }
.preview-banner { display: flex; align-items: center; gap: var(--s3); border-bottom: 1px solid var(--line); padding-bottom: var(--s4); margin-bottom: var(--s6); color: var(--muted); font-size: 11px; }
#main-content { padding: var(--s7) var(--page-gutter) var(--s8); width: 100%; max-width: 1480px; margin-inline: auto; flex: 1; min-width: 0; }
#main-content.boot-state { padding: var(--s6); }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s5); margin-bottom: var(--s6); }
.page-heading > div:first-child { min-width: 0; }
.page-description { margin-top: var(--s3); color: var(--muted); max-width: 680px; font-size: 14px; line-height: 1.8; overflow-wrap: anywhere; }
.heading-actions { padding-top: var(--s5); flex-shrink: 0; gap: var(--s2); }
.next-action { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); padding: var(--s5) var(--s6); background: var(--accent-tint); border: 1px solid #f0d5c1; border-radius: var(--r2); }
.next-action .eyebrow { color: var(--accent); }
.next-action h2 { font-size: 20px; color: #502b1d; }
.next-action p:not(.eyebrow) { color: #805c47; margin-top: var(--s2); max-width: 660px; font-size: 13px; }
.next-action .button { flex-shrink: 0; }
.workflow { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: var(--s6) 0 var(--s7); border-bottom: 1px solid var(--line); }
.workflow-step { display: flex; align-items: flex-start; gap: var(--s3); padding: 0 var(--s4) var(--s5); border-right: 1px solid var(--line); }
.workflow-step:first-child { padding-left: 0; }
.workflow-step:last-child { padding-right: 0; border-right: 0; }
.workflow-step:hover h3 { color: var(--accent); }
.workflow-step h3 { font-size: 14px; }
.workflow-step p { font-size: 11px; color: var(--muted); line-height: 1.8; margin-top: 3px; }
.step-no { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--faint); padding-top: 2px; }
.step-arrow { margin-left: auto; font-size: 15px; color: var(--muted); }
.section { margin-top: var(--s7); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s5); margin-bottom: var(--s5); }
.section-heading p { font-size: 12px; color: var(--muted); margin-top: var(--s1); line-height: 1.8; }
.section-heading .eyebrow { margin-top: 0; }
.section-heading .button { flex-shrink: 0; }
.evidence-ledger { border-top: 1px solid var(--line-strong); }
.ledger-row { display: grid; grid-template-columns: minmax(230px,1.6fr) minmax(90px,.7fr) minmax(120px,1fr) auto; gap: var(--s5); padding: var(--s5) 0; border-bottom: 1px solid var(--line); align-items: center; }
.ledger-label { display: flex; align-items: center; gap: var(--s4); }
.ledger-number { width: 30px; height: 30px; border: 1px solid var(--line-strong); flex-shrink: 0; border-radius: var(--r1); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); font-family: ui-monospace,monospace; }
.ledger-label p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.ledger-value { font-size: 28px; font-weight: 500; line-height: 1.4; font-variant-numeric: tabular-nums; }
.ledger-value small { display: block; color: var(--muted); font-size: 10px; font-weight: 400; margin-top: 3px; }
.unmeasured { color: #86897e; font-size: 15px; font-weight: 400; white-space: nowrap; }
.ledger-detail { color: var(--muted); font-size: 11px; }
.ledger-row > .button { font-size: 12px; }
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s7); }
.axis-list,.project-details { border-top: 1px solid var(--line); }
.axis-list > div,.project-details > div { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
.axis-list dt,.project-details dt { font-size: 12px; color: var(--muted); }
.axis-list dd,.project-details dd { margin: 0; font-size: 12px; text-align: right; overflow-wrap: anywhere; }
.axis-list dd { font-size: 17px; font-variant-numeric: tabular-nums; }
.axis-list dd span { color: var(--muted); font-size: 11px; }
.comparison-note { color: var(--muted); margin-top: var(--s4); font-size: 12px; }
.empty-state { background: #f1f2eb; border: 1px solid var(--line); padding: var(--s6); border-radius: var(--r2); }
.empty-state .empty-title { color: var(--ink); font-size: 16px; font-weight: 600; margin-bottom: var(--s2); }
.empty-state p { font-size: 13px; color: var(--muted); max-width: 650px; }
.empty-state .button { margin-top: var(--s5); }
.record-list { border-top: 1px solid var(--line-strong); }
.record { display: flex; align-items: flex-start; gap: var(--s5); border-bottom: 1px solid var(--line); padding: var(--s5) 0; }
.record-body { flex: 1; min-width: 0; }
.record-body h3 { overflow-wrap: anywhere; }
.record-body > p { margin-top: var(--s2); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.record-title { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.record-title h3 { margin-right: var(--s1); }
.record-meta { color: var(--muted); font-size: 11px !important; }
.record-actions { display: flex; gap: 2px; flex-shrink: 0; }
.record-actions .button { padding-inline: 8px; min-height: 32px; font-size: 12px; }
.row-number { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 4px; min-width: 20px; }
.record-details { margin-top: var(--s3); font-size: 12px; color: var(--muted); }
summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: var(--s1) 0; }
summary:hover { color: var(--ink); }
.record-details[open] { background: #f0f1e9; padding: var(--s3) var(--s4); border-radius: var(--r1); }
.record-details dl { margin-top: var(--s3); }
.record-details dl > div { display: grid; grid-template-columns: 70px minmax(0,1fr); gap: var(--s4); margin: var(--s2) 0; }
.record-details dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.record-details .hint { margin-top: var(--s3); font-size: 11px; }
.task-priority { font-size: 10px; color: var(--muted); background: #eceee3; padding: 3px 6px; border-radius: var(--r1); line-height: 1.6; margin-top: 3px; }
.task-priority.P0 { color: var(--accent); background: var(--accent-tint); }
.comparison-strip { display: flex; gap: var(--s5); background: var(--success-tint); padding: var(--s3) var(--s4); margin-bottom: var(--s4); color: var(--success); font-size: 12px; flex-wrap: wrap; }
.run-symbol { width: 26px; height: 26px; background: #e7eadd; color: #737a65; border-radius: var(--pill); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.run-symbol.succeeded { background: var(--success-tint); color: var(--success); }
.run-symbol.failed { background: var(--danger-tint); color: var(--danger); }
.inline-error,.exclusion-note { color: var(--danger); font-size: 12px !important; }
.results-section { padding-top: var(--s6); border-top: 1px solid var(--line-strong); }
.results-subheading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s5); margin-bottom: var(--s5); }
.results-subheading p { color: var(--muted); font-size: 12px; margin-top: var(--s2); }
.results-subheading .inline-actions { flex-shrink: 0; gap: var(--s2); }
.source-notice { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); background: #eef0e6; border-radius: var(--r1); margin-bottom: var(--s5); }
.source-notice p { color: var(--muted); font-size: 12px; }
.source-notice .badge { background: #dde2d2; }
.data-summary { margin-bottom: var(--s5); color: var(--muted); font-size: 13px; }
.data-summary strong { font-size: 28px; line-height: 1.3; font-weight: 500; color: var(--ink); margin-right: 4px; }
.data-summary span { font-size: 12px; }
.table-scroll { overflow-x: auto; margin-bottom: var(--s6); border: 1px solid var(--line); border-radius: var(--r1); }
table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 620px; }
th,td { text-align: left; vertical-align: middle; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
thead th { background: #eef0e7; color: var(--muted); font-size: 11px; font-weight: 500; }
tbody th { font-weight: 600; }
tbody td { white-space: nowrap; font-variant-numeric: tabular-nums; }
th small { display: block; color: var(--muted); font-weight: 400; font-size: 10px; margin-top: 3px; }
tbody tr:last-child th,tbody tr:last-child td { border-bottom: 0; }
.question-quote { color: var(--ink); font-weight: 500; }
.answer-excerpt { color: var(--muted); }
.raw-answer { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); margin-top: var(--s3); line-height: 1.9; }
.citation-list { padding-left: var(--s4); margin-top: var(--s3); }
.business-stats { display: grid; grid-template-columns: repeat(4,1fr); border-block: 1px solid var(--line); margin: var(--s5) 0; }
.business-stats > div { padding: var(--s5); border-right: 1px solid var(--line); }
.business-stats > div:first-child { padding-left: 0; }
.business-stats > div:last-child { border-right: 0; }
.business-stats span { display: block; color: var(--muted); font-size: 12px; }
.business-stats strong { display: block; font-size: 30px; font-weight: 450; line-height: 1.4; margin-top: var(--s2); font-variant-numeric: tabular-nums; }
.business-stats strong .unmeasured { font-size: 15px; }
.revenue-line { display: flex; justify-content: space-between; gap: var(--s5); align-items: center; margin-bottom: var(--s5); }
.revenue-line span { color: var(--muted); font-size: 12px; }
.revenue-line strong { font-weight: 500; font-variant-numeric: tabular-nums; }
.source-counts { display: flex; gap: var(--s5); flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: var(--s4); }
.source-counts strong { color: var(--ink); margin-left: var(--s2); }
.event-list > div { border-top: 1px solid var(--line); padding-block: var(--s3); }
.event-list > div > span { display: block; font-size: 11px; margin-top: 4px; }
.event-list p { margin-top: var(--s2); }
.project-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: var(--s5); }
.project-list-item { display: flex; flex-direction: column; justify-content: space-between; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r2); padding: var(--s5); min-height: 250px; transition: border-color .15s ease,transform .15s ease; }
.project-list-item:hover { border-color: var(--accent); }
.project-list-item:active { transform: scale(.99); }
.project-monogram { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #eaedde; border-radius: var(--r2); font-size: 18px; margin-bottom: var(--s5); }
.project-list-item .eyebrow { font-size: 10px; letter-spacing: .04em; overflow-wrap: anywhere; }
.project-list-item h2 { margin-bottom: var(--s2); }
.project-list-item p:not(.eyebrow) { color: var(--muted); font-size: 12px; }
.project-foot { display: flex; justify-content: space-between; gap: var(--s4); border-top: 1px solid var(--line); margin-top: var(--s5); padding-top: var(--s4); font-size: 11px; color: var(--muted); }
.project-foot span:last-child { color: var(--accent); white-space: nowrap; }
.first-project { border-block: 1px solid var(--line-strong); padding: var(--s7) 0; margin-top: var(--s7); display: grid; grid-template-columns: 64px minmax(0,1fr) minmax(150px,.6fr); gap: var(--s6); }
.first-project-number { font-size: 44px; line-height: 1.15; color: var(--accent-bright); font-weight: 350; letter-spacing: -.04em; }
.first-project h2 { font-size: 25px; line-height: 1.6; }
.first-project p:not(.eyebrow) { color: var(--muted); font-size: 13px; margin-top: var(--s4); max-width: 470px; }
.first-project .button { margin-top: var(--s5); }
.first-project-checks { padding-left: var(--s5); color: var(--muted); font-size: 12px; align-self: end; list-style: square; }
.first-project-checks li { margin-top: var(--s4); }
.editor-panel { max-width: 850px; }
.editor-panel > .section-heading { position: relative; display: block; padding-bottom: var(--s5); border-bottom: 1px solid var(--line-strong); }
.editor-panel > .section-heading > .button { position: absolute; top: 0; right: 0; }
.editor-panel > .section-heading h2 { padding-right: 60px; }
#editor-title:focus { outline: none; }
.editor-panel form { max-width: 700px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.field { display: block; margin-bottom: var(--s5); min-width: 0; }
.field > span { display: block; font-size: 12px; font-weight: 600; margin-bottom: var(--s2); }
.field > small { display: block; color: var(--muted); font-size: 11px; line-height: 1.8; margin-top: var(--s2); }
.field input,.field select,.field textarea { display: block; width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: var(--r1); background: var(--surface); color: var(--ink); min-height: 42px; padding: 10px 12px; font-size: 13px; line-height: 1.7; transition: border-color .15s ease; }
.field input::placeholder,.field textarea::placeholder { color: #94988b; opacity: 1; }
.field input:hover,.field select:hover,.field textarea:hover { border-color: #a6ad97; }
.field input:focus,.field textarea:focus,.field select:focus { outline: 2px solid #edb393; outline-offset: 1px; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 100px; }
.field input[type="file"] { padding: 10px; font-size: 12px; }
.field input[type="file"]::file-selector-button { border: 0; background: var(--sidebar); border-radius: var(--r1); padding: 6px 10px; margin-right: 10px; color: var(--ink); font: inherit; cursor: pointer; }
.field input:disabled,.field select:disabled,.field textarea:disabled { background: #f0f0e9; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 var(--s5); }
.fact-picker { border-top: 1px solid var(--line); padding-top: var(--s4); margin-block: var(--s3) var(--s5); }
.fact-picker legend { font-size: 12px; font-weight: 600; padding-right: var(--s3); }
.fact-picker > .hint { margin-bottom: var(--s4); font-size: 11px; }
.fact-picker .checkbox { background: #f0f2e9; border: 1px solid var(--line); border-radius: var(--r1); padding: var(--s3); margin-bottom: var(--s2); font-size: 12px; }
.checkbox { display: flex; gap: var(--s3); align-items: flex-start; margin-bottom: var(--s5); font-size: 13px; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--accent); margin: 4px 0 0; flex-shrink: 0; }
.form-context { background: #ecefe3; color: #666f57; padding: var(--s3) var(--s4); border-radius: var(--r1); font-size: 12px; line-height: 1.8; margin-bottom: var(--s5); overflow-wrap: anywhere; }
.form-divider { border-top: 1px solid var(--line); margin: var(--s5) 0; padding-top: var(--s5); }
.form-divider p { color: var(--muted); font-size: 12px; margin-top: var(--s2); }
.form-actions { padding: var(--s5) 0 0; border-top: 1px solid var(--line); margin-top: var(--s6); }
.form-pending { color: var(--muted); font-size: 12px; }
.advanced { border-block: 1px solid var(--line); padding: var(--s3) 0; margin-block: var(--s5); }
.advanced summary { margin-bottom: 0; }
.advanced[open] summary { margin-bottom: var(--s5); }
.import-steps { list-style-position: inside; font-size: 13px; color: var(--muted); margin-bottom: var(--s5); }
.import-steps li { margin-bottom: var(--s2); }
.import-steps + .inline-actions { margin-bottom: var(--s6); }
.connector-setup { display: grid; grid-template-columns: 56px minmax(0,650px); gap: var(--s5); padding: var(--s6); border: 1px solid var(--line-strong); background: #eef0e5; border-radius: var(--r2); }
.connector-mark { width: 46px; height: 46px; border: 1px solid #bfc7ac; background: #e1e6d4; border-radius: var(--r2); display: flex; align-items: center; justify-content: center; color: #5d7047; font-size: 25px; font-weight: 650; }
.connector-setup p:not(.eyebrow) { font-size: 13px; color: var(--muted); margin-block: var(--s3) var(--s5); }
.connector-setup .hint { margin-bottom: 0; font-size: 12px; }
.copy-field { display: flex; gap: var(--s2); }
.copy-field input { font-family: ui-monospace,monospace; font-size: 12px; }
.copy-field .button { flex-shrink: 0; }
.access-panel { max-width: 630px; border: 1px solid var(--line-strong); padding: var(--s6); border-radius: var(--r2); background: #eef0e6; }
.access-panel p { color: var(--muted); font-size: 13px; margin: var(--s3) 0 var(--s5); }
.workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s5) var(--page-gutter); margin-top: auto; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.workspace-footer span:first-child { color: var(--muted); }
.loading-page { min-height: 65vh; }
.loading-page h1 { color: var(--muted); font-size: 25px; }
.skeleton { width: 100%; height: 130px; background: #eef0e6; border-radius: var(--r2); margin-top: var(--s6); animation: pending 1.6s ease-in-out infinite; }
.skeleton.short { height: 42px; width: 70%; animation-delay: .2s; }
.loading-line { padding: var(--s5) 0; color: var(--muted); }
@keyframes pending { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
#main-content.auth-shell,.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); padding: 0; max-width: none; }
.auth-card { padding: var(--s8) clamp(32px,7vw,110px); align-self: center; width: 100%; }
.auth-card .brand { margin-bottom: var(--s8); }
.auth-card h1 { font-size: clamp(25px,2.6vw,38px); line-height: 1.65; }
.auth-copy > p:not(.eyebrow) { margin-top: var(--s4); color: var(--muted); font-size: 13px; }
.auth-steps { list-style: none; margin: var(--s6) 0 var(--s7); }
.auth-steps li { display: flex; align-items: center; gap: var(--s4); font-size: 13px; margin-bottom: var(--s3); }
.auth-steps span { color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; }
.local-note { font-size: 11px; color: var(--muted); margin-top: var(--s5); }
.auth-side { background: #e7eadd; min-height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: var(--s7); overflow: hidden; }
.auth-letter { color: #d1d7be; font-size: clamp(180px,28vw,420px); font-weight: 750; line-height: 1.2; letter-spacing: -.08em; margin-left: -.08em; }
.auth-side p { margin-top: var(--s6); color: #4d5940; font-size: 20px; letter-spacing: .16em; }
.auth-side small { margin-top: var(--s3); color: #7a856b; font-size: 11px; }
.auth-card > h1 { margin-bottom: var(--s4); }
.auth-card > p { color: var(--muted); margin-block: var(--s4); }
.auth-card form { margin-top: var(--s5); }
.auth-card label { display: block; margin-bottom: var(--s4); }
.auth-card input:not([type="hidden"]):not([type="checkbox"]) { width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--r1); padding: 10px 12px; }
.auth-card input[type="checkbox"] { accent-color: var(--accent); }
.auth-card button:not(.button) { min-height: 42px; padding: 8px 16px; border: 1px solid var(--line-strong); border-radius: var(--r1); background: var(--ink); color: #f7f6f0; }
.auth-card .error { padding: var(--s3) var(--s4); border: 1px solid #edd6cf; border-radius: var(--r1); }
.auth-shell:has(> .auth-card:only-child) { display: flex; align-items: center; justify-content: center; }
.auth-shell > .auth-card:only-child { max-width: 800px; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 220px; --page-gutter: 32px; }
  .ledger-row { grid-template-columns: minmax(200px,1.6fr) minmax(80px,.7fr) auto; gap: var(--s4); }
  .ledger-detail { display: none; }
  .workflow-step { gap: var(--s2); padding-inline: var(--s3); }
  .step-arrow { display: none; }
  .first-project { grid-template-columns: 44px minmax(0,1fr); }
  .first-project-checks { grid-column: 2; display: flex; flex-direction: column; gap: var(--s2); }
  .first-project-checks li { margin-top: 0; }
  .results-subheading { flex-direction: column; }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 196px; --page-gutter: 24px; }
  .sidebar { padding-inline: 16px; }
  .brand strong { font-size: 15px; }
  .brand-mark { width: 33px; height: 33px; font-size: 23px; }
  .page-heading { flex-direction: column; gap: var(--s4); }
  .heading-actions { padding-top: 0; }
  .ledger-row { grid-template-columns: minmax(0,1fr) auto; }
  .ledger-value { text-align: right; }
  .ledger-row > .button { display: none; }
  .split-section { grid-template-columns: 1fr; gap: 0; }
  .workflow { grid-template-columns: 1fr; }
  .workflow-step { border-right: 0; border-top: 1px solid var(--line); padding: var(--s4) 0; align-items: center; gap: var(--s4); }
  .step-arrow { display: block; }
  .workflow-step:first-child { border-top: 0; }
  .workflow-step:last-child { padding-right: 0; }
  .workflow-step p { display: inline; }
  .project-list { grid-template-columns: 1fr; }
  .record { gap: var(--s4); }
  .record-actions { flex-direction: column; }
  .auth-card { padding-inline: var(--s7); }
}
@media (max-width: 700px) {
  :root { --page-gutter: 20px; --s7: 36px; --s8: 48px; }
  body { font-size: 14px; }
  h1 { font-size: 26px; }
  h2 { font-size: 18px; }
  .sidebar { position: relative; width: 100%; padding: 14px var(--page-gutter); border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); }
  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  .brand-mark { width: 32px; height: 32px; font-size: 23px; }
  .mobile-menu { display: inline-flex; min-height: 36px; }
  .sidebar-content { display: none; padding-top: var(--s5); }
  .sidebar.is-open .sidebar-content { display: flex; }
  .primary-nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: var(--s4); gap: var(--s2); }
  .sidebar-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); padding-top: var(--s3); margin-top: var(--s4); gap: var(--s2); }
  .new-project { margin-top: 0; }
  .sidebar-bottom { padding-top: var(--s4); }
  .preview-label { display: none; }
  .account { padding-top: var(--s3); }
  .account .button { font-size: 12px; }
  .workspace { margin-left: 0; min-height: calc(100vh - 65px); }
  .workspace-bar { height: 48px; gap: var(--s2); }
  .workspace-bar > p { font-size: 11px; }
  .bar-preview { display: none; }
  .preview-banner { align-items: flex-start; gap: var(--s2); font-size: 10px; }
  .bar-actions { gap: 0; }
  .bar-actions .button { padding-inline: 8px; }
  #main-content { padding-top: var(--s6); }
  .page-description { font-size: 13px; }
  .page-heading { margin-bottom: var(--s5); }
  .heading-actions { gap: var(--s2); }
  .next-action { padding: var(--s5); flex-direction: column; align-items: flex-start; gap: var(--s4); }
  .next-action h2 { font-size: 19px; }
  .next-action p:not(.eyebrow) { font-size: 12px; }
  .next-action .button { min-height: 40px; }
  .workflow { margin-top: var(--s5); margin-bottom: var(--s6); }
  .workflow-step { gap: var(--s4); }
  .workflow-step h3 { font-size: 14px; }
  .workflow-step p { font-size: 11px; }
  .section-heading { gap: var(--s3); align-items: flex-start; margin-bottom: var(--s4); }
  .section-heading p { font-size: 11px; }
  .section-heading .button { min-height: 36px; font-size: 12px; padding-inline: 10px; }
  .ledger-row { padding-block: var(--s5); gap: var(--s3); }
  .ledger-label { gap: var(--s3); }
  .ledger-number { display: none; }
  .ledger-label h3 { font-size: 14px; }
  .ledger-label p { font-size: 10px; max-width: 200px; }
  .ledger-value { font-size: 24px; min-width: 60px; }
  .ledger-value .unmeasured { font-size: 13px; }
  .ledger-value small { font-size: 10px; }
  .empty-state { padding: var(--s5); }
  .empty-state .empty-title { font-size: 15px; }
  .empty-state p { font-size: 12px; }
  .record { flex-wrap: wrap; gap: var(--s3); }
  .record-body { min-width: 0; flex-basis: calc(100% - 48px); }
  .record-actions { margin-left: auto; flex-direction: row; }
  .record-actions .button { min-height: 36px; padding-inline: 12px; }
  .record-title { gap: var(--s2); }
  .record-title h3 { font-size: 14px; }
  .record-body > p { font-size: 12px; }
  .record-meta { font-size: 10px !important; }
  .record-details[open] { padding: var(--s3); }
  .record-details dl > div { grid-template-columns: 60px minmax(0,1fr); gap: var(--s2); }
  .task-record .record-actions { padding-left: 40px; width: 100%; }
  .run-record > .button { margin-left: 38px; }
  .results-subheading .inline-actions { gap: var(--s2); }
  .results-subheading .inline-actions .button { font-size: 12px; }
  .source-notice { display: block; padding: var(--s3); }
  .source-notice p { font-size: 11px; margin-top: var(--s2); }
  .business-stats { grid-template-columns: repeat(2,1fr); }
  .business-stats > div { padding: var(--s4); }
  .business-stats > div:nth-child(odd) { padding-left: 0; }
  .business-stats > div:nth-child(even) { border-right: 0; }
  .business-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .business-stats strong { font-size: 27px; }
  .revenue-line { flex-direction: column; gap: var(--s2); align-items: flex-start; }
  .source-counts { gap: var(--s3) var(--s5); }
  .first-project { grid-template-columns: 1fr; gap: var(--s5); padding-block: var(--s6); margin-top: var(--s6); }
  .first-project-number { font-size: 38px; }
  .first-project h2 { font-size: 23px; }
  .first-project p:not(.eyebrow) { font-size: 12px; }
  .first-project-checks { grid-column: 1; margin-top: var(--s2); }
  .project-list-item { padding: var(--s5); }
  .project-foot { font-size: 10px; gap: var(--s2); }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .field { margin-bottom: var(--s5); }
  .field input,.field select,.field textarea { font-size: 16px; line-height: 1.65; }
  .field input::placeholder,.field textarea::placeholder { font-size: 13px; }
  .field textarea { min-height: 120px; }
  .form-grid .checkbox { margin-bottom: var(--s4); }
  .editor-panel > .section-heading { gap: var(--s3); }
  .editor-panel .section-heading p { font-size: 12px; }
  .editor-panel .section-heading > .button { padding-inline: 8px; }
  .form-context { font-size: 11px; }
  .connector-setup { grid-template-columns: 1fr; padding: var(--s5); gap: var(--s4); }
  .connector-mark { width: 38px; height: 38px; font-size: 22px; }
  .connector-setup p:not(.eyebrow) { font-size: 12px; }
  .copy-field { flex-direction: column; align-items: flex-start; }
  .copy-field input { font-size: 12px; }
  .access-panel { padding: var(--s5); }
  .workspace-footer { flex-direction: column; align-items: flex-start; gap: var(--s1); padding-block: var(--s4); }
  #main-content.auth-shell,.auth-shell { display: block; }
  .auth-card { padding: var(--s6) var(--s5) var(--s7); }
  .auth-card .brand { margin-bottom: var(--s7); }
  .auth-card h1 { font-size: 26px; }
  .auth-copy > p:not(.eyebrow) { font-size: 12px; }
  .auth-steps { margin-bottom: var(--s6); }
  .auth-side { display: none; }
  .local-note { font-size: 10px; }
  .notice { font-size: 12px; padding: var(--s3); gap: var(--s2); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation: none !important; transition: none !important; }
}
