/* ============ IntentFlow AI — theme layer v2: pure neutral + vivid green ============
   True near-black dark mode, true white light mode — zero tint. Energy comes from
   a vivid emerald accent (buttons, active states, glows). Toggle via theme.js. */

:root {
  color-scheme: dark;
  --bg: #0a0a0b; --bg-2: #0e0e10; --panel: #121214; --panel-2: #17171a; --panel-3: #1e1e22;
  --border: rgba(255,255,255,.09); --border-2: rgba(255,255,255,.15); --border-3: rgba(255,255,255,.24);
  --hairline: rgba(255,255,255,.05);
  --ink: #f2f3f4; --ink-2: #9d9fa5; --ink-3: #6a6c73;
  --accent: #1dcf6f; --accent-2: #12a458; --accent-hi: #4ce694; --accent-soft: rgba(29,207,111,.14);
  --accent-ink: #c9f7de;
  --grad-b: #8ee03f;
  --input-bg: rgba(0,0,0,.32); --input-bg-f: rgba(0,0,0,.5);
  --row-hover: rgba(255,255,255,.045); --nav-hover: rgba(255,255,255,.06);
  --btn-h1: #232327; --btn-h2: #1b1b1f;
  --switch-off: #2b2b30;
  --sh-1: 0 1px 2px rgba(0,0,0,.5);
  --sh-2: 0 2px 8px rgba(0,0,0,.4), 0 14px 36px rgba(0,0,0,.35);
  --sh-3: 0 10px 30px rgba(0,0,0,.5), 0 30px 80px rgba(0,0,0,.6);
  --tone-blue-fg: #8fbdf2; --tone-green-fg: #5fd3a8; --tone-orange-fg: #f09a72;
  --tone-red-fg: #f0a1a1; --tone-yellow-fg: #e8b558; --tone-violet-fg: #b3aaf0;
  --live-fg: #4ce694;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f8; --bg-2: #fafbfb; --panel: #ffffff; --panel-2: #f1f2f4; --panel-3: #e8eaed;
  --border: rgba(16,20,24,.10); --border-2: rgba(16,20,24,.16); --border-3: rgba(16,20,24,.26);
  --hairline: rgba(255,255,255,.6);
  --ink: #16181a; --ink-2: #5d6167; --ink-3: #95989e;
  --accent: #12a95e; --accent-2: #0c8a4a; --accent-hi: #0b8a4e; --accent-soft: rgba(18,169,94,.12);
  --accent-ink: #07693c;
  --grad-b: #63b524;
  --input-bg: #ffffff; --input-bg-f: #ffffff;
  --row-hover: rgba(16,20,24,.05); --nav-hover: rgba(16,20,24,.07);
  --btn-h1: #f6f7f7; --btn-h2: #edeff0;
  --switch-off: #d3d6da;
  --sh-1: 0 1px 2px rgba(16,20,24,.08);
  --sh-2: 0 2px 8px rgba(16,20,24,.07), 0 14px 36px rgba(16,20,24,.08);
  --sh-3: 0 10px 30px rgba(16,20,24,.10), 0 30px 80px rgba(16,20,24,.12);
  --tone-blue-fg: #2160b8; --tone-green-fg: #117a52; --tone-orange-fg: #b8511f;
  --tone-red-fg: #bb4444; --tone-yellow-fg: #91660c; --tone-violet-fg: #6455c8;
  --live-fg: #0e8a50;
}

/* ---- global ---- */
body {
  background:
    radial-gradient(1100px 460px at 18% -8%, rgba(29,207,111,.055), transparent 60%),
    radial-gradient(900px 420px at 88% -12%, rgba(142,224,63,.035), transparent 60%),
    var(--bg);
  color: var(--ink);
}
a { color: var(--accent-hi); }
a:hover { color: var(--accent); }
::selection { background: rgba(29,207,111,.30); }
::-webkit-scrollbar-thumb { background: var(--border-2); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-thumb:hover { background: var(--border-3); background-clip: padding-box; border: 2px solid transparent; }

/* ---- shell ---- */
.sidebar { background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%); }
.topbar { background: color-mix(in srgb, var(--bg-2) 88%, transparent); }
.brand-mark { background: linear-gradient(135deg, var(--accent) 0%, var(--grad-b) 100%); box-shadow: 0 2px 12px rgba(29,207,111,.45), inset 0 1px 0 rgba(255,255,255,.28); }
.ws-switch { background: var(--panel); }
.ws-switch:hover { background: var(--panel-2); }
.nav a:hover { background: var(--nav-hover); }
.nav a.active { background: linear-gradient(90deg, var(--accent-soft), transparent 92%); color: var(--accent-ink); }
.nav a.active .ic { color: var(--accent-hi); }
.nav a.active .cnt { background: var(--accent-soft); border-color: var(--border-2); color: var(--accent-ink); }
.nav a::before { box-shadow: 0 0 8px rgba(29,207,111,.55); }
html[data-theme="light"] .nav a.active { color: var(--accent-ink); }

/* ---- controls ---- */
.btn:hover { background: linear-gradient(180deg, var(--btn-h1), var(--btn-h2)); }
.btn.primary { background: linear-gradient(180deg, #2ee287, #17c468); border-color: rgba(76,230,148,.55); color: #04150c; text-shadow: none; }
.btn.primary:hover { background: linear-gradient(180deg, #3aeb91, #1cd06f); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 4px 18px rgba(29,207,111,.4); }
html[data-theme="light"] .btn.primary { background: linear-gradient(180deg, #14b866, #0e9a52); border-color: rgba(10,120,64,.5); color: #ffffff; }
html[data-theme="light"] .btn.primary:hover { background: linear-gradient(180deg, #17c46e, #10a458); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 14px rgba(18,169,94,.32); }
.input, select.input, textarea.input { background: var(--input-bg); }
.input:focus { border-color: var(--accent); background: var(--input-bg-f); box-shadow: 0 0 0 3px var(--accent-soft); }
html[data-theme="light"] .input, html[data-theme="light"] select.input, html[data-theme="light"] textarea.input { border-color: var(--border-2); }
.tabs button:hover { background: var(--row-hover); }
.tabs button.on { color: var(--accent-hi); border-bottom-color: var(--accent); }

/* ---- tones on both surfaces ---- */
.badge.blue { color: var(--tone-blue-fg); }
.badge.green { color: var(--tone-green-fg); }
.badge.orange { color: var(--tone-orange-fg); }
.badge.red { color: var(--tone-red-fg); }
.badge.yellow { color: var(--tone-yellow-fg); }
.badge.violet { color: var(--tone-violet-fg); }
.score.s-m { background: var(--accent-soft); color: var(--accent-hi); border-color: color-mix(in srgb, var(--accent) 34%, transparent); }
.score.s-h { color: var(--tone-yellow-fg); }
.score.s-vh { color: var(--tone-orange-fg); }
.live-pill { color: var(--live-fg); }
.req-ic.pass { color: var(--tone-green-fg); }
.req-ic.fail { color: var(--tone-red-fg); }
.msg.out { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent) 11%, transparent)); border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.feed-item:hover { background: var(--row-hover); }
.tbl tbody tr.click:hover { background: var(--row-hover); }
html[data-theme="light"] .overlay { background: rgba(18,22,26,.42); }
html[data-theme="light"] .plat { color: var(--ink-2); }

/* ---- auth ---- */
.auth-wrap {
  background:
    radial-gradient(1200px 520px at 50% -12%, rgba(29,207,111,.12), transparent 62%),
    radial-gradient(800px 400px at 82% 6%, rgba(142,224,63,.06), transparent 60%),
    var(--bg);
}
.step-dots span.on { background: var(--accent); box-shadow: 0 0 8px rgba(29,207,111,.5); }

/* ---- checkboxes become switches ---- */
.check-row { padding: 6px 8px; margin: 0 -8px 6px; border-radius: 8px; transition: background .14s; user-select: none; }
.check-row:hover { background: var(--row-hover); }
.check-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 36px; height: 21px; border-radius: 21px;
  background: var(--switch-off); border: 1px solid var(--border-2); position: relative;
  cursor: pointer; flex-shrink: 0; margin: 0; transition: background .18s, border-color .18s;
}
.check-row input[type="checkbox"]::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: transform .18s cubic-bezier(.32,.72,.24,1);
}
.check-row input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.check-row input[type="checkbox"]:checked::after { transform: translateX(15px); }
.check-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- floating theme toggle ---- */
.theme-toggle {
  position: fixed; right: 18px; bottom: 18px; z-index: 90; width: 42px; height: 42px;
  border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--ink-2);
  box-shadow: var(--sh-2); transition: transform .14s, border-color .14s, color .14s;
}
.theme-toggle:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--ink); }
.theme-toggle svg { display: block; }
.toast-wrap { bottom: 72px; }
