/* TeamFlow display modes: shared visual reference, independent workspace data. */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg:#f7efe2; --surface:#fffaf2; --surface-strong:#fffaf2; --surface-soft:#f2e7d6;
  --ink:#1f2118; --muted:#626454; --soft-muted:#706753;
  --line:#ded1bd; --line-strong:#b5a68f;
  --olive:#667f43; --olive-deep:#496234; --olive-soft:#e6ecd9;
  --coral:#874437; --coral-soft:#f5e0d6; --violet:#73568c; --violet-soft:#eee4f3; --blue:#41677d; --blue-soft:#e3edf2;
  --action:#526d36; --action-text:#ffffff; --nav:#fffaf2; --sidebar:#f2e7d6;
  --hero:#f2e7d6; --hero-text:#1f2118; --hero-muted:#626454;
  --selection:#e6ecd9; --icon-plate:transparent; --nav-icon-filter:none; --marker-text:#20251f;
  --page-background:linear-gradient(145deg,#fbf4e8 0%,#f1e6d3 56%,#dfd0b8 100%);
  --background-image:url('/assets/themes-v10/leaf-desktop.webp');
  --background-wash:rgba(250,240,222,.50);
  --shadow:0 12px 36px rgba(84,68,43,.07); --shadow-soft:0 5px 20px rgba(84,68,43,.04);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:#05080d; --surface:#0c121c; --surface-strong:#111a27; --surface-soft:#151e2d;
  --ink:#f5f9ff; --muted:#b8c3cf; --soft-muted:#a0adba;
  --line:#33475e; --line-strong:#63798f;
  --olive:#dfe5ee; --olive-deep:#dfe5ee; --olive-soft:#26384d;
  --coral:#ffb4bd; --coral-soft:#422735; --violet:#c9b8ff; --violet-soft:#302747; --blue:#a8d2ff; --blue-soft:#20344c;
  --action:#dfe5ee; --action-text:#111a27; --nav:#0c121c; --sidebar:#0c121c;
  --hero:#111a27; --hero-text:#f5f9ff; --hero-muted:#b8c3cf;
  --selection:#33475e; --icon-plate:transparent; --nav-icon-filter:grayscale(1) brightness(1.85) contrast(.9); --marker-text:#20251f;
  --page-background:linear-gradient(145deg,#02050a 0%,#08111c 54%,#02040a 100%);
  --background-image:url('/assets/themes-v10/cosmic-desktop.webp');
  --background-wash:rgba(2,6,12,.40);
  --shadow:0 12px 36px rgba(0,0,0,.18); --shadow-soft:0 5px 20px rgba(0,0,0,.12);
}
:root[data-theme="color"] {
  color-scheme: light;
  --bg:#eef1fa; --surface:#f8faff; --surface-strong:#ffffff; --surface-soft:#edf1fb;
  --ink:#1d2430; --muted:#566278; --soft-muted:#657187;
  --line:#c6d0e4; --line-strong:#8b9ebc;
  --olive:#3865c7; --olive-deep:#3159b1; --olive-soft:#e1eafd;
  --coral:#a13f58; --coral-soft:#f8e2e9; --violet:#6849a5; --violet-soft:#eee5fc; --blue:#326c95; --blue-soft:#dceef9;
  --action:#315fc5; --action-text:#ffffff; --nav:#f8faff; --sidebar:#edf1fb;
  --hero:#edf1fb; --hero-text:#1d2430; --hero-muted:#566278;
  --selection:#e1eafd; --icon-plate:transparent; --nav-icon-filter:hue-rotate(135deg) saturate(.65) brightness(1.12); --marker-text:#20251f;
  --page-background:linear-gradient(145deg,#f6f8ff 0%,#e9edf8 56%,#dfe5f4 100%);
  --background-image:url('/assets/themes-v10/apple-desktop.webp');
  --background-wash:rgba(246,248,255,.48);
  --shadow:0 12px 36px rgba(78,92,126,.07); --shadow-soft:0 5px 20px rgba(78,92,126,.04);
}
body { background:var(--page-background); color:var(--ink); isolation:isolate; }
body::before { z-index:-1; inset:0; opacity:1; background-image:linear-gradient(var(--background-wash),var(--background-wash)),var(--background-image); background-size:cover; background-position:center; mask-image:none; -webkit-mask-image:none; }
button, input, textarea, select { color:inherit; }
.sidebar { background:var(--sidebar); color:var(--ink); border-color:var(--line); }
.topbar { background:var(--surface); color:var(--ink); border-color:var(--line); flex-wrap:wrap; }
.topbar-actions { flex-wrap:wrap; }
.theme-picker { display:inline-flex; align-items:center; gap:.4rem; color:var(--muted); font-size:.875rem; }
.theme-picker select { min-height:44px; max-width:100%; padding:.45rem .55rem; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface-strong); color:var(--ink); font-size:.875rem; cursor:pointer; }
.theme-picker select:focus-visible { outline:3px solid var(--olive-deep); outline-offset:2px; }
.brand-lockup small, .sidebar-note small { color:var(--muted); }
.sidebar-note { background:var(--surface); border-color:var(--line); }
.side-nav .nav-item:hover { background:var(--surface); }
.side-nav .nav-item.is-active { background:var(--selection); border-color:var(--olive-deep); color:var(--ink); }
.side-nav .nav-item > .nav-art { background:var(--icon-plate); border-radius:12px; }
.side-nav .nav-item.is-active > .nav-art { background:var(--icon-plate); }
.side-nav .nav-item:focus-visible { outline-color:var(--olive-deep); }
.hero-card, .brand-intro, .positioning-card { background:var(--hero); color:var(--hero-text); border-color:var(--line); box-shadow:var(--shadow-soft); }
.hero-kicker, .brand-intro .eyebrow, .positioning-card span { color:var(--olive-deep); }
.hero-copy > p:last-of-type, .brand-intro p:last-child, .positioning-card div p, .progress-caption span { color:var(--hero-muted); }
.brand-intro h2, .progress-orbit strong { color:var(--ink); }
.phase-pill, .brand-intro .document-badge { background:var(--surface); color:var(--olive-deep); border-color:var(--line-strong); }
.positioning-card > div { border-color:var(--line); }
.hero-actions .button-ghost { border-color:var(--line-strong); background:var(--surface); color:var(--olive-deep); }
.progress-orbit { background:conic-gradient(var(--olive) var(--progress,0%),var(--line) 0); }
.progress-orbit::before { background:var(--hero); }
.progress-orbit span { color:var(--muted); }
.button-primary, .button-dark, .status-button[data-status="done"], .action-chip.is-done::before, .topic-card.is-published .topic-state::before, .daily-check-grid label:has(input:checked)::before { background:var(--action); color:var(--action-text); }
.button-primary:hover { background:var(--action); filter:brightness(.95); }
.panel, .daily-card, .topic-card, .sync-status { background:var(--surface); color:var(--ink); border-color:var(--line); }
.quick-note textarea, .daily-card input, .daily-card textarea, .daily-card select, .meeting-sheet textarea { background:var(--surface-strong); color:var(--ink); border-color:var(--line-strong); }
textarea::placeholder, input::placeholder { color:var(--muted); opacity:1; }
.month-panel, .next-panel, .topic-card.is-published, .task-row.is-done { background:var(--olive-soft); }
.month-overview { background:var(--surface-soft); }
.route-item { background:var(--surface); }
.route-index, .topic-filter.is-active, .topic-card.is-selected { background:var(--selection); color:var(--olive-deep); }
.status-button[data-status="doing"], .topic-story[data-story="child"] { color:var(--coral); }
.topic-story[data-story="spain"] { color:var(--violet); }
.topic-story[data-story="future"] { color:var(--blue); }
.acceptance-tags span, .calendar-day, .daily-check-grid label, .icon-button { background:var(--surface-strong); }
.calendar-day.has-log, .calendar-day.is-strong { background:var(--olive-soft); }
.daily-check-grid label:has(input:checked) { background:var(--olive-soft); color:var(--olive-deep); }
.calendar-legend, .calendar-day-number { color:var(--muted); }
.book-header { border-top-color:var(--line-strong); }
.book-chapter h2 { border-left-color:var(--olive-deep); }
.book-toc { border-color:var(--line); }
.book-highlight { color:var(--marker-text); }
.story-chart::before { background:var(--surface); border-color:var(--line); }
.story-chart-center strong { color:var(--ink); }
.story-chart-center small { color:var(--muted); }
.story-card header span { color:var(--story); }
.sync-status[data-state="error"], .sync-status[data-state="pending"], .sync-status[data-state="connecting"] { color:var(--muted); }
.mobile-nav { background:var(--nav); border-color:var(--line-strong); }
.mobile-nav button { background:var(--icon-plate); }
.mobile-nav button img { opacity:1; }
.mobile-nav button.is-active { background:var(--selection); border-color:var(--olive-deep); box-shadow:inset 0 -3px var(--olive-deep); }
.mobile-nav button:focus-visible { outline-color:var(--olive-deep); }
@media (max-width:860px) {
  :root[data-theme="light"] { --background-image:url('/assets/themes-v10/leaf-mobile.webp'); }
  :root[data-theme="dark"] { --background-image:url('/assets/themes-v10/cosmic-mobile.webp'); }
  :root[data-theme="color"] { --background-image:url('/assets/themes-v10/apple-mobile.webp'); }
  .topbar { gap:.5rem; }
  .topbar-actions { gap:.5rem; min-width:0; }
  .theme-picker { gap:.25rem; }
  .theme-picker select { max-width:9rem; }
  .progress-orbit { background:linear-gradient(to right,var(--olive) var(--progress,0%),var(--line) var(--progress,0%)); }
}
@media (max-width:420px) {

  .topbar { padding-inline:12px; }
  .topbar .button { padding-inline:8px; }
}
@media (forced-colors:active) { .book-highlight { background:Mark; color:MarkText; } }

.book-view, .book-manuscript { background:var(--surface); box-shadow:none; }

.theme-picker { min-width:0; max-width:100%; }
.theme-picker select { width:8rem; min-width:0; }
.topbar-actions { max-width:100%; }


/* Compact header structure retained; v12 chrome inherits the selected theme. */
.topbar .eyebrow { color:var(--olive-deep); }
.topbar time, .topbar .sync-status { color:var(--muted); }
.topbar .sync-status { background:var(--surface-soft); border-color:var(--line); box-shadow:none; }
.topbar .button-primary { background:var(--action); color:var(--action-text); }
.topbar-actions { width:auto; }
.appearance-settings { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:16px; }
.appearance-settings h3 { margin:0; font-size:1rem; color:var(--ink); }
.appearance-settings .theme-picker { flex-wrap:wrap; gap:8px; }
.appearance-settings select { width:9rem; font-size:1rem; }
.book-manuscript { padding-inline:20px; }
.book-actions { padding-inline:12px; }
@media(min-width:861px) { .book-manuscript { padding-inline:28px; } }
[data-view="calendar"] { min-width:0; grid-template-columns:minmax(0,1fr); }
.appearance-settings { min-width:0; width:100%; }
.appearance-settings .theme-picker { min-width:0; max-width:100%; }
.topbar > div:first-child { max-width:100%; overflow-wrap:anywhere; }

/* Theme is a complete chrome contract: header, CTA, navigation, icon treatment. */
.nav-art img, .mobile-nav button img { filter:var(--nav-icon-filter); }
.mobile-nav { gap:6px; box-shadow:var(--shadow-soft); }
.mobile-nav button { background:transparent; border-radius:12px; }
.side-nav .nav-item > .nav-art, .side-nav .nav-item.is-active > .nav-art { background:transparent; }
.side-nav .nav-item:not(.is-active) { color:var(--muted); }
.side-nav .nav-item.is-active { color:var(--ink); }
.topbar .button-primary:focus-visible { outline-color:var(--olive-deep); }
.topbar .sync-status[data-state="synced"] i, .status-dot { background:var(--olive); box-shadow:0 0 0 3px var(--olive-soft); }
.topbar .sync-status[data-state="error"] { color:var(--coral); border-color:var(--coral); }
.topbar .sync-status[data-state="error"] i { background:var(--coral); box-shadow:none; }
.calendar-day-actions i { background:var(--line); }
.calendar-day-actions i.is-done { background:var(--olive); }
.calendar-day.is-today { border-color:var(--olive-deep); }

/* V13 position only: TeamFlow centered dock; keep the five existing controls. */
@media (max-width:860px) {
  .mobile-nav {
    left:50%;
    right:auto;
    width:min(390px, calc(100% - 24px));
    bottom:calc(12px + env(safe-area-inset-bottom, 0px));
    transform:translateX(-50%);
  }
}

/* V14 approved leaf-shadow M/F artwork; no generated letter/orbit overlay. */
.brand-app-icon { object-fit:contain; background:transparent; border:0; box-shadow:none; }
