/* ============================================================
   Oziq AI — Ministry of Finance, Uzbekistan
   Editorial dashboard aesthetic
   ============================================================ */

:root {
  /* warm paper base */
  --bg:           oklch(0.985 0.004 90);
  --bg-elev:     oklch(0.995 0.003 90);
  --bg-sunken:   oklch(0.965 0.005 90);
  --panel:       oklch(1 0 0);
  --ink:         oklch(0.20 0.012 250);
  --ink-2:       oklch(0.36 0.012 250);
  --ink-3:       oklch(0.52 0.010 250);
  --ink-4:       oklch(0.70 0.008 250);
  --ink-5:       oklch(0.85 0.005 250);
  --line:        oklch(0.91 0.006 250);
  --line-strong: oklch(0.84 0.008 250);

  --accent:      oklch(0.55 0.09 195);   /* Samarkand teal */
  --accent-soft: oklch(0.93 0.04 195);
  --accent-ink:  oklch(0.40 0.10 195);

  --jade:        oklch(0.62 0.10 155);
  --jade-soft:   oklch(0.93 0.05 155);
  --amber:       oklch(0.72 0.13 75);
  --amber-soft:  oklch(0.93 0.07 75);
  --rose:        oklch(0.58 0.14 25);
  --rose-soft:   oklch(0.93 0.05 25);
  --plum:        oklch(0.50 0.10 305);
  --plum-soft:   oklch(0.93 0.04 305);

  /* 12 topic colors — share chroma ~0.09, lightness ~0.62 */
  --t-onion:    oklch(0.68 0.10 305);
  --t-beef:     oklch(0.55 0.12 25);
  --t-rice:     oklch(0.78 0.09 90);
  --t-carrot:   oklch(0.68 0.14 55);
  --t-potato:   oklch(0.62 0.06 75);
  --t-logistic: oklch(0.52 0.09 245);
  --t-warehouse:oklch(0.45 0.04 250);
  --t-breeding: oklch(0.58 0.10 145);
  --t-flour:    oklch(0.84 0.05 85);
  --t-oil:      oklch(0.70 0.13 110);
  --t-poultry:  oklch(0.74 0.07 60);
  --t-sugar:    oklch(0.88 0.03 200);

  --radius: 6px;
  --radius-sm: 3px;
  --shadow-sm: 0 1px 0 oklch(0.85 0.006 250 / 0.6);
  --shadow-md: 0 1px 0 oklch(0.85 0.006 250 / 0.5), 0 6px 24px -12px oklch(0.20 0.012 250 / 0.18);

  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-serif: 'IBM Plex Serif', Georgia, serif;

  --sidebar-w: 232px;
  --topbar-h: 56px;
  --statusbar-h: 28px;
}

[data-theme="dark"] {
  --bg:          oklch(0.165 0.012 250);
  --bg-elev:     oklch(0.205 0.012 250);
  --bg-sunken:   oklch(0.135 0.012 250);
  --panel:       oklch(0.20 0.012 250);
  --ink:         oklch(0.96 0.005 90);
  --ink-2:       oklch(0.82 0.008 250);
  --ink-3:       oklch(0.66 0.010 250);
  --ink-4:       oklch(0.48 0.012 250);
  --ink-5:       oklch(0.32 0.012 250);
  --line:        oklch(0.28 0.012 250);
  --line-strong: oklch(0.35 0.012 250);

  --accent:      oklch(0.70 0.10 195);
  --accent-soft: oklch(0.30 0.06 195);
  --accent-ink:  oklch(0.82 0.10 195);

  --jade:        oklch(0.72 0.12 155);
  --jade-soft:   oklch(0.30 0.06 155);
  --amber:       oklch(0.80 0.14 75);
  --amber-soft:  oklch(0.32 0.08 75);
  --rose:        oklch(0.70 0.16 25);
  --rose-soft:   oklch(0.32 0.07 25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'ss02', 'cv11';
  font-variant-numeric: tabular-nums;
  /* Default scale — matches what user prefers at "150%" Safari zoom */
  zoom: 1.5;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

.mono { font-family: var(--font-mono); font-feature-settings: 'zero', 'ss01'; }
.serif { font-family: var(--font-serif); }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr var(--statusbar-h);
  grid-template-areas:
    "side top"
    "side main"
    "side status";
  height: 100vh;
  overflow: hidden;
}
.sidebar  { grid-area: side; }
.topbar   { grid-area: top; }
.main     { grid-area: main; overflow: auto; background: var(--bg); }
.statusbar{ grid-area: status; }

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  background: var(--bg-elev);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-brand {
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.sidebar-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'><g fill='none' stroke='%2300787c' stroke-width='0.6' opacity='0.18'><path d='M0 20 L10 10 L20 20 L30 10 L40 20'/><path d='M0 30 L10 20 L20 30 L30 20 L40 30'/></g></svg>");
  opacity: 0.5;
  pointer-events: none;
}
.brand-row { display: flex; align-items: center; gap: 10px; position: relative; }
.brand-mark {
  width: 28px; height: 28px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  display: grid; place-items: center;
  background: var(--panel);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.02em;
}
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.brand-sub { font-size: 10px; color: var(--ink-3); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 2px; position: relative; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.nav-section { padding: 12px 16px 4px; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 14px;
  font-size: 13px;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--bg-sunken); color: var(--ink); }
.nav-item.active {
  color: var(--ink);
  background: var(--bg-sunken);
  border-left-color: var(--accent);
  font-weight: 500;
}
.nav-item .nav-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  width: 16px;
}
.nav-item .nav-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--rose-soft);
  color: var(--rose);
  border-radius: 3px;
}
.nav-item .nav-sub {
  font-size: 10px;
  color: var(--ink-4);
  margin-left: 6px;
  font-family: var(--font-mono);
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 10px 16px;
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.dot-live { background: var(--jade); box-shadow: 0 0 0 3px oklch(0.62 0.10 155 / 0.2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px oklch(0.62 0.10 155 / 0); } }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  display: flex;
  align-items: stretch;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  gap: 16px;
}
.top-section { display: flex; align-items: center; gap: 12px; }
.top-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.top-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 3px;
  text-transform: uppercase;
}
.top-divider { width: 1px; background: var(--line); margin: 12px 0; }
.top-metric {
  display: flex; flex-direction: column; justify-content: center;
  font-family: var(--font-mono);
  line-height: 1.1;
}
.top-metric-k { font-size: 9.5px; color: var(--ink-4); letter-spacing: 0.06em; text-transform: uppercase; }
.top-metric-v { font-size: 13px; color: var(--ink); font-weight: 500; display: flex; align-items: baseline; gap: 4px; }
.delta-up { color: var(--jade); }
.delta-down { color: var(--rose); }

.top-search {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex; align-items: center;
}
.top-search input {
  width: 100%;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 10px 6px 32px;
  font-size: 12px;
  color: var(--ink);
}
.top-search input::placeholder { color: var(--ink-4); }
.top-search .search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ink-4);
}
.top-search .search-kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-4);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 1px 4px;
  background: var(--panel);
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.lang-switch button {
  background: transparent; border: 0; padding: 4px 8px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3);
}
.lang-switch button.on { background: var(--ink); color: var(--bg); }

.icon-btn {
  position: relative;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 4px;
  display: grid; place-items: center;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--ink); }
.icon-btn .bell-dot {
  position: absolute; top: 5px; right: 5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--rose);
}

.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elev);
}
.user-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--plum));
  color: white;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
}
.user-name { font-size: 12px; font-weight: 500; }
.user-role { font-size: 10px; color: var(--ink-3); }

/* ============================================================
   Status bar
   ============================================================ */
