/* SynBot dashboard theme: "mixing desk".
   Quiet slate panels, one violet for actions, amber lamps for things that are switched on. */
/* Fonts are loaded by a <link> in each page (faster than @import). */

:root {
  --bg: 20 21 31;          /* #14151F page */
  --sunken: 16 17 26;      /* #10111A wells, inputs */
  --panel: 27 29 42;       /* #1B1D2A cards */
  --raised: 36 38 56;      /* #242638 rows inside cards, hover */
  --line: 48 51 72;        /* #303348 borders */
  --brand: 128 110 255;    /* #806EFF actions, selection */
  --brand-deep: 101 83 240;/* #6553F0 pressed */
  --brand-light: 160 146 255; /* #A092FF highlights on dark */
  --lamp: 92 214 160;      /* #5CD6A0 "on" lamps and switches (green = good / on) */
  --warn: 255 195 90;      /* #FFC35A warnings only (orange = warning, red = error) */
  --ok: 92 214 160;
  --danger: 255 107 122;
  --text: 236 235 245;
  --muted: 151 153 179;
  --radius-panel: 18px;
  --radius-control: 10px;
  color-scheme: dark;
}

html { background: rgb(var(--bg)); }
body {
  background: rgb(var(--bg)) !important;
  color: rgb(var(--text));
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .font-display {
  font-family: "Bricolage Grotesque", "Instrument Sans", sans-serif !important;
  font-optical-sizing: auto;
  letter-spacing: -0.02em;
}
h1 { font-weight: 700 !important; }
h2, h3 { font-weight: 650 !important; }
p { text-wrap: pretty; }
::selection { background: rgb(var(--brand) / .35); }

/* scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(var(--line)); border-radius: 8px; border: 2px solid rgb(var(--bg)); }
::-webkit-scrollbar-thumb:hover { background: rgb(var(--muted) / .6); }

/* keyboard focus is always visible */
:focus-visible { outline: 2px solid rgb(var(--brand)); outline-offset: 2px; border-radius: 6px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* ── page header ──────────────────────────────────────────────
   The old gradient box with a glowing blob becomes a flat header that sits on the page. */
main > .page-hero, .page-hero {
  background: none !important;
  border: 0 !important;
  border-bottom: 1px solid rgb(var(--line)) !important;
  border-radius: 0 !important;
  padding: 0 0 1.75rem !important;
  margin-bottom: 2rem !important;
  overflow: visible !important;
}
.page-hero > .blur-3xl, .page-hero > [class*="blur-"] { display: none !important; }
/* every dashboard page: one centred column */
#SynBot-sidebar ~ main { width: 100%; max-width: 1240px !important; margin-left: auto !important; margin-right: auto !important; min-width: 0; }
/* one header layout: [icon tile] title + description ........ actions [module switch] */
.page-hero .ph-row, .page-hero.ph-row { display: flex !important; flex-direction: row !important; flex-wrap: wrap; align-items: center !important; justify-content: space-between !important; gap: 1rem 1.5rem; }
.ph-row > :not(.ph-left):not(:has(h1)) { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.ph-left { display: flex; align-items: center; gap: 1.25rem; min-width: 0; flex: 1 1 26rem; }
.ph-left h1, .ph-row h1 { margin: 0 0 .3rem !important; }
.ph-toggle { display: inline-flex; align-items: center; gap: .75rem; padding: .65rem .9rem .65rem 1rem; border-radius: 16px; border: 1px solid rgb(var(--line)); background: rgb(var(--sunken)); cursor: pointer; white-space: nowrap; }
.ph-toggle .ph-state { font-size: .875rem; font-weight: 700; color: rgb(var(--muted)); }
.ph-toggle.on .ph-state { color: rgb(var(--lamp)); }
.ph-note { margin: .9rem 0 0 !important; font-size: .8125rem; color: rgb(var(--muted)); }
@media (max-width: 640px) { .ph-left { flex-basis: 100%; } .ph-left .ph-tile { width: 3rem !important; height: 3rem !important; font-size: 1.5rem; } }
.page-hero h1 { font-size: clamp(1.75rem, 2.6vw, 2.4rem) !important; line-height: 1.1; }
.page-hero p { color: rgb(var(--muted)); max-width: 62ch; line-height: 1.55; }
/* the emoji tile next to the title */
.page-hero .w-16.h-16 {
  background: rgb(var(--panel)) !important;
  border: 1px solid rgb(var(--line)) !important;
  border-radius: 14px !important;
}

/* ── cards and controls (module pages use the kit-* classes) ── */
.kit-card {
  background: rgb(var(--panel)) !important;
  border: 1px solid rgb(var(--line) / .7) !important;
  border-radius: var(--radius-panel) !important;
  padding: 1.5rem !important;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .03);
}
.kit-card h2 { font-size: 1.15rem !important; }
.kit-input {
  background: rgb(var(--sunken)) !important;
  border: 1px solid rgb(var(--line)) !important;
  border-radius: var(--radius-control) !important;
  color: rgb(var(--text)) !important;
  padding: .6rem .85rem !important;
  font-size: .875rem !important;
  transition: border-color .15s, box-shadow .15s;
}
.kit-input:hover { border-color: rgb(var(--muted) / .45) !important; }
.kit-input:focus { border-color: rgb(var(--brand)) !important; box-shadow: 0 0 0 3px rgb(var(--brand) / .22) !important; }
select.kit-input option { background: rgb(var(--panel)); }
.kit-label {
  display: block;
  font-size: .8rem !important;
  font-weight: 600 !important;
  color: rgb(var(--text) / .82) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  margin-bottom: .45rem !important;
}
.kit-pill { font-weight: 600 !important; letter-spacing: 0 !important; }

.kit-switch { position: relative; display: inline-block; flex-shrink: 0; }
.kit-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.kit-switch span { position: absolute; inset: 0; border-radius: 999px; cursor: pointer; transition: background .2s, border-color .2s; }
.kit-switch span:before { content: ""; position: absolute; border-radius: 50%; }
.kit-switch input:disabled + span { opacity: .5; cursor: wait; }
/* switches: a dark slot; when on, the knob becomes a lit amber lamp */
.kit-switch { width: 46px !important; height: 26px !important; }
.kit-switch span {
  background: rgb(var(--sunken)) !important;
  border: 1px solid rgb(var(--line));
  box-shadow: inset 0 1px 3px rgb(0 0 0 / .45);
}
.kit-switch span:before {
  width: 18px !important; height: 18px !important; left: 3px !important; top: 3px !important;
  background: rgb(var(--muted)) !important;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), background .2s, box-shadow .2s !important;
}
.kit-switch input:checked + span { background: rgb(var(--lamp) / .14) !important; border-color: rgb(var(--lamp) / .55); }
.kit-switch input:checked + span:before {
  transform: translateX(20px) !important;
  background: rgb(var(--lamp)) !important;
  box-shadow: 0 0 10px rgb(var(--lamp) / .75), 0 0 2px rgb(var(--lamp));
}
.kit-switch input:focus-visible + span { outline: 2px solid rgb(var(--brand)); outline-offset: 2px; }

/* segmented choices */
.kit-seg {
  background: rgb(var(--sunken)) !important;
  border: 1px solid rgb(var(--line)) !important;
  border-radius: 12px !important;
  padding: 3px !important; gap: 3px !important;
}
.kit-seg button { border-radius: 9px !important; color: rgb(var(--muted)) !important; font-weight: 600 !important; }
.kit-seg button:hover { color: rgb(var(--text)) !important; }
.kit-seg button.on {
  background: rgb(var(--raised)) !important;
  color: rgb(var(--text)) !important;
  box-shadow: inset 0 0 0 1px rgb(var(--brand) / .7), 0 1px 0 rgb(255 255 255 / .04) !important;
}
.kit-savebar-inner { background: rgb(var(--panel) / .97) !important; border-color: rgb(var(--line)) !important; backdrop-filter: blur(8px); }

/* ── shared tone-down for the older pages ──
   Big glows and coloured shadows go; buttons keep their colour. */
[class*="shadow-SynBot"], [class*="shadow-[0_0_"] { --tw-shadow-color: transparent !important; }
.rounded-3xl { border-radius: 22px !important; }
button.bg-SynBot, a.bg-SynBot, .bg-SynBot.rounded-xl { box-shadow: none !important; }
.bg-SynBot:not(.kit-switch *) { color: #fff; }
input[type="range"] { accent-color: rgb(var(--brand)); }
input[type="checkbox"]:not(.sr-only):not([class*="opacity-0"]) { accent-color: rgb(var(--brand)); }

/* ── sidebar: styled in public/sidebar.js ── */

/* motion: only on page load, and never for people who asked for less */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* older pages' switches get the same slot-and-lamp look */
.toggle-label { background-color: rgb(var(--sunken)) !important; border: 1px solid rgb(var(--line)) !important; box-shadow: inset 0 1px 3px rgb(0 0 0 / .45); }
.toggle-checkbox { background: rgb(var(--muted)) !important; }
.toggle-checkbox:checked { background: rgb(var(--lamp)) !important; box-shadow: 0 0 10px rgb(var(--lamp) / .75); }
.toggle-checkbox:checked + .toggle-label { background-color: rgb(var(--lamp) / .14) !important; border-color: rgb(var(--lamp) / .55) !important; }
.peer:checked ~ .peer-checked\:bg-SynBot { background-color: rgb(var(--lamp) / .85) !important; }

/* the "module is on/off" strip at the top of module pages */
#module-banner { border-radius: 14px !important; background: rgb(var(--panel)) !important; border-color: rgb(var(--line)) !important; }
#module-banner .mb-switch span { background: rgb(var(--sunken)) !important; border: 1px solid rgb(var(--line)); }
#module-banner .mb-switch span:before { background: rgb(var(--muted)) !important; }
#module-banner .mb-switch input:checked + span { background: rgb(var(--lamp) / .14) !important; border-color: rgb(var(--lamp) / .55); }
#module-banner .mb-switch input:checked + span:before { background: rgb(var(--lamp)) !important; box-shadow: 0 0 10px rgb(var(--lamp) / .75); }

/* small all-caps labels read as shouting; use sentence case everywhere in the app */
main .uppercase, #SynBot-sidebar .uppercase { text-transform: none !important; letter-spacing: 0 !important; }
main label.uppercase, main .text-xs.uppercase { font-size: .8rem !important; }

/* Premium marker: purple pill with a crown. Dimmed when the server's plan doesn't include it. */
.premium-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .02em; line-height: 16px; white-space: nowrap; vertical-align: middle;
  color: rgb(var(--brand-light)); background: rgb(var(--brand-light) / .12); border: 1px solid rgb(var(--brand-light) / .3); }
.premium-pill svg { width: 11px; height: 11px; }
.premium-pill.locked { opacity: .75; }
a.premium-pill:hover { background: rgb(var(--brand-light) / .22); }
