/* ============================================================
   AFRIBN — Africa's Strategic News Intelligence Network
   Shared design system
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800;900&family=Hanken+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
  /* canvas */
  --bg:        #08080A;
  --bg-2:      #0B0B0E;
  --panel:     #111114;
  --panel-2:   #15151A;
  --panel-3:   #1B1B21;
  --line:      rgba(255,255,255,0.07);
  --line-2:    rgba(255,255,255,0.11);

  /* brand red */
  --red:       #E8252D;
  --red-bright:#FF3B3B;
  --red-deep:  #B71419;
  --red-tint:  rgba(232,37,45,0.12);
  --red-tint-2:rgba(232,37,45,0.20);

  /* text */
  --ink:       #F4F4F6;
  --ink-2:     #B6B6BE;
  --ink-3:     #85858E;
  --ink-4:     #5C5C64;

  /* risk / status */
  --green:     #3FB950;
  --amber:     #E3B341;
  --orange:    #FF6B35;
  --crit:      #E5252A;
  --blue:      #4493F8;
  --purple:    #A371F7;

  /* radii / shadow */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --shadow: 0 18px 50px -20px rgba(0,0,0,0.8);

  --sidebar-w: 320px;
  --topbar-h: 92px;

  --font-display: 'Archivo', system-ui, sans-serif;
  --font-sans: 'Hanken Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.afribn-readable {
  zoom: 1.12;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,h5 { font-family: var(--font-display); margin: 0; line-height: 1.05; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: var(--red); color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #25252b; border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #34343c; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---- sidebar ---- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 26px 16px 20px;
  z-index: 40;
}
.sidebar .brand { padding: 0 0 34px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 15px;
  min-height: 54px;
  padding: 14px 15px;
  border-radius: var(--r);
  color: var(--ink-2);
  font-weight: 750; font-size: 17px;
  border: 1px solid transparent;
  position: relative;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 22px; height: 22px; flex: none; }
.nav-item span { white-space: nowrap; }
.nav-item:hover { background: var(--panel); color: var(--ink); }
.nav-item.active {
  background: linear-gradient(180deg, rgba(232,37,45,0.20), rgba(232,37,45,0.10));
  color: #fff;
  border-color: rgba(232,37,45,0.45);
  box-shadow: 0 8px 24px -10px rgba(232,37,45,0.55), inset 0 1px 0 rgba(255,255,255,0.05);
}
.nav-item.active svg { color: var(--red-bright); }
.nav-badge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: 11px; font-weight: 700;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 20px; display: grid; place-items: center;
}
.nav-spacer { flex: 1; }
.nav-sep { height: 1px; background: var(--line); margin: 14px 8px; }