.statusbar {
  background: var(--ink);
  color: oklch(0.85 0.008 250);
  font-family: var(--font-mono);
  font-size: 10.5px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 18px;
  letter-spacing: 0.02em;
}
.status-cell { display: flex; align-items: center; gap: 6px; }
.status-cell .k { color: oklch(0.62 0.010 250); }
.status-cell .v { color: oklch(0.92 0.005 90); }
.status-cell .sparkline { height: 12px; }
.status-spacer { flex: 1; }

/* ============================================================
   Main content & panels
   ============================================================ */
.page {
  padding: 18px 20px 28px;
  max-width: 1600px;
}
.page.fade-in {
  animation: fadeIn 240ms ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.page-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-title .ru {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 400;
  margin-left: 10px;
  letter-spacing: 0;
}
.page-crumbs {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-4);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.page-actions { display: flex; gap: 8px; }

.btn {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--bg-sunken); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-sunken); color: var(--ink); }
.btn-sm { padding: 3px 7px; font-size: 11px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.panel-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: flex; align-items: center; gap: 8px;
}
.panel-title .num {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-4);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 4px;
}
.panel-sub { font-size: 11px; color: var(--ink-3); font-weight: 400; }
.panel-actions { display: flex; gap: 4px; align-items: center; }
.panel-body { padding: 14px; }
.panel-body.tight { padding: 10px; }
.panel-body.flush { padding: 0; }

/* KPI tiles */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.kpi {
  background: var(--panel);
  padding: 12px 14px 10px;
  display: flex; flex-direction: column;
  gap: 4px;
  min-height: 110px;
  position: relative;
}
.kpi:hover { background: var(--bg-sunken); }
.kpi-label {
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}
.kpi-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  margin-top: 2px;
}
.kpi-value .unit { font-size: 11px; color: var(--ink-3); margin-left: 3px; }
.kpi-delta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  display: flex; align-items: center; gap: 3px;
}
.kpi-spark { position: absolute; right: 10px; bottom: 8px; opacity: 0.85; }

/* Chips & badges */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg-sunken);
  color: var(--ink-2);
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.chip-jade  { background: var(--jade-soft);  color: oklch(0.40 0.10 155); border-color: transparent; }
.chip-amber { background: var(--amber-soft); color: oklch(0.48 0.13 75);  border-color: transparent; }
.chip-rose  { background: var(--rose-soft);  color: oklch(0.42 0.14 25);  border-color: transparent; }
.chip-accent{ background: var(--accent-soft);color: var(--accent-ink);    border-color: transparent; }
.chip-plum  { background: var(--plum-soft); color: var(--plum); border-color: transparent; }
.chip-ink   { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.badge {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 4px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
  position: sticky; top: 0; z-index: 1;
}
.tbl td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tr:hover td { background: var(--bg-sunken); }
.tbl tr.expanded td { background: var(--bg-sunken); }
.tbl .num { font-family: var(--font-mono); }
.tbl .checkbox { width: 24px; }

.row-expand {
  background: var(--bg-sunken);
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  animation: expand 240ms ease;
}
@keyframes expand { from { opacity: 0; } to { opacity: 1; } }

/* Forms */
.input, .select {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--ink);
  width: 100%;
}
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.toggle { position: relative; width: 32px; height: 18px; background: var(--ink-5); border-radius: 9px; cursor: pointer; transition: background 160ms; }
.toggle.on { background: var(--accent); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: white; border-radius: 50%; transition: 160ms; }
.toggle.on::after { left: 16px; }

/* Sentiment bar */
.sent-bar {
  display: flex; height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--bg-sunken);
}
.sent-bar > div { height: 100%; }
.sent-neg { background: var(--rose); }
.sent-neu { background: var(--ink-4); }
.sent-pos { background: var(--jade); }

/* Skeleton shimmer */
.skl {
  background: linear-gradient(90deg, var(--bg-sunken) 0%, var(--line) 50%, var(--bg-sunken) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 4px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Tooltips on charts */
.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 5px 7px;
  border-radius: 3px;
  white-space: nowrap;
  z-index: 10;
  transform: translate(-50%, -110%);
  box-shadow: var(--shadow-md);
}
.chart-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -4px;
  transform: translateX(-50%) rotate(45deg);
  width: 6px; height: 6px; background: var(--ink);
}

