/* ============================================================================
   shell-app.css -- the studio dashboard's own identity, layered on tokens.css.

   Identity tokens (fonts, radii, accent) live per shell rather than in
   tokens.css, because the three surfaces are deliberately different brands:
   the app is cyan/Manrope, the guest shell is per-studio gold/Fraunces, the
   public microsite is per-studio bronze/Playfair. Only the SEMANTIC palette
   is shared.
   ========================================================================== */

:root {
  --font-display: "Manrope", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --radius-sm: 8px;
  --main-max: 1100px;

  /* THE ONE IDENTITY TOKEN THAT MUST FOLLOW THE THEME.
     #22d3ee on white is ~1.9:1 -- every link in the dashboard would be
     unreadable in light mode. So --accent is split in two:
       --accent        text, links, active states   (contrast matters)
       --accent-vivid  glows, gradients, focus rings (contrast does not)
     --accent-vivid stays the brand cyan in both themes so the sidebar's
     active glow and the primary button keep their identity. */
  --accent:       #0e7490;
  --accent-vivid: #22d3ee;
  --accent-2:     #4f46e5;
  /* Dark ink in BOTH themes: --on-accent sits on --accent-vivid, which is
     the brand cyan either way. White on #22d3ee is 1.8:1 -- the primary
     button's own label would be unreadable in light mode. */
  --on-accent:    #06222a;
  /* The primary button's gradient and its ink stay the brand cyan in
     both themes -- a primary action should not change identity with
     the theme, and --accent darkens in light mode for link contrast. */
  --accent-vivid-2: #38bdf8;
  /* Channel triplets for rgb(var(--x) / alpha). A triplet keeps the
     author's hand-tuned alpha visible at the call site (.06 vs .2 vs
     .25 were deliberate) while the hue follows the theme.
     --accent-rgb tracks --accent-vivid, not --accent: every use is a
     decorative glow or gradient, where the brand cyan should hold in
     both themes. */
  --accent-rgb:   34 211 238;
  --accent-2-rgb: 79 70 229;
  --accent-glow:  rgb(var(--accent-rgb) / .35);

  /* base.css's .seg component is shell-agnostic (no --accent of its own
     to reach for) -- this is the one line that tells it which colour to
     use for the active tab's indicator on THIS shell. Points at --accent
     itself, so it needs no light/dark pair of its own: whichever --accent
     is active right now is what --seg-accent already resolves to. */
  --seg-accent: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #22d3ee; --accent-vivid: #22d3ee; --accent-2: #818cf8;
    --accent-2-rgb: 129 140 248;
  }
}
:root[data-theme="dark"] {
  --accent: #22d3ee; --accent-vivid: #22d3ee; --accent-2: #818cf8;
  --accent-2-rgb: 129 140 248;
}

/* --- shared utilities ---------------------------------------------------- */

/* Icons are <svg><use> and inherit `color` through currentColor, so they
   need no colour rules of their own. */
.ic { width: 18px; height: 18px; display: block; }

/* Visually hidden, still announced. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* --- theme toggle -------------------------------------------------------- */

.theme-toggle {
  display: inline-flex; gap: .1rem; padding: .18rem;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-pill);
}
.theme-toggle button {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 24px; border-radius: var(--radius-pill);
  color: var(--text-faint);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.theme-toggle button:hover { color: var(--text); }
.theme-toggle button[aria-pressed="true"] {
  background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm);
}
.theme-toggle button:focus-visible { outline: 2px solid var(--accent-vivid); outline-offset: 2px; }
.theme-toggle .ic { width: 15px; height: 15px; }
.theme-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; margin-bottom: .6rem;
}
.theme-toggle-row .theme-toggle-label { color: var(--text-faint); font-size: .78rem; }

/* The sidebar's .user-block is display:none below 768px, so the mobile top
   bar carries its own single-button version. */
.theme-toggle-mobile { display: none; }
@media (max-width: 768px) {
  .theme-toggle-mobile {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: var(--radius-pill);
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    cursor: pointer; padding: 0;
  }
  .theme-toggle-mobile .ic { width: 16px; height: 16px; }
}
