:root {
  --guide-ink: #f1f9f1; --guide-muted: #b1c2b7; --guide-border: #ffffff25;
  --guide-surface: #132820; --guide-base: #0e1c17; --guide-accent: #b6f3cd;
  --guide-frame: min(1330px, calc(100% - 64px));
}
@media screen {
  html:has(.guide-enabled), body.guide-enabled { background: var(--guide-base); color: var(--guide-ink); color-scheme: dark; }
  .guide-enabled #root { --bg:var(--guide-base); --panel:#152921; --panel-light:#335247; --accent:#a6eec2; --text:var(--guide-ink); --muted:var(--guide-muted); --text-h:var(--guide-ink); min-height:0; height:auto; text-align:left; border:0; }
  .guide-enabled #root > .app-shell { display:block; min-height:0; }
  .guide-enabled #root > .app-shell > .sidebar { display:none; }
  .guide-enabled #root > .app-shell > .workspace { width: var(--guide-frame); margin:auto; padding: 10px 0 36px; min-width:0; }
  .guide-enabled .workspace > .topbar { margin: 12px auto 18px; padding: 0; max-width:1280px; }
  .guide-enabled .workspace > .topbar h2 { margin:0; font-size:clamp(1.25rem,2.4vw,1.95rem); font-weight:750; line-height:1.15; letter-spacing:-.035em; }
  .guide-enabled .workspace > .topbar .eyebrow,.guide-enabled .workspace > .topbar .version { display:none; }
  .guide-is-home:not(.guide-dashboard-open) #root { display: none; }
  .guide-is-home .guide-context { display:none; }
  .guide-is-home .workspace > .topbar { display:none; }
  .guide-enabled .workspace > [class$="-page"] { padding: clamp(12px,2.2vw,34px) 0; box-sizing:border-box; }
  .guide-enabled .workspace :is(.module-hero,.dashboard-hero) { border-color:var(--guide-border); margin-bottom:24px; padding-bottom:24px; }
  .guide-enabled .workspace :is(.module-title,.dashboard-title) { font-size:clamp(1.9rem,4.3vw,3.4rem); text-transform:none; line-height:1.03; margin-block:4px 12px; color:var(--guide-ink); }
  .guide-enabled .workspace :is(.module-eyebrow,.section-kicker,.status-pill,.dashboard-title span) { color:var(--guide-accent); }
  .guide-enabled .workspace :is(.module-eyebrow,.section-kicker,.status-pill) { letter-spacing:.095em; }
  .guide-enabled .workspace .button-primary { background:#b6f3cd; border-color:#b6f3cd; color:#0c2317; box-shadow:none; }
  .guide-enabled .workspace .button-secondary { background:#ffffff09; border-color:var(--guide-border); color:var(--guide-ink); }
  .guide-enabled .workspace :is(.section-card,.settings-card) { border-color:var(--guide-border); border-radius:18px; padding:clamp(15px,2.5vw,31px); }
  .guide-enabled .workspace :is(input,textarea,select) { max-width:100%; color-scheme:dark; }
  .guide-enabled .workspace :is(.form-group input,.form-group select,.form-group textarea) { background:#0c1b16; border-color:#426057; }
  .guide-enabled .workspace :is(button,a,input,textarea,select):focus-visible { outline:2px solid var(--guide-accent); outline-offset:3px; }
  .guide-enabled .workspace :is(.report-table-wrap,.cashflow-table-wrap) { overflow-x:auto; max-width:100%; }
}
.guide-skip { position:fixed; left:12px; top:8px; z-index:10; transform:translateY(-200%); padding:9px 15px; background:#b6f3cd; color:#0e1c17; font:700 .875rem/1.3 system-ui; border-radius:8px; }
.guide-skip:focus { transform:translateY(0); }
#guide-header:not([hidden]) { background:#10241b; border-bottom:1px solid var(--guide-border); }
#guide-header, #guide-workspace, #guide-footer,.guide-dialog { color:var(--guide-ink); font: 1rem/1.5 system-ui,-apple-system,"Segoe UI",sans-serif; }
#guide-header-inner,[hidden] { display:none; }
.guide-header-inner,#guide-workspace,#guide-footer:not([hidden]) { width:var(--guide-frame); margin-inline:auto; }
.guide-header-inner,#guide-footer:not([hidden]) { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.guide-header-inner { min-height:75px; }
.guide-brand,.guide-button,.guide-stage,.guide-link,.guide-chip,.guide-tool-link { font:inherit; color:inherit; cursor:pointer; }
.guide-brand { display:flex; align-items:center; gap:11px; background:none; border:0; text-align:left; font-size:.96rem; font-weight:780; line-height:1.15; }
.guide-brand small { display:block; font-size:.67rem; font-weight:600; margin-top:4px; color:var(--guide-muted); letter-spacing:.065em; }
.guide-mark { display:grid; place-items:center; width:40px; height:40px; border-radius:12px; color:#073821; background:var(--guide-accent); flex:none; }
.guide-mark svg { width:24px; height:24px; }
.guide-header-menu,.guide-actions { display:flex; align-items:center; gap:12px; }
.guide-badge { padding:4px 10px; border-radius:20px; border:1px solid #82b49b55; color:#c5e9d4; font-size:.71rem; font-weight:750; white-space:nowrap; }
.guide-button { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-height:44px; padding:8px 14px; border-radius:10px; border:1px solid var(--guide-border); background:#ffffff09; font-size:.84rem; font-weight:720; text-align:center; }
.guide-button:hover,.guide-stage:hover,.guide-chip:hover,.guide-tool-link:hover { background:#b6f3cd16; border-color:#b6f3cd70; }
.guide-button.guide-primary { background:var(--guide-accent); color:#0d2c1d; border-color:var(--guide-accent); font-weight:810; }
.guide-button.guide-primary:hover { background:#d6ffe3; }
.guide-brand:focus-visible,.guide-button:focus-visible,.guide-stage:focus-visible,.guide-link:focus-visible,.guide-chip:focus-visible,.guide-tool-link:focus-visible { outline:2px solid var(--guide-accent); outline-offset:3px; }
.guide-journey { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:18px 0 14px; }
.guide-stage { min-height:52px; display:flex; align-items:center; justify-content:flex-start; text-align:left; gap:10px; background:#182d24; border:1px solid var(--guide-border); border-radius:10px; padding:7px 10px; font-size:.9rem; font-weight:720; }
.guide-stage-active { background:#b6f3cd19; border-color:#b6f3cd85; }
.guide-step-number { display:grid; place-items:center; width:27px; height:27px; border-radius:8px; background:#ffffff11; color:var(--guide-muted); font-size:.73rem; flex:none; }
.guide-stage-active .guide-step-number { color:#0d2b1e; background:var(--guide-accent); }
.guide-context { background:#172d23; border:1px solid var(--guide-border); border-radius:16px; margin: 14px 0; padding:16px 18px; display:grid; grid-template-columns:1fr auto; gap:9px 14px; }
.guide-context-summary { grid-column:1 / -1; }
.guide-context-label { color:var(--guide-accent); font-size:.72rem; font-weight:770; letter-spacing:.085em; text-transform:uppercase; }
.guide-context-note { font-size:.85rem; color:var(--guide-muted); }
.guide-save-note { grid-column:1/-1; color:var(--guide-muted); font-size:.74rem; }
.guide-module-list,.guide-context-actions { display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
.guide-context-actions { justify-content:flex-end; }
.guide-context-actions .guide-link { min-height:36px; }
.guide-chip { background:#ffffff09; border:1px solid var(--guide-border); border-radius:20px; padding:6px 11px; font-size:.74rem; min-height:38px; font-weight:680; text-align:left; }
.guide-chip[aria-current] { background:#b6f3cd1e; border-color:#b6f3cd85; color:var(--guide-accent); }
.guide-hero { border-radius:23px; border:1px solid #7fd3ae63; display:grid; grid-template-columns:minmax(0,1.45fr) minmax(0,1fr); overflow:hidden; padding:clamp(24px,5vw,70px); gap:clamp(18px,3vw,42px); align-items:center; background:radial-gradient(ellipse at top right,#28533f,transparent 62%),#162e23; }
.guide-kicker { color:var(--guide-accent); font-size:.73rem; font-weight:800; letter-spacing:.13em; text-transform:uppercase; }
.guide-kicker span { display:inline-block; width:8px; height:8px; margin-right:5px; background:var(--guide-accent); border-radius:50%; }
.guide-hero h1 { color:var(--guide-ink); font:790 clamp(2.4rem,6vw,5.25rem)/1.02 system-ui,-apple-system,sans-serif; letter-spacing:-.077em; margin:10px 0 16px; }
.guide-hero h1 em { color:var(--guide-accent); font-style:normal; }
.guide-hero-text > p:not(.guide-kicker) { font-size:clamp(.91rem,1.8vw,1.12rem); color:#c3d8c9; max-width:38ch; }
.guide-actions { flex-wrap:wrap; margin-top:22px; }
.guide-hero-aside { max-width:360px; justify-self:end; width:100%; padding:18px 16px 15px; border:1px solid #a1ecca45; background:#101f19ae; border-radius:18px; }
.guide-hero-aside svg { display:block; width:100%; max-height:175px; }
.guide-hero-aside-cap { display:flex; flex-direction:column; gap:3px; padding:5px 3px 0; }
.guide-hero-aside-cap span { font-size:.65rem; color:var(--guide-muted); text-transform:uppercase; letter-spacing:.09em; }
.guide-hero-aside-cap strong { font-size:.86rem; color:var(--guide-ink); }
.guide-home-note { padding:15px 3px 18px; color:var(--guide-muted); font-size:.85rem; }
.guide-home-note span { margin-right:5px; color:var(--guide-accent); }
#guide-footer:not([hidden]) { padding:16px 0 24px; border-top:1px solid var(--guide-border); color:var(--guide-muted); font-size:.785rem; }
.guide-link { border:0; background:none; color:var(--guide-accent); font-size:.77rem; font-weight:730; padding:3px 5px; }
.guide-link:hover { text-decoration:underline; }
.guide-dialog { color-scheme:dark; width:min(630px,calc(100% - 30px)); max-height:85dvh; overflow:auto; inset:0; margin:auto; border:1px solid #7ccfa766; border-radius:18px; background:#14271e; padding:clamp(14px,4vw,27px); box-shadow:0 20px 90px #000a; }
.guide-dialog::backdrop { background:#020906b9; }
.guide-dialog-head { display:flex; align-items:start; justify-content:space-between; gap:10px; margin-bottom:14px; }
.guide-dialog h2 { color:var(--guide-ink); font:780 1.7rem/1.2 system-ui; margin-top:3px; }
.guide-dialog h3 { margin-bottom:5px; color:var(--guide-accent); font-size:.83rem; }
.guide-dialog-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.guide-dialog-section { border:1px solid var(--guide-border); border-radius:10px; padding:9px; }
.guide-tool-link { display:block; text-align:left; background:none; width:100%; border:1px solid transparent; min-height:40px; border-radius:7px; padding:5px 6px; font-size:.81rem; }
.guide-tool-link[aria-current] { color:var(--guide-accent); text-decoration:underline; }
.guide-backup-note { font-size:.81rem; color:#fee3a3; margin-top:8px; max-width:76ch; }
@media screen and (max-width:820px) {
  :root { --guide-frame:calc(100% - 32px); }
  .guide-context { grid-template-columns:1fr; }
  .guide-context-actions { justify-content:space-between; }
  .guide-hero { padding:clamp(20px,4vw,48px); }
  .guide-enabled .workspace > [class$="-page"] { padding-inline:0!important; }
}
@media screen and (max-width:520px) {
  :root { --guide-frame:calc(100% - 24px); }
  .guide-header-inner { min-height:63px; gap:6px; }
  .guide-mark { width:29px; height:29px; border-radius:8px; }
  .guide-mark svg { width:17px; height:17px; }
  .guide-brand { gap:7px; font-size:.8rem; }
  .guide-brand small { font-size:.52rem; }
  .guide-badge { display:none; }
  .guide-tools { font-size:.76rem; padding-inline:8px; white-space:nowrap; }
  .guide-journey { gap:5px; margin-top:12px; }
  .guide-stage { min-height:52px; align-items:center; justify-content:center; flex-direction:column; gap:2px; padding:4px; font-size:.71rem; }
  .guide-step-number { width:20px; height:20px; border-radius:6px; font-size:.64rem; }
  .guide-hero { display:block; border-radius:16px; }
  .guide-hero-aside,.guide-desktop-break { display:none; }
  .guide-actions { align-items:stretch; flex-direction:column; gap:8px; }
  .guide-context { padding:11px; border-radius:12px; }
  .guide-module-list { gap:5px; }
  .guide-enabled .workspace :is(.module-title-row,.dashboard-hero) { align-items:flex-start; flex-direction:column; }
  .guide-enabled .workspace :is(.module-eyebrow,.section-kicker) { margin-bottom:5px; }
  .guide-enabled .workspace .button { min-height:44px; }
}
/* Responsive presentation only: legacy data, controls and print rules stay intact. */
@media screen {
  .guide-enabled .workspace :is(.module-title,.parking-header h1,.opening-title,.report-hero h1,.settings-header h1) {
    max-width:100%; overflow-wrap:anywhere; text-wrap:balance;
  }
  .guide-enabled .workspace :is(.opening-header,.parking-header,.module-title-row,.section-heading,.dashboard-hero) > * { min-width:0; }
  .guide-enabled .workspace :is(.section-card,.settings-card,.cashflow-assumption-card,.opening-check-card,.parking-card,.executive-report) { min-width:0; max-width:100%; }
  .guide-enabled .workspace :is(.cashflow-table-wrap,.report-table-wrap) {
    position:relative; min-width:0; max-width:100%; overflow-x:auto;
    overscroll-behavior-x:contain; scrollbar-width:auto;
    scrollbar-color:#66897a #14271f; touch-action:pan-x pan-y;
  }
  .guide-enabled .workspace :is(.cashflow-table-wrap,.report-table-wrap):focus-visible {
    outline:2px solid var(--guide-accent); outline-offset:2px;
  }
  .guide-enabled .workspace a { overflow-wrap:anywhere; }
  .guide-dialog { max-height:85vh; max-height:85dvh; overscroll-behavior:contain; }
  .guide-context-actions .guide-link,.guide-tool-link,.guide-chip,#guide-footer .guide-link { min-height:44px; }
  .guide-context-actions .guide-link,.guide-tool-link { overflow-wrap:anywhere; }
}
@media screen and (max-width:980px) {
  .guide-enabled .workspace :is(.cashflow-table-wrap,.report-table-wrap)::before {
    content:"Scroll for more columns  →"; position:sticky; left:0; display:block; width:max-content;
    max-width:100%; padding:8px 11px; color:var(--guide-accent); font:650 .76rem/1.3 system-ui,sans-serif;
    background:#172d23; border-bottom:1px solid var(--guide-border); white-space:normal;
  }
  .guide-enabled .workspace .report-table-wrap::before { content:none; }
  .guide-enabled .workspace .opening-header { grid-template-columns:minmax(0,1fr); gap:1.1rem; align-items:start; }
  .guide-enabled .workspace :is(.opening-header-copy,.parking-header>div:first-child) { text-align:left; }
  .guide-enabled .workspace .opening-section-heading { grid-template-columns:minmax(0,1fr); }
}
@media screen and (max-width:820px) {
  .guide-enabled .workspace .report-table-wrap::before { content:"Scroll for more columns  →"; }
  .guide-enabled .workspace :is(.parking-header h1,.opening-title) { font-size:clamp(1.9rem,7vw,3.25rem); line-height:1.06; text-transform:none; }
  .guide-enabled .workspace .parking-header>div:first-child>p:last-child { margin-top:12px; }
  .guide-enabled .workspace :is(.parking-actions,.opening-actions,.business-information-actions,.module-actions,.revenue-actions,.payroll-actions,.expenses-actions,.capital-actions,.cashflow-actions,.reports-actions) {
    display:flex; flex-wrap:wrap; width:100%; align-items:stretch; justify-content:flex-start; gap:8px;
  }
  .guide-enabled .workspace :is(.parking-actions,.opening-actions,.business-information-actions,.module-actions,.revenue-actions,.payroll-actions,.expenses-actions,.capital-actions,.cashflow-actions,.reports-actions) .button {
    flex:1 1 145px; width:auto; min-width:0; min-height:44px; padding:10px 12px; white-space:normal; line-height:1.25; overflow-wrap:anywhere;
  }
  .guide-enabled .workspace :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=button]):not([type=submit]) {
    font-size:16px; min-height:44px; min-width:0;
  }
  .guide-enabled .workspace :is(.input-with-prefix,.input-with-suffix) { min-width:0; max-width:100%; }
  .guide-enabled .workspace :is(.form-grid,.form-grid-two,.form-grid-three,.revenue-stream-fields,.payroll-role-fields,.expense-line-fields,.capital-item-fields,.cashflow-assumption-card,.breakeven-assumption-card,.opening-property-grid,.parking-site-grid,.parking-capacity-grid,.settings-form-grid) > * { min-width:0; }
  .guide-enabled .workspace .opening-check-controls,
  .guide-enabled .workspace .parking-check-grid .parking-notes { grid-template-columns:minmax(0,1fr); }
  .guide-enabled .workspace .settings-data-card .button { min-width:0; max-width:100%; white-space:normal; }
  .guide-enabled .workspace .dashboard-progress-panel { grid-template-columns:minmax(0,1fr); }
}
@media screen and (max-width:560px) {
  .guide-enabled .workspace :is(.form-grid,.form-grid-two,.form-grid-three,.revenue-stream-fields,.payroll-role-fields,.expense-line-fields,.capital-item-fields,.cashflow-assumption-card,.breakeven-assumption-card,.opening-property-grid,.opening-check-grid,.parking-site-grid,.parking-capacity-grid,.settings-form-grid) {
    grid-template-columns:minmax(0,1fr); gap:13px;
  }
  .guide-enabled .workspace :is(.expense-line-fields,.capital-item-fields,.cashflow-assumption-card,.breakeven-assumption-card,.opening-property-grid) > :nth-child(n) { grid-column:1; }
  .guide-enabled .workspace :is(.parking-actions,.opening-actions,.business-information-actions,.module-actions,.revenue-actions,.payroll-actions,.expenses-actions,.capital-actions,.cashflow-actions,.reports-actions) .button {
    flex-basis:calc(50% - 4px);
  }
  .guide-enabled .workspace :is(.cashflow-table,.report-table) :is(th,td) { padding:10px 11px; }
  .guide-enabled .workspace .cashflow-table :is(thead tr,tbody tr) > :first-child {
    position:sticky; left:0; background:#152921; box-shadow:1px 0 var(--guide-border);
  }
  .guide-enabled .workspace :is(.opening-check-card,.parking-card,.settings-card,.cashflow-assumption-card) { padding:14px; }
  .guide-enabled .workspace .opening-check-header { grid-template-columns:minmax(0,1fr); gap:8px; }
  .guide-enabled .workspace .opening-check-header > :last-child { justify-self:start; }
  .guide-enabled .workspace .cashflow-assumption-card .form-field > span { justify-content:flex-start; text-align:left; }
  .guide-header-menu,.guide-brand,.guide-context-actions,.guide-header-inner > * { min-width:0; }
}
@media screen and (max-width:360px) {
  .guide-stage { overflow-wrap:anywhere; }
  .guide-enabled .workspace :is(.parking-actions,.opening-actions,.business-information-actions,.module-actions,.revenue-actions,.payroll-actions,.expenses-actions,.capital-actions,.cashflow-actions,.reports-actions) .button { flex-basis:100%; }
  .guide-dialog-grid { grid-template-columns:minmax(0,1fr); }
}
@media screen and (max-height:500px) and (orientation:landscape) {
  .guide-dialog { max-height:calc(100dvh - 24px); }
  .guide-hero { padding-block:20px; }
  .guide-hero-aside svg { max-height:110px; }
}
@media print {
  .guide-skip,#guide-header,#guide-workspace,#guide-footer,#guide-tools-dialog { display:none!important; }
}

/* Guidance after long forms, and the independent full-backup tools. */
#guide-bottom:not([hidden]) {
  width:var(--guide-frame); margin:0 auto 18px; display:flex; flex-wrap:wrap;
  justify-content:space-between; gap:10px; padding:14px 0;
  color:var(--guide-ink); border-top:1px solid var(--guide-border);
}
.guide-backup-box {margin-top:14px;padding:14px;border:1px solid var(--guide-border);border-radius:12px;}
.guide-backup-box h3 {font-weight:750;margin-bottom:5px;}
.guide-backup-box p,#guide-backup-dialog p,#guide-backup-dialog li {color:var(--guide-muted);font-size:.91rem;}
.guide-backup-box .guide-actions,#guide-backup-dialog .guide-actions {margin-top:12px;}
#guide-backup-sections {margin:9px 0 13px;padding-inline-start:22px;}
#guide-restore-confirm:disabled {opacity:.55;cursor:not-allowed;}
@media screen and (max-width:520px) {
  #guide-bottom:not([hidden]) .guide-button {width:100%;}
  #guide-backup-dialog .guide-actions button,#guide-backup-dialog .guide-actions form {width:100%;}
  #guide-backup-dialog .guide-actions button {white-space:normal;}
}
@media print {
  #guide-bottom,#guide-backup-dialog {display:none!important;}
}
.guide-source-link a {color:var(--guide-accent);text-decoration:underline;text-underline-offset:.16em;}
.guide-source-link a:focus-visible {outline:2px solid var(--guide-accent);outline-offset:3px;}

/* Keep the stage chooser compact; worksheet actions and Next live with the worksheet. */
.guide-context {padding:10px 12px; gap:5px 9px; margin-block:8px 10px;}
.guide-context-label {font-size:.68rem;}
.guide-context-note {font-size:.8rem;}
.guide-context-actions .guide-link {min-height:44px;}
.guide-journey {margin-block:10px 8px;}
@media screen and (max-width:760px) {
  .guide-context {border:0; background:transparent; padding:2px 1px 4px; margin:5px 0;}
  .guide-context-summary, .guide-module-list, .guide-context-actions {grid-column:1 / -1;}
  .guide-context .guide-context-note {display:none;}
  .guide-context-actions {justify-content:flex-start;}
  .guide-context .guide-save-note:not(.guide-source-link) {display:none;}
  .guide-chip {min-height:44px;padding:5px 9px;}
  .guide-header-inner {min-height:52px;}
  .guide-stage {min-height:44px;}
}
