/* TransCore – tervezési rendszer (TERV 13.1) | Készítő: Kormos Attila és AI */
:root {
  color-scheme: dark;
  --bg: #0e1116; --surface-1: #161b22; --surface-2: #1f2630; --surface-3: #2a3340; --border: #2a3340;
  --text: #e6edf3; --text-muted: #9aa7b4; --accent: #7c5cff; --accent-contrast: #fff;
  --success: #2ea043; --warning: #d29922; --danger: #f85149; --info: #388bfd;
  --overlay: rgba(0, 0, 0, .55); --shadow: 0 8px 24px rgba(0, 0, 0, .45);
  --r-card: 12px; --r-btn: 10px; --sidebar-w: 240px; --topbar-h: 60px; --tabbar-h: 62px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fa; --surface-1: #ffffff; --surface-2: #eef1f4; --surface-3: #e2e7ec; --border: #d0d7de;
  --text: #1f2328; --text-muted: #59636e; --accent: #6246ea; --accent-contrast: #fff;
  --success: #1a7f37; --warning: #9a6700; --danger: #cf222e; --info: #0969da;
  --overlay: rgba(15, 20, 25, .35); --shadow: 0 8px 24px rgba(31, 35, 40, .12);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--font);
  min-height: 100vh; overflow-x: hidden;
}
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 600; line-height: 1.25; }
h1 { font-size: 32px; } h2 { font-size: 24px; } h3 { font-size: 20px; } h4 { font-size: 16px; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--text-muted); }
.small { font-size: 14px; }
.xs { font-size: 12px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* --- keret ------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.shell.collapsed { --sidebar-w: 72px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--surface-1); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; overflow-y: auto; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 16px; font-weight: 700; font-size: 20px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-btn);
  color: var(--text-muted); font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.nav-spacer { flex: 1; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 4px; }
.shell.collapsed .nav-link span, .shell.collapsed .brand span { display: none; }
.shell.collapsed .nav-link { justify-content: center; padding: 12px; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; height: var(--topbar-h); display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .grow { display: none; }
#theme-cycle { margin-left: auto; }
.search-box { position: relative; flex: 1; max-width: 520px; min-width: 0; }
.search-box input[type="search"] { padding-left: 42px; border-radius: 999px; }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.content { padding: 24px; width: 100%; max-width: 1600px; margin: 0 auto; flex: 1; }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title h1 { margin: 0; font-size: 28px; }
.footer { padding: 16px 24px; color: var(--text-muted); font-size: 12px; border-top: 1px solid var(--border); }

.tabbar { display: none; }
@media (max-width: 1023px) { .shell { grid-template-columns: 72px 1fr; } .shell .nav-link span, .shell .brand span { display: none; } .shell .nav-link { justify-content: center; padding: 12px; } }
@media (max-width: 599px) {
  .shell, .shell.collapsed { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 0 12px; }
  .content { padding: 16px; padding-bottom: calc(var(--tabbar-h) + 24px); }
  .footer { padding-bottom: calc(var(--tabbar-h) + 16px); }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabbar-h); z-index: 30;
    background: var(--surface-1); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--text-muted); font-size: 11px; background: none; border: 0; font-family: inherit; cursor: pointer;
  }
  .tabbar a.active { color: var(--accent); }
  .tabbar a:hover { text-decoration: none; }
  h1 { font-size: 26px; } .page-title h1 { font-size: 24px; }
}
.more-sheet { position: fixed; inset: 0; z-index: 40; background: var(--overlay); display: none; align-items: flex-end; }
.more-sheet.open { display: flex; }
.more-sheet .sheet { width: 100%; background: var(--surface-1); border-radius: 16px 16px 0 0; padding: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }

/* --- komponensek ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: var(--r-btn); border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: 500 14px var(--font); cursor: pointer; transition: background .15s, border-color .15s, transform .1s; text-decoration: none;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.icon-only { width: 40px; padding: 0; }
.btn.block { width: 100%; }

.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-card); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h3 { margin-bottom: 12px; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

label.field { display: block; margin-bottom: 16px; }
label.field > .lbl { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
label.field > .hint { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }
input[type="text"], input[type="password"], input[type="search"], input[type="url"], input[type="number"], select, textarea {
  width: 100%; min-height: 42px; padding: 9px 14px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-btn); font: 400 15px var(--font);
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-btn); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--text-muted); padding: 8px 16px; border-radius: 8px; font: 500 14px var(--font); cursor: pointer; min-height: 38px; }
.seg button[aria-pressed="true"] { background: var(--surface-1); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.swatch[aria-pressed="true"] { border-color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; color: var(--text-muted); padding: 12px 16px; font: 500 14px var(--font); cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text); }
.badge.ok { background: color-mix(in srgb, var(--success) 20%, transparent); color: var(--success); }
.badge.warn { background: color-mix(in srgb, var(--warning) 22%, transparent); color: var(--warning); }
.badge.err { background: color-mix(in srgb, var(--danger) 20%, transparent); color: var(--danger); }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 24px; font-weight: 600; }
.stat .k { font-size: 13px; color: var(--text-muted); }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; min-height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--surface-1); border: 1px solid var(--border); border-left: 4px solid var(--info); border-radius: 10px; padding: 12px 16px; box-shadow: var(--shadow); animation: slidein .2s ease-out; }
.toast.success { border-left-color: var(--success); } .toast.warning { border-left-color: var(--warning); } .toast.error { border-left-color: var(--danger); }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 599px) { .toasts { top: 12px; bottom: auto; right: 12px; left: 12px; max-width: none; } }

.modal-bg { position: fixed; inset: 0; z-index: 90; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: 100%; max-width: 480px; box-shadow: var(--shadow); max-height: 90vh; overflow: auto; }
.modal h3 { margin-bottom: 8px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; color: var(--text); cursor: pointer; padding: 4px 8px; border-radius: 999px; font: 500 14px var(--font); min-height: 40px; }
.user-btn:hover { background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); display: grid; place-items: center; font-weight: 700; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 50; }
.dropdown.open { display: block; }
.dropdown button, .dropdown a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; border: 0; background: none; color: var(--text); border-radius: 8px; font: 400 14px var(--font); cursor: pointer; text-align: left; min-height: 40px; }
.dropdown button:hover, .dropdown a:hover { background: var(--surface-2); text-decoration: none; }
.dropdown .who { padding: 8px 12px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* --- belépés ---------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background:
  radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.login-card .logo { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-card .logo img { width: 72px; height: 72px; border-radius: 18px; }
.login-card .logo h1 { margin: 0; font-size: 28px; }
.form-error { color: var(--danger); font-size: 14px; min-height: 1.4em; margin-bottom: 8px; }

/* --- Hamarosan / üres állapot ----------------------------------------- */
.empty { text-align: center; padding: 64px 16px; color: var(--text-muted); }
.empty .icon { width: 48px; height: 48px; margin: 0 auto 16px; opacity: .6; }
.empty h2 { color: var(--text); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; font-size: 14px; }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; word-break: break-word; }

