:root {
  --bg: #04050a;
  --ink: #f4f6ff;
  --ink-2: #a8aec8;
  --ink-3: #5d6380;
  --line: rgba(255,255,255,.08);
  --glass: rgba(14,16,28,.55);
  --glass-2: rgba(255,255,255,.04);
  --c1: #3cf0ff;
  --c2: #8b5cff;
  --c3: #ff4fa3;
  --grad: linear-gradient(100deg, var(--c1), var(--c2) 50%, var(--c3));
  --tsize: 1;
  --ease-out: cubic-bezier(.16,1,.3,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter Tight", system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#bg, #fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#bg { z-index: 0; }
#fx { z-index: 50; }
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 33%{transform:translate(-3%,2%)} 66%{transform:translate(2%,-3%)} 100%{transform:translate(0,0)} }

.view { position: relative; z-index: 2; display: none; }
.view.active { display: block; }

/* ---------------------------------------------------------- HOME */
#home { max-width: 1320px; margin: 0 auto; padding: 40px 32px 80px; }
.hero { padding: 24px 0 28px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; }
.brand-name { font-family: Unbounded; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
.brand-name b { background: var(--grad); -webkit-background-clip: text; color: transparent; }
.brand-mark { display: flex; align-items: center; gap: 3px; height: 26px; }
.brand-mark i { width: 4px; border-radius: 4px; background: var(--grad); background-size: 100% 300%; animation: eq 1s ease-in-out infinite alternate; }
.brand-mark i:nth-child(1){height:40%;animation-delay:-.2s} .brand-mark i:nth-child(2){height:90%;animation-delay:-.5s}
.brand-mark i:nth-child(3){height:60%;animation-delay:-.1s} .brand-mark i:nth-child(4){height:100%;animation-delay:-.7s}
.brand-mark i:nth-child(5){height:50%;animation-delay:-.35s}
@keyframes eq { from { transform: scaleY(.3); } to { transform: scaleY(1); } }

.hero-title { font-family: Unbounded; font-weight: 800; font-size: clamp(40px, 7vw, 96px); line-height: .98; letter-spacing: -.045em; }
.hero-title .line { display: block; overflow: hidden; animation: rise 1s var(--ease-out) both; }
.hero-title .line.accent { animation-delay: .12s; background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; color: transparent; animation: rise 1s var(--ease-out) .12s both, shift 6s linear infinite; padding-bottom: .08em; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); filter: blur(12px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes shift { to { background-position: 200% 0; } }
.hero-sub { margin-top: 22px; max-width: 620px; color: var(--ink-2); font-size: 18px; line-height: 1.55; animation: rise 1s var(--ease-out) .25s both; }

.toolbar { display: flex; gap: 12px; margin-top: 40px; flex-wrap: wrap; animation: rise 1s var(--ease-out) .35s both; }
.search { flex: 1; min-width: 260px; display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 54px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(20px); transition: border-color .3s, box-shadow .3s; }
.search:focus-within { border-color: rgba(60,240,255,.5); box-shadow: 0 0 0 4px rgba(60,240,255,.08), 0 0 40px rgba(60,240,255,.15); }
.search svg { color: var(--ink-3); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--ink); font-size: 16px; font-family: inherit; }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px; border-radius: 16px; font-weight: 600;
  background: var(--grad); color: #050510; transition: transform .2s var(--spring), box-shadow .3s; }
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: var(--glass); color: var(--ink); border: 1px solid var(--line); backdrop-filter: blur(20px); }
.btn.ghost:hover { border-color: rgba(255,255,255,.2); box-shadow: 0 10px 40px rgba(139,92,255,.15); }
.btn.tiny { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12px; }
.kw-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; font-size: 12px; background: var(--grad); color: #050510; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; animation: rise 1s var(--ease-out) .45s both; }
.chips button { height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14px; color: var(--ink-2); border: 1px solid var(--line); background: var(--glass-2); transition: all .25s; }
.chips button:hover { color: var(--ink); border-color: rgba(255,255,255,.2); }
.chips button.on { color: #050510; background: var(--ink); border-color: transparent; }
.chips button small { opacity: .55; margin-left: 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 12px; }
.card { position: relative; aspect-ratio: 1 / 1.05; border-radius: 22px; padding: 18px; cursor: pointer; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015)); border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between;
  transform-style: preserve-3d; transition: transform .5s var(--ease-out), border-color .3s, box-shadow .4s;
  opacity: 0; animation: cardIn .7s var(--ease-out) forwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%), rgba(60,240,255,.18), rgba(139,92,255,.1) 40%, transparent 70%); }
.card:hover { border-color: rgba(255,255,255,.18); box-shadow: 0 30px 80px -20px rgba(139,92,255,.35); }
.card:hover::before { opacity: 1; }
.card .logo { flex: 1; display: grid; place-items: center; padding: 14px; }
.card .logo img { max-width: 78%; max-height: 92px; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0,0,0,.5)); transition: transform .5s var(--ease-out); }
.card:hover .logo img { transform: scale(1.08) translateZ(30px); }
.card .initials { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font-family: Unbounded; font-weight: 800; font-size: 28px; color: #050510; }
.card .name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.card .meta { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.06); color: var(--ink-2); font-family: "JetBrains Mono"; letter-spacing: .02em; }
.tag.warn { color: #ffcf3c; background: rgba(255,207,60,.1); }
.card .play { position: absolute; right: 14px; top: 14px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); color: #050510; transform: scale(.4); opacity: 0; transition: all .4s var(--spring); }
.card:hover .play { transform: scale(1); opacity: 1; }
.card .play svg { width: 16px; height: 16px; fill: currentColor; stroke: none; margin-left: 2px; }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; flex-wrap: wrap; animation: rise 1s var(--ease-out) .4s both; }
.probe-info { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); font-family: "JetBrains Mono"; }
.probe-info b { color: var(--ink); }
.probe-info i { width: 10px; height: 10px; border-radius: 50%; }
.probe-info i.ok { background: #3dff9a; box-shadow: 0 0 12px #3dff9a; }
.probe-info i.spin { border: 2px solid rgba(255,255,255,.15); border-top-color: var(--c1); animation: spin .8s linear infinite; }
.switch.small { font-size: 13px; color: var(--ink-2); }
.card .st { position: absolute; left: 16px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); z-index: 2; }
.card[data-status="ok"] .st { background: #3dff9a; box-shadow: 0 0 0 0 rgba(61,255,154,.6); animation: stPulse 2s infinite; }
.card[data-status="down"] .st { background: #ff3b5c; }
.card[data-status="down"] { filter: grayscale(.85); opacity: .5 !important; }
.card[data-status="checking"] .st { background: transparent; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--c1); animation: spin .8s linear infinite; }
@keyframes stPulse { 70% { box-shadow: 0 0 0 8px rgba(61,255,154,0); } 100% { box-shadow: 0 0 0 0 rgba(61,255,154,0); } }
.empty-grid { grid-column: 1 / -1; padding: 60px; text-align: center; color: var(--ink-3); }

/* ---------------------------------------------------------- STAGE */
#stage { height: 100vh; overflow: hidden; }
.topbar { position: absolute; z-index: 10; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 20px; padding: 18px 24px;
  background: linear-gradient(to bottom, rgba(4,5,10,.85), transparent); }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(20px); transition: all .25s; }
.icon-btn:hover { border-color: rgba(255,255,255,.25); transform: translateY(-1px); }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; background: var(--c3); color: #fff; transform: scale(0); transition: transform .4s var(--spring); }
.icon-btn .badge.show { transform: scale(1); }
#mute .off { display: none; } #mute.muted .on { display: none; } #mute.muted .off { display: block; }
.now { display: flex; align-items: center; gap: 14px; min-width: 0; }
.now-logo { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.06); display: grid; place-items: center; overflow: hidden; flex: none; border: 1px solid var(--line); }
.now-logo img { max-width: 80%; max-height: 80%; object-fit: contain; }
.now-name { font-family: Unbounded; font-weight: 600; font-size: 18px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.live-dot.live { background: #ff3b5c; box-shadow: 0 0 0 0 rgba(255,59,92,.7); animation: pulse 1.6s infinite; }
.live-dot.err { background: #ffcf3c; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255,59,92,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,92,0); } }
.hud { display: flex; gap: 6px; margin-left: auto; }
.hud-item { padding: 8px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(20px); min-width: 92px; }
.hud-item span { display: block; font-size: 10px; letter-spacing: .14em; color: var(--ink-3); font-weight: 600; }
.hud-item b { font-family: "JetBrains Mono"; font-size: 14px; font-weight: 600; }
.top-actions { display: flex; gap: 8px; }

.theater { position: absolute; inset: 90px 0 120px; display: flex; align-items: center; justify-content: center; transition: right .5s var(--ease-out); }
#stage.hits-open .theater { right: 380px; }
.transcript { position: relative; width: min(1400px, 100%); height: 100%; padding: 0 6vw; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.25) 22%, #000 55%, #000 92%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.25) 22%, #000 55%, #000 92%, transparent 100%); }
.flow { position: absolute; left: 6vw; right: 6vw; bottom: 8%; font-weight: 800; font-family: "Inter Tight", "Noto Sans Arabic", system-ui, sans-serif; letter-spacing: -.025em;
  font-size: calc(clamp(34px, 5.2vw, 84px) * var(--tsize)); line-height: 1.12; transition: transform .7s var(--ease-out); }
.flow p { margin-bottom: .35em; }
.w { display: inline-block; margin-right: .26em; white-space: nowrap; color: var(--ink);
  animation: wordIn .55s var(--ease-out) both; transition: color 1.2s, opacity 1.2s; }
.w.old { color: rgba(244,246,255,.55); }
@keyframes wordIn {
  0% { opacity: 0; transform: translateY(.45em) scale(.92); filter: blur(14px); }
  60% { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: none; }
}
.w.low { opacity: .75; }
.ghost-words { display: inline; }
.ghost-words .g { display: inline-block; margin-right: .26em; color: transparent; -webkit-text-stroke: 1.5px rgba(244,246,255,.35);
  animation: ghostIn .4s var(--ease-out) both; }
@keyframes ghostIn { from { opacity: 0; } to { opacity: 1; } }
.ghost-words .g.kw { -webkit-text-stroke-color: var(--kc); }

.w.kw { position: relative; color: transparent; z-index: 2;
  background: linear-gradient(100deg, var(--kc), #fff 50%, var(--kc)); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  animation: wordIn .55s var(--ease-out) both, kwPop .9s var(--spring) both, kwShine 2.4s linear .6s infinite;
  filter: drop-shadow(0 0 22px var(--kc)) drop-shadow(0 0 60px color-mix(in srgb, var(--kc) 50%, transparent)); }
.w.kw::after { content: ""; position: absolute; left: -.1em; right: -.1em; bottom: .02em; height: .1em; border-radius: .1em; background: var(--kc);
  transform-origin: left; animation: underline .8s var(--ease-out) .25s both; box-shadow: 0 0 24px var(--kc); }
@keyframes kwPop { 0% { transform: scale(.6) translateY(.3em); } 45% { transform: scale(1.32) rotate(-2deg); } 100% { transform: none; } }
@keyframes kwShine { to { background-position: -250% 0; } }
@keyframes underline { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.shock { position: fixed; z-index: 49; pointer-events: none; border-radius: 50%; border: 3px solid var(--kc); transform: translate(-50%,-50%) scale(0);
  animation: shock 1s var(--ease-out) forwards; box-shadow: 0 0 40px var(--kc), inset 0 0 30px var(--kc); }
@keyframes shock { to { transform: translate(-50%,-50%) scale(1); opacity: 0; } }
.flash { position: fixed; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(circle at var(--fx) var(--fy), var(--kc), transparent 60%); opacity: 0; animation: flash 1.1s ease-out; }
@keyframes flash { 0% { opacity: .35; } 100% { opacity: 0; } }
#stage.shake .flow { animation: shake .45s; }
@keyframes shake { 20% { translate: -6px 3px; } 40% { translate: 5px -4px; } 60% { translate: -3px 2px; } 80% { translate: 2px -1px; } }

.loader { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; transition: opacity .6s, transform .6s var(--ease-out); }
.loader.hide { opacity: 0; transform: scale(.94); pointer-events: none; }
.rings { position: relative; width: 120px; height: 120px; }
.rings i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--c1); border-right-color: var(--c2); animation: spin 1.4s linear infinite; }
.rings i:nth-child(2) { inset: 16px; border-top-color: var(--c2); border-right-color: var(--c3); animation-duration: 1.1s; animation-direction: reverse; }
.rings i:nth-child(3) { inset: 32px; border-top-color: var(--c3); border-right-color: var(--c1); animation-duration: .8s; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-family: Unbounded; font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.loader-sub { color: var(--ink-2); font-family: "JetBrains Mono"; font-size: 13px; white-space: pre-wrap; text-align: center; max-width: 640px; }
.loader.error .rings i { border-top-color: #ffcf3c; border-right-color: #ff3b5c; animation-duration: 4s; }

/* hits */
.hits { position: absolute; z-index: 9; top: 90px; right: 16px; bottom: 24px; width: 360px; border-radius: 22px; padding: 20px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(28px) saturate(1.4);
  transform: translateX(calc(100% + 40px)); transition: transform .6s var(--ease-out); display: flex; flex-direction: column; }
#stage.hits-open .hits { transform: none; }
.hits-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.hits-head h3 { font-family: Unbounded; font-size: 16px; font-weight: 600; }
.hits-empty { color: var(--ink-3); text-align: center; margin-top: 40px; line-height: 1.6; }
.hits-list { list-style: none; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 4px; }
.hits-list li { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-left: 3px solid var(--kc);
  animation: hitIn .7s var(--spring) both; }
@keyframes hitIn { from { opacity: 0; transform: translateX(40px) scale(.9); } to { opacity: 1; transform: none; } }
.hit-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hit-kw { font-weight: 800; color: var(--kc); font-size: 17px; }
.hit-time { font-family: "JetBrains Mono"; font-size: 13px; color: var(--ink); background: rgba(255,255,255,.07); padding: 2px 8px; border-radius: 6px; }
.hit-ctx { margin-top: 8px; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }
.hit-ctx mark { background: none; color: var(--kc); font-weight: 700; }

.toasts { position: absolute; z-index: 20; left: 50%; top: 96px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: 999px; background: rgba(10,12,22,.8);
  border: 1px solid color-mix(in srgb, var(--kc) 60%, transparent); box-shadow: 0 0 40px color-mix(in srgb, var(--kc) 40%, transparent);
  backdrop-filter: blur(16px); animation: toastIn .6s var(--spring) both, toastOut .5s ease-in 3.2s forwards; }
.toast .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--kc); display: grid; place-items: center; color: #050510; font-weight: 800; }
.toast b { color: var(--kc); }
.toast time { font-family: "JetBrains Mono"; color: var(--ink-2); font-size: 13px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(.8); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px) scale(.95); } }

/* ---------------------------------------------------------- SETTINGS */
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .4s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.settings { position: fixed; z-index: 61; top: 12px; right: 12px; bottom: 12px; width: min(460px, calc(100vw - 24px)); border-radius: 26px; padding: 26px;
  background: rgba(12,14,24,.92); border: 1px solid var(--line); backdrop-filter: blur(30px); overflow-y: auto;
  transform: translateX(calc(100% + 30px)); transition: transform .6s var(--ease-out); }
.settings.on { transform: none; }
.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.settings-head h2 { font-family: Unbounded; font-size: 24px; letter-spacing: -.02em; }
.set-block { padding: 18px 0; border-top: 1px solid var(--line); }
.set-block h4 { font-size: 14px; font-weight: 700; display: flex; justify-content: space-between; margin-bottom: 6px; }
.set-block h4 b { font-family: "JetBrains Mono"; color: var(--c1); }
.hint { color: var(--ink-3); font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
.kw-input { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); min-height: 56px; }
.kw-input:focus-within { border-color: rgba(60,240,255,.4); }
.kw-chips { display: contents; }
.kw-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 6px 0 12px; border-radius: 10px; font-weight: 700; font-size: 14px;
  color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--kc) 40%, transparent);
  animation: hitIn .4s var(--spring) both; }
