/* Profit Suite control panel - owner spec: BLUE scheme on BLACK background, WHITE text.
   One typeface (Atkinson Hyperlegible Next, bundled locally - built for legibility).
   One bold element: the safety statement at the top of Home. Everything else stays quiet. */

@font-face { font-family: "Atkinson Next"; font-weight: 400; font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Next"; font-weight: 700; font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Next"; font-weight: 800; font-display: swap;
  src: url("/static/fonts/atkinson-hyperlegible-next-latin-800-normal.woff2") format("woff2"); }

:root {
  --black: #000000;
  --navy: #0A1220;
  --panel: #0F1B2D;
  --line: #1E3A5F;
  --blue: #2563EB;
  --blue-press: #1D4FD8;
  --sky: #38BDF8;
  --white: #FFFFFF;
  --mist: #CBD5E1;
  --dim: #94A3B8;
  --amber: #FBBF24;

  --r-hero: 22px;
  --r-item: 14px;
  --r-control: 10px;
  --tap: 48px;
  --gap: 16px;
  --font: "Atkinson Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; overflow-x: hidden; background: var(--black); color: var(--white);
  font-family: var(--font); font-size: 17px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-wrap: break-word;   /* a long web address in an error can never push the page sideways */
}
.toast { overflow-wrap: anywhere; }
.content { min-width: 0; }   /* lets the main column shrink on wide screens instead of being pushed wider */
[hidden] { display: none !important; }
a { color: var(--sky); text-underline-offset: 3px; }
a:hover { color: var(--white); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--mist); }
.dim { color: var(--dim); font-size: 0.92rem; }
.small { font-size: 0.92rem; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 28px; }

/* ------------------------------------------------------------------ shell */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(0, 0, 0, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--white); text-decoration: none; white-space: nowrap; }
@media (max-width: 479px) { #mode-chip { display: none; } .topbar { gap: 10px; padding-left: 14px; padding-right: 14px; } }
@media (max-width: 359px) { .topbar .brand-name { display: none; } }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: var(--r-control); border: 1px solid var(--line); color: var(--white); text-decoration: none;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--navy); color: var(--white); }
.icon-btn[aria-current="page"] { border-color: var(--sky); color: var(--sky); }
.badge-count.bell-count { top: -7px; left: auto; right: -7px; border: 2px solid var(--black); height: 22px; line-height: 18px; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.topbar .spacer { flex: 1; }

.layout { display: block; }
.sidenav { display: none; }
.content { max-width: 1040px; margin: 0 auto; padding: 20px 16px 120px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--black); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 62px; color: var(--dim); text-decoration: none; font-size: 0.85rem; font-weight: 700;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--white); }
.tab[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; background: var(--sky); border-radius: 0 0 3px 3px; }
.badge-count {
  position: absolute; top: 6px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; background: var(--blue); color: var(--white); font-size: 0.75rem; line-height: 20px; text-align: center;
}

@media (min-width: 900px) {
  .layout { display: grid; grid-template-columns: 232px 1fr; }
  .tabbar { display: none; }
  .sidenav { display: block; position: sticky; top: 57px; height: calc(100vh - 57px); padding: 20px 12px; border-right: 1px solid var(--line); }
  .sidenav a {
    position: relative; display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 14px;
    border-radius: var(--r-control); color: var(--mist); text-decoration: none; font-weight: 700;
  }
  .sidenav a svg { width: 22px; height: 22px; }
  .sidenav a:hover { background: var(--navy); color: var(--white); }
  .sidenav a[aria-current="page"] { background: var(--panel); color: var(--white); box-shadow: inset 3px 0 0 var(--sky); }
  .sidenav .badge-count { position: static; margin-left: auto; }
  .content { padding: 32px 32px 64px; }
  body { font-size: 17px; }
}

