/* FreelanceReach workspace theme — green gradient glass.
   Loaded after styles.css: it redefines the design tokens and restyles the shell (grouped sidebar, top bar, page head)
   and the shared components. Tab modules are untouched; they only use the shared classes. */

/* ================= tokens ================= */
:root {
  --bg: #eef6f1;
  --bg-grad:
    radial-gradient(1100px 620px at 12% -8%, rgba(52, 211, 153, 0.30), transparent 60%),
    radial-gradient(900px 560px at 100% 0%, rgba(16, 185, 129, 0.20), transparent 62%),
    radial-gradient(1000px 700px at 60% 110%, rgba(110, 231, 183, 0.26), transparent 60%),
    linear-gradient(160deg, #f3faf6 0%, #e8f5ee 45%, #eef7f3 100%);
  --surface: rgba(255, 255, 255, 0.80);
  --surface-2: rgba(240, 250, 245, 0.78);
  --surface-3: rgba(222, 242, 232, 0.85);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-edge: rgba(255, 255, 255, 0.75);
  --line: rgba(16, 94, 66, 0.12);
  --line-strong: rgba(16, 94, 66, 0.22);
  --text: #0d2a20;
  --text-2: #24473a;
  --muted: #557366;
  /* brand green = actions and selection only. Fills that carry white text are ≥ 4.5:1: #047857 5.48, #065f46 7.68,
     the gradient's lightest stop #058556 4.67. --accent is the brighter emerald for marks without text on them. */
  --primary: #047857;
  --primary-hover: #065f46;
  --primary-text: #047857;
  --primary-soft: rgba(16, 185, 129, 0.13);
  --primary-line: rgba(16, 185, 129, 0.35);
  --primary-grad: linear-gradient(135deg, #058556 0%, #047857 55%, #065f46 100%);
  --primary-grad-hover: linear-gradient(135deg, #047857 0%, #065f46 100%);
  --accent: #10b981;
  --ring: rgba(16, 185, 129, 0.30);
  --focus: #059669;
  --backdrop: rgba(3, 28, 20, 0.45);
  /* status (see the colour-coding block at the top of styles.css): ok is leaf green, never the brand emerald */
  --ok: #166534;  --ok-soft: rgba(34, 197, 94, 0.13);    --ok-line: rgba(34, 197, 94, 0.36);   --ok-dot: #22c55e;
  --warn: #9a5b06; --warn-soft: rgba(245, 158, 11, 0.14); --warn-line: rgba(245, 158, 11, 0.4); --warn-dot: #f59e0b;
  --err: #c81e1e;  --err-soft: rgba(239, 68, 68, 0.11);   --err-line: rgba(239, 68, 68, 0.36);  --err-dot: #ef4444;
  --info: #0369a1; --info-soft: rgba(14, 165, 233, 0.12); --info-line: rgba(14, 165, 233, 0.36); --info-dot: #0ea5e9;
  --ai: #6d4fc2;   --ai-soft: rgba(139, 92, 246, 0.10);   --ai-line: rgba(139, 92, 246, 0.32);  --ai-dot: #8b5cf6;
  --muted-dot: #9db3a8;
  --switch-off: #7a9488;                        /* 3.14:1 on the cards; the knob 3.27:1 on the track */
  --seg-on: rgba(255, 255, 255, 0.95);
  --ai-bg: var(--ai-soft);
  --topbar-bg: rgba(244, 251, 247, 0.62);
  --toast-bg: #0b2a20;
  --toast-ink: #ecfdf5;
  --shadow-1: 0 1px 2px rgba(6, 60, 40, 0.06), 0 6px 18px rgba(6, 60, 40, 0.06);
  --shadow-2: 0 10px 30px rgba(6, 60, 40, 0.10), 0 2px 6px rgba(6, 60, 40, 0.06);
  --shadow-3: 0 24px 60px rgba(6, 60, 40, 0.22), 0 6px 16px rgba(6, 60, 40, 0.10);
  --blur: saturate(1.5) blur(18px);
  --glass-hi: rgba(255, 255, 255, 0.35);       /* top highlight on cards */
  --field-bg: rgba(255, 255, 255, 0.88);       /* inputs, selects, text boxes */
  --btn-bg: rgba(255, 255, 255, 0.62);         /* plain buttons */
  --btn-bg-hover: rgba(255, 255, 255, 0.9);
  --chrome-bg: rgba(255, 255, 255, 0.6);       /* top-bar search box */
  --chrome-btn-bg: rgba(255, 255, 255, 0.55);  /* top-bar buttons */
  --kbd-bg: rgba(255, 255, 255, 0.7);
  --bar-bg: rgba(255, 255, 255, 0.92);         /* sticky bars and banners that content scrolls under */
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' fill='none' stroke='%23557366' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --side-bg: linear-gradient(180deg, rgba(7, 54, 40, 0.94) 0%, rgba(5, 41, 32, 0.95) 55%, rgba(4, 31, 26, 0.96) 100%);
  --side-ink: #cfe9de;
  --side-muted: #7fae9c;
  --side-line: rgba(167, 243, 208, 0.12);
  --side-hover: rgba(167, 243, 208, 0.08);
  --side-active: rgba(52, 211, 153, 0.17);
  --side-accent: #4ade80;
  --sidebar-w: 256px;
  --r: 12px;
  --r-lg: 16px;
  --blur-chrome: saturate(1.5) blur(14px);     /* bars and sheets that content scrolls under */
}

/* Dark: for Auto on a device in dark appearance, and again for Dark chosen in the app (data-theme on <html>,
   set by js/theme-boot.js and js/theme.js). Keep the two copies identical. Light needs no block: it is :root above.
   Always anchor theme selectors on :root (Studio uses data-theme on its poster chips). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #04120d;
    --bg-grad:
      radial-gradient(1000px 600px at 8% -10%, rgba(16, 185, 129, 0.22), transparent 60%),
      radial-gradient(900px 560px at 100% 0%, rgba(5, 150, 105, 0.16), transparent 62%),
      radial-gradient(1000px 700px at 55% 115%, rgba(52, 211, 153, 0.14), transparent 60%),
      linear-gradient(160deg, #061811 0%, #04120d 50%, #051510 100%);
    --surface: rgba(14, 38, 30, 0.78);
    --surface-2: rgba(18, 48, 38, 0.72);
    --surface-3: rgba(26, 62, 49, 0.80);
    --glass: rgba(13, 36, 28, 0.55);
    --glass-strong: rgba(13, 36, 28, 0.78);
    --glass-edge: rgba(167, 243, 208, 0.10);
    --line: rgba(167, 243, 208, 0.12);
    --line-strong: rgba(167, 243, 208, 0.22);
    --text: #e4f5ec;
    --text-2: #c3e3d5;
    --muted: #8fb5a5;
    --primary: #047857;
    --primary-hover: #065f46;
    --primary-text: #6ee7b7;
    --primary-soft: rgba(52, 211, 153, 0.14);
    --primary-line: rgba(52, 211, 153, 0.35);
    --accent: #34d399;
    --ring: rgba(110, 231, 183, 0.32);
    --focus: #6ee7b7;
    --backdrop: rgba(1, 8, 6, 0.62);
    --ok: #4ade80;  --ok-soft: rgba(34, 197, 94, 0.14);    --ok-line: rgba(34, 197, 94, 0.36);   --ok-dot: #4ade80;
    --warn: #fbbf24; --warn-soft: rgba(245, 158, 11, 0.14); --warn-line: rgba(245, 158, 11, 0.36); --warn-dot: #fbbf24;
    --err: #fca5a5;  --err-soft: rgba(239, 68, 68, 0.14);   --err-line: rgba(239, 68, 68, 0.38);  --err-dot: #f87171;
    --info: #7dd3fc; --info-soft: rgba(14, 165, 233, 0.14); --info-line: rgba(56, 189, 248, 0.36); --info-dot: #38bdf8;
    --ai: #c4b5fd;   --ai-soft: rgba(139, 92, 246, 0.16);   --ai-line: rgba(167, 139, 250, 0.38);  --ai-dot: #a78bfa;
    --muted-dot: #5f8574;
    --switch-off: #4f7263;                      /* 3.30:1 on the dark cards */
    --seg-on: #3a7760;                          /* text on it stays ≥ 4.5:1; the inset ring in styles.css draws the boundary */
    --ai-bg: var(--ai-soft);
    --topbar-bg: rgba(5, 20, 15, 0.62);
    --toast-bg: #d1fae5;
    --toast-ink: #04120d;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.25);
    --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.45);
    --shadow-3: 0 26px 64px rgba(0, 0, 0, 0.6);
    --glass-hi: rgba(167, 243, 208, 0.06);
    --field-bg: rgba(6, 26, 20, 0.85);
    --btn-bg: rgba(20, 52, 41, 0.6);
    --btn-bg-hover: rgba(28, 70, 55, 0.8);
    --chrome-bg: rgba(6, 26, 20, 0.6);
    --chrome-btn-bg: rgba(6, 26, 20, 0.55);
    --kbd-bg: rgba(6, 26, 20, 0.6);
    --bar-bg: rgba(11, 33, 26, 0.94);
    --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' fill='none' stroke='%238fb5a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --side-bg: linear-gradient(180deg, rgba(5, 34, 26, 0.92) 0%, rgba(3, 24, 19, 0.94) 100%);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #04120d;
  --bg-grad:
    radial-gradient(1000px 600px at 8% -10%, rgba(16, 185, 129, 0.22), transparent 60%),
    radial-gradient(900px 560px at 100% 0%, rgba(5, 150, 105, 0.16), transparent 62%),
    radial-gradient(1000px 700px at 55% 115%, rgba(52, 211, 153, 0.14), transparent 60%),
    linear-gradient(160deg, #061811 0%, #04120d 50%, #051510 100%);
  --surface: rgba(14, 38, 30, 0.78);
  --surface-2: rgba(18, 48, 38, 0.72);
  --surface-3: rgba(26, 62, 49, 0.80);
  --glass: rgba(13, 36, 28, 0.55);
  --glass-strong: rgba(13, 36, 28, 0.78);
  --glass-edge: rgba(167, 243, 208, 0.10);
  --line: rgba(167, 243, 208, 0.12);
  --line-strong: rgba(167, 243, 208, 0.22);
  --text: #e4f5ec;
  --text-2: #c3e3d5;
  --muted: #8fb5a5;
  --primary: #047857;
  --primary-hover: #065f46;
  --primary-text: #6ee7b7;
  --primary-soft: rgba(52, 211, 153, 0.14);
  --primary-line: rgba(52, 211, 153, 0.35);
  --accent: #34d399;
  --ring: rgba(110, 231, 183, 0.32);
  --focus: #6ee7b7;
  --backdrop: rgba(1, 8, 6, 0.62);
  --ok: #4ade80;  --ok-soft: rgba(34, 197, 94, 0.14);    --ok-line: rgba(34, 197, 94, 0.36);   --ok-dot: #4ade80;
  --warn: #fbbf24; --warn-soft: rgba(245, 158, 11, 0.14); --warn-line: rgba(245, 158, 11, 0.36); --warn-dot: #fbbf24;
  --err: #fca5a5;  --err-soft: rgba(239, 68, 68, 0.14);   --err-line: rgba(239, 68, 68, 0.38);  --err-dot: #f87171;
  --info: #7dd3fc; --info-soft: rgba(14, 165, 233, 0.14); --info-line: rgba(56, 189, 248, 0.36); --info-dot: #38bdf8;
  --ai: #c4b5fd;   --ai-soft: rgba(139, 92, 246, 0.16);   --ai-line: rgba(167, 139, 250, 0.38);  --ai-dot: #a78bfa;
  --muted-dot: #5f8574;
  --switch-off: #4f7263;                      /* 3.30:1 on the dark cards */
  --seg-on: #3a7760;                          /* text on it stays ≥ 4.5:1; the inset ring in styles.css draws the boundary */
  --ai-bg: var(--ai-soft);
  --topbar-bg: rgba(5, 20, 15, 0.62);
  --toast-bg: #d1fae5;
  --toast-ink: #04120d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 22px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-3: 0 26px 64px rgba(0, 0, 0, 0.6);
  --glass-hi: rgba(167, 243, 208, 0.06);
  --field-bg: rgba(6, 26, 20, 0.85);
  --btn-bg: rgba(20, 52, 41, 0.6);
  --btn-bg-hover: rgba(28, 70, 55, 0.8);
  --chrome-bg: rgba(6, 26, 20, 0.6);
  --chrome-btn-bg: rgba(6, 26, 20, 0.55);
  --kbd-bg: rgba(6, 26, 20, 0.6);
  --bar-bg: rgba(11, 33, 26, 0.94);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 7.5 10 12l4.5-4.5' fill='none' stroke='%238fb5a5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --side-bg: linear-gradient(180deg, rgba(5, 34, 26, 0.92) 0%, rgba(3, 24, 19, 0.94) 100%);
}

/* js/theme.js sets this for a moment while the theme changes, so every colour switches at once instead of fading unevenly */
:root.theme-switching *, :root.theme-switching *::before, :root.theme-switching *::after { transition: none !important; }

/* ================= ground ================= */
/* The gradient lives on a fixed compositor layer behind everything, instead of background-attachment: fixed on body
   (which repaints the whole page on every scroll frame). */
body { background: var(--bg); letter-spacing: 0; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg-grad); }
::selection { background: rgba(52, 211, 153, 0.35); }

/* ================= glass surfaces ================= */
/* Cards are plain glass: a translucent tint over the page gradient, no blur. Blur is reserved for floating chrome that
   content actually scrolls under (bars, sheets, dialogs, pop-ups, toasts, sticky bars) — the Materials rule. */
.card {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-1), inset 0 1px 0 var(--glass-hi);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .modal, .notif-panel, .sheet-panel, .lead-pop, .sticky-save, .send-bar, .update-banner, .toast { -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
  .topbar, .bottombar { -webkit-backdrop-filter: var(--blur-chrome); backdrop-filter: var(--blur-chrome); }
}
.card .card { background: var(--glass-strong); box-shadow: none; } /* a card inside a card stays readable */
.modal, .notif-panel { background: var(--glass-strong); border-color: var(--glass-edge); }
/* the panel sits inside the blurred top bar, so its own blur can't reach the page below it: keep it near-solid */
.notif-panel { background: var(--bar-bg); }
.card-head .card-toggle:hover { background: var(--primary-soft); }
.card-icon { filter: saturate(0.9); }

/* inputs stay solid enough to read (the same :not() list as styles.css's field rule, so this one wins for text inputs too) */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), input[type="file"], select, textarea {
  background-color: var(--field-bg);
}
input:focus, select:focus, textarea:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px var(--ring); outline: none; }

