/* QAce dashboard — docs-inspired (Astryx) layout on the QAce dark + red palette.
   Flat surfaces, a sticky top bar, a filterable left nav, spacious content.
   No framework, no build step. Class names are stable so every view keeps working. */
:root {
  --bg: #0b0e12;
  --bg-raise: #0e1217;
  --panel: #11151b;
  --panel-2: #161b22;
  --border: #262d37;
  --border-soft: #1c222b;
  --text: #dee5ec;
  --text-dim: #93a1b0;
  --text-faint: #5f6d7c;
  --accent: #f3453f;            /* QAce red */
  --accent-bright: #ff6a63;
  --accent-dim: rgba(243, 69, 63, 0.12);
  --accent-border: rgba(243, 69, 63, 0.38);
  --danger: #f87171;
  --ok: #6ee7a0;
  --shadow: 0 8px 26px rgba(3, 5, 8, 0.45);
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  --sans: ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  --sidebar-w: 258px;
  --topbar-h: 52px;
  --maxw: 1180px;
  --r-sm: 8px; --r: 11px; --r-lg: 14px;
  --z-toast: 200; --z-lightbox: 100; --z-topbar: 30; --z-drawer: 40;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background:
    radial-gradient(900px 420px at 100% -8%, rgba(243, 69, 63, 0.055), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
#app { position: relative; z-index: 1; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-bright); text-decoration: underline; }
code {
  font-family: var(--mono); font-size: 11.5px; background: var(--bg-raise);
  border: 1px solid var(--border-soft); border-radius: 5px; padding: 1px 5px;
  color: var(--accent); word-break: break-all;
}
::selection { background: rgba(243, 69, 63, .28); }
:focus-visible { outline: 2px solid var(--accent-border); outline-offset: 2px; border-radius: 4px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #33404e; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.boot { display: flex; height: 100vh; align-items: center; justify-content: center; color: var(--text-dim); }

/* =========================================================== layout / shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; }

.sidebar {
  background: var(--bg-raise);
  border-right: 1px solid var(--border-soft);
  padding: 16px 12px 14px; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.sidebar .logo { display: block; padding: 4px 6px 12px; }
.logo-img { width: 132px; height: auto; display: block; }

/* filterable nav search (docs pattern) */
.navsearch { position: relative; margin: 0 4px 10px; }
.navsearch .ns-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 13px; pointer-events: none; }
.navsearch input {
  width: 100%; padding: 7px 10px 7px 28px; border-radius: var(--r-sm);
  background: var(--panel); border: 1px solid var(--border-soft); color: var(--text); font-size: 12px;
}
.navsearch input::placeholder { color: var(--text-faint); }
.navsearch input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(243, 69, 63, .08); outline: none; }

/* the nav is the only scrolling region between the pinned logo/search and the brandmark */
.nav {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -4px; padding: 0 4px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 11px;
  border-radius: var(--r-sm); color: var(--text-dim); margin-bottom: 1px; font-weight: 500; font-size: 12.5px;
  transition: background .14s ease, color .14s ease;
}
.nav a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-dim); color: var(--accent-bright); font-weight: 600; }
/* left accent indicator on the active item (docs convention; not a decorative card stripe) */
.nav a.active::before {
  content: ""; position: absolute; left: 2px; top: 6px; bottom: 6px; width: 3px;
  border-radius: 3px; background: var(--accent);
}
.nav a .ico { width: 16px; text-align: center; opacity: .85; font-size: 12px; flex: none; }
.nav a.active .ico { opacity: 1; }
.nav-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-faint); padding: 15px 11px 6px;
}
.nav-group-label:first-child { padding-top: 2px; }

.brandmark {
  display: block; margin: 12px 6px 0; padding-top: 13px; border-top: 1px solid var(--border-soft);
  opacity: .72; transition: opacity .2s ease, transform .2s ease;
}
.brandmark:hover { opacity: 1; transform: translateY(-1px); }
.brandmark img { width: 104px; display: block; }
.brandmark .tagline { font-size: 9.5px; color: var(--text-faint); margin-top: 5px; letter-spacing: .3px; }