/* ------------------------------------------------------------------ buttons & controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; border-radius: var(--r-control);
  border: 1px solid transparent; background: var(--blue); color: var(--white);
  font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--blue-press); color: var(--white); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--white); }
.btn-quiet:hover { background: var(--navy); }
.btn-white { background: var(--white); color: var(--black); }
.btn-white:hover { background: var(--mist); color: var(--black); }
.btn-stop {
  background: var(--black); color: var(--white); border: 2px solid var(--white);
  min-height: 40px; padding: 0 14px; font-weight: 800;
}
.btn-stop:hover { background: var(--white); color: var(--black); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.linkish { background: none; border: 0; padding: 0; color: var(--sky); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.field { display: block; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field .hint { display: block; color: var(--dim); font-size: 0.9rem; margin-top: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border-radius: var(--r-control);
  border: 1px solid var(--line); background: var(--navy); color: var(--white);
}
.input::placeholder { color: var(--dim); }
.input:focus { border-color: var(--sky); outline: none; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 84px; }
.input-wrap .reveal { position: absolute; right: 4px; top: 4px; bottom: 4px; min-height: 40px; padding: 0 14px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: var(--tap); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 52px; height: 30px; border-radius: 15px; background: var(--panel); border: 1px solid var(--line); position: relative; flex: none; transition: background 0.15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--dim); transition: transform 0.15s, background 0.15s; }
.switch input:checked + .track { background: var(--blue); border-color: var(--blue); }
.switch input:checked + .track::after { transform: translateX(22px); background: var(--white); }
.switch input:focus-visible + .track { outline: 3px solid var(--sky); outline-offset: 2px; }
.switch .switch-text { font-weight: 700; font-size: 0.95rem; color: var(--mist); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--mist); font-size: 0.85rem; font-weight: 700; white-space: nowrap;
}
.chip-on { border-color: var(--sky); color: var(--sky); }
.chip-wrap { white-space: normal; max-width: 100%; border-radius: 14px; }
.chip-attn { border-color: var(--amber); color: var(--amber); }
.chip-solid { background: var(--white); color: var(--black); border-color: var(--white); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* ------------------------------------------------------------------ the one bold element: safety statement */
.status-hero {
  position: relative; padding: 28px 22px 24px; border-radius: var(--r-hero);
  background: var(--navy); border: 1px solid var(--line); overflow: hidden;
}
.status-hero::after { /* quiet blue horizon line along the bottom edge */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--sky));
}
.signal { display: inline-flex; align-items: center; gap: 12px; color: var(--sky); font-weight: 700; }
.signal-light { position: relative; width: 14px; height: 14px; border-radius: 50%; background: var(--sky); }
.signal-light::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--sky);
  opacity: 0; animation: ping 2.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 70% { transform: scale(1.6); opacity: 0; } 100% { opacity: 0; } }
.status-title { margin-top: 14px; font-size: clamp(2rem, 8.5vw, 3.4rem); font-weight: 800; line-height: 1.02; letter-spacing: -0.025em; max-width: 14ch; }
.status-sub { margin-top: 12px; color: var(--mist); font-size: 1.05rem; max-width: 46ch; }
.status-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.status-hero.is-stopped { background: var(--white); color: var(--black); border-color: var(--white); }
.status-hero.is-stopped::after { background: var(--black); }
.status-hero.is-stopped .signal { color: var(--black); }
.status-hero.is-stopped .signal-light { background: var(--black); border-radius: 3px; }
.status-hero.is-stopped .signal-light::before { display: none; }
.status-hero.is-stopped .status-sub { color: #1F2937; }
.status-hero.is-live { border-color: var(--amber); }
.status-hero.is-live .signal { color: var(--amber); }
.status-hero.is-live .signal-light { background: var(--amber); }
.status-hero.is-live .signal-light::before { border-color: var(--amber); }

/* ------------------------------------------------------------------ sections & rows */
.section { padding-top: 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head a { font-weight: 700; text-decoration: none; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-item);
  border: 1px solid var(--line); background: var(--black);
}
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 1px; color: var(--sky); }
.notice.attn { border-color: var(--amber); }
.notice.attn svg { color: var(--amber); }
.notice strong { display: block; }