/* ================= buttons ================= */
.btn { border-radius: 10px; }
.btn.primary {
  background: var(--primary-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}
.btn.primary:hover { background: var(--primary-grad-hover); border-color: transparent; box-shadow: 0 8px 20px rgba(16, 185, 129, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn:not(.primary):not(.ghost):not(.danger) { background: var(--btn-bg); border-color: var(--line-strong); }
.btn:not(.primary):not(.ghost):not(.danger):hover { background: var(--btn-bg-hover); border-color: var(--primary-line); }
.btn.ghost:hover { background: var(--primary-soft); color: var(--primary-text); }
a { color: var(--primary-text); }

/* ================= sidebar ================= */
.sidebar {
  background: var(--side-bg);
  border-right: 1px solid var(--side-line) !important;
  color: var(--side-ink);
  box-shadow: 12px 0 40px rgba(3, 30, 22, 0.18);
  scrollbar-width: thin;
  scrollbar-color: rgba(167, 243, 208, 0.18) transparent;
}
.sidebar .brand { padding: 2px 8px 16px; color: #f0fdf6; gap: 11px; }
.brandmark {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--primary-grad);
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.brandmark svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.brandcopy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brandcopy strong { font-size: 0.9688rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; }
.brandcopy small { font-size: 0.6875rem; letter-spacing: 0.08em; color: var(--side-muted); font-weight: 700; }
.workspace-card {
  display: flex; align-items: center; gap: 10px;
  margin: 0 2px 16px; padding: 10px;
  border: 1px solid var(--side-line); border-radius: 12px;
  background: rgba(167, 243, 208, 0.06);
}
.workspace-glyph {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: grid; place-items: center;
  background: rgba(52, 211, 153, 0.18); color: #a7f3d0; font-size: 0.6875rem; font-weight: 800;
}
.workspace-copy { display: flex; flex-direction: column; min-width: 0; }
.workspace-copy strong { font-size: 0.7813rem; font-weight: 650; color: #ecfdf5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-copy small { font-size: 0.6875rem; color: var(--side-muted); }
.sidebar .side-nav { gap: 14px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-caption { padding: 0 12px 5px; color: var(--side-muted); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.sidebar .nav-item {
  position: relative;
  min-height: 38px; padding: 0 12px; gap: 11px;
  border: 1px solid transparent; border-radius: 10px;
  color: var(--side-ink); font-size: 0.8438rem; font-weight: 550;
}
.sidebar .nav-item:hover { background: var(--side-hover); color: #fff; }
.sidebar .nav-item:active { background: var(--side-active); }
.sidebar .nav-item.active {
  background: var(--side-active);
  border-color: rgba(110, 231, 183, 0.18);
  color: #fff; font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.sidebar .nav-item.active::before {
  content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--side-accent); box-shadow: 0 0 10px rgba(74, 222, 128, 0.7);
}
.nav-ico { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; }
.nav-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-nav .nav-item:not(.active) .nav-ico { filter: none; opacity: 1; color: var(--side-muted); }
.sidebar .nav-item.active .nav-ico { color: #86efac; }
.sidebar .nav-badge { margin-left: auto; background: rgba(52, 211, 153, 0.22); color: #d1fae5; }
.sidebottom { margin-top: auto; padding-top: 16px; }
.runtime {
  display: flex; align-items: center; gap: 10px; padding: 11px 10px;
  border: 1px solid var(--side-line); border-radius: 12px;
  background: rgba(167, 243, 208, 0.06); color: var(--side-ink); text-decoration: none;
}
.runtime:hover { background: rgba(167, 243, 208, 0.1); color: #fff; }
/* the service dot: healthy = ok, check = warn, offline = err (the sidebar is dark in both themes, so the bright dot values are fixed) */
.rt-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2); }
.rt-copy { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.rt-copy strong { font-size: 0.75rem; font-weight: 650; color: #ecfdf5; }
.rt-copy small { font-size: 0.6875rem; color: var(--side-muted); }
.rt-tag { flex: none; font-size: 0.6875rem; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: rgba(74, 222, 128, 0.18); color: #bbf7d0; letter-spacing: 0.01em; }
[data-runtime][data-tone="warn"] .rt-dot { background: #fbbf24; box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18); }
[data-runtime][data-tone="warn"] .rt-tag { background: rgba(251, 191, 36, 0.16); color: #fde68a; }
[data-runtime][data-tone="bad"] .rt-dot { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18); }
[data-runtime][data-tone="bad"] .rt-tag { background: rgba(248, 113, 113, 0.16); color: #fecaca; }

/* ================= top bar ================= */
.topbar { background: var(--topbar-bg); border-bottom: 1px solid var(--glass-edge); box-shadow: 0 1px 0 var(--line); gap: 14px; }
.crumb { flex: none; font-size: 0.6875rem; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.crumb b { color: var(--text-2); font-weight: 800; }
.jump {
  display: none; align-items: center; gap: 8px; height: 36px; width: min(340px, 32vw); padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--chrome-bg); color: var(--muted);
}
.jump svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.jump input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0; font-size: 0.8125rem; color: var(--text); }
.jump kbd { flex: none; font: 600 0.6875rem/1.6 var(--font); padding: 0 5px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--muted); background: var(--kbd-bg); }
.jump:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.topbar-actions { margin-left: auto; gap: 10px; }
.sys { display: none; align-items: center; gap: 7px; font-size: 0.7188rem; font-weight: 550; color: var(--muted); white-space: nowrap; }
.sys[data-tone="bad"] .rt-dot { background: var(--err-dot); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
.sys[data-tone="good"] .rt-dot { background: var(--ok-dot); box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.topbar .icon-btn { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--chrome-btn-bg); }
.topbar .icon-btn:hover { background: var(--primary-soft); color: var(--primary-text); }

/* ================= page head ================= */
.pagehead { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 18px; }
.pagehead .page-title { flex: none; font-size: 1.5rem; font-weight: 760; letter-spacing: -0.02em; line-height: 1.15; white-space: normal; overflow: visible; }
.page-sub { margin: 0; color: var(--muted); font-size: 0.8438rem; }
.page-sub:empty { display: none; }

@media (min-width: 900px) {
  .sidebar { padding: 18px 12px 14px; }
  /* the bar's content lines up with the 1240px page column on wide windows */
  .topbar { padding: 0 max(32px, calc((100% - 1240px) / 2 + 32px)); }
  .notif-panel { right: max(12px, calc((100% - 1240px) / 2 + 20px)); } /* keeps the panel under the bell */
  .crumb { display: inline; }
  .jump { display: flex; }
  .pagehead { margin: 8px 0 22px; }
  .pagehead .page-title { font-size: 1.75rem; }
  .content { max-width: 1240px; }
}
@media (min-width: 1100px) { .sys { display: inline-flex; } }
@media (max-width: 899.98px) {
  /* phones: the screen name fades into the bar once the large title scrolls under it (main.js sets html.title-in-bar) */
  .crumb { display: block; flex: 1 1 auto; min-width: 0; font-size: 0; letter-spacing: 0; text-transform: none; opacity: 0; transition: opacity var(--dur-2) var(--ease); }
  .crumb #page-crumb { display: none; }
  .crumb b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
  html.title-in-bar .crumb { opacity: 1; }
}

/* ================= phones: bottom bar ================= */
.bottombar { background: var(--topbar-bg); border-top: 1px solid var(--glass-edge); }
.bottombar .nav-item.active, .sheet .nav-item.active { color: var(--primary-text); }
.bottombar .nav-item.active .nav-ico { color: var(--primary-text); }
.sheet-panel { background: var(--glass-strong); }

/* ================= shared bits that carried the old blue ================= */
.nav-item.active { background: var(--primary-soft); color: var(--primary-text); }
.skip-link { background: var(--primary-grad); }
.toast { background: color-mix(in srgb, var(--toast-bg) 92%, transparent); }

/* PIN screen */
.login-card { background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-2); }

/* ================= accessibility settings: Reduce Transparency and Increase Contrast =================
   Component level on purpose: token overrides on :root would lose to the dark blocks' (0,2,0) selectors. */
@media (prefers-reduced-transparency: reduce) {
  body::before { background: var(--bg); }
  .card, .card .card, .modal, .notif-panel, .sheet-panel, .bottombar, .topbar, .lead-pop, .sticky-save, .send-bar, .update-banner, .qr-menu, .msel-pop, .login-card, .alert-row {
    background: var(--bar-bg) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  .toast { background: var(--toast-bg) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .toast.error { background: var(--danger-bg) !important; }
}
@media (prefers-contrast: more) {
  body::before { background: var(--bg); }
  .card, .card .card, .modal, .notif-panel, .sheet-panel, .bottombar, .topbar, .lead-pop, .sticky-save, .send-bar, .qr-menu, .msel-pop, .login-card, .alert-row {
    background: var(--bar-bg) !important; border-color: var(--text-2) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  }
  .btn, .chip, input, select, textarea, .table-wrap, th, td, .stat, .pill, .seg, .badge, .callout { border-color: var(--text-2) !important; }
  .muted, .card-sub, .page-sub, .hint, .field .hint, .stat span { color: var(--text-2); }
  .switch input[type="checkbox"] { box-shadow: inset 0 0 0 1px var(--text-2); }
}

/* touch screens: this file's hover rules out-rank the reset in styles.css, so they are reset here too */
@media (hover: none) {
  .btn:not(.primary):not(.ghost):not(.danger):hover { background: var(--btn-bg); border-color: var(--line-strong); }
  .btn.primary:hover { background: var(--primary-grad); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25); }
  .btn.ghost:hover { background: transparent; color: var(--text-2); }
  .card-head .card-toggle:hover { background: transparent; }
  .sidebar .nav-item:not(.active):hover { background: transparent; color: var(--side-ink); }
  .runtime:hover { background: rgba(167, 243, 208, 0.06); color: var(--side-ink); }
  .topbar .icon-btn:hover { background: var(--chrome-btn-bg); color: var(--text-2); }
}

/* ================= the appearance menu (top bar ◐): Auto / Light / Dark and the colour palette ================= */
.appr-menu { position: fixed; z-index: 45; display: none; padding: 12px 12px 10px; border-radius: var(--r-lg); background: var(--glass-strong); border: 1px solid var(--line);
  box-shadow: var(--shadow-3); transform-origin: top right; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.appr-menu.open { display: block; animation: appr-in var(--dur-2, 220ms) var(--ease-out, var(--ease)) both; }
@keyframes appr-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } to { opacity: 1; transform: none; } }
.appr-title { font-size: 0.75rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 0 4px 6px; }
.appr-title + .appr-row { margin-bottom: 12px; }
.appr-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.appr-palettes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.appr-opt { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--btn-bg); color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 550; cursor: pointer; transition: background var(--dur-1, 120ms) var(--ease), border-color var(--dur-1, 120ms) var(--ease), transform 100ms ease-out; }
.appr-opt:active { transform: scale(0.97); }
@media (hover: hover) { .appr-opt:hover { background: var(--btn-bg-hover); } }
.appr-opt[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); box-shadow: inset 0 0 0 1px var(--primary-line); }
.appr-opt svg { width: 18px; height: 18px; }
.appr-sw { width: 18px; height: 18px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.appr-note { margin: 10px 4px 0; font-size: 0.75rem; line-height: 1.45; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .appr-menu.open { animation: appr-fade 150ms ease both; } @keyframes appr-fade { from { opacity: 0; } to { opacity: 1; } } .appr-opt:active { transform: none; opacity: 0.8; } }
@media (prefers-reduced-transparency: reduce) { .appr-menu { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }
