/* IPTV Web — tema degiskenleri, kabuk, menu, izgara ve player stilleri */

:root {
  --bg: #0e1116;
  --bg-2: #151a21;
  --bg-3: #1c232c;
  --line: #262f3a;
  --fg: #e8edf4;
  --fg-dim: #93a1b3;
  --fg-mute: #64748b;
  --accent: #3b82f6;
  --accent-2: #60a5fa;
  --accent-fg: #ffffff;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
  --shadow: 0 8px 28px rgba(0, 0, 0, .45);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 236px;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-2: #ffffff;
  --bg-3: #eef2f7;
  --line: #dde4ec;
  --fg: #14202e;
  --fg-dim: #51617a;
  --fg-mute: #8494a8;
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --accent-fg: #ffffff;
  --shadow: 0 8px 24px rgba(20, 32, 46, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }

/* `display` veren her sinif (.field, .nav-item, .live-badge, .pl-status …) tarayicinin
   varsayilan [hidden] kuralini ezer. Gizlemenin her yerde calismasi icin bunu sabitliyoruz. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--fg);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); text-decoration: none; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------- ortak ogeler ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-3); color: var(--fg); cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s;
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:hover { background: var(--line); }
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { border-color: #7f1d1d; color: #fca5a5; background: transparent; }
.btn.danger:hover { background: rgba(239, 68, 68, .12); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
/* Cok satirli aciklama tasiyan secim butonlari (ornegin arabellek profilleri) */
.btn.wrap { white-space: normal; line-height: 1.45; display: block; }
.btn.wrap.on { border-color: var(--accent); background: rgba(59, 130, 246, .13); }
/* Secili secenek dugmesi (yayin bicimi, uyumluluk modu…) */
.btn.on { border-color: var(--accent); background: rgba(59, 130, 246, .13); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--fg-dim); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--fg-mute); }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input::placeholder { color: var(--fg-mute); }

.card {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}

.msg { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 14px; }
.msg.err { background: rgba(239, 68, 68, .12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .3); }
.msg.ok  { background: rgba(34, 197, 94, .12); color: #86efac; border: 1px solid rgba(34, 197, 94, .3); }
.msg.info{ background: rgba(59, 130, 246, .1); color: var(--accent-2); border: 1px solid rgba(59, 130, 246, .28); }
.msg.warn{ background: rgba(245, 158, 11, .12); color: #fcd34d; border: 1px solid rgba(245, 158, 11, .3); }
html[data-theme="light"] .msg.err { color: #b91c1c; }
html[data-theme="light"] .msg.ok { color: #15803d; }
html[data-theme="light"] .msg.warn { color: #b45309; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { padding: 48px 20px; text-align: center; color: var(--fg-mute); }

/* --------------------------------- giris ----------------------------------- */

#login {
  min-height: 100%; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(1000px 560px at 50% -10%, rgba(59,130,246,.16), transparent 70%);
}
.login-box { width: 100%; max-width: 400px; }
.login-logo {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  margin-bottom: 22px; font-size: 25px; font-weight: 700; letter-spacing: -.3px;
}
.login-logo svg { width: 36px; height: 36px; color: var(--accent); }
.login-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: var(--bg-3); padding: 4px; border-radius: 10px; }
.login-tabs button {
  flex: 1; padding: 9px; border: 0; background: transparent; color: var(--fg-dim);
  border-radius: 7px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.login-tabs button.active { background: var(--bg-2); color: var(--fg); box-shadow: var(--shadow); }

.qr-wrap { text-align: center; }
.qr-wrap img {
  width: 232px; height: 232px; border-radius: var(--radius); background: #fff;
  padding: 10px; display: block; margin: 0 auto 14px;
}
.qr-code {
  font-size: 32px; font-weight: 700; letter-spacing: 7px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--accent-2); margin: 6px 0 4px;
}
.qr-steps { text-align: left; font-size: 13.5px; color: var(--fg-dim); margin: 16px 0 0; padding-left: 20px; }
.qr-steps li { margin-bottom: 5px; }

/* --------------------------------- kabuk ----------------------------------- */

#app { display: none; height: 100%; }
#app.on { display: grid; grid-template-columns: var(--sidebar-w) 1fr; }

.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px;
  font-weight: 700; font-size: 17px; border-bottom: 1px solid var(--line);
}
.brand svg { width: 24px; height: 24px; color: var(--accent); flex: none; }

.nav { flex: 1; overflow-y: auto; padding: 10px 10px 16px; }
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 0; }
.nav-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .9px;
  color: var(--fg-mute); padding: 8px 10px 6px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 11px; border-radius: var(--radius-sm); border: 0;
  background: transparent; color: var(--fg-dim); cursor: pointer; text-align: left;
  font-size: 14.5px; transition: background .13s, color .13s;
}
.nav-item:hover { background: var(--bg-3); color: var(--fg); }
.nav-item.active { background: var(--accent); color: var(--accent-fg); font-weight: 500; }
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item .count { margin-left: auto; font-size: 11.5px; opacity: .75; }

.sidebar-foot { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; align-items: center; }
.user-chip {
  flex: 1; display: flex; align-items: center; gap: 9px; padding: 7px 9px;
  border-radius: var(--radius-sm); background: var(--bg-3); min-width: 0; cursor: pointer;
  border: 0; color: inherit; text-align: left;
}
.user-chip:hover { background: var(--line); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
}
.user-chip .who { min-width: 0; }
.user-chip .who b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who span { font-size: 11.5px; color: var(--fg-mute); }
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-3); display: grid; place-items: center;
  cursor: pointer; color: var(--fg-dim);
}
.icon-btn:hover { background: var(--line); color: var(--fg); }
.icon-btn svg { width: 18px; height: 18px; }

/* Mobil menu karartmasi — masaustunde hic yer kaplamamali (yoksa grid sutunu yer) */
.scrim { display: none; }

.main { display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  border-bottom: 1px solid var(--line); background: var(--bg-2); flex: none;
}
.topbar h1 {
  font-size: 17px; margin: 0; font-weight: 600; flex: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-box { position: relative; flex: 1; max-width: 420px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--fg-mute); }
.search-box input { padding-left: 36px; background: var(--bg); }
.menu-toggle { display: none; }

/* Ust cubuktaki eylem butonlari govde butonlarindan daha kompakt olmali */
#topActions { display: flex; gap: 8px; flex: none; margin-left: auto; }
.topbar .btn { padding: 7px 13px; font-size: 13.5px; }
.topbar .btn svg { width: 16px; height: 16px; }

.content { flex: 1; overflow-y: auto; padding: 18px; }
.content.split { display: grid; grid-template-columns: 224px 1fr; gap: 16px; padding: 0; overflow: hidden; }
.cat-pane { border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 10px; }
.cat-item {
  display: flex; align-items: center; width: 100%; padding: 9px 11px; gap: 8px;
  border: 0; background: transparent; color: var(--fg-dim); border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; font-size: 14px;
}
.cat-item:hover { background: var(--bg-3); color: var(--fg); }
.cat-item.active { background: var(--accent); color: var(--accent-fg); }
.cat-item .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-item .count { margin-left: auto; font-size: 11px; opacity: .7; flex: none; }
.list-pane { overflow-y: auto; padding: 16px; }

/* --------------------------------- izgara ---------------------------------- */

.grid { display: grid; gap: 12px; }
.grid.live { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.grid.vod  { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }

.tile {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; position: relative;
  transition: border-color .15s, transform .1s;
}
.tile:hover, .tile:focus-visible { border-color: var(--accent); outline: none; }
.tile:hover { transform: translateY(-2px); }
.tile .thumb {
  width: 100%; background: var(--bg-3); display: grid; place-items: center; overflow: hidden;
}
.grid.live .thumb { aspect-ratio: 16/9; }
.grid.vod .thumb { aspect-ratio: 2/3; }
.tile .thumb img { width: 100%; height: 100%; object-fit: contain; }
.grid.vod .thumb img { object-fit: cover; }
.tile .thumb .ph { font-size: 22px; font-weight: 700; color: var(--fg-mute); }
.tile .meta { padding: 9px 11px; }
.tile .meta b { display: block; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .meta span { font-size: 11.5px; color: var(--fg-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.tile .fav {
  position: absolute; top: 7px; right: 7px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.55); border: 0; display: grid; place-items: center; cursor: pointer;
  color: #fff; opacity: 0; transition: opacity .15s;
}
.tile:hover .fav, .tile .fav.on { opacity: 1; }
.tile .fav.on { color: #f59e0b; }
.tile .fav svg { width: 16px; height: 16px; }
.tile .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); }

.load-more { display: flex; justify-content: center; padding: 20px; }

/* --------------------------------- player ---------------------------------- */

#player {
  position: fixed; inset: 0; background: #000; z-index: 100; display: none;
  flex-direction: column;
}
#player.on { display: flex; }
#player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-wrap { flex: 1; position: relative; min-height: 0; }

.pl-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: space-between; transition: opacity .25s;
  background: linear-gradient(180deg, rgba(0,0,0,.72) 0%, transparent 22%, transparent 62%, rgba(0,0,0,.85) 100%);
}
.pl-overlay.hide { opacity: 0; pointer-events: none; }

.pl-top { display: flex; align-items: center; gap: 12px; padding: 16px 20px; color: #fff; }
.pl-top .title { flex: 1; min-width: 0; }
.pl-top .title b { display: block; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-top .title span { font-size: 12.5px; opacity: .75; }
.pl-btn {
  border: 0; background: rgba(255,255,255,.14); color: #fff; width: 42px; height: 42px;
  border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none;
  transition: background .15s;
}
.pl-btn:hover, .pl-btn:focus-visible { background: rgba(255,255,255,.3); outline: none; }
.pl-btn svg { width: 21px; height: 21px; }
.pl-btn.big { width: 60px; height: 60px; }
.pl-btn.big svg { width: 30px; height: 30px; }

.pl-bottom { padding: 12px 20px 20px; color: #fff; }
.seekbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.seekbar .t { font-size: 12.5px; font-variant-numeric: tabular-nums; opacity: .85; min-width: 48px; text-align: center; }
.track {
  flex: 1; height: 5px; background: rgba(255,255,255,.25); border-radius: 3px;
  position: relative; cursor: pointer;
}
.track .buf { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.3); border-radius: 3px; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 3px; }
.track .knob {
  position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%); box-shadow: 0 1px 5px rgba(0,0,0,.5);
}
.track.live { pointer-events: none; opacity: .4; }
.pl-controls { display: flex; align-items: center; gap: 10px; }
.pl-controls .spacer { flex: 1; }
.live-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  background: var(--danger); border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .5px;
}
.live-badge i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.pl-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.pl-status {
  background: rgba(0,0,0,.72); padding: 14px 22px; border-radius: 30px; color: #fff;
  display: flex; align-items: center; gap: 12px; font-size: 14px;
}
.seek-hint {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.62); color: #fff; padding: 16px 22px; border-radius: 12px;
  font-size: 17px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.seek-hint.show { opacity: 1; }
.seek-hint.back { left: 9%; }
.seek-hint.fwd { right: 9%; }

