/* Insights pages: same neutral near-black as the dashboard (static/index.html tokens). */
:root {
  --bg1: #08090c; --bg2: #0d0f14; --text: #f2f4f8; --muted: #8b93a3;
  --cyan: #6d8cff; --good: #34d399; --bad: #f87171; --warn: #fbbf24;
  --panel: #121419; --panel2: #171a21; --border: #23262e;
  --ig: #e05fc0; --fb: #4a7dff;
}
* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body { background: var(--bg1); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
       -webkit-font-smoothing: antialiased; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 18px 22px 80px; }
.top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 4px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.top h1 { font-size: 20px; font-weight: 600; letter-spacing: .2px; }
.top h1 span { color: var(--muted); font-weight: 400; }
.tabs { display: inline-flex; gap: 4px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.tabs a { color: var(--muted); padding: 6px 14px; border-radius: 8px; font-weight: 500; }
.tabs a.on { background: var(--panel2); color: var(--text); text-decoration: none; }
.sp { flex: 1; }
.home { color: var(--muted); font-size: 13px; }

h2 { font-size: 15px; font-weight: 600; margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
h2 small { color: var(--muted); font-weight: 400; font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

button, .btn { background: var(--panel2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 13px;
  font: inherit; font-weight: 500; cursor: pointer; transition: border-color .12s, background .12s; }
button:hover, .btn:hover { border-color: #3a3f4b; text-decoration: none; }
button:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--cyan); border-color: var(--cyan); color: #0a0c12; }
button.danger { color: var(--bad); }
button.ghost { background: transparent; }
button.small { padding: 3px 9px; font-size: 12px; border-radius: 7px; }
button:disabled { opacity: .5; cursor: default; }
input, select { background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font: inherit; }
input[type=number] { width: 70px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 1px; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid var(--border); }
.flash.ok { border-color: #1f6b50; background: rgba(52, 211, 153, .08); }
.flash.err { border-color: #7a2f2f; background: rgba(248, 113, 113, .08); }

.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; }
.stat b { display: block; font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 12.5px; }
.stat.good b { color: var(--good); } .stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; border: 1px solid transparent; }
.pill.KEEP, .pill.connected { color: var(--good); background: rgba(52, 211, 153, .12); border-color: rgba(52, 211, 153, .3); }
.pill.WATCH, .pill.reconnect_soon { color: var(--warn); background: rgba(251, 191, 36, .12); border-color: rgba(251, 191, 36, .3); }
.pill.DROP, .pill.reconnect, .pill.disconnected { color: var(--bad); background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .3); }
.pill.NODATA, .pill.none { color: var(--muted); background: rgba(139, 147, 163, .1); border-color: var(--border); }
.plat { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.plat.instagram { background: var(--ig); } .plat.facebook { background: var(--fb); }

.login { padding: 14px 16px; margin-bottom: 10px; }
.login .head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.login .head b { font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--bg2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 12px; }
.chip.hidden { opacity: .5; border-style: dashed; }
.chip .fol { color: var(--muted); font-size: 12px; }
.chip button { padding: 1px 9px; font-size: 12px; border-radius: 999px; }
.warnline { color: var(--warn); font-size: 12.5px; margin-top: 8px; }
.errline { color: var(--bad); font-size: 12.5px; margin-top: 8px; }

.menu { display: inline-block; }
/* + Connect an account: a centred modal like Lens */
.menu.open { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 4, 7, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.menu.open > #plus { display: none; }
.menu .pop { display: none; position: relative; width: min(560px, 100%); background: var(--panel); border: 1px solid #2c3039;
  border-radius: 14px; padding: 26px 22px 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, .6); font-weight: 400; }
.menu.open .pop { display: block; }
.pop h3 { font-size: 21px; font-weight: 600; margin: 4px 0 8px; }
.pop > p { margin: 0 0 18px; font-size: 13.5px; }
.pop .x { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.pop .x:hover { color: var(--text); background: var(--panel2); }
.pop a, .pop button.opt { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 14px 16px; margin-top: 10px;
  border-radius: 10px; color: var(--text); background: var(--bg2); border: 1px solid var(--border); font: inherit; cursor: pointer; }
.pop a:hover, .pop button.opt:hover { border-color: #4b8f6c; background: #10201a; text-decoration: none; }
.pop a.off { opacity: .5; cursor: not-allowed; pointer-events: none; }
.pop b { font-size: 15px; font-weight: 600; }
.pop small { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.ic { flex: none; width: 18px; height: 18px; margin-top: 2px; border-radius: 6px; }
.ic.ig { background: radial-gradient(circle at 30% 110%, #fdcb52 0 25%, #fd5949 45%, #d6249f 65%, #285aeb 95%); }
.ic.fb { background: var(--fb); border-radius: 50%; }
.ic.va { background: var(--good); border-radius: 50%; }

.setup ol { margin: 8px 0 0 20px; } .setup li { margin: 4px 0; }
code, .code { background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font: 12px ui-monospace, Menlo, monospace; word-break: break-all; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: var(--bg1); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--panel); }
tbody tr.sel { background: var(--panel2); }
td.wrapc { white-space: normal; min-width: 220px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--bg1); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.reasons { margin: 6px 0 0 18px; padding: 0; color: var(--muted); font-size: 13px; white-space: normal; }
.reasons li.bad { color: var(--bad); } .reasons li.warn { color: var(--warn); } .reasons li.good { color: var(--good); }

.range { display: inline-flex; background: var(--panel); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.range button { border: 0; background: none; padding: 5px 13px; border-radius: 7px; color: var(--muted); }
.range button.on { background: var(--panel2); color: var(--text); }
.rule { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 14px; }
.rule label { color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }

.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .grid2, .grid3, .stats3 { grid-template-columns: 1fr; } }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.bars .b { display: grid; grid-template-columns: 100px 1fr 46px; gap: 8px; align-items: center; margin: 5px 0; font-size: 12.5px; }
.bars .b i { display: block; height: 8px; border-radius: 4px; background: var(--cyan); }
.bars .b .t { background: var(--bg2); border-radius: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--muted); }
.flag { color: var(--bad); font-weight: 600; font-size: 12px; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; margin-left: 6px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.drop { border: 1.5px dashed #343845; border-radius: 12px; padding: 14px; }
.drop.over { border-color: var(--cyan); background: rgba(109, 140, 255, .06); }
.linkbox { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkbox input { flex: 1; min-width: 260px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* framed inside the dashboard panel: no page chrome */
html.embed .wrap { padding-top: 14px; }
/* connect links: platform toggle (Instagram | Facebook) */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; padding: 2px; background: var(--panel2); }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--cyan); }
.seg button:not(.on) { color: var(--muted); }
td.nowrap { white-space: nowrap; }

.chip a.acct { color: inherit; text-decoration: none; }
.chip a.acct:hover { text-decoration: underline; }

/* ================= Statistics (2026-10-04 redesign): Averages table + Videos grid, Radar island look ================= */
/* copied from static/index.html Radar (.rtabs/.rtab, .cal/.fw-opt pickers, .racct-table, .vtile cards) */
.st-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.st-bar .sp { flex: 1; }
.st-upd { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rtabs { display: inline-flex; gap: 4px; background: #0b1220; border: 1px solid var(--border); border-radius: 999px; padding: 4px; flex-wrap: wrap; }
.rtab { background: none; border: none; color: var(--muted); border-radius: 999px; padding: 7px 16px; font-size: 12px; font-weight: 700;
        letter-spacing: .04em; cursor: pointer; transition: all .18s ease; }
.rtab:hover { color: var(--text); border: none; }
.rtab.on { background: #14283a; color: #cfe3ff; }
.rtabs.big .rtab { padding: 8px 20px; font-size: 13px; }
.rbtn { background: rgba(74,214,192,.08); color: #4ad6c0; border: 1px solid #235c56; border-radius: 999px; padding: 7px 15px;
        font-size: 11.5px; font-weight: 800; cursor: pointer; white-space: nowrap; transition: all .18s ease; }
.rbtn:hover { border-color: #4ad6c0; box-shadow: 0 0 18px rgba(74,214,192,.2); }
.rbtn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.cal { position: relative; display: inline-block; }
.cal-btn { display: flex; align-items: center; gap: 9px; background: #0a1222; color: var(--text); border: 1px solid var(--border);
           border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.cal-btn:hover { border-color: #6ea8ff; }
.cal-pop { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; background: #070d1a; border: 1px solid var(--border);
           border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.7); width: 230px; padding: 8px; max-height: 360px; overflow-y: auto; }
.cal-pop.hidden { display: none; }
.cal-pop.right { left: auto; right: 0; }
.fw-caret { color: var(--muted); font-size: 10px; }
.fw-opt { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); border-radius: 9px;
          padding: 8px 11px; cursor: pointer; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.fw-opt:last-child { margin-bottom: 0; }
.fw-opt small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.fw-opt:hover { background: #16233f; border: 0; }
.fw-opt.on { background: var(--cyan); color: #04101f; }
.fw-opt.on small { color: rgba(4,16,31,.72); }
.fw-opt.sep { border-bottom: 1px solid var(--border); border-radius: 9px 9px 0 0; }

/* summary cards */
.st-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 8px; }
.st-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.st-card .l { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.st-card .v { font-size: 27px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-card .v.name { font-size: 18px; line-height: 1.6; }
.st-card .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.chg { font-weight: 700; }
.chg.up { color: var(--good); } .chg.down { color: var(--bad); }
.st-note { color: var(--muted); font-size: 12px; margin: 8px 0 14px; }
.st-note b { color: var(--text); font-weight: 600; }

/* Averages table (Radar accounts table) */
.racct-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--bg1); }
.racct-table { width: 100%; border-collapse: collapse; }
.racct-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
                  padding: 10px 14px; cursor: pointer; user-select: none; white-space: nowrap; position: static; background: none; border: 0; }
.racct-table th:hover { color: var(--text); }
.racct-table th.num { text-align: right; }
.racct-table th.nos { cursor: default; }
.racct-table th .arrow { color: var(--cyan); margin-left: 3px; }
.racct-table td { padding: 10px 14px; border-top: 1px solid var(--border); border-bottom: 0; font-size: 13px; vertical-align: middle; white-space: nowrap; }
.racct-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.racct-table tbody tr.arow { cursor: pointer; }
.racct-table tbody tr.arow:hover td { background: #0c1730; }
.racct-table tr.total td { background: #0b0f17; font-weight: 700; }
.racct-table tr.total td .sub { font-weight: 500; }
.racct-who { display: flex; align-items: center; gap: 10px; min-width: 290px; }
.racct-who .nm { font-weight: 650; white-space: nowrap; }
.racct-who .why { color: var(--muted); font-size: 11.5px; white-space: normal; line-height: 1.35; margin-top: 1px; max-width: 360px; }
.racct-avatar-fallback { width: 34px; height: 34px; border-radius: 999px; flex-shrink: 0; background: #2b3a55; color: #cfd6e4;
                         display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.racct-avatar-fallback.all { background: #14283a; color: #cfe3ff; font-size: 15px; }
.racct-gain { color: #4ad6c0; } .racct-loss { color: #f0576a; }
.racct-table td .sub { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.vplat { display: inline-block; font-size: 9.5px; font-weight: 900; letter-spacing: .03em; padding: 2px 6px; border-radius: 6px;
         border: 1px solid rgba(255,255,255,.14); background: rgba(8,10,16,.85); }
.vplat.fb { color: #6ea8ff; } .vplat.ig { color: #e05fc0; }
a.open { color: var(--cyan); font-size: 12px; font-weight: 700; white-space: nowrap; }
.spark { display: inline-block; vertical-align: middle; margin-right: 8px; }

/* Videos grid (Radar video cards) */
.vidgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.vtile { position: relative; background: linear-gradient(180deg, #101c33, #0a1120); border: 1px solid var(--border); border-radius: 16px;
         overflow: hidden; cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.vtile:hover { border-color: #4ad6c0; transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.45); }
.vtile .vimg { position: relative; display: block; width: 100%; aspect-ratio: 9/16; background: #0a0c10; overflow: hidden; }
.vtile .vimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vtile .vnothumb { display: flex; align-items: center; justify-content: center; height: 100%; color: #4a5672; font-size: 12px;
                   text-align: center; padding: 0 16px; line-height: 1.45; }
.vtile .vrank { position: absolute; top: 10px; left: 10px; z-index: 3; background: rgba(8,10,16,.85); backdrop-filter: blur(6px);
                border: 1px solid rgba(255,255,255,.14); border-radius: 9px; padding: 4px 9px; box-shadow: 0 6px 16px rgba(0,0,0,.45); }
.vtile .vrank b { font-size: 14px; font-weight: 900; line-height: 1.2; }
.vtile .vplatform { position: absolute; top: 10px; right: 46px; z-index: 3; font-size: 10px; font-weight: 900; letter-spacing: .03em;
                    padding: 4px 7px; border-radius: 7px; background: rgba(8,10,16,.85); border: 1px solid rgba(255,255,255,.14); }
.vtile .vplatform.ig { color: #e05fc0; } .vtile .vplatform.fb { color: #6ea8ff; }
.vtile .vopen { position: absolute; top: 9px; right: 10px; background: rgba(4,10,22,.72); border: 1px solid rgba(255,255,255,.16);
                border-radius: 9px; padding: 4px 9px; font-size: 12px; color: var(--text); z-index: 3; text-decoration: none; }
.vtile .vopen:hover { border-color: #4ad6c0; text-decoration: none; }
.vtile .vlen { position: absolute; bottom: 9px; right: 10px; z-index: 3; background: rgba(8,10,16,.85); border-radius: 7px;
               padding: 2px 7px; font-size: 11px; font-weight: 700; }
.vtile .vstatrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 13px 0; font-size: 12.5px; font-weight: 700; color: #fff; }
.vtile .vstatrow span { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.vtile .vstatrow svg { opacity: .75; }
.vtile .vstatrow .hl { color: #4ad6c0; }
.vtile .vnums { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 13px 0; font-size: 11.5px; }
.vtile .vnums span:nth-child(odd) { color: #7f889a; }
.vtile .vnums span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; color: #dfe4ee; font-weight: 600; }
.vtile .vfoot { padding: 9px 13px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vtile .vacct { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vtile .vout { font-size: 11px; color: #6b7385; white-space: nowrap; }
.vtile .vdesc { padding: 5px 13px 13px; font-size: 12px; line-height: 1.45; color: #a8b0c0; min-height: 34px;
                display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vtile .vdesc .dim { color: #545c6c; }
.more { display: flex; justify-content: center; margin: 22px 0 6px; }

/* drill-down + modal */
.dr-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.dr-head h2 { margin: 0; font-size: 19px; }
.dr-why { color: var(--muted); font-size: 13.5px; margin: 2px 0 14px; }
.dr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 980px) { .dr-grid { grid-template-columns: 1fr; } }
.box { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; min-width: 0; }
.box h3 { font-size: 13px; font-weight: 700; margin: 0 0 10px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.box h3 small { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.chart text { fill: var(--muted); font-size: 11px; }
.vrow { display: grid; grid-template-columns: 54px minmax(0, 1fr) 150px; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); cursor: pointer; }
.vrow:first-of-type { border-top: 0; }
.vrow:hover .t { color: var(--cyan); }
.vrow .th { width: 54px; height: 96px; border-radius: 8px; background: #0a0c10 center/cover no-repeat; border: 1px solid var(--border); }
.vrow .t { font-size: 12.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vrow .t.dim { color: var(--muted); font-weight: 500; }
.vrow .n { font-size: 12px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.vrow .n b { color: var(--text); }
.ww { margin: 0; padding: 0 0 0 18px; font-size: 13.5px; line-height: 1.5; }
.ww li { margin: 4px 0; }
details.rules { margin-top: 30px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
details.rules > summary { cursor: pointer; padding: 11px 16px; color: var(--muted); font-size: 13px; font-weight: 600; list-style: none; }
details.rules > summary::-webkit-details-marker { display: none; }
details.rules > summary::before { content: "▸ "; }
details.rules[open] > summary::before { content: "▾ "; }
details.rules .in { padding: 0 16px 14px; }
.modal { position: fixed; inset: 0; z-index: 200; background: rgba(2,6,14,.78); display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal.hidden { display: none; }
.modal .mbox { width: min(900px, 100%); max-height: calc(100vh - 44px); overflow-y: auto; background: #0b0f17; border: 1px solid var(--border);
               border-radius: 16px; padding: 18px 20px; position: relative; }
.modal .x { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }
.mgrid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; }
@media (max-width: 760px) { .mgrid { grid-template-columns: 1fr; } }
.mgrid .cover { width: 100%; aspect-ratio: 9/16; border-radius: 12px; background: #0a0c10 center/cover no-repeat; border: 1px solid var(--border); }
.kv2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.kv2 div { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.kv2 span { display: block; color: var(--muted); font-size: 11px; }
.kv2 b { font-size: 15px; font-variant-numeric: tabular-nums; }
.st-cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (max-width: 900px) { .st-card .v { font-size: 23px; } .st-card { padding: 12px 13px; } }
/* narrow panel: keep the account column visible while the numbers scroll */
.racct-table td:first-child, .racct-table th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg1); }
.racct-table tr.total td:first-child { background: #0b0f17; }
.racct-table tbody tr.arow:hover td:first-child { background: #0c1730; }

/* wide tables: an always-visible scrollbar at the bottom (macOS hides overlay scrollbars) + drag to scroll */
.racct-wrap, .tablewrap { scrollbar-width: auto; scrollbar-color: #4a5060 #12151c; cursor: grab; }
.racct-wrap.dragging, .tablewrap.dragging { cursor: grabbing; user-select: none; }
.racct-wrap::-webkit-scrollbar, .tablewrap::-webkit-scrollbar { height: 12px; }
.racct-wrap::-webkit-scrollbar-track, .tablewrap::-webkit-scrollbar-track { background: #12151c; border-radius: 0 0 14px 14px; }
.racct-wrap::-webkit-scrollbar-thumb, .tablewrap::-webkit-scrollbar-thumb { background: #4a5060; border-radius: 8px; border: 3px solid #12151c; }
.racct-wrap::-webkit-scrollbar-thumb:hover, .tablewrap::-webkit-scrollbar-thumb:hover { background: #6b7385; }

/* Copy-for-Claude packs, scripts, LAN (read-only) mode — 2026-10-04 */
.packbar { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rbtn.ghost { background: transparent; color: var(--muted); border-color: var(--border); text-decoration: none; }
.rbtn.ghost:hover { color: var(--text); border-color: #4ad6c0; text-decoration: none; }
a.rbtn { display: inline-block; }
.script { max-height: 320px; overflow-y: auto; font-size: 13px; line-height: 1.5; }
.script .sl { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; padding: 2px 0; }
.script .sl .t { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }
textarea.packtext { width: 100%; height: 55vh; background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
                    padding: 10px; font: 12px/1.45 ui-monospace, Menlo, monospace; }
.maconly { font-size: 11.5px; border: 1px dashed var(--border); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }

/* A/B tests (insights_ab.py) — 2026-10-04 */
.ab-intro { color: var(--muted); font-size: 12.5px; }
.abgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.abcard { background: linear-gradient(180deg, #101c33, #0a1120); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; cursor: pointer;
          transition: border-color .15s, transform .15s; min-width: 0; }
.abcard:hover { border-color: #4ad6c0; transform: translateY(-2px); }
.abc-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.abc-top b { font-size: 14.5px; line-height: 1.3; }
.abc-q { color: var(--muted); font-size: 11.5px; margin: 3px 0 10px; }
.abc-v { font-size: 12.5px; line-height: 1.45; margin-top: 10px; }
.abc-v.dim { color: var(--muted); }
.abc-foot { color: #6b7385; font-size: 11px; margin-top: 8px; }
.pill.abopen { color: #6ea8ff; background: rgba(110,168,255,.1); border-color: rgba(110,168,255,.3); white-space: nowrap; }
.pill.abdec { color: var(--good); background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.3); white-space: nowrap; }
.pill.abarch { color: var(--muted); background: rgba(139,147,163,.1); border-color: var(--border); }
.abbars .abb { display: grid; grid-template-columns: 14px minmax(0, 110px) minmax(0, 1fr) 48px; gap: 8px; align-items: center; margin: 5px 0; font-size: 12px; }
.abbars.big .abb { grid-template-columns: 16px minmax(0, 220px) minmax(0, 1fr) 70px; font-size: 13px; margin: 7px 0; }
.abb .s { font-weight: 900; color: #cfe3ff; }
.abb .l { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.abb .t { position: relative; height: 10px; background: #0b1220; border-radius: 5px; }
.abb .t .mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: #3a4150; }
.abb .t .f { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: #4a5060; }
.abb .t .f.g { background: #34d399; } .abb .t .f.b { background: #f0576a; }
.abb .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.abb.lead .s, .abb.lead .l { color: var(--good); }
.abverdict { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid #4a5060; border-radius: 12px; padding: 12px 16px; margin: 4px 0 14px; }
.abverdict.sure { border-left-color: var(--good); } .abverdict.open { border-left-color: #6ea8ff; }
.abverdict p { margin: 8px 0 0; font-size: 14px; font-weight: 600; line-height: 1.45; }
.abverdict.few p { color: var(--muted); font-weight: 500; }
.racct-table.abt td { white-space: nowrap; }
.abtile { position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 11px; padding: 9px 0; border-top: 1px solid var(--border); cursor: pointer; }
.abtile:first-of-type { border-top: 0; }
.abtile.young { opacity: .6; }
.abtile .th { position: relative; width: 54px; height: 96px; border-radius: 8px; background: #0a0c10 center/cover no-repeat; border: 1px solid var(--border); }
.abtile .th .vlen { position: absolute; bottom: 3px; right: 3px; background: rgba(8,10,16,.85); border-radius: 5px; padding: 0 4px; font-size: 10px; font-weight: 700; }
.abtile .who { font-size: 11.5px; color: var(--muted); }
.abtile .hk { font-size: 12.5px; font-weight: 600; line-height: 1.35; margin: 3px 26px 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.abtile:hover .hk { color: var(--cyan); }
.abtile .nm { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #dfe4ee; font-variant-numeric: tabular-nums; }
.abtile .nm svg { opacity: .7; }
.abtile .yt { font-size: 11px; color: var(--warn); margin-top: 3px; }
.abtile .abx { position: absolute; top: 8px; right: 0; padding: 0 7px; font-size: 15px; line-height: 1.4; border-radius: 7px; background: none; color: var(--muted); }
.abtile .abx:hover { color: var(--bad); }
.abnotes { width: 100%; min-height: 64px; background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13px; }
.rbtn.danger { color: var(--bad); }
.rbtn.danger:hover { border-color: var(--bad); box-shadow: none; }
.sgl { margin-top: 10px; max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.sgr { display: grid; grid-template-columns: 18px 22px minmax(0, 230px) minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 10px; border-top: 1px solid var(--border); font-size: 12px; cursor: pointer; }
.sgr:first-child { border-top: 0; }
.sgr .who { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sgr .hk { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv { font-weight: 900; text-align: center; border-radius: 6px; padding: 1px 0; }
.sv.A { color: #6ea8ff; background: rgba(110,168,255,.12); } .sv.B { color: #e0a85f; background: rgba(224,168,95,.12); }
.abform label { display: block; color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.abform input, .abform select, .abform textarea { display: block; width: 100%; margin-top: 4px; background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font: inherit; }
.abform .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .mbox.abform { width: min(520px, 100%); }
.vtile .vab { position: absolute; bottom: 9px; left: 10px; z-index: 4; background: rgba(8,10,16,.85); border: 1px solid rgba(255,255,255,.16); border-radius: 7px;
              padding: 2px 8px; font-size: 11px; font-weight: 800; color: #cfd6e4; letter-spacing: .03em; }
.vtile .vab:hover { border-color: #4ad6c0; }
.vtile .vab.in { color: #04101f; background: #4ad6c0; border-color: #4ad6c0; }
.vtile .vab:disabled { opacity: 1; cursor: default; }
.abpop { position: fixed; z-index: 300; width: 300px; background: #070d1a; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.7); padding: 10px; }
.abpop .h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 2px 6px; }
.abpop .r { padding: 6px 2px; border-top: 1px solid var(--border); }
.abpop .r:first-of-type { border-top: 0; }
.abpop .n { font-size: 13px; font-weight: 650; margin-bottom: 5px; }
.abpop .b { display: flex; gap: 6px; flex-wrap: wrap; }
.abpop .b button { padding: 3px 9px; font-size: 11.5px; border-radius: 999px; }
.abpop .b button.on { background: #4ad6c0; color: #04101f; border-color: #4ad6c0; }
.abpop .b button.rm { color: var(--muted); background: none; }
@media (max-width: 640px) { .abform .two { grid-template-columns: 1fr; } .sgr { grid-template-columns: 18px 22px minmax(0, 1fr); } .sgr .hk { grid-column: 3; } }
.abside { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.abside .box { max-height: 560px; overflow-y: auto; }
.abtile { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 7px 0; }
.abtile .th { width: 40px; height: 71px; border-radius: 7px; }
.abtile .hk { font-size: 12px; }

/* Public read-only Insights site. insights_publish.py ships style.css = static/insights.css + this file. */
.pub-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 4px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.pub-head h1 { font-size: 20px; font-weight: 650; }
.pub-head .ro { color: var(--muted); font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.mkv { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 12px; }
.mkv div { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.mkv span { display: block; color: var(--muted); font-size: 11px; }
.mkv b { font-size: 15px; font-variant-numeric: tabular-nums; }
.mkv i { display: block; font-style: normal; color: #7f889a; font-size: 11px; line-height: 1.35; margin-top: 3px; }
.racct-table tbody tr.arow td { cursor: pointer; }
@media (max-width: 640px) { .wrap { padding: 12px 16px 60px; } .vidgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
@media (max-width: 760px) { .mgrid .cover { width: 140px; } .modal { padding: 10px; } }

