:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #646a73;
  --line: #e3e1db;
  --red: #c8102e;
  --red-ink: #ffffff;
  --chip: #eeece6;
  --link: #0b4fa3;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114;
    --surface: #171a1f;
    --text: #e9eaec;
    --muted: #9aa1ab;
    --line: #262a31;
    --chip: #22262d;
    --link: #7fb2ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* Son Dakika ticker */
.ticker { display: flex; align-items: stretch; background: var(--red); color: var(--red-ink); font-weight: 600; font-size: 14px; position: sticky; top: 0; z-index: 10; }
.ticker[hidden] { display: none; }
.ticker__label { flex: none; padding: 8px 12px; background: #8f0b20; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.ticker__label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
.ticker__viewport { overflow: hidden; flex: 1; display: flex; align-items: center; }
.ticker__track { display: inline-flex; white-space: nowrap; gap: 0; padding-left: 12px; animation: scroll var(--dur, 40s) linear infinite; }
.ticker__copy { display: inline-flex; padding-right: 48px; }
.ticker__track a { text-decoration: none; padding: 0 8px; }
.ticker__track a:hover { text-decoration: underline; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.sep { opacity: .7; padding: 0 6px; }
/* track holds the items twice; moving by half loops seamlessly with text visible from the start */
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes blink { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; padding-left: 0; overflow-x: auto; }
}

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top__row { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 6px; }
.brand { font-weight: 800; font-size: 22px; text-decoration: none; letter-spacing: -.01em; }
.brand__mark { color: var(--red); margin-right: 6px; }
.live { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa1ab; }
.live.on .dot { background: #1ea862; }
.cats { display: flex; gap: 4px; overflow-x: auto; padding: 6px 0 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; text-decoration: none; font-size: 14px; padding: 6px 12px; border-radius: 999px; color: var(--muted); }
.cats a[aria-current="page"] { background: var(--text); color: var(--bg); }

/* Feed */
.page-title { font-size: 20px; margin: 20px 0 12px; }
.feed { display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card--breaking { border-left: 4px solid var(--red); }
.card--new { animation: flash 2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px rgba(200,16,46,.35); } to { box-shadow: none; } }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.badge { display: inline-block; text-decoration: none; background: var(--chip); color: var(--text); padding: 2px 8px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.badge--red { background: var(--red); color: var(--red-ink); }
.card__title { font-size: 18px; line-height: 1.3; margin: 8px 0 6px; }
.card__title a { text-decoration: none; }
.card__title a:hover { text-decoration: underline; }
.card__summary { margin: 0 0 10px; }
.card__sources { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.more { color: var(--link); text-decoration: none; font-weight: 600; margin-left: auto; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
.load-more { display: block; margin: 20px auto; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.load-more[hidden] { display: none; }

/* Story */
.story { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 20px 0; }
.story__title { font-size: 24px; line-height: 1.25; margin: 10px 0; }
.story__summary { font-size: 18px; }
.note { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 10px; }
.h2 { font-size: 16px; margin: 24px 0 8px; }
.srcs { list-style: none; padding: 0; margin: 0; }
.src { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.src a { color: var(--link); text-decoration: none; font-weight: 600; flex: none; }
.src time { display: block; font-size: 12px; }
.aff { font-size: 11px; background: var(--chip); padding: 1px 6px; border-radius: 4px; color: var(--muted); }

.foot { color: var(--muted); font-size: 13px; padding-top: 24px; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }

/* ---------- installed app (iPhone home screen) ---------- */
/* status bar area: the app draws under it (black-translucent), so fill it with the brand red */
body { padding-top: env(safe-area-inset-top); }
body::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top);
  background: var(--red); z-index: 30;
}
.ticker { top: env(safe-area-inset-top); }
.wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.is-app .foot p:last-child { display: none; }
a, button { -webkit-tap-highlight-color: transparent; }

.top__actions { display: flex; align-items: center; gap: 10px; }
.bell {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer;
}
.bell[hidden] { display: none; }
.bell.on { background: var(--red); border-color: var(--red); color: #fff; }
.bell:disabled { opacity: .6; }

.install {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); max-width: 520px; margin: 0 auto;
  animation: rise .35s ease-out;
}
.install[hidden] { display: none; }
.install img { border-radius: 10px; flex: none; }
.install__text { display: flex; flex-direction: column; font-size: 13px; line-height: 1.4; }
.install__text strong { font-size: 14px; }
.install__text svg { vertical-align: -2px; color: var(--link); }
.install button { margin-left: auto; flex: none; border: 0; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; padding: 4px 6px; }
@media (max-width: 420px) {
  .live { font-size: 0; gap: 0; }          /* keep only the green dot next to the bell */
  .brand { font-size: 20px; }
}
@keyframes rise { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
