/* The web app. Built like the Scroll GTA6 app (full screen cards, labelled rail, Explore hub, side nav on desktop),
   in the meltflex look: white, black, Inter, uppercase light headings. No purple. */
@font-face { font-family: "Inter"; src: url("/fonts/inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --bg: #fff; --ink: #0a0a0a; --sub: #555; --muted: #f5f5f5; --line: #ededed; --soft: #6b6b6b;
  --ok: #12805c; --no: #c0392b; --radius: 16px; --nav-h: 62px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2,.8,.2,1); color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.55 "Inter", -apple-system, system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 10px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ───────── layout ───────── */
#app { height: 100dvh; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: 'stage' 'nav'; }
.stage { grid-area: stage; position: relative; min-height: 0; }
.view { position: absolute; inset: 0; display: none; }
.view.active { display: block; }
.view.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: var(--safe-t); }
.nav { grid-area: nav; display: flex; background: rgba(255,255,255,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 5; }
.brand, .nav-foot { display: none; }
.nav-items { display: flex; flex: 1; }
.nav-btn { flex: 1; height: var(--nav-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--soft); font-size: 11px; font-weight: 500; letter-spacing: .02em; }
.nav-btn svg { width: 24px; height: 24px; }
.nav-btn.on { color: var(--ink); }
.nav-btn.on svg { stroke-width: 2.1; }
@media (max-width: 420px) { .nav-btn { font-size: 10px; } .nav-btn svg { width: 22px; height: 22px; } }

@media (min-width: 900px) {
  #app { grid-template-rows: 1fr; grid-template-columns: 232px minmax(0, 1fr); grid-template-areas: 'nav stage'; }
  .nav { flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 20px 14px; gap: 22px; background: #fff; backdrop-filter: none; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 17px; font-weight: 600; text-decoration: none; }
  .brand img { border-radius: 8px; }
  .nav-items { flex-direction: column; flex: 0; gap: 2px; }
  .nav-btn { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 46px; padding: 0 12px; border-radius: 12px; font-size: 15px; color: var(--sub); }
  .nav-btn svg { width: 21px; height: 21px; }
  .nav-btn.on { background: var(--muted); }
  .nav-foot { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding: 0 12px; font-size: 13px; }
  .nav-foot a, .nav-foot button { color: var(--sub); text-decoration: none; padding: 6px 0; text-align: left; }
  .nav-foot a:hover, .nav-foot button:hover { color: var(--ink); }
  #view-feed { padding: 22px; background: var(--muted); }
  .feed-frame { position: relative !important; height: 100%; max-width: 460px; margin: 0 auto; border-radius: 28px; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.08); }
}

/* ───────── feed ───────── */
.feed-frame { position: absolute; inset: 0; background: #fff; overflow: hidden; }
.feed { height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain; container-type: inline-size; outline: none; }
.feed::-webkit-scrollbar { display: none; }
.feed-top { position: absolute; z-index: 3; top: 0; left: 0; right: 0; padding: calc(var(--safe-t) + 12px) 14px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; pointer-events: none; }
.feed-top > * { pointer-events: auto; }
.feed-switch { display: inline-flex; padding: 3px; border-radius: 99px; background: rgba(255,255,255,.85); border: 1px solid var(--line); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.feed-switch button { height: 30px; padding: 0 11px; border-radius: 99px; font-size: 11.5px; font-weight: 500; color: var(--sub); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
.feed-switch button.on { background: var(--ink); color: #fff; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 99px; font-size: 11.5px; font-weight: 500; color: var(--ink); background: rgba(255,255,255,.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 0 rgba(229,72,77,.5); animation: live 1.8s infinite; flex: none; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(229,72,77,0); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }

.card { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: flex; align-items: flex-end; color: var(--ink); overflow: hidden; isolation: isolate; border-bottom: 1px solid var(--line); }
.card-bg { position: absolute; inset: 0; z-index: -1; background: #fff; }
.card-bg::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 44px 44px; -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 52%); mask-image: linear-gradient(180deg, #000 0%, transparent 52%); opacity: .8; }
.card.dark { color: #fff; border-color: #1a1a1a; }
.card.dark .card-bg { background: #0a0a0a; }
.card.dark .card-bg::before { background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); }
.card-glyph { position: absolute; top: calc(var(--safe-t) + 80px); left: 22px; width: 96px; height: 96px; padding: 24px; border-radius: 26px; background: #fff; border: 1px solid var(--line); color: var(--ink); box-shadow: 0 12px 30px rgba(0,0,0,.06); transform: rotate(-6deg); }
.card.dark .card-glyph { background: #161616; border-color: #262626; color: #fff; box-shadow: none; }
.card-glyph svg { width: 100%; height: 100%; stroke-width: 1.4; }
.card-big { position: absolute; top: calc(var(--safe-t) + 206px); left: 18px; font-size: clamp(46px, 14cqi, 84px); font-weight: 300; letter-spacing: .02em; line-height: .95; text-transform: uppercase; color: #efefef; pointer-events: none; white-space: nowrap; }
.card.dark .card-big { color: #1c1c1c; }
.card-main { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; width: 100%; padding: 0 84px 0 20px; margin-bottom: 26px; text-align: left; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 11px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.chip svg { width: 12px; height: 12px; }
.chip-cat { background: var(--ink); color: #fff; }
.chip-src { background: #fff; color: var(--sub); border: 1px solid var(--line); }
.chip-hot { background: var(--muted); color: var(--ink); }
.card.dark .chip-cat { background: #fff; color: var(--ink); }
.card.dark .chip-src { background: transparent; color: #bbb; border-color: #333; }
.card.dark .chip-hot { background: #1f1f1f; color: #fff; }
.card-title { font-size: clamp(27px, 8.2cqi, 38px); font-weight: 600; line-height: 1.08; letter-spacing: -.025em; text-wrap: balance; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.card-body { font-size: 16.5px; line-height: 1.5; color: var(--sub); text-wrap: pretty; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 5; overflow: hidden; }
.card.dark .card-body { color: #c8c8c8; }
.card-by { font-size: 13px; color: var(--soft); }
.read-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); text-decoration: none; }
.read-btn.solid { background: var(--ink); color: #fff; border-color: var(--ink); }
.card.dark .read-btn { background: transparent; color: #fff; border-color: #333; }
.card.dark .read-btn.solid { background: #fff; color: var(--ink); border-color: #fff; }
.card-end { align-items: center; justify-content: center; text-align: center; }
.card-end .card-main { align-items: center; padding: 0 28px; cursor: default; text-align: center; margin: 0; }
.card-end .card-title { font-weight: 300; text-transform: uppercase; letter-spacing: .04em; }
.rail { position: absolute; right: 10px; bottom: 26px; display: flex; flex-direction: column; gap: 14px; }
.rail-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 56px; font-size: 10.5px; font-weight: 500; color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.rail-btn svg { width: 46px; height: 46px; padding: 12px; border-radius: 50%; background: #fff; border: 1px solid var(--line); transition: transform .15s, background .15s; }
.card.dark .rail-btn { color: #fff; }
.card.dark .rail-btn svg { background: #161616; border-color: #2a2a2a; }
.rail-btn:active svg { transform: scale(.9); }
.rail-btn.on svg { background: var(--ink); color: #fff; border-color: var(--ink); }
.rail-btn[data-like].on svg { fill: #fff; }
.card.dark .rail-btn.on svg { background: #fff; color: var(--ink); border-color: #fff; }
.card.dark .rail-btn[data-like].on svg { fill: var(--ink); }
.rail-btn.pop svg { animation: pop .4s ease; }
@keyframes pop { 40% { transform: scale(1.25); } }
.hint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 11px; color: var(--soft); text-transform: uppercase; letter-spacing: .12em; animation: bob 1.6s var(--ease) infinite alternate; pointer-events: none; }
@keyframes bob { to { transform: translate(-50%, -5px); } }
.quote { font-size: clamp(21px, 6cqi, 27px); font-weight: 500; line-height: 1.35; letter-spacing: -.015em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8; overflow: hidden; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.who .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; }
.card.dark .who .av { background: #fff; color: var(--ink); }
.who b { font-weight: 600; display: block; line-height: 1.2; }
.who small { color: var(--soft); }

/* ───────── pages ───────── */
.page { max-width: 820px; margin: 0 auto; padding: 24px 16px 56px; display: flex; flex-direction: column; gap: 22px; }
.page-head small { display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .12em; font-weight: 500; font-size: 12px; color: var(--sub); }
.page-head small svg { width: 15px; height: 15px; }
.page-head h1 { font-size: clamp(28px, 7vw, 40px); font-weight: 300; text-transform: uppercase; letter-spacing: .04em; line-height: 1.1; margin-top: 8px; }
.page-head p { color: var(--sub); margin-top: 10px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--sub); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: -8px; }
.sec { display: flex; flex-direction: column; gap: 12px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sec-head h2 { font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.sec-head button, .sec-head a { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); white-space: nowrap; text-decoration: none; }
.tabs-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.tabs-row::-webkit-scrollbar { display: none; }
.tchip { flex: none; height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); color: var(--sub); font-size: 12px; font-weight: 500; white-space: nowrap; text-transform: uppercase; letter-spacing: .05em; }
.tchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 12px; background: var(--muted); color: var(--sub); }
.search input { flex: 1; min-width: 0; height: 100%; color: var(--ink); outline: none; font-size: 16px; }
.empty { color: var(--sub); text-align: center; padding: 48px 20px; }
.soon { padding: 28px 22px; border-radius: var(--radius); border: 1px dashed #d4d4d4; color: var(--sub); text-align: center; }

/* Explore hub: big black tiles, like Scroll GTA6's Explore */
.hub { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .hub { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
.hub-tile { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 4 / 3.4; padding: 14px; border-radius: 18px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; background: #0a0a0a; color: #fff; text-align: left; transition: transform .2s var(--ease); }
.hub-tile:active { transform: scale(.97); }
.hub-tile.light { background: var(--muted); color: var(--ink); }
.hub-tile .hub-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.1); }
.hub-tile.light .hub-ic { background: #fff; }
.hub-tile .hub-ic svg { width: 21px; height: 21px; }
.hub-tile .hub-big { position: absolute; right: 10px; top: 52px; font-size: 54px; font-weight: 300; color: rgba(255,255,255,.1); line-height: 1; pointer-events: none; font-variant-numeric: tabular-nums; }
.hub-tile.light .hub-big { color: rgba(0,0,0,.07); }
.hub-tile b { display: block; font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; }
.hub-tile small { display: block; font-size: 12.5px; line-height: 1.35; color: rgba(255,255,255,.62); margin-top: 3px; }
.hub-tile.light small { color: var(--sub); }
.hub-lock, .hub-free { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; background: #fff; color: var(--ink); }
.hub-lock svg { width: 11px; height: 11px; }
.hub-tile.light .hub-lock { background: var(--ink); color: #fff; }
.hub-free { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; }
.hub-tile.light .hub-free { border-color: #d4d4d4; color: var(--sub); }

/* rows */
.list { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 14px 16px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); text-align: left; text-decoration: none; transition: transform .15s var(--ease), border-color .15s; }
.row:hover { border-color: #d4d4d4; }
.row:active { transform: scale(.985); }
.row .ic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--muted); color: var(--ink); }
.row .ic svg { width: 20px; height: 20px; }
.row .tx { min-width: 0; flex: 1; }
.row .m { display: block; font-size: 11px; font-weight: 500; color: var(--soft); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.row .t { display: block; font-weight: 600; line-height: 1.32; }
.row .s { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; color: var(--sub); margin-top: 4px; }
.row .num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--muted); color: var(--sub); margin-top: 2px; }
.row .num svg { width: 15px; height: 15px; }
.row.done .num { background: var(--ink); color: #fff; }
.grid2 { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.tile { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 190px; padding: 18px; border-radius: 18px; text-align: left; background: #fff; border: 1px solid var(--line); }
.tile:first-child { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
.tile .k { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); }
.tile h3 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; line-height: 1.15; }
.tile p { font-size: 14px; color: var(--sub); white-space: pre-line; }
.tile:first-child p, .tile:first-child .foot { color: #bbb; }
.tile .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--sub); }
.bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; flex: 1; }
.tile:first-child .bar, .hero-dark .bar { background: #2a2a2a; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.tile:first-child .bar i, .hero-dark .bar i { background: #fff; }

/* live */
.live-new { position: sticky; top: 10px; z-index: 2; align-self: center; height: 38px; padding: 0 16px; border-radius: 99px; background: var(--ink); color: #fff; font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.tl { display: flex; flex-direction: column; }
.tl-day { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--soft); padding: 18px 0 8px; }
.tl-item { display: grid; grid-template-columns: 58px 1fr; gap: 12px; width: 100%; padding: 13px 0; border-top: 1px solid var(--line); text-align: left; }
.tl-item time { font-size: 13px; font-weight: 500; color: var(--soft); font-variant-numeric: tabular-nums; padding-top: 2px; }
.tl-item.fresh time { color: #e5484d; }
.tl-item .t { font-weight: 600; line-height: 1.35; display: block; }
.tl-item .m { display: block; font-size: 12.5px; color: var(--soft); margin-top: 4px; }
.tl-item .m b { color: var(--ink); font-weight: 500; }
.tl-item:hover .t { text-decoration: underline; text-underline-offset: 3px; }

/* brief, course hero */
.hero-dark { padding: 24px; border-radius: 22px; background: #0a0a0a; color: #fff; }
.hero-dark h2 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.hero-dark .page-head small, .hero-dark .page-head p { color: #bbb; }
.tldr { margin: 16px 0 0; padding: 0; list-style: none; }
.tldr li { padding: 10px 0 10px 18px; border-top: 1px solid #222; position: relative; color: #ddd; }
.tldr li::before { content: ''; position: absolute; left: 2px; top: 20px; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.box { background: var(--muted); border-radius: 14px; padding: 16px 18px; }
.box b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--sub); font-weight: 500; margin-bottom: 6px; }
.box ol, .box ul { margin: 0; padding-left: 20px; } .box li { margin: 6px 0; }

/* guide reader */
.article { display: flex; flex-direction: column; gap: 14px; line-height: 1.7; color: #262626; }
.article h2 { font-size: 20px; font-weight: 600; letter-spacing: -.015em; color: var(--ink); margin-top: 14px; line-height: 1.3; }
.article p, .article ul, .article ol { margin: 0; }
.article ul, .article ol { padding-left: 22px; } .article li { margin: 6px 0; }
.article table { width: 100%; border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.article th, .article td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.answer { padding: 18px 20px; border-radius: 14px; background: var(--muted); border-left: 3px solid var(--ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; text-decoration: none; text-align: center; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.hero-dark .btn { background: #fff; color: var(--ink); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0); transition: background .22s var(--ease); }
.sheet-wrap.open { background: rgba(0,0,0,.36); }
.sheet { width: 100%; max-width: 620px; max-height: 92dvh; display: flex; flex-direction: column; background: #fff; border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform .3s var(--ease); overflow: hidden; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-head { position: relative; padding: 26px 64px 16px 20px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; margin-top: 10px; }
.sheet-grab { position: absolute; top: 8px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: #d4d4d4; }
.sheet-close { position: absolute; top: 16px; right: 14px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); }
.sheet-body { padding: 18px 20px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; line-height: 1.65; color: #262626; }
.sheet-body .note { font-size: 13px; color: var(--soft); }
.sheet-foot { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1 1 140px; }
@media (min-width: 900px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 24px; max-height: 86dvh; } }

/* paywall + sign in */
.plans { display: grid; gap: 10px; }
.plan { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); }
.plan.best { border-color: var(--ink); }
.plan b { display: block; font-weight: 600; } .plan small { color: var(--sub); }
.plan .price { font-size: 22px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.perks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.perks li { display: flex; gap: 10px; align-items: flex-start; }
.perks svg { margin-top: 4px; width: 16px; height: 16px; }
.gate { position: fixed; inset: 0; z-index: 40; background: #fff; overflow-y: auto; display: flex; justify-content: center; padding: 48px 20px; }
.gate-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.gate h1 { font-size: 30px; font-weight: 300; text-transform: uppercase; letter-spacing: .04em; line-height: 1.15; }
.gate p { color: var(--sub); }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 12px; background: var(--muted); }
.seg button { height: 40px; border-radius: 9px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--sub); text-align: center; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.field input { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-size: 16px; outline: none; }
.field input:focus { border-color: var(--ink); }
.msg { font-size: 14px; color: var(--no); } .msg.ok { color: var(--ok); }
.fine { font-size: 12.5px; color: var(--soft); text-align: center; }

/* quiz */
.q { font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.choice { display: block; width: 100%; text-align: left; padding: 15px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); line-height: 1.4; }
.choice.right { background: #ecfdf3; border-color: #a6f4c5; }
.choice.wrong { background: #fef3f2; border-color: #fecdca; }
.choice.dim { color: var(--soft); }
.why b { color: var(--ink); }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 18px + var(--safe-b)); transform: translate(-50%, 10px); background: var(--ink); color: #fff; font-size: 13px; font-weight: 500; padding: 10px 16px; border-radius: 12px; opacity: 0; transition: .2s var(--ease); pointer-events: none; z-index: 50; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + 116px); } }

/* Review fixes: the text always sits above the decoration, and short phones drop the decoration. */
.card-main { position: relative; z-index: 1; }
@media (max-height: 780px) {
  .card-big { display: none; }
  .card-glyph { width: 64px; height: 64px; padding: 16px; border-radius: 18px; top: calc(var(--safe-t) + 64px); }
}
@media (max-height: 680px) { .card-glyph { display: none; } }
/* Narrow phones: the four filters and the live pill must fit in 360px. */
@media (max-width: 400px) {
  .feed-top { padding-left: 10px; padding-right: 10px; gap: 6px; }
  .feed-switch button { padding: 0 8px; letter-spacing: .01em; font-size: 11px; }
  .pill { padding: 0 10px; gap: 6px; }
}

/* ───────── GTA6 structure: stars pill, Today, Library rank, banner, settings, item sheet ───────── */
:root[data-size='s'] { font-size: 15px; } :root[data-size='l'] { font-size: 17.5px; }
:root[data-size='s'] .card-title { font-size: clamp(24px, 7.4cqi, 34px); } :root[data-size='l'] .card-title { font-size: clamp(30px, 9cqi, 42px); }
:root[data-size='s'] .card-body { font-size: 15px; } :root[data-size='l'] .card-body { font-size: 18px; }
.pill-stars { flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px; height: auto; padding: 6px 12px; border-radius: 14px; }
.pill-stars b { font-size: 11px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.stars { display: inline-flex; gap: 2px; }
.stars i svg { width: 13px; height: 13px; fill: #e5e5e5; stroke: none; display: block; }
.stars i.on svg { fill: var(--ink); }
.stars.big i svg { width: 26px; height: 26px; }
.head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--muted); }
.icon-btn svg { width: 20px; height: 20px; }
.k { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--soft); }
.k svg { width: 14px; height: 14px; }
.goal { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px; border-radius: 18px; border: 1px solid var(--line); }
.goal-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.goal-main p { color: var(--sub); font-size: 14px; }
.goal-side { display: grid; align-content: center; justify-items: end; padding-left: 16px; border-left: 1px solid var(--line); text-align: right; }
.goal-side b { font-size: 26px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.goal-side small { font-size: 12px; color: var(--soft); margin-bottom: 8px; }
.drop { padding: 6px 18px 10px; border-radius: 18px; border: 1px solid var(--line); }
.drop-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 8px; }
.drop-head h2 { font-size: 15px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; border-radius: 10px; }
.btn-sm svg { width: 14px; height: 14px; fill: currentColor; }
.drop-row { display: grid; grid-template-columns: 46px 1fr 18px; gap: 12px; align-items: center; width: 100%; padding: 12px 0; border-top: 1px solid var(--line); text-align: left; }
.drop-row .thumb { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--muted); }
.drop-row .thumb.dark { background: var(--ink); color: #fff; }
.drop-row .thumb svg { width: 20px; height: 20px; }
.drop-row b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 600; line-height: 1.3; }
.drop-row small { color: var(--soft); font-size: 12.5px; }
.drop-row > svg { width: 16px; height: 16px; color: var(--soft); }
.brief-card, .banner { display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; }
.brief-card .k, .banner .k { color: #9a9a9a; }
.brief-card .more, .banner .more { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: #fff; }
.banner { position: relative; overflow: hidden; min-height: 170px; justify-content: flex-end; padding: 22px; border-radius: 22px; background: #0a0a0a; color: #fff; }
.banner::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 36px 36px; -webkit-mask-image: linear-gradient(180deg, #000, transparent 75%); mask-image: linear-gradient(180deg, #000, transparent 75%); }
.banner > * { position: relative; }
.banner h2 { font-size: clamp(22px, 5.6vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.rank { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; border: 1px solid var(--line); }
.rank-top { display: flex; justify-content: space-between; align-items: flex-end; }
.rank-top small, .rank > small { font-size: 12.5px; color: var(--soft); }
.rank-top b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.rank-top .pts { font-size: 22px; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.stats b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats small { color: var(--soft); font-size: 12.5px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.set-h { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--soft); margin: 10px 0 2px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.danger { color: var(--no); }
.lead { font-size: 18px; line-height: 1.5; color: var(--ink); }
.why-box { display: flex; gap: 12px; padding: 16px; border-radius: 14px; background: var(--muted); }
.why-box .ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--ink); color: #fff; }
.why-box .ic svg { width: 16px; height: 16px; }
.why-box b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.todo { display: flex; flex-direction: column; gap: 8px; }
.todo-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--muted); line-height: 1.45; }
.todo-row .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--ink); margin-top: 1px; }
.todo-row .tick svg { width: 12px; height: 12px; }
.src-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); text-decoration: none; }
.src-link small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--soft); }
.src-link b { font-weight: 600; }
.sheet-foot .btn-save { flex: 0 1 auto; }
.sheet-foot .btn svg { width: 16px; height: 16px; }
.sec-head h2 .dot { display: inline-block; vertical-align: middle; margin-right: 4px; }

.rank .bar, .goal .bar { display: block; flex: none; height: 6px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.feed-more { height: 1px; scroll-snap-align: none; }
.card-big::before { content: attr(data-w); }

.av-ic { font-size: 13px; font-weight: 600; background: var(--ink) !important; color: #fff !important; border-radius: 50% !important; }

/* scrolling inside an Explore section */
#view-explore.sfeed-on { padding-top: 0; overflow: hidden; }
.sfeed-frame .feed-top-r { display: inline-flex; gap: 6px; }
.pill-back svg { width: 15px; height: 15px; }
.pill-count svg { width: 13px; height: 13px; }
@media (min-width: 900px) { #view-explore.sfeed-on { padding: 22px; background: var(--muted); } }
.sfeed-frame .hint { display: none; }
