* { box-sizing: border-box; }

:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  --safe-top: max(14px, env(safe-area-inset-top));
  --safe-bottom: max(8px, env(safe-area-inset-bottom));
  --nav-height: 72px;
}

html, body { margin: 0; min-width: 320px; min-height: 100%; overflow-x: hidden; background: var(--canvas); }
body { min-height: 100dvh; }
button, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.preview-shell { width: min(100%, 560px); min-height: 100dvh; margin: 0 auto; padding: var(--safe-top) 16px calc(var(--nav-height) + var(--safe-bottom) + 28px); }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.demo-badge { display: inline-flex; min-height: 24px; align-items: center; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { display: grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; font-size: 12px; font-weight: 900; letter-spacing: -.04em; }
.brand-kicker { margin: 0 0 3px; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
h1 { margin: 0; font-size: 23px; line-height: 1; letter-spacing: -.04em; }
.round-action { display: grid; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; place-items: center; border: 0; color: inherit; font-size: 22px; }
.analytics-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 14px 0 13px; }
.analytics-tab { min-width: 0; min-height: 44px; padding: 7px 3px; border: 0; background: transparent; color: inherit; font-size: clamp(11px, 3.2vw, 13px); font-weight: 650; white-space: nowrap; }
.control-rail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px; margin-bottom: 15px; }
.control { min-width: 0; }
.control > span { display: block; margin: 0 0 5px 3px; font-size: 10px; font-weight: 650; }
.control select { width: 100%; min-width: 0; height: 44px; padding: 0 28px 0 11px; border-radius: 0; outline: 0; color: inherit; text-overflow: ellipsis; }
.content { display: grid; gap: 12px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.section-heading span { font-size: 10px; font-weight: 700; }
.kpi-label { margin: 0; font-size: 11px; font-weight: 650; }
.kpi-value { margin: 7px 0 0; overflow-wrap: anywhere; font-size: clamp(24px, 7.5vw, 34px); font-weight: 800; line-height: 1; letter-spacing: -.055em; }
.kpi-note { margin: 7px 0 0; font-size: 11px; }
.data-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 48px; }
.data-title { overflow: hidden; font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.data-sub { margin-top: 3px; font-size: 10px; }
.data-value { font-size: 13px; font-weight: 800; text-align: right; white-space: nowrap; }
.bar-chart { display: flex; align-items: end; gap: 5px; height: 136px; }
.bar { min-width: 3px; flex: 1; }
.chart-caption { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.chart-caption b { color: var(--accent); font-size: 10px; }
.demo-note { margin: 0; padding: 11px 13px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.35; }
.demo-action { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; margin-top: 10px; padding: 10px 13px; border: 1px solid var(--line); background: transparent; color: inherit; font-size: 12px; font-weight: 750; text-align: left; }
.demo-action span { color: var(--accent); font-size: 18px; }
.geo-bars { display: grid; gap: 10px; }
.geo-bars > div { display: grid; grid-template-columns: 90px minmax(0, 1fr) 32px; gap: 8px; align-items: center; font-size: 11px; }
.geo-bars i, .geo-bars b { display: block; height: 8px; }
.geo-bars i { overflow: hidden; background: var(--line); }
.geo-bars b { background: var(--accent); }
.geo-bars strong { font-size: 11px; text-align: right; }
.insight-card { display: grid; gap: 7px; font-size: 12px; line-height: 1.4; }
.insight-card span { color: var(--muted); }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.tool-card { display: grid; min-height: 126px; padding: 13px; align-content: space-between; border: 1px solid var(--line); background: transparent; color: inherit; text-align: left; }
.tool-card b { font-size: 14px; }
.tool-card span { color: var(--muted); font-size: 11px; line-height: 1.3; }
.tool-card i { color: var(--accent); font-size: 19px; font-style: normal; }
.profile-card { display: flex; align-items: center; gap: 11px; }
.profile-card > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: var(--accent); color: var(--canvas); font-size: 13px; font-weight: 900; }
.profile-card b, .profile-card small { display: block; }
.profile-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.ai-hero { display: flex; align-items: center; gap: 13px; padding: 17px; border: 1px solid var(--line); }
.ai-orb { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 50%; background: var(--accent); color: var(--canvas); font-size: 23px; }
.ai-hero h2 { margin: 3px 0; font-size: 19px; letter-spacing: -.03em; }
.ai-hero p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.35; }
.chat-thread { display: grid; gap: 9px; }
.chat-bubble { max-width: 92%; padding: 12px 13px; font-size: 12px; line-height: 1.45; }
.chat-bubble.user { justify-self: end; background: var(--accent); color: var(--canvas); }
.chat-bubble.assistant { justify-self: start; border: 1px solid var(--line); background: var(--surface); }
.chat-bubble.assistant b, .chat-bubble.assistant span { display: block; }
.chat-bubble.assistant span { margin-top: 6px; color: var(--muted); }
.suggestions { display: flex; flex-wrap: wrap; gap: 7px; }
.suggestions button { min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); background: var(--surface); color: inherit; font-size: 11px; }
.ai-input { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 6px 6px 6px 13px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.ai-input button { width: 36px; height: 36px; border: 0; background: var(--accent); color: var(--canvas); font-size: 18px; }
.is-syncing { animation: spin .36s linear; }
.onboarding-form { display: grid; gap: 12px; }
.onboarding-form label { display: grid; gap: 6px; font-size: 11px; font-weight: 700; }
.onboarding-form input { width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.onboarding-form .check-line { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.onboarding-form .check-line input { width: 18px; min-height: 18px; }
.form-copy { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.invite-code { margin: 0; padding: 11px; border: 1px dashed var(--accent); color: var(--accent); font-size: 16px; font-weight: 900; letter-spacing: .05em; overflow-wrap: anywhere; }
.state-card { display: grid; min-height: 260px; place-items: center; padding: 30px 18px; text-align: center; }
.state-card h2 { margin: 0; font-size: 18px; }
.state-card p { max-width: 300px; margin: 9px auto 0; font-size: 13px; line-height: 1.5; }
.spinner { width: 32px; height: 32px; margin: 0 auto 14px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.placeholder-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 14px; place-items: center; font-size: 24px; }
.main-nav { position: fixed; z-index: 20; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: min(100%, 560px); min-height: calc(var(--nav-height) + var(--safe-bottom)); margin: auto; padding: 7px 4px var(--safe-bottom); }
.main-nav-item { display: grid; min-width: 0; min-height: 56px; padding: 4px 1px; place-content: center; justify-items: center; gap: 4px; border: 0; background: transparent; color: inherit; }
.main-nav-item span { display: grid; min-width: 26px; height: 24px; place-items: center; font-size: 18px; line-height: 1; }
.main-nav-item b { max-width: 100%; overflow: hidden; font-size: clamp(8px, 2.7vw, 10px); font-weight: 650; text-overflow: ellipsis; }
.ai-nav span { width: 30px; height: 30px; margin-top: -6px; border-radius: 50%; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Concept A — Editorial Ledger: warm, light, spacious, typographic. */
body.concept-a {
  --canvas: #f3f0e8;
  --surface: #faf8f2;
  --ink: #1d1c19;
  --muted: #706d65;
  --line: #cbc5b9;
  --accent: #ad3d28;
  --accent-soft: #e8c9b8;
  color-scheme: light;
}
.concept-a .preview-shell { padding-right: 18px; padding-left: 18px; }
.concept-a .brand-mark { border: 1px solid var(--ink); border-radius: 50%; font-family: Georgia, serif; }
.concept-a .brand-kicker, .concept-a .control > span, .concept-a .data-sub, .concept-a .kpi-note { color: var(--muted); }
.concept-a h1, .concept-a .editorial-total { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.concept-a .round-action { border: 1px solid var(--ink); border-radius: 50%; background: transparent; }
.concept-a .analytics-tabs { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.concept-a .analytics-tab { position: relative; }
.concept-a .analytics-tab.is-active::after { position: absolute; right: 18%; bottom: -1px; left: 18%; height: 3px; background: var(--accent); content: ""; }
.concept-a .control select { border: 1px solid var(--line); background: var(--surface); }
.concept-a .editorial-hero { padding: 22px 0 18px; border-bottom: 1px solid var(--ink); }
.concept-a .editorial-overline { color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.concept-a .editorial-total { margin: 10px 0 3px; font-size: clamp(40px, 13vw, 64px); line-height: .95; letter-spacing: -.055em; }
.concept-a .editorial-meta { display: flex; flex-wrap: wrap; gap: 5px 15px; margin-top: 15px; color: var(--muted); font-size: 12px; }
.concept-a .ledger-grid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.concept-a .ledger-kpi { padding: 17px 12px 16px 0; border-right: 1px solid var(--line); }
.concept-a .ledger-kpi:nth-child(2n) { padding-right: 0; padding-left: 15px; border-right: 0; }
.concept-a .editorial-section { padding: 18px 0 4px; border-bottom: 1px solid var(--ink); }
.concept-a .demo-badge { border-color: var(--accent); color: var(--accent); }
.concept-a .demo-summary .ledger-kpi:nth-child(3), .concept-a .demo-summary .ledger-kpi:nth-child(4) { border-top: 1px solid var(--line); }
.concept-a .demo-action, .concept-a .ai-hero, .concept-a .ai-input { border-color: var(--ink); }
.concept-a .tool-card, .concept-a .chat-bubble.assistant { background: var(--surface); }
.concept-a .tool-card { border-color: var(--ink); }
.concept-a .ai-hero, .concept-a .chat-bubble { border-radius: 0; }
.concept-a .bar { background: var(--ink); }
.concept-a .bar:nth-child(3n) { background: var(--accent); }
.concept-a .data-row { border-top: 1px solid var(--line); }
.concept-a .data-value { color: var(--accent); }
.concept-a .state-card { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.concept-a .placeholder-icon { border: 1px solid var(--ink); border-radius: 50%; }
.concept-a .main-nav { border-top: 1px solid var(--ink); background: rgba(243, 240, 232, .96); }
.concept-a .main-nav-item { color: var(--muted); }
.concept-a .main-nav-item.is-active { color: var(--accent); }
.concept-a .ai-nav span { background: var(--ink); color: var(--canvas); }

/* Concept B — Operations Console: dark, compact, high-signal. */
body.concept-b {
  --canvas: #10120f;
  --surface: #191c17;
  --ink: #f2f4e9;
  --muted: #92988a;
  --line: #30352d;
  --accent: #d9ff3f;
  --accent-soft: #283112;
  color-scheme: dark;
}
.concept-b .preview-shell { padding-right: 12px; padding-left: 12px; }
.concept-b .brand-mark { border-radius: 4px; background: var(--accent); color: #10120f; }
.concept-b .brand-kicker, .concept-b .control > span, .concept-b .data-sub, .concept-b .kpi-note { color: var(--muted); }
.concept-b h1 { font-size: 22px; font-weight: 850; text-transform: uppercase; }
.concept-b .round-action { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--accent); }
.concept-b .analytics-tabs { gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #0b0d0a; }
.concept-b .analytics-tab { min-height: 44px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.concept-b .analytics-tab.is-active { background: var(--accent); color: #10120f; }
.concept-b .control select { border: 1px solid var(--line); background: var(--surface); }
.concept-b .console-ticker { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.concept-b .demo-summary { grid-template-columns: 1fr 1fr; }
.concept-b .console-kpi { min-width: 0; padding: 13px 9px; background: var(--surface); }
.concept-b .console-kpi:first-child { background: var(--accent-soft); }
.concept-b .console-kpi .kpi-value { color: var(--accent); font-size: clamp(20px, 6.6vw, 30px); }
.concept-b .console-panel { padding: 13px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.concept-b .console-panel .section-heading { padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.concept-b .section-heading span { color: var(--accent); }
.concept-b .bar { border-radius: 2px 2px 0 0; background: linear-gradient(180deg, var(--accent), #63751f); }
.concept-b .data-row { min-height: 43px; border-top: 1px solid var(--line); }
.concept-b .data-value { color: var(--accent); font-variant-numeric: tabular-nums; }
.concept-b .status-meter { display: grid; grid-template-columns: 72px 1fr auto; gap: 8px; align-items: center; min-height: 39px; border-top: 1px solid var(--line); font-size: 11px; }
.concept-b .meter-track { height: 5px; background: #0b0d0a; }
.concept-b .meter-fill { height: 100%; background: var(--accent); }
.concept-b .state-card { border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.concept-b .placeholder-icon { border-radius: 4px; background: var(--accent); color: #10120f; }
.concept-b .main-nav { border-top: 1px solid var(--line); background: rgba(16, 18, 15, .97); }
.concept-b .main-nav-item { color: var(--muted); text-transform: uppercase; }
.concept-b .main-nav-item.is-active { color: var(--accent); }
.concept-b .ai-nav span { border-radius: 4px; background: var(--accent); color: #10120f; }
.concept-b .demo-badge { border-color: var(--accent); color: var(--accent); }
.concept-b .tool-card, .concept-b .ai-hero, .concept-b .ai-input { border-color: var(--line); background: var(--surface); }
.concept-b .tool-card:hover, .concept-b .demo-action:hover { border-color: var(--accent); }
.concept-b .chat-bubble { border-radius: 4px; }

/* Concept C — Modular Studio: bright bento, tactile, generous. */
body.concept-c {
  --canvas: #edf3f0;
  --surface: #ffffff;
  --ink: #17342c;
  --muted: #65756f;
  --line: #d5e0db;
  --accent: #006b55;
  --accent-soft: #c9ece0;
  --sun: #ffd86a;
  --blue: #cfe5ff;
  color-scheme: light;
}
.concept-c .brand-mark { border-radius: 12px 12px 4px 12px; background: var(--ink); color: white; }
.concept-c .brand-kicker, .concept-c .control > span, .concept-c .data-sub, .concept-c .kpi-note { color: var(--muted); }
.concept-c .round-action { border-radius: 14px; background: var(--surface); box-shadow: 0 5px 16px rgba(23, 52, 44, .08); }
.concept-c .analytics-tabs { gap: 5px; padding: 4px; border-radius: 16px; background: #dde8e3; }
.concept-c .analytics-tab { min-height: 44px; border-radius: 12px; color: var(--muted); }
.concept-c .analytics-tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 3px 10px rgba(23, 52, 44, .08); }
.concept-c .control select { border: 0; border-radius: 13px; background: var(--surface); box-shadow: 0 4px 14px rgba(23, 52, 44, .06); }
.concept-c .bento-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 10px; }
.concept-c .bento-card { min-width: 0; padding: 16px; border-radius: 20px; background: var(--surface); }
.concept-c .bento-card.primary { grid-row: span 2; background: var(--ink); color: white; }
.concept-c .demo-summary .bento-card:nth-child(4) { background: #f7d5dc; }
.concept-c .bento-card.sun { background: var(--sun); }
.concept-c .bento-card.blue { background: var(--blue); }
.concept-c .bento-card .kpi-value { font-size: clamp(22px, 7.2vw, 33px); }
.concept-c .bento-card.primary .kpi-note, .concept-c .bento-card.primary .kpi-label { color: #bcd0c9; }
.concept-c .bento-panel { padding: 16px; border-radius: 22px; background: var(--surface); box-shadow: 0 8px 26px rgba(23, 52, 44, .06); }
.concept-c .bar { border-radius: 8px 8px 3px 3px; background: var(--accent); }
.concept-c .bar:nth-child(4n) { background: var(--sun); }
.concept-c .data-row { border-top: 1px solid var(--line); }
.concept-c .data-value { color: var(--accent); }
.concept-c .pill-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.concept-c .data-pill { max-width: 100%; padding: 9px 11px; border-radius: 999px; background: var(--canvas); font-size: 11px; font-weight: 700; }
.concept-c .state-card { border-radius: 22px; background: var(--surface); box-shadow: 0 8px 26px rgba(23, 52, 44, .06); }
.concept-c .placeholder-icon { border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.concept-c .main-nav { border-top: 1px solid rgba(23, 52, 44, .08); background: rgba(255, 255, 255, .96); box-shadow: 0 -10px 30px rgba(23, 52, 44, .07); }
.concept-c .main-nav-item { color: var(--muted); }
.concept-c .main-nav-item.is-active { color: var(--accent); }
.concept-c .ai-nav span { background: var(--accent); color: white; }
.concept-c .demo-badge { border: 0; background: var(--accent-soft); color: var(--accent); }
.concept-c .demo-action { border: 0; border-radius: 14px; background: var(--accent-soft); }
.concept-c .tool-card, .concept-c .ai-hero, .concept-c .ai-input { border: 0; border-radius: 18px; background: var(--surface); box-shadow: 0 8px 26px rgba(23, 52, 44, .06); }
.concept-c .chat-bubble { border-radius: 17px; }

@media (max-width: 350px) {
  .preview-shell { padding-right: 10px; padding-left: 10px; }
  .concept-a .preview-shell { padding-right: 13px; padding-left: 13px; }
  .analytics-tab { font-size: 10px; }
  .control-rail { gap: 6px; }
  .concept-b .console-ticker { grid-template-columns: 1.2fr 1fr 1fr; }
  .concept-b .console-kpi { padding-right: 6px; padding-left: 6px; }
  .concept-c .bento-card { padding: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; }
}