/* Page-level grids */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }

/* Mobile companion screens */
.mobile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 24px;
  padding: 8px 4px 24px;
}
.iphone {
  width: 100%;
  aspect-ratio: 390 / 844;
  background: var(--ink);
  border-radius: 38px;
  padding: 8px;
  position: relative;
  box-shadow: 0 30px 80px -30px oklch(0.20 0.012 250 / 0.4), 0 6px 20px -10px oklch(0.20 0.012 250 / 0.2);
}
.iphone::after {
  content: "";
  position: absolute;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: 90px; height: 22px;
  background: var(--ink);
  border-radius: 14px;
  z-index: 3;
}
.iphone-screen {
  width: 100%; height: 100%;
  background: var(--bg);
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
  font-size: 10px;
}
.iphone-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 24px 6px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  color: var(--ink);
}
.iphone-statusbar .icons { display: flex; gap: 4px; }
.iphone-tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 0 14px;
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
}
.iphone-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-4);
  font-size: 8.5px;
  font-weight: 500;
}
.iphone-tab.on { color: var(--accent); }
.iphone-tab .badge {
  position: absolute;
  background: var(--rose);
  color: white;
  font-size: 7px;
  border-radius: 6px;
  padding: 0 3px;
  transform: translate(8px, -4px);
}
.iphone-content { flex: 1; overflow: hidden; padding: 6px 14px 0; }
.iphone-content.scroll { overflow-y: auto; }

.mobile-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin: 8px 0 4px;
  display: flex; justify-content: space-between;
}
.mobile-label .idx { color: var(--ink-4); }

/* word cloud */
.cloud { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px 10px; line-height: 1.1; padding: 4px; }
.cloud span { cursor: pointer; transition: color 120ms; }
.cloud span:hover { color: var(--accent); }

/* Filter rail (inquiry inbox) — flows with page, no inner scroll */
.filter-rail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  align-self: start;
}
.filter-group { margin-bottom: 14px; }
.filter-label {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 5px;
  font-weight: 600;
}
.filter-options { display: flex; flex-direction: column; gap: 3px; }
.filter-opt {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px;
  padding: 2px 0;
}
.filter-opt .count { margin-left: auto; font-family: var(--font-mono); color: var(--ink-4); font-size: 10px; }

input[type="checkbox"] { accent-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* Map */
.uz-map path {
  fill: var(--bg-sunken);
  stroke: var(--line-strong);
  stroke-width: 1;
  cursor: pointer;
  transition: fill 160ms;
}
.uz-map path:hover { stroke: var(--ink); stroke-width: 1.5; }
.uz-map path.selected { stroke: var(--ink); stroke-width: 2; }
.uz-map text { fill: var(--ink-2); font-size: 9px; font-family: var(--font-mono); pointer-events: none; }

/* Subtle hover affordance on chart panels */
.panel.interactive:hover { box-shadow: var(--shadow-md); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  background: transparent; border: 0;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
}
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--accent); }

.seg {
  display: inline-flex;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  background: transparent; border: 0;
  padding: 3px 8px;
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  border-radius: 3px;
  font-weight: 500;
}
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* Activity feed */
.feed-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  align-items: start;
}
.feed-item:last-child { border-bottom: 0; }
.feed-item .topic-mark {
  width: 8px; height: 8px; border-radius: 2px;
  margin-top: 5px;
}
.feed-item .msg { color: var(--ink-2); }
.feed-item .meta { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin-top: 2px; }
.feed-item .time { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); white-space: nowrap; }

/* Notification dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 340px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  z-index: 100;
  overflow: hidden;
}

/* Kbd shortcut display */
.kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--panel);
  color: var(--ink-2);
}