.rows { border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 16px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none;
}
.row:hover .row-title { color: var(--sky); }
.engine-row { grid-template-columns: auto 1fr; grid-template-areas: "num main" ". end"; row-gap: 10px; }
.engine-row > .num { grid-area: num; align-self: start; }
.engine-row > .row-main { grid-area: main; }
.engine-row > .row-end { grid-area: end; justify-content: space-between; }
@media (min-width: 640px) {
  .engine-row { grid-template-columns: auto 1fr auto; grid-template-areas: "num main end"; }
  .engine-row > .num { align-self: center; }
}
.num {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--panel); border: 1px solid var(--line); font-weight: 800; color: var(--sky);
}
.row > * { min-width: 0; }
.row-title { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.row-meta { color: var(--mist); font-size: 0.93rem; margin-top: 2px; overflow-wrap: anywhere; }
.row-last { color: var(--dim); font-size: 0.9rem; margin-top: 4px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-end { display: flex; align-items: center; gap: 8px; }
.chev { width: 20px; height: 20px; color: var(--dim); }
.row > svg:first-child { width: 24px; height: 24px; color: var(--sky); }

.meter { height: 12px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--sky)); border-radius: 6px; transition: width 0.4s ease; }
.meter.full > span { background: var(--white); }
.figure { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.figure-sub { color: var(--mist); }
.split { display: grid; gap: 22px; }
@media (min-width: 760px) { .split { grid-template-columns: 1fr 1fr; } }

.panel { background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-item); padding: 18px; }

/* ------------------------------------------------------------------ running mode chooser */
.mode-options { display: grid; gap: 10px; }
@media (min-width: 760px) { .mode-options { grid-template-columns: 1fr 1fr; } }
.mode-option {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: start; text-align: left;
  padding: 16px; border-radius: var(--r-item); border: 1px solid var(--line); background: var(--black); color: var(--white); cursor: pointer;
}
.mode-option strong { display: block; font-size: 1.05rem; }
.mode-sub { display: block; color: var(--mist); font-size: 0.93rem; margin-top: 4px; }
.mode-radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--dim); margin-top: 2px; }
.mode-option[aria-pressed="true"] { border-color: var(--sky); background: var(--navy); box-shadow: inset 0 0 0 1px var(--sky); }
.mode-option[aria-pressed="true"] .mode-radio { border-color: var(--sky); background: radial-gradient(circle, var(--sky) 0 45%, transparent 50%); }
.plain-list { margin: 0; padding-left: 20px; color: var(--mist); }
.plain-list li + li { margin-top: 8px; }
.catch-row { grid-template-columns: 28px 1fr auto; }

/* ------------------------------------------------------------------ to-do items */
.segments { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--navy); border: 1px solid var(--line); gap: 4px; max-width: 100%; overflow-x: auto; }
.segments button { min-height: 40px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--mist); font-weight: 700; cursor: pointer; white-space: nowrap; }
.segments button[aria-pressed="true"] { background: var(--blue); color: var(--white); }

.item { border: 1px solid var(--line); border-left: 4px solid var(--sky); border-radius: var(--r-item); background: var(--navy); padding: 18px; }
.item[data-engine="quant_alpha"] { border-left-color: var(--blue); }
.item[data-engine="prediction_markets"] { border-left-color: var(--white); }
.item[data-engine="bittensor_optimizer"] { border-left-color: var(--dim); }
.item-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.item-title { margin-top: 10px; font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.item-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.item-summary { margin-top: 6px; color: var(--mist); }
.item ul { margin: 6px 0 0; padding-left: 20px; color: var(--mist); }
.item li + li { margin-top: 4px; }
.item-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
details.more { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--sky); min-height: 44px; display: flex; align-items: center; }
.plan { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--black); border: 1px solid var(--line); border-radius: var(--r-control); padding: 12px; color: var(--mist); font-size: 0.93rem; max-height: 320px; overflow: auto; }
.empty { padding: 36px 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r-item); color: var(--mist); }
.empty h3 { color: var(--white); margin-bottom: 6px; }