.epg-strip { padding: 0 20px 4px; color: #fff; font-size: 13px; opacity: .85; }
.epg-strip b { font-weight: 600; }

/* --------------------------------- modal ----------------------------------- */

.modal-back {
  position: fixed; inset: 0; background: rgba(4, 7, 12, .72); z-index: 200;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-back.on { display: flex; }
.modal {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  width: 100%; max-width: 540px; max-height: 88vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.modal.wide { max-width: 860px; }
.modal-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line); flex: none;
}
.modal-head h2 { font-size: 17px; margin: 0; flex: 1; font-weight: 600; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px;
  border-top: 1px solid var(--line); flex: none;
}

/* --------------------------------- tablo ----------------------------------- */

/* Genis tablolar sayfayi degil, kendi kabini yatay kaydirsin */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 10px 12px; color: var(--fg-mute); font-weight: 600;
  font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--line);
}
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-3); color: var(--fg-dim);
}
.badge.ok { background: rgba(34,197,94,.16); color: #4ade80; }
.badge.err { background: rgba(239,68,68,.16); color: #f87171; }
.badge.warn { background: rgba(245,158,11,.16); color: #fbbf24; }
.badge.accent { background: rgba(59,130,246,.16); color: var(--accent-2); }
html[data-theme="light"] .badge.ok { color: #15803d; }
html[data-theme="light"] .badge.err { color: #b91c1c; }
html[data-theme="light"] .badge.warn { color: #b45309; }

.pl-card {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2);
  margin-bottom: 12px;
}
.pl-card .ic {
  width: 42px; height: 42px; border-radius: 10px; flex: none;
  background: var(--bg-3); display: grid; place-items: center; color: var(--accent);
}
.pl-card .ic svg { width: 21px; height: 21px; }
.pl-card .info { flex: 1; min-width: 0; }
.pl-card .info b { display: block; font-size: 15px; margin-bottom: 3px; }
.pl-card .info span { font-size: 12.5px; color: var(--fg-mute); }
.pl-card .acts { display: flex; gap: 7px; flex: none; }

.drop {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px 20px;
  text-align: center; color: var(--fg-mute); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(59,130,246,.06); color: var(--fg-dim); }
.drop svg { width: 30px; height: 30px; margin-bottom: 8px; color: var(--fg-mute); }

.seg { display: flex; gap: 4px; background: var(--bg-3); padding: 4px; border-radius: 9px; margin-bottom: 16px; }
.seg button {
  flex: 1; padding: 8px 12px; border: 0; background: transparent; color: var(--fg-dim);
  border-radius: 6px; cursor: pointer; font-size: 13.5px;
}
.seg button.active { background: var(--bg-2); color: var(--fg); font-weight: 500; }

.ep-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; cursor: pointer;
}
.ep-row:hover { border-color: var(--accent); background: var(--bg-3); }
.ep-row .num { width: 30px; text-align: center; color: var(--fg-mute); font-weight: 600; flex: none; }
.ep-row .t { flex: 1; min-width: 0; }
.ep-row .t b { display: block; font-size: 14px; }
.ep-row .t span { font-size: 12px; color: var(--fg-mute); display: block; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.ep-row > svg { width: 18px; height: 18px; flex: none; color: var(--fg-mute); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; }
.kv dt { color: var(--fg-mute); }
.kv dd { margin: 0; }

.toast-host {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--fg);
  padding: 11px 18px; border-radius: 24px; font-size: 14px; box-shadow: var(--shadow);
  animation: toast-in .22s ease;
}
.toast.err { border-color: rgba(239,68,68,.5); color: #fca5a5; }
.toast.ok { border-color: rgba(34,197,94,.5); color: #86efac; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* --------------------------------- mobil ----------------------------------- */

@media (max-width: 860px) {
  #app.on { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease; border-right: 1px solid var(--line);
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; display: none; }
  .scrim.on { display: block; }
  .menu-toggle { display: grid; }
  /* Tek sutun, iki satir: kategori seridi icerigi kadar, liste kalani alir */
  .content.split { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 0; }
  .cat-pane {
    border-right: 0; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 7px;
    overflow-x: auto; overflow-y: hidden; padding: 9px 12px;
    scrollbar-width: none;
  }
  .cat-pane::-webkit-scrollbar { display: none; }
  /* Kategoriler yatay "pill" seridi olur — dikeyde gerilmemeli */
  .cat-item { width: auto; flex: none; background: var(--bg-3); padding: 8px 14px; border-radius: 20px; }
  .cat-pane .seg { margin: 0; flex: none; }
  .cat-item .count { display: none; }
  .grid.live { grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); }
  .grid.vod { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }

  /* Ust cubuk iki satira ayrilir: 1) menu + baslik + eylem  2) arama */
  .topbar { flex-wrap: wrap; row-gap: 10px; padding: 10px 14px; }
  .topbar h1 { font-size: 16px; order: 1; flex: 1; min-width: 0; }
  .menu-toggle { order: 0; }
  #topActions { order: 2; margin-left: 0; }
  .search-box { order: 3; flex-basis: 100%; max-width: none; }

  .content { padding: 14px; }
  .list-pane { padding: 12px; }

  /* Liste kartlari: bilgi ust satirda, islemler alt satirda tam genislikte */
  .pl-card { flex-wrap: wrap; padding: 13px 14px; gap: 12px; }
  .pl-card .info { flex-basis: calc(100% - 56px); }
  .pl-card .acts { flex-basis: 100%; }
  .pl-card .acts .btn { flex: 1; }

  /* Modal alt sayfa (bottom sheet) gibi acilsin — basparmakla erisilebilir */
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding: 14px 16px; }
  .modal-foot .btn { flex: 1; }

  /* Islem butonu tasiyan tablolar mobilde karta donusur — yoksa islem sutunu
     yatay kaydirmanin arkasinda kalir ve kullanici onu hic bulamaz. */
  .tbl.stack thead { display: none; }
  .tbl.stack tr {
    display: block; border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 12px 14px; margin-bottom: 10px;
  }
  .tbl.stack td { display: block; border: 0; padding: 3px 0; }
  .tbl.stack td::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: 10.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--fg-mute);
  }
  .tbl.stack td:not([data-label])::before { display: none; }
  .tbl.stack td.acts-cell { padding-top: 10px; }
  .tbl.stack .actions { justify-content: stretch; }
  .tbl.stack .actions .btn { flex: 1; }

  /* Kart olmayan tablolar sikismasin, kendi kabinda kaysin */
  .tbl-wrap .tbl:not(.stack) { min-width: 520px; }

  .pl-top { padding: 12px 14px; }
  .pl-bottom { padding: 10px 14px 16px; }
  .pl-btn { width: 38px; height: 38px; }
  .pl-btn.big { width: 52px; height: 52px; }
}

/* TV / uzaktan kumanda: odak her zaman gorunur olsun */
@media (hover: none) {
  .tile .fav { opacity: 1; }
}
.tile:focus-visible, .cat-item:focus-visible, .nav-item:focus-visible, .ep-row:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