/* content column = sticky top bar + scrolling main */
.content { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  flex: none; height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 clamp(16px, 3.5vw, 40px); border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.3) blur(10px); -webkit-backdrop-filter: saturate(1.3) blur(10px);
  position: sticky; top: 0; z-index: var(--z-topbar);
}
.hamb { display: none; background: none; border: none; color: var(--text-dim); font-size: 17px; padding: 4px 8px; border-radius: var(--r-sm); }
.hamb:hover { color: var(--text); background: var(--panel-2); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.crumbs .c-root { color: var(--text-dim); cursor: pointer; }
.crumbs .c-root:hover { color: var(--text); }
.crumbs .c-sep { color: var(--text-faint); }
.crumbs .c-cur { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.project-pill {
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel-2); color: var(--text-dim); font-size: 11.5px; white-space: nowrap;
}
.acct { display: flex; align-items: center; gap: 10px; min-width: 0; }
.acct-name { color: var(--text-dim); font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1 1 auto; min-width: 0; overflow-y: auto; padding: 30px clamp(16px, 3.5vw, 40px) 84px; }
.page { max-width: var(--maxw); margin: 0 auto; }

.scrim { display: none; }

/* ================================================================= generic */
h1 { font-size: 24px; margin: 0 0 6px; font-weight: 700; letter-spacing: -.4px; text-wrap: balance; line-height: 1.25; }
h2 { font-size: 15px; margin: 30px 0 12px; color: var(--text); font-weight: 650; letter-spacing: -.2px; }
h3 { font-size: 13.5px; margin: 18px 0 8px; font-weight: 600; }
.sub { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; max-width: 720px; line-height: 1.6; }
.card {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--r-lg);
  padding: 20px; margin-bottom: 16px;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* buttons — solid red primary CTA, bordered secondary */
button, .btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 7px 14px; font-size: 12.5px; font-weight: 500;
  cursor: pointer; font-family: var(--sans);
  transition: background .15s ease, border-color .15s ease, transform .1s ease, box-shadow .15s ease, color .15s ease;
}
button:hover:not(:disabled) { background: #1c232c; border-color: #364253; }
button:active:not(:disabled) { transform: translateY(1px) scale(.985); }
button:disabled { opacity: .45; cursor: default; }
button.primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 1px 2px rgba(3, 5, 8, .3), inset 0 1px 0 rgba(255, 255, 255, .12);
}
button.primary:hover:not(:disabled) { filter: brightness(1.06); box-shadow: 0 4px 16px rgba(243, 69, 63, .32); }
button.danger { background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .3); color: var(--danger); }
button.danger:hover:not(:disabled) { background: rgba(248, 113, 113, .16); border-color: rgba(248,113,113,.45); }
button.small { padding: 4px 10px; font-size: 11.5px; border-radius: 7px; }
.icon-btn {
  width: 27px; height: 27px; padding: 0; border-radius: 7px; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; opacity: .72;
}
tr:hover .icon-btn { opacity: 1; }
.icon-btn:hover:not(:disabled) { opacity: 1; }

input, select, textarea {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 11px; font-size: 12.5px; font-family: var(--sans);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-border); box-shadow: 0 0 0 3px rgba(243, 69, 63, .08);
}
label { display: block; font-size: 11.5px; color: var(--text-dim); margin: 14px 0 5px; font-weight: 500; }
label:first-child { margin-top: 0; }
.field-note { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
form .full { width: 100%; }

/* ============================================================= stats strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--r); padding: 14px 16px;
  transition: border-color .15s ease;
}
.stat:hover { border-color: var(--border); }
.stat .n { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.6px; line-height: 1.1; }
.stat .l { font-size: 10.5px; color: var(--text-faint); margin-top: 3px; letter-spacing: .3px; text-transform: uppercase; }
.stat.critical .n { color: #fda4af; } .stat.high .n { color: #fdba74; }
.stat.medium .n { color: #fcd34d; } .stat.low .n { color: #7dd3fc; }
.stat.gold .n { color: var(--accent); }

/* ===================================================================== login */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  width: 384px; background: var(--panel);
  border: 1px solid var(--border-soft); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow);
}
.auth-card h1 { color: var(--text); text-align: center; }
.auth-card h1 em { font-style: normal; color: var(--accent); }
.auth-card button { width: 100%; margin-top: 18px; padding: 10px; }
.auth-logo { display: block; width: 108px; height: auto; margin: 0 auto 16px; }
.auth-brand { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border-soft); text-align: center; }
.auth-brand img { width: 92px; opacity: .72; transition: opacity .2s ease; }
.auth-brand a:hover img { opacity: 1; }
.auth-switch { text-align: center; margin-top: 16px; color: var(--text-dim); font-size: 13px; }
.auth-switch a, .oauth-btn { color: var(--accent); cursor: pointer; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.oauth-row { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.oauth-btn {
  display: block; text-align: center; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--r-sm); background: var(--panel-2); color: var(--text); font-weight: 500; transition: border-color .15s;
}
.oauth-btn:hover { border-color: var(--accent-border); }
.checkline { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--text-dim); font-size: 13px; cursor: pointer; }
.error-box {
  background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .3); color: var(--danger);
  border-radius: var(--r-sm); padding: 10px 12px; font-size: 12px; margin-top: 12px;
}
.ok-box {
  background: var(--accent-dim); border: 1px solid var(--accent-border); color: var(--accent-bright);
  border-radius: var(--r-sm); padding: 10px 12px; font-size: 12px; margin-top: 12px; word-break: break-all;
}