/* ------------------------------------------------------------------ engine detail */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; justify-content: space-between; }
.page-head .num { width: 44px; height: 44px; font-size: 1.2rem; }
.page-title { display: flex; align-items: center; gap: 14px; }
.kv { display: grid; grid-template-columns: minmax(40%, 1fr) minmax(0, auto); gap: 8px 16px; }
.kv dt { color: var(--mist); }
.kv dd { margin: 0; font-weight: 700; text-align: right; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 70px 1fr 64px; gap: 10px; align-items: center; font-size: 0.92rem; }
.bar-track { height: 10px; background: var(--panel); border-radius: 5px; position: relative; overflow: hidden; }
.bar-track > span { position: absolute; top: 0; bottom: 0; background: var(--sky); border-radius: 5px; }
.spark { width: 100%; height: 120px; display: block; }
.form-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .form-grid { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------------ setup checklist */
.check { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.check-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); color: var(--dim); font-weight: 800; font-size: 0.85rem; }
.check-icon.set { background: var(--sky); border-color: var(--sky); color: var(--black); }
.check-icon.problem { border-color: var(--amber); color: var(--amber); }
.check-name { font-weight: 700; }
.code { font-family: var(--font); font-weight: 700; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--white); overflow-wrap: anywhere; }
.check-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }

/* ------------------------------------------------------------------ sign-in / setup screens */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 480px; }
.gate-card .brand { margin-bottom: 28px; font-size: 1.25rem; }
.gate-card .brand-mark { width: 36px; height: 36px; }
.gate-title { font-size: clamp(1.9rem, 7vw, 2.4rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 18px 48px; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); color: var(--sky); font-weight: 800;
}
.secret-box { display: flex; gap: 8px; align-items: stretch; }
.secret-box output { flex: 1; min-height: var(--tap); padding: 12px; border-radius: var(--r-control); background: var(--black); border: 1px solid var(--sky); overflow-wrap: anywhere; font-weight: 700; letter-spacing: 0.02em; user-select: all; }