/* ---- main ---- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 22px;
  padding: 0 34px;
  background: rgba(8,8,10,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.search {
  flex: 1; max-width: 560px;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 0 16px; height: 52px;
  color: var(--ink-3);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: rgba(232,37,45,0.5); box-shadow: 0 0 0 3px var(--red-tint); }
.search svg { width: 19px; height: 19px; flex: none; }
.search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--ink); font-family: inherit; font-size: 15px;
}
.search input::placeholder { color: var(--ink-3); }
.kbd {
  font-size: 12px; color: var(--ink-3);
  border: 1px solid var(--line-2); border-radius: 6px;
  padding: 2px 8px; background: var(--bg-2);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  position: relative;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 11px; background: var(--panel); border: 1px solid var(--line);
  color: var(--ink-2); transition: .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }
.icon-btn svg { width: 19px; height: 19px; }
.readability-btn span {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}
.readability-btn.active {
  color: var(--red-bright);
  background: var(--red-tint);
  border-color: rgba(232,37,45,0.5);
  box-shadow: 0 0 0 3px rgba(232,37,45,0.08);
}
.dot {
  position: absolute; top: 9px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); border: 2px solid var(--bg);
}
.badge-count {
  position: absolute; top: 4px; right: 4px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 20px; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.avatar {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px; border-radius: 40px;
  border: 1px solid var(--line); background: var(--panel);
  margin-left: 6px;
}
.avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar svg { width: 16px; height: 16px; color: var(--ink-3); }

.content { padding: 32px 34px 56px; max-width: 1640px; width: 100%; margin: 0 auto; }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}
.panel-pad-lg { padding: 26px; }
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow.red { color: var(--red-bright); }
.muted { color: var(--ink-3); }
.muted-2 { color: var(--ink-2); }
.tabnum { font-variant-numeric: tabular-nums; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 20px; border-radius: 12px;
  font-weight: 600; font-size: 15px; border: 1px solid transparent;
  transition: .16s; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 10px 26px -10px rgba(232,37,45,0.7); }
.btn-primary:hover { background: #ff2f37; transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(232,37,45,0.8); }
.btn-ghost { background: var(--panel); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--ink-4); }
.btn-sm { height: 40px; padding: 0 15px; font-size: 14px; }

/* pills / tags */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 7px; text-transform: uppercase;
  background: var(--panel-3); color: var(--ink-2); white-space: nowrap;
}
.pill.politics  { background: rgba(229,72,77,0.16);  color: #ff7378; }
.pill.economy   { background: rgba(63,185,80,0.15);  color: #5ed46e; }
.pill.energy    { background: rgba(240,136,62,0.16); color: #ffa05a; }
.pill.security  { background: rgba(163,113,247,0.16);color: #bd9bff; }
.pill.trade     { background: rgba(68,147,248,0.16); color: #6fb0ff; }
.pill.finance   { background: rgba(227,179,65,0.16); color: #f0cd6b; }
.pill.industry  { background: rgba(139,148,158,0.18);color: #b9c0c8; }
.pill.tech      { background: rgba(68,147,248,0.16); color: #6fb0ff; }
.pill.high-impact { background: var(--red); color: #fff; }
.pill.region    { background: rgba(255,255,255,0.08); color: var(--ink-2); }

/* risk text */
.risk-low  { color: var(--green) !important; }
.risk-med  { color: var(--amber) !important; }
.risk-high { color: var(--orange) !important; }
.risk-crit { color: var(--crit) !important; }
.up   { color: var(--green); }
.down { color: var(--red-bright); }

/* signal score */
.signal { font-family: var(--font-display); font-weight: 800; }

/* divider */
.hr { height: 1px; background: var(--line); border: none; margin: 0; }

/* logo wordmark */
.logo { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.logo-img { width: auto; display: block; }
.logo .mark { width: 42px; height: auto; flex: none; }
.logo .wm { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.01em; line-height: 1; }
.logo .wm b { color: var(--red); font-weight: 800; }
.logo .sub { display: block; font-family: var(--font-sans); font-weight: 700; font-size: 9px; letter-spacing: 0.22em; color: var(--ink-3); margin-top: 3px; }

/* utility layout */
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; }

/* page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-title { font-size: 32px; font-weight: 800; letter-spacing: -0.025em; display: flex; align-items: center; gap: 14px; }
.page-title .tic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--red-tint); color: var(--red-bright); }
.page-title .tic svg { width: 22px; height: 22px; }
.page-sub { color: var(--ink-3); margin-top: 8px; font-size: 15px; }

/* stat card */
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.stat .top { display: flex; align-items: center; gap: 12px; }
.stat .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat .ic svg { width: 22px; height: 22px; }
.stat .lbl { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.stat .num { font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -0.02em; }
.stat .delta { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; }

/* category dot */
.cdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

/* filter select */
.select, .input {
  height: 46px; border-radius: 11px; background: var(--panel);
  border: 1px solid var(--line-2); color: var(--ink);
  padding: 0 14px; font-family: inherit; font-size: 14px; outline: none;
}
.select { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2385858e' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
.select:hover, .input:focus { border-color: var(--ink-4); }
.input:focus { border-color: rgba(232,37,45,0.5); box-shadow: 0 0 0 3px var(--red-tint); }
.input::placeholder { color: var(--ink-3); }
.search-inline { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 11px; padding: 0 14px; height: 46px; color: var(--ink-3); }
.search-inline input { background: none; border: none; outline: none; color: var(--ink); font-family: inherit; font-size: 14px; flex: 1; }
.search-inline svg { width: 17px; height: 17px; }

/* table */
.tbl-scroll { overflow-x: auto; max-width: 100%; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-weight: 500; font-size: 13px; color: var(--ink-3);
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 16px 14px; border-bottom: 1px solid var(--line); font-size: 14.5px; vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.022); }
.tbl tbody tr:last-child td { border-bottom: none; }

/* flag chip */
.flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,0.12); }

/* mini progress bar */
.bar { height: 6px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 6px; }

/* star rating */
.stars { display: inline-flex; gap: 3px; }
.stars svg { width: 17px; height: 17px; }
.stars .on { color: var(--red); fill: var(--red); }
.stars .off { color: #3a3a40; fill: #3a3a40; }

/* tabs */
.tabs { display: flex; gap: 30px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tab {
  padding: 0 2px 16px; color: var(--ink-3); font-weight: 600; font-size: 15px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: #fff; border-bottom-color: var(--red); }

/* fade-in */
@media (prefers-reduced-motion: no-preference) {
  .fade { opacity: 0; transform: translateY(10px); animation: fade .5s ease forwards; }
  @keyframes fade { to { opacity: 1; transform: none; } }
}

/* responsive */
.menu-btn { display: none; }
@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 20px 0 60px -20px rgba(0,0,0,0.85); }
  .app.nav-open .sidebar { transform: none; }
  .menu-btn { display: grid !important; }
  .content { padding: 22px; }
}

/* ============================================================
   SHELL EXTRAS — grouped nav, role switcher, drawer
   ============================================================ */
.nav-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 0 6px; }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-group { font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-4); padding: 16px 12px 7px; }

.avatar { position: relative; cursor: pointer; }
.av-meta { display: flex; flex-direction: column; line-height: 1.18; }
.av-name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.av-role { font-size: 11px; color: var(--red-bright); font-weight: 600; }
.av-menu { position: absolute; top: calc(100% + 12px); right: 0; min-width: 232px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 8px; box-shadow: var(--shadow); z-index: 60; display: none; }
.avatar.open .av-menu { display: block; }
.av-head { font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 8px 10px 6px; }
.av-opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none; color: var(--ink-2); font-size: 13.5px; font-weight: 500; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.av-opt:hover { background: var(--panel-3); color: #fff; }
.av-opt.on { color: #fff; }
.av-opt svg:last-child { margin-left: auto; color: var(--red-bright); }
.av-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* global toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--panel-2); border: 1px solid var(--line-2); padding: 12px 20px; border-radius: 12px; font-size: 14px; font-weight: 500; opacity: 0; transition: .25s; z-index: 200; box-shadow: var(--shadow); pointer-events: none; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* status pill */
.spill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 4px 11px; border-radius: 7px; white-space: nowrap; }
.spill-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* ============================================================
   PRODUCTION COMPONENTS
   ============================================================ */
/* metric/stat card variants reuse .stat */
.kpi-row { display: grid; gap: 16px; margin-bottom: 22px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,0.62); backdrop-filter: blur(3px); z-index: 150; display: none; align-items: center; justify-content: center; padding: 24px; }
.modal-back.open { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.modal-h h3 { font-size: 20px; font-weight: 700; }
.modal-b { padding: 22px 24px; }
.modal-f { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); }

/* drawer */
.drawer-back { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 150; display: none; }
.drawer-back.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 500px; max-width: 94vw; background: var(--panel); border-left: 1px solid var(--line-2); z-index: 151; transform: translateX(100%); transition: transform .26s ease; overflow-y: auto; box-shadow: -24px 0 70px -24px rgba(0,0,0,0.85); }
.drawer.open { transform: none; }
.drawer-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.drawer-b { padding: 22px 24px; }

/* form fields */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 13px; color: var(--ink); font-family: inherit; font-size: 14px; outline: none; }
.field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(232,37,45,0.5); box-shadow: 0 0 0 3px var(--red-tint); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-4); }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2385858e' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content:''; position:absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -26px; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--red); }
.tl-dot.done { border-color: var(--green); background: var(--green); }
.tl-dot.muted { border-color: var(--ink-4); background: var(--panel-2); }
.tl-t { font-weight: 600; font-size: 14.5px; }
.tl-m { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.45; }

/* score factor rows */
.factor { display: grid; grid-template-columns: 1fr 130px 46px; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.factor:last-child { border-bottom: none; }
.factor .fn { font-size: 14px; font-weight: 500; }
.factor .fn small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; font-weight: 400; }
.factor .ftrack { height: 6px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.factor .ftrack > span { display: block; height: 100%; border-radius: 6px; background: var(--red); }
.factor .fv { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range].rng { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: var(--panel-3); outline: none; }
input[type=range].rng::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--red); cursor: pointer; box-shadow: 0 0 0 3px rgba(232,37,45,0.25); }

/* reliability badge */
.rel-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }

/* dropzone */
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 30px 20px; text-align: center; color: var(--ink-3); cursor: pointer; transition: .15s; }
.dropzone:hover { border-color: rgba(232,37,45,0.5); background: var(--red-tint); color: var(--ink-2); }
.dropzone svg { width: 30px; height: 30px; margin-bottom: 10px; color: var(--ink-4); }

/* kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(264px, 1fr); gap: 16px; overflow-x: auto; padding-bottom: 6px; }
.kcol { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.kcol-h { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; font-weight: 700; font-size: 14px; }
.kcol-h .cnt { margin-left: auto; font-size: 12px; color: var(--ink-3); background: var(--panel-3); padding: 1px 9px; border-radius: 20px; }
.kcard { background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; padding: 14px; margin-bottom: 10px; cursor: pointer; transition: .14s; }
.kcard:hover { border-color: var(--line-2); transform: translateY(-1px); }

/* empty + skeleton */
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty svg { width: 38px; height: 38px; margin-bottom: 14px; color: var(--ink-4); }
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* segmented toggle */
.seg-toggle { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg-toggle button { border: none; background: none; color: var(--ink-3); padding: 7px 13px; border-radius: 7px; font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.seg-toggle button svg { width: 16px; height: 16px; }
.seg-toggle button.on { background: var(--red); color: #fff; }

/* generic detail rows */
.kv { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-3); white-space: nowrap; }
.kv .v { font-weight: 600; text-align: right; }

/* tab bar (reusable) */
.ptabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.ptab { padding: 0 2px 14px; color: var(--ink-3); font-weight: 600; font-size: 14.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; transition: color .15s; }
.ptab:hover { color: var(--ink-2); }
.ptab.active { color: #fff; border-bottom-color: var(--red); }
