/* Tokenized News mini app: the news palette (brand/kit tokens, "news" set) on a phone. */
@font-face { font-family: "Schibsted Grotesk"; font-weight: 400; font-display: swap; src: url("fonts/sg-400.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 600; font-display: swap; src: url("fonts/sg-600.woff2") format("woff2"); }
@font-face { font-family: "Schibsted Grotesk"; font-weight: 800; font-display: swap; src: url("fonts/sg-800.woff2") format("woff2"); }
:root {
  --ground: #170d10; --raised: #24171a; --raised-2: #2e1e22; --rule: #3a2a2d; --ink: #f7eded; --muted: #c4a9ad;
  --accent: #ff5a4f; --on-accent: #170d10; --ok: #5cc2b4; --warn: #f2c14e;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
body { padding-bottom: calc(72px + var(--safe-b)); min-height: 100vh; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--ink); }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--ground); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 10px; }
.wm { display: block; height: 28px; }
.wm svg { height: 28px; width: auto; display: block; }
.tag { background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 13px; letter-spacing: .18em; padding: 4px 8px 4px 10px; }
.icon { background: none; border: 1px solid var(--rule); border-radius: 10px; width: 38px; height: 38px; font-size: 20px; }

main { padding: 12px 16px 24px; max-width: 680px; margin: 0 auto; }
h2 { font-size: 13px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 20px 0 10px; }
h2:first-child { margin-top: 6px; }
.empty { color: var(--muted); text-align: center; padding: 40px 12px; }
.empty b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }

.card { background: var(--raised); border: 1px solid var(--rule); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.chip { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; padding: 3px 7px; border-radius: 6px; background: var(--raised-2); color: var(--ink); }
.chip.flash { background: var(--accent); color: var(--on-accent); }
.chip.roundup { background: var(--ok); color: #151515; }
.chip.recap { background: #c69be0; color: #151515; }
.chip.posted { background: var(--ok); color: #151515; }
.headline { font-size: 18px; font-weight: 800; line-height: 1.25; margin: 0 0 8px; }
.heads { margin: 0 0 10px; padding-left: 18px; font-weight: 600; }
.heads li { margin: 2px 0; }
.player { position: relative; background: #000; border-radius: 10px; overflow: hidden; margin: 8px 0 10px; }
.player video { display: block; width: 100%; max-height: 70vh; background: #000; }
.player.vertical video { aspect-ratio: 9/16; max-height: 62vh; object-fit: contain; }
.player.horizontal video { aspect-ratio: 16/9; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { flex: 1 1 auto; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--rule); background: var(--raised-2); font-weight: 800; font-size: 15px; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.ok { background: var(--ok); color: #151515; border-color: var(--ok); }
.btn.ghost { background: none; }
.btn.small { flex: 0 0 auto; min-height: 34px; padding: 6px 10px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; }
details { margin: 8px 0; }
summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.notes { font-size: 13px; color: var(--muted); padding-left: 18px; margin: 6px 0; }
.links { font-size: 13px; margin: 6px 0 0; padding-left: 18px; }
.links a { color: var(--muted); word-break: break-all; }
.fix { margin-top: 10px; }
textarea, input[type=number], select { width: 100%; background: var(--ground); color: var(--ink); border: 1px solid var(--rule); border-radius: 10px; padding: 10px; font: inherit; }
textarea { min-height: 90px; resize: vertical; margin-bottom: 8px; }

/* Live */
.now { border-color: var(--accent); }
.pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-right: 8px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.steps { list-style: none; margin: 10px 0 0; padding: 0; }
.steps li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.steps li:first-child { font-weight: 600; }
.steps time, .log time { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; font-size: 13px; }
.meter { height: 10px; border-radius: 6px; background: var(--ground); border: 1px solid var(--rule); overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--ok); }
.meter.low i { background: var(--accent); }
.log { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.log li { display: flex; gap: 10px; padding: 6px 0; border-top: 1px solid var(--rule); color: var(--muted); }
.log li span { color: var(--ink); word-break: break-word; }

/* Found */
.story { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin-bottom: 10px; border-radius: 12px; background: var(--raised); border: 1px solid var(--rule); }
.story.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.score { flex: 0 0 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: var(--raised-2); }
.score.hi { background: var(--accent); color: var(--on-accent); }
.score.mid { background: var(--warn); color: #151515; }
.story .t { font-weight: 600; line-height: 1.3; }
.story .s { font-size: 13px; color: var(--muted); margin-top: 4px; }
.story .why { font-size: 13px; margin-top: 6px; color: var(--ink); opacity: .85; }
.story .acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; margin: 4px 0 10px; overflow-x: auto; }
.filters button { flex: 0 0 auto; border: 1px solid var(--rule); background: none; border-radius: 20px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.filters button.on { background: var(--ink); color: var(--ground); border-color: var(--ink); }

/* Ready */
.copy { position: relative; background: var(--ground); border: 1px solid var(--rule); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; font-size: 14px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
.copyhead { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }

/* Settings */
.set { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); }
.set:first-of-type { border-top: 0; }
.set label b { display: block; font-weight: 600; }
.set label span { font-size: 13px; color: var(--muted); }
.switch { appearance: none; width: 54px; height: 32px; border-radius: 16px; background: var(--rule); position: relative; justify-self: end; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(22px); }

.banner { margin: 10px 16px 0; padding: 10px 12px; border-radius: 10px; background: var(--warn); color: #151515; font-weight: 600; font-size: 14px; }
.banner.err { background: var(--accent); color: var(--on-accent); }

.actionbar { position: fixed; left: 0; right: 0; bottom: calc(64px + var(--safe-b)); z-index: 6; padding: 10px 16px; background: var(--raised); border-top: 1px solid var(--rule); display: flex; gap: 8px; align-items: center; }
.actionbar .n { font-size: 13px; color: var(--muted); flex: 0 0 auto; margin-right: 4px; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; background: var(--ground); border-top: 1px solid var(--rule); padding-bottom: var(--safe-b); }
.tabs button { position: relative; flex: 1; background: none; border: 0; padding: 8px 0 10px; font-size: 11px; font-weight: 600; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tabs .ti { font-size: 18px; line-height: 22px; }
.tabs button.on { color: var(--ink); }
.tabs button.on .ti { color: var(--accent); }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; line-height: 18px; }
.dot { position: absolute; top: 8px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s infinite; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + var(--safe-b)); z-index: 9; background: var(--ink); color: var(--ground); padding: 12px 14px; border-radius: 12px; font-weight: 600; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