.kw-chip button { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; opacity: .7; }
.kw-chip button:hover { opacity: 1; background: rgba(255,255,255,.1); }
.kw-chip svg { width: 14px; height: 14px; }
#kwField { flex: 1; min-width: 160px; background: none; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 15px; padding: 0 6px; }
.kw-suggest { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.kw-suggest button { padding: 4px 10px; border-radius: 8px; border: 1px dashed var(--line); color: var(--ink-2); font-size: 12px; }
.kw-suggest button:hover { border-color: var(--c1); color: var(--c1); }
input[type=range] { width: 100%; accent-color: var(--c1); }
.toggles { display: flex; flex-direction: column; gap: 14px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; }
.switch input { display: none; }
.switch span { width: 42px; height: 24px; border-radius: 12px; background: rgba(255,255,255,.1); position: relative; transition: background .3s; flex: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { transform: translateX(18px); }
.how { padding-left: 18px; color: var(--ink-2); font-size: 13.5px; line-height: 1.8; }
.how code { font-family: "JetBrains Mono"; font-size: 12px; color: var(--c1); }

@media (max-width: 900px) {
  .hud { display: none; }
  #stage.hits-open .theater { right: 0; }
  .hits { width: calc(100% - 32px); top: auto; height: 50vh; }
}
@media (max-width: 600px) {
  #home { padding: 24px 16px 60px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .topbar { padding: 12px; gap: 10px; }
  .now-name { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* dil seçici */
.lang-pick { position: relative; cursor: pointer; }
.lang-pick select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.lang-pick b::after { content: " ▾"; color: var(--ink-3); font-size: 11px; }
.tag.lang { color: var(--c1); background: rgba(60,240,255,.08); }
/* olası (bulanık) eşleşme */
.w.kw.fz { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--kc) 60%, transparent)); animation: wordIn .55s var(--ease-out) both, kwPop .9s var(--spring) both; }
.w.kw.fz::after { background: none; border-bottom: .06em dashed var(--kc); box-shadow: none; height: 0; }
.w.kw.fz::before { content: "≈"; position: absolute; top: -.55em; right: -.35em; font-size: .38em; color: var(--kc); -webkit-text-fill-color: var(--kc); }
.hit-fz { font-size: 10px; letter-spacing: .1em; padding: 2px 6px; border-radius: 5px; border: 1px dashed var(--kc); color: var(--kc); margin-left: 6px; vertical-align: middle; }
.hits-list li.fz { border-left-style: dashed; opacity: .85; }
textarea#vocab { width: 100%; resize: vertical; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--ink); font: inherit; font-size: 14px; outline: none; }
textarea#vocab:focus { border-color: rgba(60,240,255,.4); }
.muted { color: var(--ink-3); }

/* sağdan sola diller (Arapça, Farsça…) */
.flow[dir="rtl"] { letter-spacing: 0; line-height: 1.35; }
.flow[dir="rtl"] .w, .flow[dir="rtl"] .g { margin-right: 0; margin-left: .26em; }
/* uyarılar */
.notices { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 5; }
.notice { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 12px; font-size: 13.5px; color: #ffcf3c;
  background: rgba(255,207,60,.08); border: 1px solid rgba(255,207,60,.3); backdrop-filter: blur(12px); animation: hitIn .5s var(--spring) both; }
.nospeech { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(10px); display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-radius: 999px; font-size: 13px; color: var(--ink-2); background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(12px); opacity: 0; transition: opacity .6s, transform .6s var(--ease-out); pointer-events: none; z-index: 5; }
.nospeech.on { opacity: 1; transform: translateX(-50%); }
.nospeech small { color: var(--ink-3); }
.nospeech .eq { display: flex; gap: 2px; align-items: flex-end; height: 14px; }
.nospeech .eq i { width: 3px; background: var(--c2); border-radius: 2px; animation: eq .8s ease-in-out infinite alternate; }
.nospeech .eq i:nth-child(1){height:40%} .nospeech .eq i:nth-child(2){height:90%;animation-delay:-.3s}
.nospeech .eq i:nth-child(3){height:60%;animation-delay:-.6s} .nospeech .eq i:nth-child(4){height:80%;animation-delay:-.15s}
.hit-ctx { unicode-bidi: plaintext; }
.grid.hide-down .card[data-status="down"] { display: none; }
.resume { position: absolute; left: 0; right: 0; margin: 0 auto; width: max-content; top: 62%; z-index: 6; display: none; box-shadow: 0 10px 50px rgba(139,92,255,.5); }
.resume.on { display: inline-flex; animation: hitIn .5s var(--spring) both; }
.resume svg { fill: currentColor; stroke: none; }

/* ---------------------------------------------------------- ARŞİV ARAMA */
.seek { margin-top: 36px; animation: rise 1s var(--ease-out) .35s both; }
.seek-box { position: relative; display: flex; align-items: center; gap: 14px; height: 72px; padding: 0 10px 0 24px; border-radius: 22px;
  background: rgba(14,16,28,.72); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(24px);
  box-shadow: 0 30px 80px -30px rgba(139,92,255,.45); transition: border-color .3s, box-shadow .3s; }
.seek-box::before { content: ""; position: absolute; inset: -1px; border-radius: 23px; padding: 1px; background: var(--grad); opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; transition: opacity .3s; pointer-events: none; }
.seek-box:focus-within::before { opacity: 1; }
.seek-box:focus-within { box-shadow: 0 0 0 6px rgba(139,92,255,.12), 0 30px 90px -20px rgba(60,240,255,.35); }
.seek-box > svg { width: 24px; height: 24px; color: var(--ink-2); flex: none; }
.seek-box input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--ink); font: 600 21px "Inter Tight"; letter-spacing: -.01em; }
.seek-box input::placeholder { color: var(--ink-3); font-weight: 500; }
.seek-box kbd { font: 600 12px "JetBrains Mono"; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.seek-box .btn { height: 52px; padding: 0 26px; border-radius: 15px; font-size: 16px; }
.seek-opts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-top: 14px; }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); }
.seg button { height: 32px; padding: 0 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: all .25s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: rgba(255,255,255,.1); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }

.results { margin: 8px 0 72px; }
.results[hidden] { display: none; }
.res-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.res-summary { font-size: 15px; color: var(--ink-2); }
.res-summary b { color: var(--ink); font-weight: 700; }
.res-summary .q { font-family: Unbounded; font-weight: 600; color: var(--ink); }

.hist { position: relative; margin-top: 18px; padding: 16px 18px 10px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); }
.hist figcaption { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 8px; }
.hist svg { display: block; width: 100%; height: 110px; overflow: visible; stroke: none; } /* genel svg kuralı çizgi veriyor */
.hist .bar { fill: #8b5cff; transition: fill .2s, opacity .2s; }
.hist .hit { fill: transparent; cursor: pointer; }
.hist .hit:hover + .bar, .hist .bar.sel { fill: #b39aff; }
.hist .axis { fill: var(--ink-3); font: 11px "JetBrains Mono"; }
.hist .base { stroke: rgba(255,255,255,.12); stroke-width: 1; }
.hist-tip { position: absolute; pointer-events: none; padding: 7px 10px; border-radius: 10px; background: rgba(8,10,20,.95); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink); white-space: nowrap; transform: translate(-50%, -100%); }
.hist-tip b { font-family: "JetBrains Mono"; }
.hist-tip[hidden] { display: none; }

.facets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.facet { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 6px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-2); background: var(--glass-2); border: 1px solid var(--line); transition: all .2s; animation: hitIn .45s var(--spring) both; }
.facet:hover { color: var(--ink); border-color: rgba(255,255,255,.2); }
.facet.on { color: var(--ink); border-color: #8b5cff; background: rgba(139,92,255,.14); }
.facet .fl { width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.92); display: grid; place-items: center; overflow: hidden; flex: none; }
.facet .fl img { max-width: 88%; max-height: 80%; object-fit: contain; }
.facet .fl b { font: 800 11px Unbounded; color: #050510; }
.facet .n { font-family: "JetBrains Mono"; font-size: 12px; color: var(--ink-3); }
.res-filter { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.res-filter .chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 12px; border-radius: 9px; font-size: 13px;
  background: rgba(60,240,255,.1); border: 1px solid rgba(60,240,255,.35); color: var(--c1); }
.res-filter .chip button { width: 20px; height: 20px; border-radius: 6px; color: inherit; }
.res-filter .chip button:hover { background: rgba(255,255,255,.1); }

.res-list { list-style: none; margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.res { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 18px; border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,.055), rgba(255,255,255,.015)); border: 1px solid var(--line);
  animation: resIn .6s var(--ease-out) both; transition: border-color .3s, box-shadow .3s; }
