:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #142033;
  --ink-2: #4a5568;
  --muted: #7a8596;
  --line: #e3e7ed;
  --brand: #0e2a47;
  --brand-ink: #ffffff;
  --accent: #c99a2e;
  --link: #1557b0;
  --up: #0b8a57;
  --down: #c8372d;
  --uae: #b0322a;
  --india: #d9741f;
  --world: #2c64b8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 30, 54, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 14px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
h2.section { margin: 26px 0 10px; }
code, pre, .num { font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.pos { color: var(--up); }
.neg { color: var(--down); }

/* Top bar */
.topbar { background: #ffffff; color: var(--ink); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(16, 30, 54, .05); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { color: var(--brand); font-weight: 700; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); }
.mainnav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { color: var(--ink-2); padding: 6px 11px; border-radius: 6px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.mainnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.mainnav a.on { background: #e8eef7; color: var(--brand); }
.mainnav a.muted { color: var(--muted); }

/* Ticker – continuous scrolling strip */
.ticker { border-top: 1px solid var(--line); background: var(--surface-2); overflow: hidden; position: relative; }
.ticker::before, .ticker::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40px; z-index: 1; pointer-events: none; }
.ticker::before { left: 0; background: linear-gradient(90deg, var(--surface-2), transparent); }
.ticker::after { right: 0; background: linear-gradient(-90deg, var(--surface-2), transparent); }
.ticker-track { display: flex; width: max-content; white-space: nowrap; font-size: 13px; padding: 7px 0; animation: tickerScroll var(--dur, 60s) linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-track.static { animation: none; padding-left: 16px; }
.tk { color: var(--ink); padding: 0 14px; border-right: 1px solid var(--line); }
.tk b { font-weight: 500; color: var(--ink-2); }
.tk.up .chg { color: var(--up); }
.tk.down .chg { color: var(--down); }
.tk.flat .chg { color: var(--muted); }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker { overflow-x: auto; } .ticker-track { animation: none; } }

/* Layout */
.wrap { max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.side-col { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
@media (max-width: 960px) {
  .layout, .grid2 { grid-template-columns: 1fr; }
  .side-col { position: static; }
}

/* Tabs & filters */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 3px; width: fit-content; max-width: 100%; overflow-x: auto; }
.feed-col > .tabs { margin-bottom: 12px; }
.tab { padding: 6px 14px; border-radius: 6px; color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.tab:hover { text-decoration: none; background: var(--surface-2); }
.tab.on { background: var(--brand); color: #fff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 240px; }
.filter-note { margin: -4px 0 12px; font-size: 14px; color: var(--ink-2); }

input, select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--link) 40%, transparent); border-color: var(--link); }
textarea { width: 100%; resize: vertical; }
.btn {
  font: inherit; font-weight: 600; font-size: 14px; border: 1px solid var(--brand); background: var(--brand); color: #fff;
  border-radius: 7px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { text-decoration: none; filter: brightness(1.15); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.small { padding: 4px 9px; font-size: 12.5px; font-weight: 500; }
.btn.danger { color: var(--down); }

/* Cards */
.card {
  position: relative; display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 44px 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.card-body { flex: 1; min-width: 0; }
.card h3 { margin: 4px 0 4px; font-size: 16.5px; line-height: 1.35; font-weight: 600; letter-spacing: -.005em; }
.card h3 a { color: var(--ink); }
.card h3 a:visited { color: var(--ink-2); }
.sum { margin: 0 0 8px; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.meta .src { font-weight: 600; color: var(--ink-2); }
.thumb { width: 132px; height: 88px; object-fit: cover; border-radius: 7px; flex-shrink: 0; background: var(--surface-2); }
@media (max-width: 600px) { .thumb { width: 84px; height: 64px; } .card { padding-right: 40px; } }
.star {
  position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: transparent;
  color: var(--line); font-size: 19px; cursor: pointer; line-height: 30px; padding: 0;
}
.star:hover { color: var(--accent); background: var(--surface-2); }
.star.on { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.chip:hover { text-decoration: none; border-color: var(--link); color: var(--link); }
.tone { font-size: 12px; font-weight: 600; }
.tone.pos { color: var(--up); }
.tone.neg { color: var(--down); }
.badge { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 7px; border-radius: 4px; border: 1px solid currentColor; color: var(--muted); }
.badge.r-uae { color: var(--uae); }
.badge.r-india { color: var(--india); }
.badge.r-world { color: var(--world); }
.badge.r-admin { color: var(--accent); }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.side-col .panel { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats > div { display: flex; flex-direction: column; }
.big { font-size: 24px; font-weight: 500; line-height: 1.1; }
.lbl { font-size: 12px; color: var(--muted); }
.region-split { display: flex; gap: 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.region-split a { color: var(--ink); display: inline-flex; gap: 6px; align-items: center; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bars a { display: grid; grid-template-columns: 1fr 70px 34px; gap: 8px; align-items: center; color: var(--ink); font-size: 13px; }
.bars a:hover { text-decoration: none; }
.bars a:hover .bar-label { color: var(--link); }
.bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.bars .num { text-align: right; color: var(--muted); font-size: 12px; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; }
.pager { display: flex; justify-content: space-between; margin-top: 14px; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.stack label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; color: var(--ink); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; }
.inline-form .grow, .inline-form input[name=keyword] { flex: 1 1 220px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.spacer { flex: 1; }
.small-input { width: 130px; padding: 4px 8px; font-size: 12.5px; }
.auth { max-width: 380px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.auth h1 { margin-bottom: 4px; }
.auth p { margin-top: 0; }

/* Saved & alerts */
.saved-item { margin-bottom: 18px; }
.saved-item .card { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.note-form, .note-view { background: var(--surface-2); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 10px 12px; }
.note-form .row { margin-top: 8px; }
.note-view p { margin: 6px 0 0; font-size: 14px; }
.match-label { font-size: 12.5px; color: var(--muted); margin: 0 0 4px 2px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list li.off, tr.off { opacity: .5; }

/* Tables */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl .url { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 12px; overflow-x: auto; margin: 4px 0 12px; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; border: 1px solid; }
.flash.ok { background: color-mix(in srgb, var(--up) 10%, var(--surface)); border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.flash.err { background: color-mix(in srgb, var(--down) 10%, var(--surface)); border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.flash.warn { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 0 16px 30px; }