/* ==================================================================== tables */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th {
  text-align: left; color: var(--text-faint); font-weight: 600; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .6px; padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
}
td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: top; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover td { background: rgba(243, 69, 63, .03); }
td .title-link { color: var(--text); font-weight: 600; }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border-soft); border-radius: var(--r); }
.tablewrap table { min-width: 560px; }
.tablewrap th:first-child, .tablewrap td:first-child { padding-left: 16px; }
.tablewrap th:last-child, .tablewrap td:last-child { padding-right: 16px; }

/* =================================================================== pager */
.pager {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 14px 0 2px; padding-top: 12px; border-top: 1px solid var(--border-soft);
}
.pager button { min-width: 0; }
.pager button:disabled { opacity: .35; }
.pager .pager-at {
  font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pager .pager-of { margin-left: auto; font-size: 11.5px; white-space: nowrap; }
/* The gallery/table above a pager shouldn't collapse against it. */
.gallery + .pager, .tablewrap + .pager { margin-top: 16px; }
@media (max-width: 640px) {
  .pager .pager-of { margin-left: 0; width: 100%; }
}

/* ===================================================================== chips */
.chip {
  display: inline-block; border-radius: 6px; padding: 2px 8px; font-size: 10.5px; font-weight: 700;
  border: 1px solid transparent; line-height: 1.55; letter-spacing: .2px; font-variant-numeric: tabular-nums;
}
.chip.critical { background: rgba(159, 18, 57, .22); color: #fda4af; border-color: rgba(159, 18, 57, .55); }
.chip.high { background: rgba(154, 52, 18, .22); color: #fdba74; border-color: rgba(154, 52, 18, .55); }
.chip.medium { background: rgba(161, 98, 7, .2); color: #fcd34d; border-color: rgba(161, 98, 7, .5); }
.chip.low { background: rgba(3, 105, 161, .2); color: #7dd3fc; border-color: rgba(3, 105, 161, .5); }
.chip.cat { background: var(--panel-2); color: var(--text-dim); border-color: var(--border); font-weight: 500; }
.chip.status-recording { background: rgba(159, 18, 57, .22); color: #fda4af; border-color: rgba(159, 18, 57, .55); }
.chip.status-recording::before { content: "●"; margin-right: 4px; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.chip.status-ended { background: var(--panel-2); color: var(--text-dim); border-color: var(--border); }
.chip.p1 { background: rgba(159, 18, 57, .22); color: #fda4af; border-color: rgba(159, 18, 57, .55); }
.chip.p2 { background: rgba(161, 98, 7, .2); color: #fcd34d; border-color: rgba(161, 98, 7, .5); }
.chip.p3 { background: rgba(3, 105, 161, .2); color: #7dd3fc; border-color: rgba(3, 105, 161, .5); }
.chip.ok { background: rgba(110, 231, 160, .14); color: var(--ok); border-color: rgba(110, 231, 160, .4); }

/* ==================================== coverage bar + crawl-map + memory panel */
.cbar { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin: 8px 0 4px; }
.cbar i { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: width .3s ease; }
.map-node { padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.map-node:last-child { border-bottom: none; }
.map-node-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.map-node-t { font-weight: 600; color: var(--text); }
.map-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mem-panel {
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  padding: 14px 16px; margin: 10px 0 0; overflow-x: auto; white-space: pre-wrap;
  line-height: 1.6; color: var(--text-dim); max-height: 460px; overflow-y: auto; font-family: var(--mono); font-size: 11.5px;
}

/* ====================================================================== tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-soft); margin: 24px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--text-dim); padding: 9px 14px; font-size: 13px; white-space: nowrap; font-weight: 500;
  transition: color .15s ease, border-color .15s ease;
}
.tabs button:hover { color: var(--text); background: none; }
.tabs button.active { color: var(--accent-bright); border-bottom-color: var(--accent); font-weight: 600; }

/* ================================================================== timeline */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border-soft); }
.tl-item { position: relative; padding: 5px 0 9px; }
.tl-item::before {
  content: ""; position: absolute; left: -20px; top: 10px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--text-faint); box-shadow: 0 0 0 3px var(--bg-raise);
}
.tl-item.annotation::before { background: var(--accent); }
.tl-item.navigation::before { background: #7dd3fc; }
.tl-item.screenshot::before { background: var(--ok); }
.tl-item.interaction::before { background: #a78bfa; }
.tl-item.console::before { background: var(--danger); }
.tl-item.network::before { background: #fb923c; }
.tl-item .when { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }
.tl-item .desc { margin-top: 1px; }

/* =========================================================== annotation cards */
.anno {
  border: 1px solid var(--border-soft); border-left-width: 3px; border-radius: var(--r);
  padding: 15px 17px; margin-bottom: 12px; background: var(--panel);
  transition: border-color .15s ease;
}
.anno:hover { border-color: var(--border); }
.anno.sev-critical { border-left-color: #9f1239; }
.anno.sev-high { border-left-color: #c2610c; }
.anno.sev-medium { border-left-color: #a16207; }
.anno.sev-low { border-left-color: #0369a1; }
.anno .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.anno .head .t { font-weight: 700; font-size: 13.5px; flex: 1; min-width: 140px; letter-spacing: -.1px; }
.anno .note { color: var(--text-dim); margin: 9px 0; white-space: pre-wrap; line-height: 1.55; }
.analysis { border-top: 1px dashed var(--border); margin-top: 12px; padding-top: 10px; font-size: 12.5px; }
.analysis dt { color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: .7px; margin-top: 9px; font-weight: 700; }
.analysis dd { margin: 3px 0 0; white-space: pre-wrap; line-height: 1.55; color: var(--text-dim); }

/* ================================================================== fix plan */
.fixplan { list-style: none; margin: 0; padding: 0; }
.fixplan li {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 4px;
  border-bottom: 1px solid var(--border-soft); line-height: 1.5;
}
.fixplan li:last-child { border-bottom: none; }
.fixplan .box { flex: none; width: 14px; height: 14px; margin-top: 2px; border: 1.5px solid var(--accent-border); border-radius: 4px; }
.fixplan .todo { flex: 1; }
.fixplan .todo .refs { display: block; font-family: var(--mono); font-size: 10px; color: var(--text-faint); margin-top: 2px; }

/* =============================================================== screenshots */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.shot {
  border: 1px solid var(--border-soft); border-radius: var(--r); overflow: hidden;
  background: var(--panel-2); transition: transform .15s ease, border-color .15s ease, box-shadow .2s ease;
}
.shot:hover { transform: translateY(-2px); border-color: var(--accent-border); box-shadow: 0 8px 22px rgba(3, 5, 8, .5); }
.shot img { width: 100%; height: 150px; object-fit: cover; object-position: top; display: block; cursor: zoom-in; background: #fff; }
.shot .cap { padding: 8px 11px; font-size: 10.5px; color: var(--text-dim); font-family: var(--mono); }
.lightbox {
  position: fixed; inset: 0; background: rgba(4, 6, 9, .9); z-index: var(--z-lightbox);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out; animation: fadein .15s ease;
}
@keyframes fadein { from { opacity: 0; } }
.lightbox img { max-width: 94vw; max-height: 94vh; border-radius: 8px; box-shadow: 0 24px 80px rgba(0,0,0,.7); }

/* ==================================================================== report */
.report-md {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: var(--r);
  padding: 24px 30px; overflow-x: auto; line-height: 1.7; max-width: 860px;
}
.report-md h1 { font-size: 20px; }
.report-md h2 { font-size: 16px; border-bottom: 1px solid var(--border-soft); padding-bottom: 6px; color: var(--accent-bright); }
.report-md h3 { font-size: 14px; } .report-md h4, .report-md h5 { font-size: 12.5px; color: var(--accent); }
.report-md pre { background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--r-sm); padding: 13px; overflow-x: auto; }
.report-md li { margin: 3px 0; }

/* ================================================================== settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 16px; align-items: start; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 12.5px; }
.kv dt { color: var(--text-faint); } .kv dd { margin: 0; word-break: break-all; }
.snippet {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px;
  font-family: var(--mono); font-size: 11px; color: var(--accent); word-break: break-all; user-select: all;
}
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-soft);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .lab { font-size: 12.5px; }
.toggle-row .lab small { display: block; color: var(--text-faint); margin-top: 1px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

/* ==================================================================== toasts */
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel); border: 1px solid var(--accent-border); color: var(--accent-bright);
  padding: 11px 15px; border-radius: var(--r); font-size: 12.5px;
  box-shadow: var(--shadow); max-width: 380px; animation: slidein .18s ease;
}
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } }
.toast.err { border-color: rgba(248, 113, 113, .4); color: var(--danger); }

/* ==================================================================== states */
.empty {
  text-align: center; color: var(--text-faint); padding: 52px 20px;
  border: 1px dashed var(--border); border-radius: var(--r); line-height: 1.7;
}
.empty b { color: var(--text-dim); font-size: 14px; }
.empty-steps { max-width: 540px; margin: 12px auto 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.7; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

.checklist { list-style: none; margin: 14px 0 0; padding: 0; }
.checklist li {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  border: 1px solid var(--border-soft); border-radius: var(--r); margin-bottom: 8px;
  background: var(--panel); transition: border-color .15s ease, background .15s ease;
}
.checklist li:last-child { margin-bottom: 0; }
.checklist li.current { border-color: var(--accent-border); background: var(--accent-dim); }
.checklist .mark {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
  font-size: 11px; font-weight: 700; color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.checklist li.done .mark { background: rgba(110, 231, 160, .14); border-color: rgba(110, 231, 160, .4); color: var(--ok); }
.checklist li.current .mark { border-color: var(--accent-border); color: var(--accent-bright); }
.checklist .body { flex: 1; min-width: 0; }
.checklist .body b { font-weight: 600; color: var(--text); }
.checklist li.done .body b { color: var(--text-dim); }
.checklist .body .d { color: var(--text-dim); font-size: 11.5px; margin-top: 2px; line-height: 1.5; }
.checklist .step-cta { margin-top: 10px; }
.spin {
  display: inline-block; width: 12px; height: 12px; border: 2px solid var(--text-faint);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--panel-2) 25%, #1b222b 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton.row-lg { height: 46px; margin: 8px 0; }

/* =========================================================== platform admin */
.pa-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pa-head .meta { color: var(--text-faint); font-size: 11.5px; font-family: var(--mono); }
.pa-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2px 26px; margin: 4px 0 2px; }
.pa-status .it { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; min-width: 0; }
.pa-status .it .k { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; flex: none; width: 84px; }
.pa-status .it .v { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pa-status .it .v small { color: var(--text-faint); }
.pa-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.pa-dot.ok { background: var(--ok); box-shadow: 0 0 6px rgba(110, 231, 160, .5); }
.pa-dot.warn { background: #fcd34d; box-shadow: 0 0 6px rgba(252, 211, 77, .4); }
.pa-dot.err { background: var(--danger); box-shadow: 0 0 6px rgba(248, 113, 113, .5); }
.pa-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.pa-golink { color: var(--accent); cursor: pointer; }
.pa-golink:hover { text-decoration: underline; }
.pa-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.pa-toolbar input[type="search"] { flex: 1; min-width: 170px; }
.pa-toolbar .count { color: var(--text-faint); font-size: 11.5px; white-space: nowrap; }
.pa-feed { list-style: none; margin: 0; padding: 0; }
.pa-feed li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; align-items: baseline; }
.pa-feed li:last-child { border-bottom: none; }
.pa-feed .when { flex: none; font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); width: 74px; }
.pa-feed .what { min-width: 0; overflow-wrap: anywhere; }
.pa-feed .what b { font-weight: 600; }
.pa-feed .what small { color: var(--text-faint); }
.pa-plan { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.pa-plan .nm { flex: none; width: 76px; color: var(--text-dim); text-transform: capitalize; }
.pa-plan .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.pa-plan .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); opacity: .75; }
.pa-plan .ct { flex: none; font-family: var(--mono); font-size: 11px; color: var(--text-dim); width: 56px; text-align: right; }
td select.pa-planpick { padding: 4px 8px; font-size: 11.5px; border-radius: 7px; }
.pa-ua { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); font-size: 11px; }
#paBody td.faint, #paBody .pa-feed .what small { color: var(--text-dim); }
.cellv { min-width: 0; overflow-wrap: anywhere; }

/* ================================================= environment / secrets */
.env-row {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 10px 20px;
  align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-soft);
}
.env-row:last-child { border-bottom: none; }
.env-meta { min-width: 0; }
.env-meta code { background: var(--bg-raise); }
.env-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.env-label small { color: var(--text-faint); font-size: 11px; }
.env-ctrl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.env-ctrl input { min-width: 0; }
.env-ctrl input:disabled { opacity: .6; cursor: not-allowed; }
.env-clear { display: flex; align-items: center; gap: 5px; color: var(--text-faint); font-size: 11.5px; white-space: nowrap; cursor: pointer; }

/* ===================================== integrations + billing + analytics */
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text-dim); font-size: 11px; margin-left: 6px; }
.pill.ok { color: #7fd18a; border-color: #2f6b3a; background: rgba(127, 209, 138, .08); }
.integ-card { max-width: 640px; margin-bottom: 16px; }
.integ-head { display: flex; align-items: center; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.integ-card .integ-head .icon { margin-right: 7px; }
.fld { display: block; margin: 8px 0; }
.fld > span { display: block; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.fld input { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--panel-2); color: var(--text); }
.right { text-align: right; margin-top: 10px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 14px 0; }
.plan-card { display: flex; flex-direction: column; }
.plan-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(243, 69, 63, .4); }
.plan-name { font-weight: 700; font-size: 16px; }
.plan-price { font-size: 24px; margin: 6px 0; color: var(--accent); font-weight: 700; }
.plan-tag { font-size: 12px; min-height: 32px; color: var(--text-dim); }
.plan-feats { list-style: none; padding: 0; margin: 10px 0; font-size: 12px; color: var(--text-dim); }
.plan-feats li { padding: 4px 0; border-bottom: 1px solid var(--border-soft); }
.sub-line { margin-bottom: 8px; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-row .stat { flex: 1; min-width: 120px; }
.stat-val { font-size: 23px; font-weight: 700; color: var(--accent); }
.stat-lbl { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; }
.an-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 10px; overflow-x: auto; }
.an-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 26px; }
.an-fill { width: 18px; border-radius: 3px 3px 0 0; }
.an-day { font-size: 9px; color: var(--text-faint); margin-top: 3px; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.tbl td { padding: 7px 8px; border-bottom: 1px solid var(--border-soft); }
.tbl .right, td.right { text-align: right; }

/* ============================================================ shared widgets */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.widget-card { display: flex; flex-direction: column; }
.widget-card .wtitle { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.widget-card .wtitle b { font-size: 13px; }
.widget-body-row { display: flex; align-items: center; gap: 16px; }
.donut-wrap { position: relative; flex: none; }
.donut-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.donut-label b { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.donut-label small { font-size: 9.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .4px; margin-top: 1px; }
.donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; font-size: 12px; }
.donut-legend li { display: flex; align-items: center; gap: 7px; padding: 3px 0; color: var(--text-dim); }
.donut-legend .dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.donut-legend .lv { margin-left: auto; font-family: var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.hbar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.hbar-label { width: 150px; flex: none; font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-val { width: 44px; flex: none; text-align: right; font-size: 11.5px; color: var(--text); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; }
.mini-list li:last-child { border-bottom: none; }
.mini-list .mtitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.mini-list .mwhen { flex: none; color: var(--text-faint); font-size: 11px; }
.integ-help { margin-top: 10px; border: 1px solid var(--border-soft); border-radius: var(--r-sm); padding: 10px 13px; background: var(--panel-2); }
.integ-help summary { cursor: pointer; font-weight: 600; color: var(--text-dim); font-size: 12px; list-style: none; }
.integ-help summary::-webkit-details-marker { display: none; }
.integ-help summary::before { content: "▸ "; color: var(--accent); }
.integ-help[open] summary::before { content: "▾ "; }
.integ-help ol { margin: 9px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 12px; line-height: 1.7; }
.integ-help li { margin-bottom: 4px; }
.cron-presets { display: flex; gap: 7px; flex-wrap: wrap; }
.sch-meta { display: flex; flex-direction: column; gap: 2px; }

/* ================================================================ status page */
.sdot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); }
.sdot.up { background: var(--ok); box-shadow: 0 0 6px rgba(110, 231, 160, .5); }
.sdot.degraded { background: #fcd34d; box-shadow: 0 0 6px rgba(252, 211, 77, .4); }
.sdot.down { background: var(--danger); box-shadow: 0 0 6px rgba(248, 113, 113, .5); }
.sdot.idle { background: var(--text-faint); }
.status-banner {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--r-lg);
  border: 1px solid var(--border-soft); margin-bottom: 16px; background: var(--panel);
}
.status-banner .sdot { width: 13px; height: 13px; }
.status-banner b { font-size: 15px; }
.status-banner.up { border-color: rgba(110, 231, 160, .35); }
.status-banner.degraded { border-color: rgba(252, 211, 77, .4); }
.status-banner.down { border-color: rgba(248, 113, 113, .45); }
.status-list { display: flex; flex-direction: column; }
.status-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border-soft); }
.status-row:last-child { border-bottom: none; }
.status-name { flex: 1; min-width: 0; font-weight: 600; }
.status-name .faint { font-weight: 400; margin-top: 2px; }

/* ============================================================== responsive */
/* Tablet/desktop-narrow: the sidebar becomes an off-canvas drawer toggled from
   the top bar; the content column takes the full width. */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; width: 280px; max-width: 86vw; height: 100vh; z-index: var(--z-drawer);
    transform: translateX(-100%); transition: transform .22s cubic-bezier(.16,1,.3,1);
    box-shadow: 0 0 40px rgba(0,0,0,.5);
  }
  .shell.nav-open .sidebar { transform: translateX(0); }
  .scrim { position: fixed; inset: 0; background: rgba(4,6,9,.55); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .shell.nav-open .scrim { display: block; opacity: 1; pointer-events: auto; }
  .content { height: 100vh; }
  .hamb { display: inline-flex; align-items: center; justify-content: center; }
  .pa-cols { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .env-row { grid-template-columns: 1fr; gap: 8px; }
  .acct-name { display: none; }
  .main { padding: 22px 14px 70px; }
  .card { padding: 16px; }
}

/* On phones the status list values wrap instead of hard-truncating (no hover on touch). */
@media (max-width: 700px) {
  .pa-status .it .v { white-space: normal; overflow-wrap: anywhere; }
  /* Action-heavy tables restack into cards on phones (needs data-th on each td). */
  .tablewrap table.t-stack { min-width: 0; }
  .t-stack thead { display: none; }
  .t-stack, .t-stack tbody { display: block; }
  .t-stack tr {
    display: block; border: 1px solid var(--border-soft); border-radius: var(--r);
    background: var(--panel-2); padding: 4px 12px; margin-bottom: 10px;
  }
  .t-stack td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
    border-bottom: 1px solid var(--border-soft); padding: 8px 0; text-align: right;
    min-width: 0; overflow-wrap: anywhere;
  }
  .t-stack td > * { min-width: 0; overflow-wrap: anywhere; }
  .cellv { text-align: right; }
  .t-stack td:last-child { border-bottom: none; }
  .t-stack td::before {
    content: attr(data-th); color: var(--text-faint); font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px; text-align: left; flex: none;
  }
  .t-stack td:not([data-th])::before { content: none; }
  .t-stack td.pa-actions { justify-content: flex-end; }
  .t-stack tbody tr:hover td { background: none; }
  .pa-ua { max-width: 170px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
