/* Magnova v20 SAMPLE: more vibrant, premium. Presentation only. */
:root { --bg: #eef2ff; --blue: #4f46e5; --gold: #4f46e5; --saf: #f97316; }
body { background: radial-gradient(900px 500px at 8% 0%, rgba(99,102,241,.18), transparent 60%),
  radial-gradient(800px 500px at 100% 10%, rgba(236,72,153,.14), transparent 60%),
  radial-gradient(900px 600px at 50% 100%, rgba(20,184,166,.14), transparent 60%), #f1f5ff; background-attachment: fixed; }
.topbar.hero { min-height: 280px; background: linear-gradient(120deg, #312e81, #4f46e5 40%, #db2777 75%, #f97316); }
.topbar.hero::before { background: linear-gradient(120deg, rgba(49,46,129,.72), rgba(79,70,229,.45) 45%, rgba(219,39,119,.45) 75%, rgba(249,115,22,.5)), url("hero-collage.jpg") center / cover no-repeat; mix-blend-mode: normal; }
.topbar.hero::after { height: 6px; background: linear-gradient(90deg, #ef4444, #10b981, #f59e0b, #ec4899, #6366f1); }
.hero .brand-name { background: none; -webkit-text-fill-color: #fff; color: #fff; text-shadow: 0 4px 26px rgba(0,0,0,.6), 0 0 3px rgba(0,0,0,.5); }
.topnav { background: rgba(255,255,255,.82); backdrop-filter: blur(14px); }
.topnav a.on { background: linear-gradient(90deg, #4f46e5, #db2777); box-shadow: 0 6px 16px rgba(79,70,229,.4); }
button, .btn { background: linear-gradient(90deg, #4f46e5, #7c3aed); box-shadow: 0 6px 18px rgba(79,70,229,.4); }
button.ok { background: linear-gradient(90deg, #059669, #14b8a6); }
.tile { color: #fff; border: 0; box-shadow: 0 12px 28px rgba(15,23,42,.18); background: linear-gradient(135deg, var(--c1), var(--c2)); }
.tile::before { display: none; }
.tile-num, .tile-lab { color: #fff; } .tile-lab { opacity: .9; }
.t-gold { --c1: #4f46e5; --c2: #7c3aed; } .t-cyan { --c1: #0891b2; --c2: #14b8a6; } .t-amber { --c1: #f59e0b; --c2: #f97316; }
.t-green { --c1: #059669; --c2: #22c55e; } .t-red { --c1: #e11d48; --c2: #ec4899; }
.card { border: 0; box-shadow: 0 14px 34px rgba(15,23,42,.14); }
.card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--acc); }
.card { position: relative; }
.card-body { background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--acc) 9%, #fff)); }
.card:hover { box-shadow: 0 22px 46px color-mix(in srgb, var(--acc) 40%, transparent); }
.cat { background: linear-gradient(90deg, var(--acc), color-mix(in srgb, var(--acc) 60%, #fff)); }
.panel { border: 0; box-shadow: 0 12px 30px rgba(15,23,42,.1); position: relative; overflow: hidden; }
.panel::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, #4f46e5, #ec4899, #f97316); }
.ph::before { background: linear-gradient(180deg, #ec4899, #f97316); }
.usp-grid .usp { border: 0; border-top: 0; color: #fff; background: linear-gradient(150deg, var(--acc), color-mix(in srgb, var(--acc) 55%, #111)); box-shadow: 0 12px 26px color-mix(in srgb, var(--acc) 35%, transparent); }
.usp-grid .usp-t, .usp-grid .usp-m, .usp-grid .usp ul { color: #fff; } .usp-grid .usp-m { opacity: .9; }
.ask { background: linear-gradient(135deg, #eef2ff, #fdf2f8); }
.live { border: 0; box-shadow: 0 14px 34px rgba(15,23,42,.14); position: relative; overflow: hidden; }
.live::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981, #6366f1); }
.evpanel { margin-bottom: 14px; }
.evpanel .live-list { max-height: 280px; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.ev-ico { border-radius: 10px; }
.ev-gold { --ec: #6366f1; } .ev-green { --ec: #10b981; } .ev-cyan { --ec: #06b6d4; } .ev-amber { --ec: #f59e0b; } .ev-red { --ec: #ef4444; }
.tab.on { background: linear-gradient(90deg, #4f46e5, #db2777); border-color: transparent; }
.credit-mini { border: 0; box-shadow: 0 10px 24px rgba(5,150,105,.2); background: linear-gradient(135deg, #ecfdf5, #fff); }
.foot { background: linear-gradient(90deg, #1e1b4b, #312e81, #831843); }
/* responsive */
@media (max-width: 1100px) { .evpanel .live-list { max-height: 220px; } }
@media (max-width: 640px) { .tile { padding: 10px 12px; } .topbar.hero { min-height: 200px; } }

/* login (approved sample) */
body:has(.login-wrap) .topbar.hero, body:has(.login-wrap) .topnav, body:has(.login-wrap) .foot { display: none; }
body:has(.login-wrap) main { max-width: none; padding: 0; width: 100%; }
.login-wrap { min-height: 100vh; padding: 0; display: grid; grid-template-columns: 1.1fr 1fr; align-items: stretch; justify-content: stretch;
  background: linear-gradient(135deg, #312e81, #4f46e5 40%, #db2777 75%, #f97316); position: relative; }
.login-wrap::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(49,46,129,.7), rgba(219,39,119,.45)), url("hero-collage.jpg") center / cover; }
.login-art, .login-box { position: relative; z-index: 2; }
.login-art { color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; gap: 18px; }
.la-kick { letter-spacing: 6px; font-size: 14px; color: #fde68a; }
.la-title { font-size: 60px; line-height: 1.05; text-shadow: 0 4px 24px rgba(0,0,0,.45); }
.la-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.la-pills span { padding: 7px 16px; border-radius: 999px; font-size: 15px; color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
.la-pills .p1 { background: #059669; } .la-pills .p2 { background: #dc2626; } .la-pills .p3 { background: #d97706; } .la-pills .p4 { background: #be185d; }
.la-sub { font-size: 17px; max-width: 460px; opacity: .92; }
.login-box { align-self: center; justify-self: center; width: min(430px, 90%); margin: 40px 0; padding: 26px 26px 24px; border-radius: 22px; background: rgba(255,255,255,.96); box-shadow: 0 30px 70px rgba(0,0,0,.45); }
@media (max-width: 900px) { .login-wrap { grid-template-columns: 1fr; } .login-art { padding: 36px 24px 8px; } .la-title { font-size: 38px; } .la-sub { display: none; } .login-box { margin: 18px 0 36px; } }

/* ================= FLOATING SIDE SEARCH (Dec 2026) =================
   Ask Anything docks to the side of the screen instead of sitting mid-page. */
.askdock-btn {
  position: fixed; right: 0; top: 42%; z-index: 900;
  writing-mode: vertical-rl; text-orientation: mixed;
  background: linear-gradient(165deg, #1d4ed8, #2fd6ff); color: #fff;
  border: 0; border-radius: 12px 0 0 12px; padding: 16px 9px;
  font-family: system-ui, -apple-system, sans-serif; font-size: 13px; font-weight: 700;
  letter-spacing: .18em; cursor: pointer;
  box-shadow: 0 8px 24px rgba(29,78,216,.4);
}
.askdock-btn:hover { filter: brightness(1.08); }
.askdock {
  position: fixed; right: 12px; top: 86px; z-index: 950;
  width: min(430px, calc(100vw - 24px)); max-height: min(78vh, 760px);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(calc(100% + 24px)); transition: transform .25s ease;
  border-radius: 14px; box-shadow: 0 18px 60px rgba(10,20,60,.35);
}
.askdock.open { transform: none; }
.askdock .ask { position: relative; margin: 0; }
.askdock-x {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.08); color: #333; font-size: 17px; line-height: 1; cursor: pointer;
}
.askdock-x:hover { background: rgba(0,0,0,.16); }
@media (max-width: 640px) {
  .askdock-btn {
    top: auto; bottom: 18px; right: 14px;
    writing-mode: horizontal-tb; border-radius: 999px; padding: 14px 20px;
    letter-spacing: .1em;
  }
  .askdock {
    right: 0; left: 0; top: auto; bottom: 0;
    width: auto; max-height: 78vh;
    border-radius: 16px 16px 0 0;
    transform: translateY(106%);
  }
  .askdock.open { transform: none; }
}

/* ================= DARK SEARCH BUTTON + DARK/LIGHT MODE (Dec 2026) ================= */
/* search dock button: dark in both modes */
.askdock-btn { background: linear-gradient(165deg, #0b1220, #1e293b); color: #e8eef8;
  border: 1px solid rgba(148,163,184,.4); border-right: 0;
  box-shadow: 0 8px 24px rgba(2,6,23,.55); }
@media (max-width: 640px) { .askdock-btn { border: 1px solid rgba(148,163,184,.4); } }

/* theme toggle: fixed bottom-left on every page (dashboard, audit, settings, login) */
.theme-toggle { position: fixed; left: 14px; bottom: 16px; z-index: 900; width: 46px; height: 46px;
  border-radius: 50%; display: grid; place-items: center; padding: 0; font-size: 20px; cursor: pointer;
  background: #ffffff; color: #1e293b; border: 1px solid #cbd5e1; box-shadow: 0 8px 22px rgba(15,23,42,.2); }
html[data-theme="dark"] .theme-toggle { background: #111c30; color: #f8fafc; border-color: #33456a; box-shadow: 0 8px 22px rgba(0,0,0,.5); }

/* dark theme: variable swap + overrides for the v19/v20 light surfaces */
html[data-theme="dark"] {
  --bg: #0b1220; --bg2: #0f172a; --panel: #0f172a; --panel2: #16233c; --line: #26334d;
  --gold: #8fb0ff; --gold-dim: #60a5fa; --gold-dark: #1e3a8a;
  --green: #34d399; --red: #f87171; --text: #d5dfee; --dim: #8aa0bd;
  --ink: #f1f5f9; --blue: #8fb0ff; --saf: #fbbf24;
  --acc-dragon: #f87171; --acc-bengal: #34d399; --acc-nepride: #fbbf24; --acc-tibet: #f472b6;
  --vi-cyan: #22d3ee; --vi-amber: #fbbf24; --vi-green: #34d399; --vi-red: #f87171;
}
html[data-theme="dark"] body { background-color: #0b1220; color: var(--text); background-image:
  radial-gradient(900px 500px at 8% 0%, rgba(79,70,229,.12), transparent 60%),
  radial-gradient(800px 500px at 100% 10%, rgba(236,72,153,.08), transparent 60%); background-attachment: fixed; }
html[data-theme="dark"] a { color: var(--blue); }
html[data-theme="dark"] .topnav { background: rgba(9,14,27,.92); border-bottom-color: var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.45); }
html[data-theme="dark"] .topnav a { color: #d5dfee; }
html[data-theme="dark"] .topnav a:hover { background: #1c2a45; }
html[data-theme="dark"] .topnav a.on { background: linear-gradient(90deg, #4f46e5, #db2777); color: #fff; }
html[data-theme="dark"] code { color: #5eead4; background: #13203a; }
html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { background: #0f1b30; color: var(--ink); border-color: #33456a; }
html[data-theme="dark"] label { color: #9fb3cf; }
html[data-theme="dark"] button.mini, html[data-theme="dark"] .mini, html[data-theme="dark"] .cardlinks .btn { background: #16233c; color: #9fc0ff; border-color: #2a3f6e; }
html[data-theme="dark"] .mini:hover, html[data-theme="dark"] .cardlinks .btn:hover { background: #2f6fed; color: #fff; }
html[data-theme="dark"] .alert { background: #3a1414; color: #fca5a5; border-color: #7f1d1d; }
html[data-theme="dark"] .ticker { background: #0f172a; border-color: var(--line); }
html[data-theme="dark"] .tk { color: var(--ink); }
html[data-theme="dark"] .tk:hover { color: var(--blue); }
html[data-theme="dark"] .notes { background: #2a2110; border-color: #6b5a1e; color: var(--text); }
html[data-theme="dark"] .gen { background: #0f172a; border-color: var(--line); }
html[data-theme="dark"] .card { background: #111c30; box-shadow: 0 14px 34px rgba(0,0,0,.45); }
html[data-theme="dark"] .card-body { background: linear-gradient(180deg, #111c30, color-mix(in srgb, var(--acc) 15%, #111c30)); }
html[data-theme="dark"] .thumb, html[data-theme="dark"] .arch-thumb { background: #1a2740; }
html[data-theme="dark"] .ring { background: conic-gradient(var(--acc) calc(var(--p) * 1%), #26334d 0); }
html[data-theme="dark"] .ring::before { background: #111c30; }
html[data-theme="dark"] .cardlinks .btn { background: #111c30; border-color: color-mix(in srgb, var(--acc) 45%, #111c30); color: var(--acc); }
html[data-theme="dark"] .cardlinks .btn:hover { background: var(--acc); color: #0b1220; }
html[data-theme="dark"] .s-draft { color: #b8c4d8; background: #1c2940; border-color: #33456a; }
html[data-theme="dark"] .s-in_review { color: #fde68a; background: #3a2c10; border-color: #a87f1f; }
html[data-theme="dark"] .s-approved { color: #a7f3d0; background: #0e2e22; border-color: #1f7a5c; }
html[data-theme="dark"] .s-published { color: #bae6fd; background: #0e2438; border-color: #2a6a94; }
html[data-theme="dark"] .panel { background: #0f172a; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
html[data-theme="dark"] .ph { border-bottom-color: #26334d; }
html[data-theme="dark"] .lk-meta { color: #fbbf24; }
html[data-theme="dark"] .nw, html[data-theme="dark"] .li, html[data-theme="dark"] .ar { border-bottom-color: #1c2940; }
html[data-theme="dark"] .ask { background: linear-gradient(150deg, #101d36, #0f172a); border-color: #2a3f6e; }
html[data-theme="dark"] .ask-form input { border-color: #33507e; }
html[data-theme="dark"] .answer { background: #101d36; color: var(--ink); }
html[data-theme="dark"] .arch-cycle { color: var(--blue); }
html[data-theme="dark"] .live { background: #0f172a; border-color: var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
html[data-theme="dark"] .live-head { color: var(--ink); border-bottom-color: #26334d; }
html[data-theme="dark"] .tab { background: #1c2940; color: #c3d0e4; border-color: #2c3d5e; }
html[data-theme="dark"] .tab:hover { background: #253a5e; }
html[data-theme="dark"] .tab.on { background: #2f6fed; color: #fff; border-color: #2f6fed; }
html[data-theme="dark"] .credit-mini { background: #0f172a; border-color: #1f7a5c; }
html[data-theme="dark"] .credit-mini.m-warn { border-color: #a87f1f; }
html[data-theme="dark"] .credit-mini.m-crit { border-color: #b91c1c; }
html[data-theme="dark"] .cm-bar { background: #26334d; }
html[data-theme="dark"] .ev { border-bottom-color: #1c2940; }
html[data-theme="dark"] table.audit th { border-bottom-color: #26334d; }
html[data-theme="dark"] table.audit td { border-bottom-color: #1c2940; }
html[data-theme="dark"] .story-row, html[data-theme="dark"] .receipt, html[data-theme="dark"] .settings-panel, html[data-theme="dark"] .login-box { background: #0f172a; border-color: var(--line); color: var(--text); }
html[data-theme="dark"] .risk { background: #0f172a; }
html[data-theme="dark"] .meter, html[data-theme="dark"] .meter-big { background: #0f172a; color: var(--ink); }
html[data-theme="dark"] .meter-bar { background: #26334d; border-color: #33456a; }
html[data-theme="dark"] .meter-warn { color: #fde68a; background: #2a2110; border-color: #6b5a1e; }
html[data-theme="dark"] .meter-warn.crit { color: #fca5a5; background: #3a1414; border-color: #7f1d1d; }
html[data-theme="dark"] .foot { background: #060b16; }
html[data-theme="dark"] .askdock { box-shadow: 0 18px 60px rgba(0,0,0,.6); }
html[data-theme="dark"] .askdock-x { background: rgba(255,255,255,.12); color: #e8eef8; }
