/* FuelStorm interface typography. Brand-selected fonts still style brand previews. */
:root {
  --font-ui: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --font-display: var(--font-ui);
  --font-data: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --type-display: clamp(36px, 4.2vw, 56px);
  --type-title: clamp(28px, 3vw, 40px);
  --type-section: clamp(22px, 2vw, 28px);
  --type-body: 14px;
  --type-detail: 12px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-control: 10px;
  --radius-panel: 18px;
  --motion-fast: 150ms;
  --motion-standard: 280ms;
  --motion-reveal: 480ms;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --analyze-ease: var(--motion-ease);
  font-family: var(--font-ui);
  font-size: var(--type-body);
}

body, button, input, textarea, select { font-family: var(--font-ui); }
button, input, textarea, select { font-size: inherit; }
h1, h2, h3 { font-family: var(--font-display); }
p { max-width: 72ch; }

.brand-intro h1, .page-heading h1, .project-heading h1,
.analyze-intro h1, .analyze-creator-heading h2 {
  font-family: var(--font-display);
  font-size: var(--type-display);
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.page-heading h1, .project-heading h1, .client-library-heading h2 { font-size: var(--type-title); }
.analyze-creator-heading h2 { font-size: var(--type-title); }
.brand-guide-heading h2, .project-section-heading h2,
.library-heading h2, .planner-heading h2, .brand-overview h2,
.dashboard-panel h2, .upcoming-generator h2, .upcoming-library h3,
.empty-library h3, .bible-heading h2, .board-heading h2, .dialog-heading h2,
.analyze-breakdown h3, .analyze-next h3, .client-asset-editor h3,
.bible-section-head h3, .strat-question, .project-record h3,
.project-empty h3, .board-empty h3, .board-dialog h2, .youtube-result h2 {
  font-family: var(--font-display);
  font-size: var(--type-section);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.client-library-heading h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.07; letter-spacing: -.035em; }
.bible-sheet-name { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -.035em; }
.dashboard-metrics strong, .youtube-metrics strong, .price > span:first-child {
  font-family: var(--font-ui);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.board-link-body p { font-family: var(--font-ui); font-weight: 600; letter-spacing: -.025em; }
.brand-project strong, .brand-guide-card h3, .analyze-pattern h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -.02em;
}
.composer > .section-title h2, .controls > .section-title h2,
.prompt-heading h2, .section-title h2 {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.015em;
}
.eyebrow, .field-label, .workspace-switch label,
.analyze-section-head, .analyze-platform-status,
.analyze-metrics span, .generator-context, #saveState {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0;
  line-height: 1.45;
}
.eyebrow, .field-label { letter-spacing: .025em; }
.analyze-post-index { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.studio-nav button { font-family: var(--font-ui); letter-spacing: 0; }
.section-help { font-family: var(--font-ui); font-size: var(--type-detail); letter-spacing: 0; line-height: 1.5; }

.primary, .quiet, .mode-control button, .library-filter button,
.generator-modes button, .analyze-dialog button {
  min-height: 40px;
  border-radius: var(--radius-control);
  font-family: var(--font-ui);
  font-size: var(--type-detail);
  font-weight: 650;
  letter-spacing: -.01em;
  transition: background-color var(--motion-fast) ease,
              border-color var(--motion-fast) ease,
              color var(--motion-fast) ease,
              transform var(--motion-fast) var(--motion-ease);
}
.primary:not(:disabled):active, .quiet:not(:disabled):active { transform: scale(.98); }
.quiet { background: var(--panel); border-color: var(--line); }
.quiet:hover { border-color: var(--muted); }
.mode-control, .library-filter, .generator-modes { border-radius: calc(var(--radius-control) + 3px); }
:root[data-theme="light"] .generator-modes button[aria-pressed="true"] {
  background: var(--text);
  color: var(--panel);
}

.analyze-dialog :is(input, select, textarea),
#legacyStudio :is(input:not([type=file]):not([type=checkbox]), select, textarea),
.client-search input {
  border-radius: var(--radius-control);
  font-family: var(--font-ui);
  font-size: var(--type-body);
  line-height: 1.45;
  transition: border-color var(--motion-fast) ease,
              box-shadow var(--motion-fast) ease;
}
.analyze-dialog :is(input, select, textarea):focus-visible,
#legacyStudio :is(input:not([type=file]):not([type=checkbox]), select, textarea):focus-visible,
.client-search input:focus-visible {
  border-color: var(--text);
  outline: 0;
  box-shadow: 0 0 0 3px var(--raised);
}

.generator-panel, #legacyStudio .library-section, .analyze-next,
.analyze-breakdown, .analyze-dialog { border-radius: var(--radius-panel); }
.analyze-layout { gap: var(--space-6); }
.analyze-platform-toggle { min-height: 78px; }
.analyze-panel-wrap { transition-duration: var(--motion-standard); transition-timing-function: var(--motion-ease); }
.analyze-chevron { transition-duration: var(--motion-standard); transition-timing-function: var(--motion-ease); }
.analyze-platform { animation-duration: var(--motion-reveal); }
.analyze-flight-card { animation-duration: var(--motion-reveal); }
.generator-panel .composer { padding-top: var(--space-6); }
.generator-panel .controls { padding-top: var(--space-5); }
#legacyStudio .library-section { padding-top: var(--space-6); }

@media (max-width: 1100px) {
  .analyze-layout { grid-template-columns: 1fr; }
  .analyze-directory { display: flex; gap: var(--space-2); overflow-x: auto; }
  .analyze-directory .analyze-section-head { flex: none; display: grid; gap: var(--space-1); min-width: 80px; }
  .analyze-creator { width: auto; min-width: 145px; flex: none; }
  .analyze-creator-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 760px) {
  :root { --type-display: clamp(34px, 10vw, 48px); --type-title: clamp(28px, 8vw, 38px); }
  .analyze-layout { gap: var(--space-5); }
  .board-heading h2 { font-size: 16px; }
  .generator-panel .composer, .generator-panel .controls { padding-left: var(--space-4); padding-right: var(--space-4); }
}
@media (prefers-reduced-motion: reduce) {
  .primary, .quiet, .mode-control button, .library-filter button,
  .generator-modes button, .analyze-dialog button,
  .analyze-dialog :is(input, select, textarea),
  #legacyStudio :is(input:not([type=file]):not([type=checkbox]), select, textarea),
  .client-search input, .analyze-panel-wrap, .analyze-chevron { transition: none; }
}
/* A quiet material system shared by the operator views. */
:root {
  --motion-fast: 160ms;
  --motion-medium: 240ms;
  --motion-curve: cubic-bezier(.2,.8,.2,1);
}
:where(button, a, input, textarea, select, summary) {
  -webkit-tap-highlight-color: transparent;
}
:where(button, .quiet, .primary, .text-button, .brand-project, .client-directory-card, .content-template-card) {
  transition: background-color var(--motion-fast) ease,
              border-color var(--motion-fast) ease,
              color var(--motion-fast) ease,
              box-shadow var(--motion-medium) var(--motion-curve),
              transform var(--motion-fast) var(--motion-curve);
}
:where(.primary, .quiet, .brand-project, .client-directory-card, .content-template-card):active {
  transform: scale(.985);
}
:where(.primary, .quiet, .brand-project, .client-directory-card, .content-template-card):focus-visible {
  outline-offset: 3px;
}

:root[data-theme="light"] {
  --bg: #fff;
  --panel: #fff;
  --raised: #f0f2f5;
  --line: #e0e3e8;
  --text: #20242a;
  --muted: #5e6570;
  --accent: #353b45;
  --focus: #0066cc;
  --glass: rgba(255,255,255,.78);
  --glass-line: rgba(217,222,230,.9);
  --glass-shadow: 0 10px 36px rgba(40,52,70,.06), 0 1px 3px rgba(40,52,70,.04);
}
:root[data-theme="light"] body {
  background: radial-gradient(ellipse 85% 65% at 50% -12%, #f4f7fc 0, #fff 72%);
}
:root[data-theme="light"] :is(button, a, input, select, textarea):focus-visible {
  outline-color: var(--focus);
}
:root[data-theme="light"] :is(.primary, .rail-new, .board-toolbar button.primary, .board-media-prep-actions .primary) {
  background: #e9ecf0;
  color: #232932;
  border: 1px solid #dfe3e9;
  box-shadow: 0 1px 2px rgba(40,52,70,.08);
}
:root[data-theme="light"] :is(.primary, .rail-new, .board-toolbar button.primary, .board-media-prep-actions .primary):hover {
  background: #dce1e8;
  color: #1a2028;
  border-color: #d0d7df;
  box-shadow: 0 3px 9px rgba(40,52,70,.1);
}
:root[data-theme="light"] :is(.quiet, .project-room-tools button[aria-current="page"], .mode-control .selected, .library-filter .selected) {
  background: #f4f5f7;
  color: var(--text);
  border-color: var(--line);
}
:root[data-theme="light"] .quiet:hover {
  background: #eaedf1;
  color: var(--text);
}
:root[data-theme="light"] :is(header, .studio-rail, .profile-panel, .client-quick-menu, .rail-new-menu, dialog, .board-side-tools, .board-footer>div, .board-pin-menu) {
  background: var(--glass);
  border-color: var(--glass-line);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: saturate(1.25) blur(18px);
  backdrop-filter: saturate(1.25) blur(18px);
}
:root[data-theme="light"] :is(.dashboard-panel, .brand-project, .project-room-panel, .project-room-context, .project-assistant, .analytics-chart-card, .metricool-report, .analyze-panel-wrap) {
  background: rgba(255,255,255,.84);
  border-color: var(--glass-line);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}
:root[data-theme="light"] :is(.brand-project, .content-template-card):hover {
  border-color: #cbd3de;
  box-shadow: 0 14px 34px rgba(40,52,70,.1), 0 2px 5px rgba(40,52,70,.05);
  transform: translateY(-2px);
}
:root[data-theme="light"] :is(input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
  background: rgba(255,255,255,.94);
  border-color: #d8dde5;
  color: var(--text);
}
:root[data-theme="light"] :is(input, select, textarea)::placeholder {
  color: #777f8b;
}
:root[data-theme="light"] .project-field > span,
:root[data-theme="light"] .project-reference-fieldset legend { color: var(--muted); }
:root[data-theme="light"] :is(.field-label, .project-field label, .eyebrow) {
  color: #626a76;
}
:root[data-theme="light"] .board-viewport {
  background-color: #fafbfc;
  background-image: radial-gradient(#dce2e9 1px, transparent 1px);
}
:root[data-theme="light"] .board-section {
  background: rgba(241,243,246,.82);
  border-color: #d9dee5;
}
:root[data-theme="light"] .board-toolbar button:not(.primary),
:root[data-theme="light"] .board-hint {
  background: var(--glass);
  border-color: var(--glass-line);
  box-shadow: 0 2px 10px rgba(40,52,70,.07);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
:root[data-theme="light"] :is(.project-room-nav, .workspace-section-nav) {
  border-color: var(--line);
}
:root[data-theme="light"] :is(.project-room-nav button[aria-current="page"], .workspace-section-nav button[aria-current="page"]) {
  border-bottom-color: #596575;
}
@media (prefers-reduced-motion: reduce) {
  :where(button, .quiet, .primary, .text-button, .brand-project, .client-directory-card, .content-template-card) {
    transition: none;
  }
  :where(.primary, .quiet, .brand-project, .client-directory-card, .content-template-card):active,
  :root[data-theme="light"] :is(.brand-project, .client-directory-card, .content-template-card):hover {
    transform: none;
  }
}
:root[data-theme="light"] :is(.generator-modes button[aria-pressed="true"], .theme-control button[aria-pressed="true"], .mode-control button[aria-pressed="true"], .library-filter button[aria-pressed="true"]) {
  background: #e7eaef;
  color: var(--text);
  box-shadow: inset 0 0 0 1px #d9dfe6;
}
.client-library-filter-panel { margin: 14px 0 10px; }
.client-library-filter-panel summary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--panel);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.client-library-filter-panel summary::-webkit-details-marker { display: none; }
.client-library-filter-panel summary::after { content: '⌄'; margin-left: 12px; color: var(--muted); transition: transform var(--motion-fast) ease; }
.client-library-filter-panel[open] summary::after { transform: rotate(180deg); }
.client-library-filter-panel .client-library-filters { margin: 14px 0 18px; }
:root[data-theme="light"] .client-library-filter-panel summary { background: #f4f5f7; border-color: #e0e3e8; }
@media (prefers-reduced-motion: reduce) { .client-library-filter-panel summary::after { transition: none; } }
.generation-settings { margin: 0 0 20px; border-bottom: 1px solid var(--line); }
.generation-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 0 12px;
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}
.generation-settings summary::-webkit-details-marker { display: none; }
.generation-settings summary span { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 400; }
.generation-settings summary::after { content: '⌄'; color: var(--muted); transition: transform var(--motion-fast) ease; }
.generation-settings[open] summary::after { transform: rotate(180deg); }
.generation-settings-fields { padding: 4px 0 18px; }
:root[data-theme="light"] #legacyStudio .controls { background: rgba(255,255,255,.82); border-color: var(--glass-line); }
@media (prefers-reduced-motion: reduce) { .generation-settings summary::after { transition: none; } }
.rate-details { margin-top: 10px; }
.rate-details summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; color: var(--muted); cursor: pointer; font-size: 11px; }
.rate-details summary::-webkit-details-marker { display: none; }
.rate-details summary::after { content: '⌄'; }
.rate-details[open] summary::after { transform: rotate(180deg); }
.rate-details .cost-math { margin-top: 8px; }
.bible-index-section { margin-top: 8px; }
.bible-index-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.bible-index-section summary::-webkit-details-marker { display: none; }
.bible-index-section summary::after { content: '⌄'; transition: transform var(--motion-fast) ease; }
.bible-index-section[open] summary::after { transform: rotate(180deg); }
.bible-index-section summary:hover { background: var(--raised); color: var(--text); }
.bible-index-section button { width: 100%; padding-left: 20px; }
.bible-export-menu { position: relative; }
.bible-export-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.bible-export-menu summary::-webkit-details-marker { display: none; }
.bible-export-menu summary::after { content: '⌄'; color: var(--muted); }
.bible-export-menu[open] summary::after { transform: rotate(180deg); }
.bible-export-menu > div { position: absolute; z-index: 5; right: 0; top: calc(100% + 6px); display: grid; gap: 4px; min-width: 170px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 34px rgba(20,25,35,.15); }
.bible-export-menu > div button { width: 100%; text-align: left; }
:root[data-theme="light"] .bible-export-menu > div { background: var(--glass); border-color: var(--glass-line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
@media (prefers-reduced-motion: reduce) { .bible-index-section summary::after { transition: none; } }

/* Compact, tactile actions keep the light interface calm without obscuring labels. */
:root[data-theme="light"] :is(.primary, .quiet, .bible-export-menu summary, .client-library-filter-panel summary) {
  border-radius: 999px;
  background: rgba(234,237,241,.78);
  border-color: rgba(209,216,224,.78);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(40,52,70,.045), inset 0 1px rgba(255,255,255,.7);
  -webkit-backdrop-filter: saturate(1.2) blur(14px);
  backdrop-filter: saturate(1.2) blur(14px);
}
:root[data-theme="light"] :is(.primary, .quiet, .bible-export-menu summary, .client-library-filter-panel summary):hover {
  background: rgba(221,226,232,.92);
  border-color: #cbd3dd;
}
:root[data-theme="light"] .bible-section {
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
:root[data-theme="light"] .bible-sheet[data-default-palette="true"] {
  --sheet-bg: #f0f2f5;
  --sheet-ink: #20242a;
  --sheet-accent: #465160;
}
:root[data-theme="light"] .bible :is(textarea, input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), select) {
  background: #f7f8fa;
  border-color: #e4e8ed;
}
:root[data-theme="light"] .bible :is(textarea, input:not([type="color"]):not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]), select):focus-visible {
  outline-color: var(--focus);
  background: #fff;
}
.bible-index-section summary, .bible-index button { transition: background-color var(--motion-fast) ease, color var(--motion-fast) ease; }
.strat-preferences { min-width: 190px; }
.strat-preferences summary { display: inline-flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 14px; list-style: none; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text); }
.strat-preferences summary::-webkit-details-marker { display: none; }
.strat-preferences summary::after { content: '⌄'; color: var(--muted); transition: transform var(--motion-fast) ease; }
.strat-preferences[open] summary::after { transform: rotate(180deg); }
.strat-preferences-fields { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
:root[data-theme="light"] .strat-preferences summary { background: var(--glass); border-color: var(--glass-line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
:root[data-theme="light"] .strat-proposal { background: rgba(255,255,255,.72); border-color: var(--glass-line); box-shadow: var(--glass-shadow); }
:root[data-theme="light"] .strat-empty { background: #f7f8fa; border-style: solid; }
:root[data-theme="light"] .bible-empty { background: #f7f8fa; border-style: solid; border-color: #e8ebef; }
@media (prefers-reduced-motion: reduce) { .bible-index-section summary, .bible-index button, .strat-preferences summary::after { transition: none; } }

.analytics-overview-panel .dashboard-panel-heading { align-items: start; }
.analytics-overview-panel .dashboard-platforms { margin: 0; padding: 0; border: 0; }
.analytics-overview-panel .metricool-compact-period { margin: 4px 0 18px; color: var(--muted); font-size: 12px; }
.analytics-overview-panel .metricool-compact-grid { gap: 10px; }
.analytics-overview-panel .metricool-compact-grid > div { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--raised); }
.analytics-overview-panel .metricool-compact-grid strong { font-size: 12px; color: var(--muted); }
.analytics-overview-panel .metricool-compact-grid span { margin-top: 4px; font-size: 22px; font-weight: 650; letter-spacing: -.035em; font-variant-numeric: tabular-nums; color: var(--text); }
.analytics-overview-panel .metricool-compact-grid small { line-height: 1.35; }
.analytics-overview-panel .metricool-source-note { margin: 12px 0 0; }
.dashboard-analytics-sources { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.dashboard-analytics-sources summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; cursor: pointer; }
.dashboard-analytics-sources summary::-webkit-details-marker { display: none; }
.dashboard-analytics-sources summary::after { content: '⌄'; }
.dashboard-analytics-sources[open] summary::after { transform: rotate(180deg); }
.dashboard-analytics-sources .dashboard-youtube-source { padding: 14px 0; }
.dashboard-analytics-sources .quiet { margin-bottom: 4px; }

/* Consistent dialog actions and a preview-led reference picker. */
#saveDraftDialog .dialog-actions { align-items: center; }
#saveDraftDialog .dialog-actions > button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 104px; height: 42px; min-height: 42px; padding: 0 18px;
  margin: 0; font-size: 12px; line-height: 1; border-radius: 999px;
}
#listDialog[data-view="library"] { width: min(760px, calc(100vw - 32px)); }
.asset-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.asset-picker-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); overflow: hidden; }
.asset-picker-preview { aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--raised); overflow: hidden; }
.asset-picker-preview > :is(img, video) { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.asset-picker-preview audio { width: calc(100% - 24px); max-width: 100%; }
.asset-picker-audio { color: var(--muted); font-size: 44px; }
.asset-picker-actions { display: flex; gap: 12px; align-items: center; padding: 12px 48px 12px 14px; }
.asset-picker-actions strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.asset-picker-actions .quiet { min-height: 34px; padding: 6px 14px; font-size: 12px; }
.asset-picker-info { margin: 0; }
.asset-picker-info > summary { position: absolute; right: 10px; top: auto; margin-top: -46px; width: 32px; height: 34px; display: grid; place-items: center; cursor: pointer; list-style: none; color: var(--muted); border-radius: 50%; }
.asset-picker-info > summary::-webkit-details-marker { display: none; }
.asset-picker-info > summary:hover { background: var(--raised); color: var(--text); }
.asset-picker-info > p { margin: 0; padding: 0 14px 14px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; color: var(--muted); }
.asset-picker-info > p span { display: block; text-transform: capitalize; }
.studio-rail .studio-nav button { row-gap: 10px; min-height: 72px; }
@media (max-width: 760px) { .studio-rail .studio-nav button { row-gap: 8px; min-height: 64px; } }
@media (max-width: 480px) { .asset-picker-grid { grid-template-columns: 1fr; } }
:root[data-theme="light"] .analytics-overview-panel .metricool-compact-grid > div { background: #f5f7f9; border-color: #e7eaf0; }
@media (max-width: 700px) { .analytics-overview-panel .metricool-compact-grid { grid-template-columns: 1fr; } }

/* The header's glass creates its own layer; lift it above page content so its menus (profile, workspace) overlay everything below. */
header { position: relative; z-index: 30; }
/* Blur can't reach through the header's own glass layer, so its pop-overs use a near-opaque surface. */
/* Pop-over menus are solid surfaces with a soft lift, never glass: nothing behind them should show through. */
:root { --popover-bg: var(--panel); --popover-line: var(--line); --popover-shadow: 0 18px 48px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.35); }
:root[data-theme="light"] { --popover-bg: #fff; --popover-line: #e3e6eb; --popover-shadow: 0 18px 48px rgba(24,32,44,.16), 0 2px 6px rgba(24,32,44,.08); }
:root :is(.profile-panel, .client-quick-menu, .rail-new-menu, .assist-menu, .bible-export-menu > div, .board-pin-menu),
:root[data-theme="light"] :is(.profile-panel, .client-quick-menu, .rail-new-menu, .assist-menu, .bible-export-menu > div, .board-pin-menu) {
  background: var(--popover-bg);
  border: 1px solid var(--popover-line);
  box-shadow: var(--popover-shadow);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
/* App shell on every page: the window never scrolls, the header stays pinned, and <main> is the page's scroll area.
   --app-top (header height + its margins) is measured in app.js for sticky panels inside main. */
html,body{height:100%;overflow:hidden}
body{display:flex;flex-direction:column;height:100dvh}
body>header{flex:none}
main{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;align-self:stretch;margin-right:0}
/* Glass header: content scrolls up *behind* the pinned header and is softly blurred through it.
   main reaches up under the header (negative margin = --app-top) and pads its content back down. */
body>header{position:relative;z-index:35;
 background:linear-gradient(180deg,color-mix(in srgb,var(--panel) 78%,transparent),color-mix(in srgb,var(--panel) 62%,transparent))!important;
 -webkit-backdrop-filter:blur(18px) saturate(1.4)!important;backdrop-filter:blur(18px) saturate(1.4)!important;
 border-color:color-mix(in srgb,var(--line) 70%,transparent)!important;
 box-shadow:inset 0 1px 0 color-mix(in srgb,#fff 14%,transparent),0 10px 30px #00000014!important}
main{margin-top:calc(-1 * var(--app-top,90px));padding-top:calc(var(--app-top,90px) + 28px)!important}
/* The gap above and beside the header: a band that fades page colour to clear, so text leaves view gently. */
body::after{content:"";position:fixed;z-index:30;left:0;right:0;top:0;height:calc(var(--app-top,90px) + 14px);pointer-events:none;
 background:linear-gradient(to bottom,color-mix(in srgb,var(--bg) 88%,transparent) 0%,color-mix(in srgb,var(--bg) 55%,transparent) 60%,transparent 100%);
 -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
 -webkit-mask-image:linear-gradient(to bottom,#000 70%,transparent);mask-image:linear-gradient(to bottom,#000 70%,transparent)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){body>header{background:var(--panel)!important}}
@media (prefers-reduced-transparency:reduce){body>header{background:var(--panel)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}body::after{-webkit-backdrop-filter:none;backdrop-filter:none}}
/* Page content lines up with the header's edges (header: 104px from the left, clamp(16px,2vw,48px) from the right). */
@media (min-width:761px){main{padding-left:12px!important;padding-right:clamp(16px,2vw,48px)!important}}

/* No visible scrollbars anywhere in FuelStorm: everything still scrolls by wheel, trackpad, keyboard and touch. */
*{scrollbar-width:none!important}
*::-webkit-scrollbar{display:none!important;width:0!important;height:0!important}