.res:hover { border-color: rgba(255,255,255,.16); box-shadow: 0 24px 60px -30px rgba(139,92,255,.4); }
@keyframes resIn { from { opacity: 0; transform: translateY(16px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.res-logo { width: 64px; height: 64px; border-radius: 16px; background: rgba(255,255,255,.94); display: grid; place-items: center; overflow: hidden; }
.res-logo img { max-width: 84%; max-height: 74%; object-fit: contain; }
.res-logo b { font: 800 18px Unbounded; color: #050510; }
.res-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.res-ch { font-weight: 800; font-size: 16px; }
.res-time { font: 600 14px "JetBrains Mono"; color: var(--c1); background: rgba(60,240,255,.08); padding: 2px 8px; border-radius: 7px; }
.res-rel { font-size: 13px; color: var(--ink-3); }
.res-live { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  color: var(--ink-2); border: 1px solid var(--line); transition: all .2s; }
.res-live:hover { color: #fff; border-color: #ff3b5c; background: rgba(255,59,92,.12); }
.res-live i { width: 7px; height: 7px; border-radius: 50%; background: #ff3b5c; }
.views { display: inline-flex; gap: 2px; margin-top: 10px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.views button { height: 26px; padding: 0 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); transition: all .2s; }
.views button:hover { color: var(--ink); }
.views button.on { color: var(--ink); background: rgba(255,255,255,.1); }
.res-text { margin-top: 10px; font-size: 17px; line-height: 1.6; color: var(--ink-2); transition: opacity .25s; }
.res-text.loading { opacity: .4; }
.res-text .tw { cursor: default; border-radius: 4px; transition: background .15s; }
.res-text .tw:hover { background: rgba(255,255,255,.07); color: var(--ink); }
.res-text mark { background: none; color: var(--ink); font-weight: 800; padding: 0 1px;
  background-image: linear-gradient(100deg, rgba(60,240,255,.35), rgba(139,92,255,.35)); background-size: 100% 38%; background-repeat: no-repeat; background-position: 0 88%; }
.ctx-line { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 12px; padding: 6px 0; border-top: 1px dashed rgba(255,255,255,.06); }
.ctx-line:first-child { border-top: 0; }
.ctx-line time { font: 600 12px "JetBrains Mono"; color: var(--ink-3); padding-top: 4px; }
.ctx-line.anchor { color: var(--ink); }
.ctx-line.anchor time { color: var(--c1); }
.ctx-head { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 4px; }
.res-empty, .res-err { padding: 40px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 18px; }
.res-more { display: flex; justify-content: center; margin-top: 18px; }
.res-more .btn[hidden] { display: none; }
.skel { height: 120px; border-radius: 20px; background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.07) 50%, rgba(255,255,255,.03) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.live-sec { margin-top: 8px; padding-top: 32px; border-top: 1px solid var(--line); }
.sec-head h2 { font-family: Unbounded; font-size: 26px; letter-spacing: -.02em; }
.sec-head p { color: var(--ink-2); margin-top: 6px; }
.live-sec .toolbar { margin-top: 20px; animation: none; }
.live-sec .filter-row, .live-sec .chips { animation: none; }

@media (max-width: 700px) {
  .seek-box { height: 60px; padding-left: 16px; }
  .seek-box input { font-size: 17px; }
  .seek-box kbd { display: none; }
  .seek-box .btn { height: 44px; padding: 0 16px; }
  .res { grid-template-columns: 44px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .res-logo { width: 44px; height: 44px; border-radius: 12px; }
  .res-live { margin-left: 0; }
  .ctx-line { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------------------------------------------------------- SADE ANA SAYFA (arama motoru) */
#home { max-width: none; padding: 0; }
#livepage { max-width: 1320px; margin: 0 auto; padding: 0 32px 80px; }
.topnav { display: flex; align-items: center; justify-content: flex-end; gap: 22px; padding: 20px 28px; font-size: 14px; font-weight: 600; }
#livepage .topnav { padding: 20px 0; }
.topnav a { color: var(--ink-2); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: color .2s; }
.topnav a:hover { color: var(--ink); }
.topnav .grow { flex: 1; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: #ff3b5c; box-shadow: 0 0 0 0 rgba(255,59,92,.6); animation: pulse 1.8s infinite; }
.brand-sm .brand-name { font-size: 20px; }

.landing { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: calc(100vh - 140px);
  max-width: 720px; margin: 0 auto; padding: 0 20px; transition: min-height .5s var(--ease-out); }
.logo-xl { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); margin-bottom: 34px; animation: rise .9s var(--ease-out) both; }
.logo-xl .brand-mark { height: 54px; gap: 6px; }
.logo-xl .brand-mark i { width: 8px; border-radius: 6px; }
.logo-xl .brand-name { font-size: 76px; letter-spacing: -.05em; }
.landing .seek { width: 100%; margin-top: 0; animation: rise .9s var(--ease-out) .1s both; }
.landing .seek-box { height: 62px; padding: 0 8px 0 22px; border-radius: 31px; }
.landing .seek-box::before { border-radius: 32px; }
.seek-box input { font-size: 18px; font-weight: 500; }
.seek-go { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #050510; flex: none;
  transition: transform .25s var(--spring); }
.seek-go:hover { transform: scale(1.06); }
.seek-go svg { width: 20px; height: 20px; stroke-width: 2.4; }
.landing .seek-opts { justify-content: center; gap: 12px; margin-top: 16px; }
.landing .seg { background: none; border-color: transparent; backdrop-filter: none; }
.landing-note { margin-top: 26px; color: var(--ink-3); font-size: 14px; text-align: center; animation: rise .9s var(--ease-out) .2s both; }

/* arama yapılınca: üst çubuk düzeni */
body.searching .landing { min-height: 0; max-width: 940px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start;
  gap: 8px 22px; padding: 4px 20px 0; }
body.searching .logo-xl { margin: 0; animation: none; }
body.searching .logo-xl .brand-name { font-size: 30px; }
body.searching .logo-xl .brand-mark { height: 24px; gap: 3px; }
body.searching .logo-xl .brand-mark i { width: 4px; }
body.searching .landing .seek { flex: 1; min-width: 280px; animation: none; }
body.searching .landing .seek-box { height: 52px; }
body.searching .landing .seek-go { width: 38px; height: 38px; }
body.searching .landing .seek-opts { justify-content: flex-start; margin-top: 8px; }
body.searching .landing-note { display: none; }
body.searching #home .topnav { position: absolute; right: 0; top: 0; }
.results { max-width: 900px; margin: 18px auto 80px; padding: 0 20px; }
.link-btn { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.link-btn:hover { color: var(--ink); }

.live-head h1 { font-family: Unbounded; font-weight: 800; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.03em; margin-top: 10px; }
.live-head p { color: var(--ink-2); margin-top: 8px; }
.live-head .toolbar { margin-top: 24px; animation: none; }
.live-head .filter-row, .live-head .chips { animation: none; }

@media (max-width: 700px) {
  .logo-xl .brand-name { font-size: 54px; }
  .logo-xl .brand-mark { height: 40px; }
  .topnav { padding: 16px; gap: 16px; }
  #livepage { padding: 0 16px 60px; }
  body.searching #home .topnav { position: static; }
  body.searching .landing { padding-top: 0; }
  .landing .seek-opts { flex-direction: column; align-items: center; }
}

/* ======================================================================= MOBİL / PWA
   Uygulama standartları: güvenli alanlar (çentik, home çubuğu), ≥44px dokunma hedefleri, ≥16px giriş metni
   (iOS yakınlaştırmaz), alt sekme çubuğu, alttan açılan sayfalar, dinamik görünüm yüksekliği (dvh). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
button, .tabbar a, .facet, .chips button, .seg button, .views button { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.install-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 13.5px; font-weight: 700;
  color: #050510; background: var(--grad); }
.install-btn[hidden] { display: none; }
.install-btn svg { width: 16px; height: 16px; stroke-width: 2.4; }
.tabbar { display: none; }
#stage { height: 100vh; height: 100dvh; }
.topnav { padding-top: max(20px, env(safe-area-inset-top)); padding-right: max(28px, env(safe-area-inset-right)); }

@media (max-width: 900px) {
  /* --- alt sekme çubuğu */
  .tabbar { display: flex; position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    padding: 6px max(10px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
    background: rgba(8,10,20,.82); border-top: 1px solid var(--line); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px;
    color: var(--ink-3); font-size: 11px; font-weight: 600; text-decoration: none; border-radius: 12px; transition: color .2s; }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a.on { color: var(--ink); }
  .tabbar a.on svg { color: var(--c1); filter: drop-shadow(0 0 8px rgba(60,240,255,.5)); }
  body[data-view="stage"] .tabbar { display: none; }
  body:not([data-view="stage"]) .view.active { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .hide-m { display: none !important; }
  .grain { display: none; }                       /* pil: sürekli animasyonu kapat */

  /* --- ana sayfa */
  #home .topnav { min-height: 56px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .landing { min-height: calc(100dvh - 56px - 72px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); padding: 0 16px; }
  .logo-xl { margin-bottom: 26px; }
  .logo-xl .brand-name { font-size: 56px; }
  .logo-xl .brand-mark { height: 40px; gap: 5px; }
  .logo-xl .brand-mark i { width: 6px; }
  .landing .seek-box { height: 56px; padding: 0 6px 0 18px; }
  .seek-box input { font-size: 17px; }
  .seek-go { width: 44px; height: 44px; }
  .landing .seek-opts { flex-direction: column; align-items: stretch; gap: 8px; }
  .landing .seg { width: 100%; display: flex; background: var(--glass-2); border-color: var(--line); }
  .landing .seg button { flex: 1; min-height: 40px; padding: 0 6px; font-size: 13.5px; }
  .landing-note { font-size: 13px; padding: 0 12px; }
  body.searching .landing { flex-direction: column; align-items: stretch; gap: 10px; padding: 0 16px; }
  body.searching .logo-xl { justify-content: center; }
  body.searching .landing .seek { min-width: 0; }
  body.searching .landing .seek-box { height: 50px; }
  body.searching .landing .seek-opts { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 4px -16px 0; padding: 0 16px; }
  body.searching .landing .seek-opts::-webkit-scrollbar { display: none; }
  body.searching .landing .seg { width: auto; flex: none; }
  body.searching .landing .seg button { flex: none; padding: 0 12px; }
  body.searching #home .topnav { position: static; min-height: 0; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 6px; }

  /* --- sonuçlar */
  .results { padding: 0 16px; margin-top: 12px; }
  .res-summary { font-size: 14px; }
  .hist { padding: 12px 12px 8px; border-radius: 16px; }
  .hist svg { height: 90px; }
  .facets { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 14px -16px 0; padding: 2px 16px; }
  .facets::-webkit-scrollbar { display: none; }
  .facet { flex: none; height: 42px; scroll-snap-align: start; }
  .res { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 18px; }
  .res-logo { width: 44px; height: 44px; border-radius: 12px; }
  .res-head { gap: 6px 8px; }
  .res-ch { font-size: 15px; }
  .res-time { font-size: 13px; }
  .res-live { order: 5; margin-left: 0; min-height: 36px; }
  .views { display: flex; width: 100%; }
  .views button { flex: 1; min-height: 36px; font-size: 13px; }
  .res-text { font-size: 16px; }
  .ctx-line { grid-template-columns: 1fr; gap: 0; }
  .res-more .btn { width: 100%; justify-content: center; }

  /* --- canlı yayınlar sayfası */
  #livepage { padding: 0 16px; }
  #livepage .topnav { padding-left: 0; padding-right: 0; }
  .live-head .toolbar { flex-direction: column; }
  .live-head .toolbar .search { flex: none; }
  .live-head .toolbar .btn { justify-content: center; }
  .search { min-width: 0; height: 50px; }
  .search input { font-size: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 16px -16px 0; padding: 0 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { flex: none; height: 40px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { aspect-ratio: auto; min-height: 168px; padding: 14px; border-radius: 18px; }
  .card .logo { padding: 8px; }
  .card .logo img { max-height: 64px; }
  .card .name { font-size: 14.5px; }
  .card .play { display: none; }
  .card .meta .tag.src { display: none; }

  /* --- canlı sahne */
  .topbar { padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left)); gap: 10px; }
  .now-logo { width: 40px; height: 40px; border-radius: 12px; }
  .now-name { font-size: 15px; max-width: 42vw; }
  .top-actions { gap: 6px; margin-left: auto; }
  .theater { inset: calc(70px + env(safe-area-inset-top)) 0 calc(96px + env(safe-area-inset-bottom)); }
  .transcript { padding: 0 16px; }
  .flow { left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); bottom: 6%;
    font-size: calc(clamp(26px, 7.4vw, 44px) * var(--tsize)); line-height: 1.16; }
  .loader-text { font-size: 20px; text-align: center; padding: 0 20px; }
  .loader-sub { padding: 0 24px; }
  .toasts { top: calc(72px + env(safe-area-inset-top)); width: calc(100% - 32px); }
  .toast { max-width: 100%; font-size: 13.5px; }
  .notices { width: calc(100% - 32px); }
  .notice { font-size: 13px; }
  .nospeech { bottom: 10px; font-size: 12.5px; max-width: calc(100% - 32px); }
  /* eşleşmeler: alttan açılan sayfa */
  .hits { position: fixed; z-index: 30; left: 0; right: 0; top: auto; bottom: 0; width: 100%; height: 62dvh; border-radius: 24px 24px 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(105%); }
  .hits::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255,255,255,.2); }
  #stage.hits-open .theater { right: 0; }

  /* --- ayarlar: alttan açılan sayfa */
  .settings { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 90dvh; border-radius: 26px 26px 0 0;
    padding: 26px 18px calc(22px + env(safe-area-inset-bottom)); transform: translateY(105%); }
  .settings::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: rgba(255,255,255,.2); }
  .settings.on { transform: none; }
  #kwField, textarea#vocab { font-size: 16px; }
  .kw-suggest button { min-height: 34px; }
  .switch { min-height: 40px; }
}

@media (max-width: 380px) {
  .logo-xl .brand-name { font-size: 46px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .now-name { max-width: 34vw; }
  .icon-btn { width: 42px; height: 42px; }
}

/* yatay telefon: canlı sahnede yazıya daha çok yer */
@media (max-height: 500px) and (orientation: landscape) {
  .theater { inset: calc(60px + env(safe-area-inset-top)) 0 40px; }
  .flow { font-size: calc(clamp(22px, 4.6vw, 36px) * var(--tsize)); }
  .landing { min-height: 0; padding-top: 24px; }
  .logo-xl { margin-bottom: 16px; }
  .logo-xl .brand-name { font-size: 40px; }
}

/* uygulama olarak açıldığında (ana ekrandan) */
@media (display-mode: standalone) {
  body { overscroll-behavior-y: none; }
  .install-btn { display: none !important; }
}

/* canlı sahne üst çubuğu: kanal adı düğmelerin altına girmesin, sığmazsa "…" */
@media (max-width: 900px) {
  .topbar .now { flex: 1; min-width: 0; }
  .topbar .now > div { min-width: 0; }
  .now-name { max-width: none; }
}
@media (max-width: 420px) {
  .topbar .now-logo { display: none; }
  .top-actions .icon-btn { width: 42px; height: 42px; }
}
