/* Torrent Manager visuals. Shared Pevlika controls (.btn, .field, .panel-title, .stat-grid) are reused; this file only styles the product surfaces. */
.tm-app { min-width: 0; }
.tm-screen { display: flex; flex-direction: column; min-height: 0; height: 100%; min-width: 0; }
#tm-torrents, #tm-media, #tm-create, #tm-settings { min-height: 0; min-width: 0; }
.tm-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 4px 2px 12px; }
#tm-create > .tm-scroll, #tm-settings > .tm-scroll { height: 100%; }
.tm-add { display: flex; gap: 8px; align-items: stretch; padding: 2px 0 8px; flex: 0 0 auto; }
.tm-add input[type="text"] { flex: 1 1 auto; min-width: 0; font-size: 16px; min-height: 44px; }
.tm-add .btn { min-height: 44px; white-space: nowrap; }
.tm-file-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tm-summary { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); padding: 0 2px 4px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.tm-empty { text-align: center; padding: 28px 12px; display: grid; gap: 10px; justify-items: center; }
.tm-empty h2 { margin: 0; font-size: 1.15rem; }
.tm-empty p { margin: 0; max-width: 34rem; color: var(--muted); }
.tm-cards, .tm-media-list, .tm-files, .tm-episodes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tm-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line, rgba(127,127,127,.3)); border-radius: 14px; background: var(--surface, transparent); cursor: pointer; text-align: left; width: 100%; color: inherit; font: inherit; min-height: 44px; }
.tm-card:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.tm-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tm-card-name { font-weight: 600; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tm-badge { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2, rgba(127,127,127,.15)); color: var(--muted); white-space: nowrap; }
.tm-badge[data-state="downloading"] { background: var(--accent); color: var(--on-accent, #fff); }
.tm-badge[data-state="seeding"] { background: rgba(46,160,67,.2); color: inherit; }
.tm-badge[data-state="error"], .tm-badge[data-state="storage"] { background: rgba(200,50,50,.2); color: inherit; }
.tm-bar { height: 6px; border-radius: 99px; background: var(--surface-2, rgba(127,127,127,.2)); overflow: hidden; }
.tm-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
@media (prefers-reduced-motion: reduce) { .tm-bar i { transition: none; } }
.tm-card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-card-note { margin: 0; font-size: .8rem; color: var(--muted); }
.tm-head { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; padding-bottom: 4px; }
.tm-d-name { margin: 0; font-size: 1rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1 1 auto; min-width: 0; }
.tm-d-line { margin: 6px 0; color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.tm-diag { margin: 8px 0; padding: 10px 12px; border-radius: 12px; background: rgba(230,160,30,.16); font-size: .9rem; }
.tm-diag[data-kind="storage"], .tm-diag[data-kind="error"] { background: rgba(200,50,50,.16); }
.tm-stats { margin: 10px 0; }
.tm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tm-actions .btn { min-height: 44px; }
.tm-danger { color: var(--danger, #b3261e); }
.tm-danger-fill { background: var(--danger, #b3261e); color: #fff; }
.tm-mode { border: 0; padding: 0; margin: 12px 0; min-width: 0; }
.tm-mode legend { font-weight: 600; padding: 0 0 6px; }
.tm-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tm-seg button { display: grid; gap: 2px; padding: 8px 6px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line, rgba(127,127,127,.3)); background: transparent; color: inherit; font: inherit; text-align: center; cursor: pointer; }
.tm-seg button small { font-size: .7rem; color: var(--muted); line-height: 1.2; }
.tm-seg button[aria-checked="true"] { background: var(--accent); color: var(--on-accent, #fff); border-color: var(--accent); }
.tm-seg button[aria-checked="true"] small { color: inherit; opacity: .85; }
.tm-pieces { display: grid; grid-template-columns: repeat(48, 1fr); gap: 1px; height: 18px; border-radius: 6px; overflow: hidden; background: var(--surface-2, rgba(127,127,127,.2)); }
.tm-pieces i { display: block; background: var(--accent); }
.tm-count { color: var(--muted); font-weight: 400; font-size: .85rem; }
.tm-files-tools { display: flex; gap: 6px; }
.tm-file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line, rgba(127,127,127,.2)); }
.tm-file label { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.tm-file-name { overflow-wrap: anywhere; font-size: .92rem; }
.tm-file-sub { display: block; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tm-file-actions { display: flex; gap: 4px; }
.tm-ic { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-width: 44px; border-radius: 999px; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; }
.tm-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tm-ic:focus-visible, .tm-media-item:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.tm-ic:disabled { opacity: .35; cursor: default; }
.tm-ic-main { background: var(--accent); color: var(--on-accent, #fff); }
.tm-ic-main svg { fill: currentColor; }
.tm-why { margin: 14px 0; color: var(--muted); font-size: .9rem; }
.tm-why summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.tm-hint { color: var(--muted); padding: 16px 4px; }
.tm-media-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line, rgba(127,127,127,.3)); border-radius: 14px; width: 100%; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 56px; }
.tm-media-item small { display: block; color: var(--muted); font-size: .78rem; }
.tm-media-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2, rgba(127,127,127,.15)); display: grid; place-items: center; }
.tm-media-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Player: black stage, bounded to the screen, controls below the video so nothing covers the picture on phones. */
.tm-stage { display: flex; flex-direction: column; height: 100%; min-height: 0; background: #000; color: #fff; border-radius: 14px; overflow: hidden; }
.tm-stage:fullscreen { border-radius: 0; }
.tm-p-head { display: flex; align-items: center; gap: 4px; padding: 4px 6px; flex: 0 0 auto; }
.tm-p-head .btn { color: #fff; min-width: 44px; }
.tm-p-title { min-width: 0; display: grid; }
.tm-p-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.tm-p-title small { color: rgba(255,255,255,.7); font-size: .75rem; }
.tm-video-wrap { position: relative; flex: 1 1 auto; min-height: 120px; display: grid; place-items: center; background: #000; }
.tm-video-wrap video { width: 100%; height: 100%; max-height: 100%; object-fit: contain; background: #000; }
.tm-buffer-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,.7); padding: 8px 14px; border-radius: 99px; font-size: .85rem; pointer-events: none; max-width: 88%; text-align: center; }
.tm-controls { flex: 0 0 auto; padding: 4px 8px calc(6px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 2px; background: #111; }
.tm-seek { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: .78rem; font-variant-numeric: tabular-nums; }
.tm-seekbar { position: relative; height: 44px; display: grid; align-items: center; }
.tm-seek-buf { position: absolute; left: 0; right: 0; height: 6px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; top: 50%; transform: translateY(-50%); }
.tm-seek-buf i { position: absolute; top: 0; bottom: 0; background: rgba(255,255,255,.4); }
.tm-seek-buf b { position: absolute; top: 0; bottom: 0; background: var(--accent); opacity: .85; }
.tm-seekbar input[type="range"] { position: relative; width: 100%; margin: 0; background: transparent; accent-color: var(--accent); height: 44px; }
.tm-ctl-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 4px; }
.tm-ctl-row select { min-height: 44px; max-width: 8.5rem; background: #222; color: #fff; border: 1px solid #444; border-radius: 10px; font-size: 14px; padding: 0 6px; }
.tm-ctl-row .tm-ic { color: #fff; }
.tm-ctl-row .tm-ic-main { color: var(--on-accent, #fff); }
.tm-vol input { width: 80px; accent-color: var(--accent); height: 44px; }
.tm-p-status { margin: 0; text-align: center; font-size: .8rem; color: rgba(255,255,255,.75); min-height: 1.2em; }
.tm-episodes { max-height: 22%; overflow-y: auto; padding: 0 8px 8px; background: #111; flex: 0 0 auto; }
.tm-episodes:empty { display: none; }
.tm-episodes button { width: 100%; text-align: left; background: transparent; color: #fff; border: 0; padding: 8px; min-height: 44px; border-radius: 8px; font: inherit; font-size: .88rem; cursor: pointer; overflow-wrap: anywhere; }
.tm-episodes button[aria-current="true"] { background: rgba(255,255,255,.14); font-weight: 600; }
.tm-stage:fullscreen .tm-episodes, .tm-stage.tm-immersive .tm-episodes { display: none; }
.tm-form { display: grid; gap: 14px; padding: 4px 2px 16px; max-width: 46rem; }
.tm-picked { margin: 0; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.tm-dialog { border: 1px solid var(--line, rgba(127,127,127,.4)); border-radius: 16px; padding: 18px; max-width: min(92vw, 26rem); background: var(--surface, #fff); color: var(--text, inherit); }
.tm-dialog::backdrop { background: rgba(0,0,0,.5); }
.tm-dialog h3 { margin: 0 0 8px; }
.tm-storage { display: grid; gap: 6px; }
.tm-storage p { margin: 0; }
@media (max-width: 480px) { .tm-add { flex-wrap: wrap; } .tm-add input[type="text"] { flex-basis: 100%; } .tm-add .btn { flex: 1 1 0; justify-content: center; } }
@media (min-width: 900px) { .tm-cards { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
@media (orientation: landscape) and (max-height: 520px) { .tm-episodes { display: none; } .tm-p-head { display: none; } }
.tm-drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 22px 14px; border: 2px dashed var(--line, rgba(127,127,127,.5)); border-radius: 16px; cursor: pointer; min-height: 44px; }
.tm-drop:focus-within, .tm-drop[data-over="true"] { border-color: var(--accent); background: var(--surface-2, rgba(127,127,127,.1)); }
.tm-drop strong { font-size: 1.05rem; }
.tm-stats .stat dd { font-size: 17px; font-variant-numeric: tabular-nums; }