/* --- poszterrács, kártyák, jelvények (keresés/tallózás) ---------------------------------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); border-radius: 999px; padding: 6px 14px; font: 500 14px var(--font); cursor: pointer; min-height: 36px; }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
@media (max-width: 599px) { .poster-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; } }
.poster-card { text-align: left; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-card); padding: 0; overflow: hidden; cursor: pointer; color: var(--text); font: inherit; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.poster-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.poster { position: relative; aspect-ratio: 2 / 3; background: var(--surface-3); overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster.noimg { display: grid; place-items: center; background: linear-gradient(135deg, var(--surface-2), var(--surface-3)); }
.poster.noimg::after { content: "🎬"; font-size: 34px; opacity: .45; }
.tr-badge, .fl-badge { position: absolute; top: 8px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; background: #555; }
.tr-badge { left: 8px; } .fl-badge { right: 8px; background: var(--success); }
.tr-ncore { background: #2f81f7; } .tr-hun { background: #e8590c; } .tr-bit { background: #12b886; }
.chip.tr-ncore[aria-pressed="true"] { border-color: #2f81f7; } .chip.tr-hun[aria-pressed="true"] { border-color: #e8590c; } .chip.tr-bit[aria-pressed="true"] { border-color: #12b886; }
.chip.tr-ncore, .chip.tr-hun, .chip.tr-bit { background: var(--surface-2); }
.pc-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pc-title { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-sub { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin-top: 4px; }

/* --- Kezdőlap: hős-sáv, állapotcsík, sorok ------------------------------------------------------- */
.hero { position: relative; margin: -8px 0 20px; border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.hero-slide { min-height: 340px; background-size: cover; background-position: center 25%; display: flex; align-items: flex-end; transition: background-image .4s; }
.hero-body { padding: 32px; max-width: 720px; color: #fff; }
.hero-body h1 { font-size: 40px; margin: 0 0 8px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.hero-meta { color: var(--text-muted); font-size: 14px; margin-bottom: 8px; }
.hero-body .hero-meta { color: rgba(255,255,255,.8); }
.hero-ov { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 16px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hero-dots { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 6px; }
.hero-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,.4); cursor: pointer; padding: 0; }
.hero-dots button[aria-current="true"] { background: #fff; }
@media (max-width: 599px) { .hero-slide { min-height: 300px; } .hero-body { padding: 20px; } .hero-body h1 { font-size: 28px; } }
.status-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip-stat { padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.chip-stat.ok { color: var(--success); } .chip-stat.err { color: var(--danger); }
.row-sec { margin-bottom: 28px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.row-head h2 { margin: 0; font-size: 20px; }
.h-strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 10px; scrollbar-width: thin; }
.h-item { flex: 0 0 160px; scroll-snap-align: start; display: flex; }
.h-item .poster-card { width: 100%; }
@media (max-width: 599px) { .h-item { flex-basis: 120px; } }
.tr-stack { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tr-stack .tr-badge { position: static; }
.rate-badge { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0,0,0,.65); }
.pc-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.pc-chips .badge { padding: 1px 8px; font-size: 11px; }
.poster-card.dim { opacity: .6; }
.poster-card.dim:hover { opacity: 1; }

/* --- címoldal ------------------------------------------------------------------------------------ */
.title-head { position: relative; border-radius: 16px; overflow: hidden; background: var(--surface-1); border: 1px solid var(--border); margin-bottom: 20px; }
.title-bg { position: absolute; inset: 0; background-size: cover; background-position: center 20%; opacity: .22; filter: blur(2px); }
.title-in { position: relative; display: flex; gap: 24px; padding: 24px; flex-wrap: wrap; }
.title-poster { width: 200px; border-radius: 12px; box-shadow: var(--shadow); align-self: flex-start; }
.title-poster.noimg { height: 300px; background: var(--surface-3); }
.title-main { flex: 1; min-width: 260px; }
.title-main h1 { margin-bottom: 4px; }
.title-ov { max-width: 760px; }
@media (max-width: 599px) { .title-in { padding: 16px; gap: 16px; } .title-poster { width: 130px; } }
.rel { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px 16px; margin-bottom: 10px; display: grid; gap: 8px; }
.rel-bad { opacity: .75; }
.rel-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rel-name { word-break: break-all; font-size: 14px; }
.rel-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.tr-badge.static { position: static; }
.empty .btn { margin-top: 12px; }

/* --- letöltések ---------------------------------------------------------------------------------- */
.dl-ind { position: relative; }
.dl-count { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); font: 700 11px/18px var(--font); text-align: center; }
.dl-card { display: grid; grid-template-columns: 84px 1fr; gap: 16px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px; margin-bottom: 12px; }
.dl-poster { width: 84px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; background: var(--surface-3); }
.dl-main { min-width: 0; display: grid; gap: 8px; align-content: start; }
.dl-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dl-title { font-weight: 600; font-size: 17px; color: var(--text); }
.dl-relname { word-break: break-all; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.steps li { padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); }
.steps li.done { color: var(--success); }
.steps li.current { background: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.dl-prog { display: flex; align-items: center; gap: 12px; }
.bar { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .6s linear; }
.pct { min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; }
.dl-line { display: flex; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.dl-eta { font-weight: 600; }
.dl-extra { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dl-extra:empty { display: none; }
.dl-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-actions .btn { min-height: 38px; }
@media (max-width: 599px) { .dl-card { grid-template-columns: 56px 1fr; gap: 12px; } .dl-poster { width: 56px; } }
.dl-dialog { display: grid; gap: 8px; max-height: 70vh; overflow-y: auto; }
.dl-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dl-row select { max-width: 100%; }
.dl-list { display: grid; gap: 8px; }
.dl-pick { text-align: left; background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; width: 100%; }
.dl-rel.chosen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dl-rel { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.dl-rel.bad { opacity: .75; }
.dl-folder { word-break: break-all; font-size: 13px; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* --- könyvtár ---------------------------------------------------------------------------------- */
.lib-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.lib-search { flex: 1; min-width: 220px; max-width: none; }
.lib-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.lib-filters { position: sticky; top: calc(var(--topbar-h) + 12px); display: grid; gap: 14px; }
.lib-fs { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
.lib-fs legend { font-weight: 600; font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 0 4px; }
.lib-opt { display: flex; gap: 8px; align-items: center; font-size: 14px; cursor: pointer; min-height: 28px; }
.lib-opt span:nth-of-type(1) { flex: 1; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.lib-grid .poster-card { width: auto; }
.lib-h { margin: 28px 0 12px; font-size: 20px; }
.lib-other { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lib-files { flex-basis: 100%; display: grid; gap: 4px; }
.lib-file { font-size: 13px; word-break: break-all; }
.play-badge { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); display: grid; place-items: center; font-size: 15px; text-decoration: none; box-shadow: var(--shadow); }
.play-badge:hover { text-decoration: none; filter: brightness(1.1); }
.ep-row { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); color: var(--text); }
.ep-no { min-width: 64px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  .lib-layout { grid-template-columns: 1fr; }
  .lib-filters { display: none; position: static; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px; }
  .lib-filters.open { display: grid; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
}
@media (min-width: 900px) { #filter-btn { display: none; } }

/* --- lejátszó ------------------------------------------------------------------------------------ */
.watch-body { background: #000; color: #fff; overflow: hidden; }
.watch { position: fixed; inset: 0; background: #000; display: grid; }
.watch video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.w-top, .w-bar { position: absolute; left: 0; right: 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; transition: opacity .25s; color: #fff; }
.w-top { top: 0; flex-direction: row; align-items: center; gap: 12px; padding-top: max(10px, env(safe-area-inset-top)); background: linear-gradient(#000c, transparent); }
.w-top .btn, .w-bar .btn { color: #fff; }
.w-title { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-bar { bottom: 0; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, #000c); }
.w-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.w-row .btn { min-width: 44px; min-height: 44px; padding: 0 10px; font-size: 16px; }
.w-row select { max-width: 160px; background: #1f2630; color: #fff; }
.w-time { font-variant-numeric: tabular-nums; font-size: 14px; padding: 0 8px; }
.watch input[type=range] { accent-color: var(--accent); width: 100%; }
#w-vol { width: 90px; }
.watch.idle .w-top, .watch.idle .w-bar { opacity: 0; pointer-events: none; }
.watch.idle { cursor: none; }
.w-center { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-size: 18px; text-shadow: 0 1px 6px #000; text-align: center; padding: 24px; }
.w-resume, .w-next { position: absolute; background: #161b22ee; border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: grid; gap: 12px; }
.w-resume { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; }
.w-next { right: 16px; bottom: 120px; grid-auto-flow: column; align-items: center; }
.w-btns { display: flex; gap: 8px; justify-content: center; }
@media (max-width: 599px) { #w-vol, #w-mute { display: none; } .w-title { font-size: 14px; } }

/* figyelőlista és epizódlista (0.7.0) */
.eps-season .ep-row { flex-wrap: wrap; }
.eps-season .ep-row .grow { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.eps-season .ep-no { min-width: 72px; }
.dl-card .dl-title { font-weight: 600; }

/* 0.8.0: értékelés, polcok, megosztás */
.btn.fav.on { color: #ef4444; border-color: #ef4444; }
.star-avg { color: #f5b301; font-weight: 600; }
.star-pick { display: flex; gap: 4px; margin-bottom: 12px; }
.star-pick .star { background: none; border: 0; font-size: 34px; line-height: 1; cursor: pointer; color: var(--border); padding: 2px 4px; min-width: 44px; min-height: 44px; }
.star-pick .star.on { color: #f5b301; }
.reviews { margin-top: 16px; }
.review { border-top: 1px solid var(--border); padding-top: 8px; }
.share-msg { margin: 6px 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; font-style: italic; }
.dl-card.unread { border-color: var(--accent); }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-contrast); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }
.shelf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.shelf-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; display: grid; gap: 12px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.shelf-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.shelf-head { display: flex; gap: 12px; align-items: center; }
.shelf-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.shelf-ic .icon { width: 24px; height: 24px; }
.shelf-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.share-body { background: var(--bg); }
.share-wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.share-brand { display: inline-flex; margin-bottom: 16px; }
.share-eps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabbar #more-btn { position: relative; }
.nav-badge.dot { position: absolute; top: 2px; right: 22%; margin: 0; min-width: 18px; height: 18px; font-size: 11px; }

/* 0.9.0: átvétel és sorozat-rendező táblái */
.ops-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ops-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ops-table td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ops-table tr.ops-done { opacity: .55; }

/* 0.9.1: eseménynapló-sor – telefonon az oszlopok egymás alá törnek (nincs vízszintes túlcsordulás) */
.log-row { display: grid; grid-template-columns: 150px 90px 110px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; align-items: baseline; min-width: 0; }
.log-row > * { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) { .log-row { grid-template-columns: auto auto 1fr; gap: 4px 10px; } .log-row > :last-child { grid-column: 1 / -1; } }

/* 0.9.2: figyelőlista – szűrősáv és az automatikus letöltés kapcsolója */
.wl-bar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.wl-auto { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 10px; }
.wl-auto input { margin-top: 2px; flex: none; }
