/* Thadwell - Frutiger Aero theme. Light = daytime sky, Dark (default) = aurora night.
   Every surface reads from the variables below, so both themes share one set of rules. */

/* ================= LIGHT ================= */
:root {
  --sky: linear-gradient(180deg, #3eaeea 0%, #7fcdf6 24%, #c3ebfe 52%, #e9f9ff 72%, #e0f6d4 100%);
  --ink: #0c2a40; --ink-2: #3b5a70; --ink-3: #6f8ba0;
  --accent: #0a72b5;
  --wordmark: linear-gradient(180deg, #0f86c8 0%, #0a5a98 100%);
  --line: rgba(120, 175, 215, .45); --line-soft: rgba(120, 175, 215, .3);
  --glass: rgba(255, 255, 255, .62); --glass-strong: rgba(255, 255, 255, .82); --glass-edge: rgba(255, 255, 255, .95);
  --shadow: 0 10px 30px rgba(10, 80, 140, .14), 0 2px 6px rgba(10, 80, 140, .08);
  --small-shadow: 0 2px 6px rgba(10, 80, 140, .1);
  --inset-hi: inset 0 1px 0 #fff;
  --sheen: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0));
  --bar-top: linear-gradient(180deg, rgba(255,255,255,.92) 0%, rgba(240,250,255,.78) 50%, rgba(205,236,252,.7) 51%, rgba(225,245,255,.8) 100%);
  --bar-edge: rgba(255,255,255,.95);
  --tile: linear-gradient(180deg, rgba(255,255,255,.9), rgba(232,246,255,.7));
  --tile-2: linear-gradient(180deg, rgba(255,255,255,.96), rgba(238,249,255,.9));
  --tile-edge: rgba(255,255,255,.95);
  --hero: linear-gradient(135deg, rgba(255,255,255,.85) 0%, rgba(214,242,255,.75) 60%, rgba(214,250,205,.7) 100%);
  --sel: linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(220,243,255,.92) 100%);
  --seg-bg: linear-gradient(180deg, rgba(255,255,255,.9), rgba(215,238,252,.85));
  --track: linear-gradient(180deg, #d6e9f5, #eef7fc);
  --ring-track: rgba(150, 195, 225, .45);
  --orb-bg: radial-gradient(circle at 40% 30%, #fff 0%, rgba(235,248,255,.9) 55%, rgba(200,232,250,.9) 100%);
  --input-bg: #fff;
  --stripe: rgba(225, 243, 255, .45);
  --chip-bg: rgba(225, 243, 255, .9);
  --chat-form-bg: linear-gradient(180deg, rgba(230,246,255,.7), rgba(255,255,255,.8));
  --h-healthy: linear-gradient(180deg, #f0ffe8 0%, #cff5bb 50%, #b6ec9c 51%, #cdf3b8 100%);
  --h-watch:   linear-gradient(180deg, #fffbe9 0%, #ffeaa8 50%, #ffdc78 51%, #ffe9a2 100%);
  --h-act:     linear-gradient(180deg, #fff1ee 0%, #ffd0c8 50%, #ffb4a8 51%, #ffcbc2 100%);
  --t-healthy: #1d6f17; --t-watch: #7d5400; --t-act: #a3241a;
  --b-healthy: #8fd774; --b-watch: #ecc25a; --b-act: #f0998c;
  --good: #23944a; --act: #d0392f;
  --scroll: rgba(30, 140, 200, .45);
  --asof-shadow: 0 1px 0 rgba(255,255,255,.7);
  /* scene */
  --glow-a: rgba(255, 255, 240, .95); --glow-b: rgba(170, 245, 255, .6);
  --stars-op: 0;
  --cloud: rgba(255, 255, 255, .9); --cloud-op: .85;
  --rib-a: #ffffff; --rib-b: #6fdcff; --rib-c: #b6f78f; --rib-op: 1;
  --hill-a1: #c4f29a; --hill-a2: #6cc94e; --hill-b1: #a2e570; --hill-b2: #3fae3a;
  --hill-op: .62; --rim: rgba(255, 255, 255, .75);
  --bub-hi: rgba(255,255,255,.95); --bub-rim: rgba(255,255,255,.55); --bub-tint: rgba(150,225,255,.35); --bub-glow: rgba(80,190,240,.25);
  color-scheme: light;
}

/* ================= DARK (default) ================= */
:root[data-theme="dark"] {
  --sky: linear-gradient(180deg, #020a15 0%, #041a2e 30%, #06304a 62%, #07404c 85%, #062c33 100%);
  --ink: #e4f4ff; --ink-2: #a8c7dc; --ink-3: #7896ad;
  --accent: #5fd0ff;
  --wordmark: linear-gradient(180deg, #d4f6ff 0%, #45c3f4 100%);
  --line: rgba(120, 200, 255, .22); --line-soft: rgba(120, 200, 255, .13);
  --glass: rgba(8, 34, 58, .58); --glass-strong: rgba(16, 52, 84, .72); --glass-edge: rgba(150, 220, 255, .22);
  --shadow: 0 14px 36px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .35);
  --small-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  --inset-hi: inset 0 1px 0 rgba(255,255,255,.16);
  --sheen: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,0));
  --bar-top: linear-gradient(180deg, rgba(46,100,140,.78) 0%, rgba(20,60,92,.78) 50%, rgba(8,34,58,.85) 51%, rgba(12,44,70,.85) 100%);
  --bar-edge: rgba(150, 220, 255, .25);
  --tile: linear-gradient(180deg, rgba(44,96,138,.45), rgba(10,38,62,.5));
  --tile-2: linear-gradient(180deg, rgba(38,86,126,.6), rgba(12,42,68,.6));
  --tile-edge: rgba(150, 220, 255, .2);
  --hero: linear-gradient(135deg, rgba(30,92,138,.6) 0%, rgba(10,48,80,.6) 60%, rgba(16,78,64,.55) 100%);
  --sel: linear-gradient(180deg, rgba(46,120,170,.75), rgba(16,62,98,.75));
  --seg-bg: linear-gradient(180deg, rgba(4,20,36,.85), rgba(18,52,82,.85));
  --track: linear-gradient(180deg, rgba(0,0,0,.5), rgba(40,80,110,.45));
  --ring-track: rgba(120, 190, 240, .22);
  --orb-bg: radial-gradient(circle at 40% 30%, rgba(90,160,210,.65) 0%, rgba(16,50,80,.9) 60%, rgba(6,24,42,.95) 100%);
  --input-bg: rgba(3, 18, 32, .8);
  --stripe: rgba(120, 200, 255, .05);
  --chip-bg: rgba(20, 60, 95, .75);
  --chat-form-bg: linear-gradient(180deg, rgba(6,26,44,.6), rgba(12,40,64,.75));
  --h-healthy: linear-gradient(180deg, rgba(160,255,130,.42) 0%, rgba(70,190,50,.30) 50%, rgba(36,140,26,.42) 51%, rgba(70,190,50,.32) 100%);
  --h-watch:   linear-gradient(180deg, rgba(255,214,110,.55) 0%, rgba(245,165,20,.40) 50%, rgba(205,125,0,.52) 51%, rgba(245,165,20,.42) 100%);
  --h-act:     linear-gradient(180deg, rgba(255,150,130,.45) 0%, rgba(225,75,55,.32) 50%, rgba(180,40,25,.45) 51%, rgba(225,75,55,.34) 100%);
  --t-healthy: #c9ffb4; --t-watch: #ffe6a0; --t-act: #ffc4b8;
  --b-healthy: rgba(140,240,110,.45); --b-watch: rgba(255,210,100,.45); --b-act: rgba(255,140,120,.5);
  --good: #6ee05a; --act: #ff7b68;
  --scroll: rgba(90, 190, 240, .35);
  --asof-shadow: none;
  --glow-a: rgba(60, 170, 230, .35); --glow-b: rgba(60, 255, 190, .16);
  --stars-op: .75;
  --cloud: rgba(110, 200, 255, .16); --cloud-op: .7;
  --rib-a: #9ff7ff; --rib-b: #2ad0ff; --rib-c: #62ffa6; --rib-op: .9;
  --hill-a1: #0f5a5e; --hill-a2: #062f37; --hill-b1: #0d4752; --hill-b2: #041f27;
  --hill-op: .95; --rim: rgba(110, 255, 210, .45);
  --bub-hi: rgba(210,248,255,.9); --bub-rim: rgba(110,220,255,.45); --bub-tint: rgba(40,170,240,.22); --bub-glow: rgba(60,200,255,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { color: var(--ink); font: 14px/1.45 var(--sans); display: flex; flex-direction: column; background: var(--sky) fixed; }
:root { --mono: "Cascadia Mono", "SF Mono", Consolas, ui-monospace, monospace;
  --sans: "Frutiger", "Frutiger LT Std", "Myriad Pro", "Segoe UI", "Segoe UI Variable", system-ui, -apple-system, Roboto, sans-serif;
  --r: 16px; --aqua: #1ea7e4; --aqua-deep: #0a72b5; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ================= background scene ================= */
.aero-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.sky-glow { position: absolute; inset: 0;
  background:
    radial-gradient(60% 45% at 82% 6%, var(--glow-a), transparent 70%),
    radial-gradient(45% 40% at 8% 20%, var(--glow-b), transparent 70%); }
.starfield { position: absolute; inset: 0 0 35% 0; opacity: var(--stars-op);
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 27% 8%, #cfefff, transparent),
    radial-gradient(1.4px 1.4px at 41% 26%, #fff, transparent), radial-gradient(1px 1px at 55% 12%, #e9fbff, transparent),
    radial-gradient(1.3px 1.3px at 68% 30%, #fff, transparent), radial-gradient(1px 1px at 76% 6%, #cfefff, transparent),
    radial-gradient(1.5px 1.5px at 89% 22%, #fff, transparent), radial-gradient(1px 1px at 95% 40%, #e9fbff, transparent),
    radial-gradient(1px 1px at 5% 42%, #fff, transparent), radial-gradient(1.2px 1.2px at 34% 46%, #cfefff, transparent),
    radial-gradient(1px 1px at 61% 50%, #fff, transparent), radial-gradient(1.2px 1.2px at 83% 55%, #e9fbff, transparent);
  background-size: 640px 420px; animation: twinkle 7s ease-in-out infinite alternate; }
@keyframes twinkle { from { filter: brightness(.8); } to { filter: brightness(1.25); } }
.cloud { position: absolute; border-radius: 50%; background: var(--cloud); opacity: var(--cloud-op); filter: blur(22px); }
.cloud.c1 { width: 520px; height: 120px; left: -80px; top: 9%; animation: float 70s linear infinite alternate; }
.cloud.c2 { width: 380px; height: 90px; left: 38%; top: 4%; animation: float 90s linear infinite alternate-reverse; }
.cloud.c3 { width: 440px; height: 100px; right: -60px; top: 22%; animation: float 80s linear infinite alternate; }
@keyframes float { from { transform: translateX(-40px); } to { transform: translateX(60px); } }
.ribbons { position: absolute; inset: 0; width: 100%; height: 100%; opacity: var(--rib-op); mix-blend-mode: screen; }
:root:not([data-theme="dark"]) .ribbons { mix-blend-mode: normal; filter: drop-shadow(0 6px 14px rgba(20, 130, 200, .35)); }
.rs-a { stop-color: var(--rib-a); } .rs-b { stop-color: var(--rib-b); } .rs-c { stop-color: var(--rib-c); }
.drift { transform-box: fill-box; }
.drift.d1 { animation: sway 38s ease-in-out infinite alternate; }
.drift.d2 { animation: sway 46s ease-in-out infinite alternate-reverse; }
.drift.d3 { animation: sway 54s ease-in-out infinite alternate; }
@keyframes sway { from { transform: translate(-30px, 10px) scaleY(.94); } to { transform: translate(30px, -12px) scaleY(1.06); } }
.hills { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 24vh; }
.hill { opacity: var(--hill-op); }
.hs-a1 { stop-color: var(--hill-a1); } .hs-a2 { stop-color: var(--hill-a2); }
.hs-b1 { stop-color: var(--hill-b1); } .hs-b2 { stop-color: var(--hill-b2); }
.hills .rim { stroke: var(--rim); stroke-width: 2; filter: blur(1px); }
.bubble {
  position: absolute; bottom: -120px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, var(--bub-hi) 0 9%, transparent 10%),
    radial-gradient(circle at 50% 50%, transparent 58%, var(--bub-rim) 72%, var(--bub-tint) 100%);
  border: 1px solid var(--bub-rim);
  box-shadow: inset 0 -6px 14px var(--bub-glow), 0 0 14px var(--bub-glow);
  animation: rise linear infinite;
}
.b1 { left: 5%;  width: 46px; height: 46px; animation-duration: 26s; }
.b2 { left: 16%; width: 20px; height: 20px; animation-duration: 19s; animation-delay: -6s; }
.b3 { left: 30%; width: 64px; height: 64px; animation-duration: 34s; animation-delay: -14s; }
.b4 { left: 46%; width: 28px; height: 28px; animation-duration: 23s; animation-delay: -3s; }
.b5 { left: 60%; width: 54px; height: 54px; animation-duration: 30s; animation-delay: -20s; }
.b6 { left: 72%; width: 16px; height: 16px; animation-duration: 17s; animation-delay: -9s; }
.b7 { left: 82%; width: 40px; height: 40px; animation-duration: 28s; animation-delay: -12s; }
.b8 { left: 91%; width: 24px; height: 24px; animation-duration: 21s; animation-delay: -16s; }
.b9 { left: 38%; width: 12px; height: 12px; animation-duration: 15s; animation-delay: -4s; }
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; } 8% { opacity: .9; }
  50% { transform: translate(18px, -55vh); } 92% { opacity: .8; }
  100% { transform: translate(-12px, -112vh); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bubble { display: none; } .drift, .cloud, .starfield { animation: none; }
}

/* ================= shared glass + gloss ================= */
.glass, .card, .loc, .loc-all {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.5); -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow), var(--inset-hi);
}
.summary-btn, .seg button.on {
  border: 1px solid var(--aqua-deep); color: #fff; font-weight: 600;
  text-shadow: 0 -1px 0 rgba(0, 60, 110, .45);
  background: linear-gradient(180deg, #8fe3ff 0%, #3dbdf2 48%, #1497d9 52%, #36b4ee 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -2px 6px rgba(255,255,255,.35), 0 3px 8px rgba(10, 110, 180, .35);
}
.summary-btn:hover, .chat-form button:hover:not(:disabled) { filter: brightness(1.08) saturate(1.1); }

/* ================= top bar ================= */
.topbar {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 22px; flex-wrap: wrap; background: var(--bar-top);
  border-bottom: 1px solid var(--bar-edge); box-shadow: 0 4px 18px rgba(0, 40, 80, .22);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { filter: drop-shadow(0 3px 5px rgba(10, 90, 150, .35)); }
:root[data-theme="dark"] .logo { filter: drop-shadow(0 0 8px rgba(60, 200, 255, .55)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.wordmark { font-size: 23px; font-weight: 300; letter-spacing: .01em; background: var(--wordmark); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }
.group { color: var(--ink-2); padding-left: 12px; border-left: 1px solid var(--line); }
.badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 999px; }
.badge.demo { color: #7a5200; border: 1px solid #e9b84a; box-shadow: inset 0 1px 0 #fff;
  background: linear-gradient(180deg, #fff6d6 0%, #ffe39a 50%, #ffd36a 51%, #ffe08e 100%); }
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--seg-bg);
  border: 1px solid var(--line); box-shadow: inset 0 1px 3px rgba(0, 40, 80, .2); }
.seg button { border: 1px solid transparent; background: none; padding: 5px 14px; border-radius: 999px; color: var(--ink-2); }
.sources { display: flex; gap: 6px; flex-wrap: wrap; }
.src { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--tile-edge); border-radius: 999px; padding: 3px 10px; background: var(--tile); box-shadow: var(--small-shadow); }
.src i { width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, #9db3c3 45%, #5d7a8f 100%); }
.src.live i { background: radial-gradient(circle at 35% 30%, #fff 0 18%, #7be35a 45%, #2b9a1f 100%); }
.src.demo i { background: radial-gradient(circle at 35% 30%, #fff 0 18%, #ffd25a 45%, #d18f00 100%); }
.src.error i { background: radial-gradient(circle at 35% 30%, #fff 0 18%, #ff8a7a 45%, #c42a1d 100%); }
.ai-pill { font-size: 12px; border-radius: 999px; padding: 4px 12px; color: var(--ink-2); border: 1px solid var(--line); background: var(--tile); }
.ai-pill.on { color: #0f5d16; border-color: #5fbf45; box-shadow: inset 0 1px 0 #fff, 0 0 10px rgba(110, 220, 80, .35);
  background: linear-gradient(180deg, #f1ffe9 0%, #c8f5b0 50%, #a9ec8a 51%, #c6f4ac 100%); }
.ai-pill.off { color: #a3241a; border-color: #eba69d; background: linear-gradient(180deg, #fff3f1, #ffd7d1); }

/* theme toggle: glossy track with a sliding sun/moon orb */
.theme-toggle { position: relative; width: 64px; height: 30px; padding: 0; border-radius: 999px; flex: none;
  border: 1px solid #0b6ea8;
  background: linear-gradient(180deg, #a8ecff 0%, #4cc3f3 48%, #1d9ddb 52%, #5ccbf5 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -2px 5px rgba(255,255,255,.3), 0 2px 6px rgba(0, 60, 110, .3); }
.theme-toggle svg { position: absolute; top: 6px; width: 17px; height: 17px; }
.theme-toggle .tt-sun { left: 8px; fill: #fff7c4; stroke: #fff7c4; opacity: .55; }
.theme-toggle .tt-moon { right: 8px; fill: #ffffff; opacity: .9; }
.tt-knob { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #fffbe0 0%, #ffd64a 45%, #e59a00 100%);
  box-shadow: 0 2px 5px rgba(0,0,0,.35), inset 0 -2px 4px rgba(150, 80, 0, .35), 0 0 10px rgba(255, 220, 90, .7);
  transition: left .25s cubic-bezier(.5, 1.6, .5, 1), background .25s; }
.tt-knob::after { content: ""; position: absolute; left: 18%; right: 18%; top: 6%; height: 40%; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,0)); }
:root[data-theme="dark"] .theme-toggle { border-color: #3a6f9a;
  background: linear-gradient(180deg, #2c5a82 0%, #12365a 48%, #061f38 52%, #0e3254 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 0 10px rgba(60, 190, 255, .35), 0 2px 6px rgba(0,0,0,.4); }
:root[data-theme="dark"] .theme-toggle .tt-sun { opacity: .45; fill: #ffe58a; stroke: #ffe58a; }
:root[data-theme="dark"] .theme-toggle .tt-moon { opacity: .35; }
:root[data-theme="dark"] .tt-knob { left: 36px;
  background: radial-gradient(circle at 38% 30%, #ffffff 0%, #d9ecff 45%, #8fb2d6 100%);
  box-shadow: 0 2px 5px rgba(0,0,0,.45), inset 0 -2px 4px rgba(40, 70, 110, .35), 0 0 12px rgba(160, 220, 255, .75); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ================= layout ================= */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr) 390px; gap: 20px; padding: 20px 22px; }
.col-left, .col-center, .col-right { min-height: 0; }
.col-center { overflow: auto; padding: 0 6px 6px 2px; }
.col-left { overflow: auto; padding: 0 4px 6px 0; }
@media (max-width: 1180px) {
  body { height: auto; min-height: 100%; }
  .layout { grid-template-columns: 250px minmax(0, 1fr); }
  .col-right { grid-column: 1 / -1; height: 560px; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .hero { grid-template-columns: auto 1fr; }
  .hero .summary-btn { grid-column: 1 / -1; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group, .tagline { display: none; }
}

/* ================= location list ================= */
.loc-all { width: 100%; text-align: left; border-radius: var(--r); padding: 11px 14px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.loc-list { display: flex; flex-direction: column; gap: 9px; }
.loc { display: grid; grid-template-columns: 48px 1fr; gap: 11px; align-items: center; text-align: left; color: var(--ink);
  border-radius: var(--r); padding: 10px 12px; transition: transform .12s ease, background .12s ease; }
.loc:hover, .loc-all:hover { transform: translateY(-1px); background: var(--glass-strong); }
.loc-all.on, .loc.on { background: var(--sel); border-color: #6cc8f2; box-shadow: 0 0 0 2px rgba(30, 167, 228, .5), var(--shadow); }
.loc .name { font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.loc .city { font-size: 12px; color: var(--ink-3); font-weight: 400; }
.loc .flag { font-size: 12px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.asof { font-size: 12px; color: var(--ink-2); margin: 12px 4px; text-shadow: var(--asof-shadow); }

.ring { position: relative; width: 46px; height: 46px; border-radius: 50%; background: var(--orb-bg);
  box-shadow: inset 0 -2px 5px rgba(0, 40, 90, .2), 0 2px 5px rgba(0, 40, 90, .25); }
.ring svg { transform: rotate(-90deg); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font: 600 14px var(--mono); color: var(--ink); }
.ring::after { content: ""; position: absolute; left: 18%; right: 18%; top: 6%; height: 34%; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0)); pointer-events: none; }
:root[data-theme="dark"] .ring::after { background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0)); }
.delta { font: 600 11px var(--mono); }
.delta.up { color: var(--good); } .delta.down { color: var(--act); }

/* ================= cards ================= */
.card { position: relative; border-radius: var(--r); padding: 16px 18px; margin-bottom: 16px; overflow: hidden; }
.card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 46px; pointer-events: none; background: var(--sheen); }
.card > * { position: relative; }
.card h3 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--accent); font-weight: 600; }
.hero { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; background: var(--hero); }
.hero h1 { margin: 0; font-size: 26px; font-weight: 300; color: var(--ink); }
.hero .sub { color: var(--ink-2); }
.bigscore { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; position: relative;
  font: 700 36px/1 var(--mono); color: #fff; text-shadow: 0 1px 2px rgba(0, 50, 100, .45);
  background: radial-gradient(circle at 40% 30%, #b8efff 0%, #2bb0ea 45%, #0a6aa8 100%);
  border: 1px solid rgba(10, 90, 150, .4); box-shadow: 0 8px 18px rgba(0, 60, 120, .35), inset 0 -6px 12px rgba(0, 40, 90, .25); }
.bigscore.healthy { background: radial-gradient(circle at 40% 30%, #d9ffc8 0%, #59c93b 45%, #1f7f1b 100%); }
.bigscore.watch { background: radial-gradient(circle at 40% 30%, #fff1c2 0%, #f2b425 45%, #a86b00 100%); }
.bigscore.act { background: radial-gradient(circle at 40% 30%, #ffd2c9 0%, #ec5a45 45%, #9b1d13 100%); }
:root[data-theme="dark"] .bigscore { box-shadow: 0 0 26px rgba(255, 200, 60, .25), 0 8px 18px rgba(0,0,0,.45), inset 0 -6px 12px rgba(0, 0, 0, .3); }
:root[data-theme="dark"] .bigscore.healthy { box-shadow: 0 0 26px rgba(110, 230, 80, .3), 0 8px 18px rgba(0,0,0,.45), inset 0 -6px 12px rgba(0,0,0,.3); }
:root[data-theme="dark"] .bigscore.act { box-shadow: 0 0 26px rgba(255, 90, 70, .3), 0 8px 18px rgba(0,0,0,.45), inset 0 -6px 12px rgba(0,0,0,.3); }
.bigscore::after { content: ""; position: absolute; left: 16%; right: 16%; top: 5%; height: 40%; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,0)); }
.status { display: inline-block; vertical-align: middle; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 11px; box-shadow: var(--inset-hi); }
.status.healthy { background: var(--h-healthy); color: var(--t-healthy); border: 1px solid var(--b-healthy); }
.status.watch { background: var(--h-watch); color: var(--t-watch); border: 1px solid var(--b-watch); }
.status.act { background: var(--h-act); color: var(--t-act); border: 1px solid var(--b-act); }

.cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1400px) { .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cat { border: 1px solid var(--tile-edge); border-radius: 12px; padding: 10px 12px; background: var(--tile); box-shadow: var(--small-shadow); }
.cat .lbl { font-size: 12px; color: var(--ink-2); }
.cat .val { font: 600 22px var(--mono); }
.bar { height: 9px; border-radius: 99px; overflow: hidden; margin-top: 6px; background: var(--track); box-shadow: inset 0 1px 2px rgba(0, 40, 80, .25); }
.bar b { display: block; height: 100%; border-radius: 99px; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.bg-healthy { background: linear-gradient(180deg, #a8ef86 0%, #4cbb2f 50%, #2f9a1d 51%, #4fbd34 100%); }
.bg-watch { background: linear-gradient(180deg, #ffe08a 0%, #f2b425 50%, #d99a0c 51%, #f2b72d 100%); }
.bg-act { background: linear-gradient(180deg, #ffad9f 0%, #ec5a45 50%, #cf3b28 51%, #ea5b47 100%); }
:root[data-theme="dark"] .bar b { box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 8px currentColor; }
:root[data-theme="dark"] .bg-healthy { color: rgba(110,230,80,.5); } :root[data-theme="dark"] .bg-watch { color: rgba(255,200,60,.5); } :root[data-theme="dark"] .bg-act { color: rgba(255,90,70,.5); }

/* ================= flags ================= */
.flags { display: flex; flex-direction: column; gap: 8px; }
.ticket { display: grid; grid-template-columns: 7px 1fr; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--tile-edge); background: var(--tile-2); box-shadow: var(--small-shadow); }
.ticket .edge.act { background: linear-gradient(180deg, #ff9585, #d0392f); }
.ticket .edge.watch { background: linear-gradient(180deg, #ffd977, #d99a0c); }
.ticket .body { padding: 9px 12px; }
.ticket .meta { font: 600 11px var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.none { color: var(--ink-2); }

.metrics { width: 100%; border-collapse: collapse; font-size: 13px; }
.metrics td, .metrics th { padding: 7px 6px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.metrics tbody tr:nth-child(odd) { background: var(--stripe); }
.metrics th { font-weight: 600; color: var(--ink-2); font-size: 12px; }
.metrics td.num { font-family: var(--mono); text-align: right; }
.metrics td.dim { color: var(--ink-3); font-size: 12px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1400px) { .two { grid-template-columns: 1fr; } }
.spark { width: 100%; height: 96px; }
:root[data-theme="dark"] .spark path[stroke] { filter: drop-shadow(0 0 4px rgba(80, 200, 255, .45)); }
.legend { font-size: 12px; color: var(--ink-2); display: flex; gap: 14px; margin-top: 4px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }

.review { border-bottom: 1px solid var(--line-soft); padding: 8px 0; font-size: 13px; }
.review:last-child { border-bottom: 0; }
.stars { color: #f2a900; letter-spacing: 1px; }
.review .m { color: var(--ink-3); font-size: 12px; }
.summary-btn { border-radius: 999px; padding: 9px 18px; }
.summary-btn:disabled { opacity: .65; cursor: wait; }
.summary { white-space: normal; }

/* ================= heatmap: glossy gel tiles ================= */
.heat { width: 100%; border-collapse: separate; border-spacing: 5px; }
.heat th { font-size: 12px; color: var(--ink-2); font-weight: 600; text-align: left; padding: 4px 6px; }
.heat td { border-radius: 10px; padding: 9px 8px; font: 600 13px var(--mono); text-align: center; box-shadow: var(--inset-hi), var(--small-shadow); }
.heat td.name { font: 600 14px var(--sans); text-align: left; background: none; box-shadow: none; cursor: pointer; color: var(--accent); }
.heat td.name:hover { text-decoration: underline; }
.h-healthy { background: var(--h-healthy); color: var(--t-healthy); }
.h-watch { background: var(--h-watch); color: var(--t-watch); }
.h-act { background: var(--h-act); color: var(--t-act); }
.heat td.h-off { background: none; box-shadow: none; border: 1px dashed var(--line, rgba(120,140,160,.35)); color: var(--ink-3, #8a9aa8); }
.cat.off { opacity: .7; } .cat .offnote { font-size: 12px; color: var(--ink-2); margin-top: 6px; }
:root[data-theme="dark"] .heat td:not(.name) { border: 1px solid rgba(255,255,255,.08); }

/* ================= chat ================= */
.col-right { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; }
.chat-head { display: flex; gap: 10px; align-items: center; padding: 12px 16px; background: var(--bar-top); border-bottom: 1px solid var(--bar-edge); }
.chat-head svg { flex: none; filter: drop-shadow(0 2px 3px rgba(10, 90, 150, .3)); }
.chat-head h2 { margin: 0; font-size: 17px; font-weight: 400; color: var(--accent); }
.chat-head .hint { font-size: 12px; color: var(--ink-3); }
.chat-log { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.suggest { display: flex; flex-direction: column; gap: 7px; }
.suggest button { text-align: left; border-radius: 12px; padding: 8px 12px; color: var(--ink-2);
  border: 1px solid var(--line); background: var(--tile); box-shadow: var(--small-shadow); transition: all .12s ease; }
.suggest button:hover { color: var(--ink); border-color: var(--aqua); box-shadow: 0 0 0 3px rgba(30,167,228,.25), var(--small-shadow); }
.msg { max-width: 100%; }
.msg.user { align-self: flex-end; color: #fff; border-radius: 16px 16px 4px 16px; padding: 8px 13px;
  text-shadow: 0 -1px 0 rgba(0, 60, 110, .4); border: 1px solid var(--aqua-deep);
  background: linear-gradient(180deg, #7fdcff 0%, #2fb2ee 48%, #1497d9 52%, #2aaae6 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 3px 8px rgba(10, 110, 180, .3); }
.msg.bot { border-radius: 16px 16px 16px 4px; padding: 10px 13px; background: var(--tile-2); border: 1px solid var(--tile-edge); box-shadow: var(--small-shadow); }
.msg.greet { border-left: 4px solid var(--aqua); }
.msg.bot p { margin: 0 0 6px; } .msg.bot p:last-child { margin: 0; }
.msg.bot ul { margin: 4px 0 6px 18px; padding: 0; }
.steps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.steps span { font: 11px var(--mono); color: var(--ink-3); background: var(--chip-bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.msg.err { background: var(--h-act); color: var(--t-act); border-radius: 12px; padding: 8px 12px; border: 1px solid var(--b-act); }
.typing { color: var(--ink-3); font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--bar-edge); background: var(--chat-form-bg); }
.chat-form textarea { flex: 1; resize: none; border-radius: 12px; padding: 8px 11px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); background: var(--input-bg); box-shadow: inset 0 2px 4px rgba(0, 40, 80, .18); outline: none; }
.chat-form textarea::placeholder { color: var(--ink-3); }
.chat-form textarea:focus { border-color: var(--aqua); box-shadow: inset 0 2px 4px rgba(0, 40, 80, .18), 0 0 0 3px rgba(30,167,228,.3); }
.chat-form button { border-radius: 12px; padding: 0 20px; color: #fff; font-weight: 600;
  border: 1px solid #2f8f1a; text-shadow: 0 -1px 0 rgba(20, 80, 0, .45);
  background: linear-gradient(180deg, #b9f59a 0%, #66cf41 48%, #3fae22 52%, #5cc63b 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 3px 8px rgba(40, 130, 20, .35); }
:root[data-theme="dark"] .chat-form button { box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 0 12px rgba(100, 220, 60, .4); }
.chat-form button:disabled { opacity: .55; cursor: wait; }

.col-center::-webkit-scrollbar, .col-left::-webkit-scrollbar, .chat-log::-webkit-scrollbar { width: 10px; }
.col-center::-webkit-scrollbar-thumb, .col-left::-webkit-scrollbar-thumb, .chat-log::-webkit-scrollbar-thumb {
  border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; background-color: var(--scroll); }