/* ------------------------------------------------------------------ modal & toasts */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.78); display: grid; place-items: end center; padding: 16px; }
@media (min-width: 600px) { .modal-backdrop { place-items: center; } }
.modal { width: 100%; max-width: 460px; background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-hero); padding: 24px; }
.modal h2 { font-size: 1.45rem; }
.modal p { margin-top: 10px; color: var(--mist); }
.modal .btn-row { margin-top: 22px; }
.modal .btn-row .btn { flex: 1; }
.modal.is-stop { background: var(--white); color: var(--black); border-color: var(--white); }
.modal.is-stop p { color: #1F2937; }
.modal.is-stop .btn-quiet { color: var(--black); border-color: #9CA3AF; }
.modal.is-stop .btn-quiet:hover { background: #E5E7EB; }

.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 60; display: grid; gap: 8px; width: min(92vw, 440px); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { padding: 14px 16px; border-radius: var(--r-item); background: var(--white); color: var(--black); font-weight: 700; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6); }
.toast.attn { background: var(--amber); }

.skeleton { height: 18px; border-radius: 6px; background: var(--panel); margin: 10px 0; }
.skeleton.tall { height: 160px; border-radius: var(--r-hero); }

.help h3 { margin-top: 26px; }
.help p, .help li { color: var(--mist); max-width: 70ch; }
.help ul, .help ol { padding-left: 22px; }
.help li + li { margin-top: 6px; }
.help dt { font-weight: 700; margin-top: 14px; }
.help dd { margin: 4px 0 0; color: var(--mist); max-width: 70ch; }

.log { font-size: 0.92rem; }
.log .row { grid-template-columns: 1fr auto; padding: 12px 2px; }

/* ------------------------------------------------------------------ notifications */
.phone-card { position: relative; overflow: hidden; }
.phone-card .phone-head { display: flex; gap: 14px; align-items: flex-start; }
.phone-card .phone-head > svg { width: 30px; height: 30px; flex: none; color: var(--sky); margin-top: 2px; }
.phone-card.is-on { border-color: var(--sky); }
.phone-card.is-on .phone-head > svg { color: var(--white); background: var(--blue); border-radius: 10px; padding: 5px; width: 36px; height: 36px; margin-top: 0; }
/* a preview of what lands in the phone's notification bar */
.shade { border-radius: 16px; background: #111827; border: 1px solid #27364D; padding: 12px 14px; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; max-width: 420px; }
.shade-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--black); display: grid; place-items: center; }
.shade-icon svg { width: 26px; height: 26px; }
.shade-app { color: var(--dim); font-size: 0.85rem; }
.shade-title { font-weight: 700; margin-top: 1px; }
.shade-body { color: var(--mist); font-size: 0.93rem; }
.pref-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.pref-row > * { min-width: 0; }
.time-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.time-grid .field { min-width: 0; }
.time-grid .input { min-width: 0; }
input[type="time"].input { color-scheme: dark; }
.input:disabled { opacity: 0.5; }
.note-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: start; padding: 14px 2px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.note-row > * { min-width: 0; }
.note-row:hover .row-title { color: var(--sky); }
.unread-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; background: transparent; }
.note-row.is-unread .unread-dot { background: var(--sky); }
.note-row.is-urgent .row-title { color: var(--white); }
.note-row.is-urgent .unread-dot { background: var(--white); }
.note-meta { color: var(--dim); font-size: 0.85rem; margin-top: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------ Stats, Health & fixes, engine settings (2.3) */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; }
.kpi-card { background: var(--navy); border: 1px solid var(--line); border-radius: var(--r-item); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.kpi-label { font-size: 0.9rem; color: var(--mist); font-weight: 700; }
.kpi-value { font-size: 1.55rem; font-weight: 800; color: var(--white); line-height: 1.15; overflow-wrap: anywhere; }
.kpi-sub { font-size: 0.85rem; color: var(--dim); }

.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-row { display: grid; grid-template-columns: minmax(0, 11rem) 1fr auto; align-items: center; gap: 10px; font-size: 0.93rem; }
.funnel-track { height: 12px; background: var(--black); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.funnel-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--sky)); border-radius: 999px; min-width: 2px; }
.funnel-val { text-align: right; font-weight: 700; color: var(--white); }

.issue-card { background: var(--navy); border: 1px solid var(--line); border-left: 4px solid var(--sky); border-radius: var(--r-item); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.issue-card.sev-error { border-left-color: #EF4444; background: #140B12; }
.issue-card.sev-warn { border-left-color: var(--amber); }
.issue-card.sev-info { border-left-color: var(--sky); }
.issue-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sev-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; border: 1px solid var(--line); color: var(--white); background: var(--panel); }
.sev-pill.sev-error { background: #7F1D1D; border-color: #EF4444; color: #FFFFFF; }
.sev-pill.sev-warn { background: #451A03; border-color: var(--amber); color: #FDE68A; }
.sev-pill.sev-info { background: #0C2440; border-color: var(--sky); color: #E0F2FE; }

.fix-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--white); font-size: 0.95rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.85rem; background: var(--panel); border: 1px solid var(--line); color: var(--mist); }
.tag-chip strong { color: var(--white); }

.field-name { display: block; margin-bottom: 2px; }
.settings-box > summary { font-weight: 700; }
@media (max-width: 479px) {
  .funnel-row { grid-template-columns: minmax(0, 8.5rem) 1fr auto; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 359px) { .kpi-grid { grid-template-columns: 1fr; } }
