/*!
 * WebTorrent 磁力下载 / 做种分享 — /tools/webtorrent
 * 变量定义在 :root（弹窗、toast 挂在 body 下，不能用 .wt 作用域变量）。
 * 三端断点：1600 / 1200 / 900 / 767 / 420；手机输入框 16px 防 iOS 缩放。
 */
:root {
    --wt-bg: #0d1015;
    --wt-card: #161a21;
    --wt-card-2: #1c222b;
    --wt-line: #2a323d;
    --wt-line-soft: #222933;
    --wt-fg: #e6e9ee;
    --wt-sub: #98a3b3;
    --wt-faint: #7d8794;
    --wt-accent: #1d9bf0;
    --wt-accent-soft: rgba(29, 155, 240, .13);
    --wt-ok: #3fb950;
    --wt-ok-soft: rgba(63, 185, 80, .13);
    --wt-warn: #d29922;
    --wt-warn-soft: rgba(210, 153, 34, .14);
    --wt-err: #f85149;
    --wt-err-soft: rgba(248, 81, 73, .13);
    --wt-zebra: rgba(127, 127, 127, .055);
    --wt-shadow: 0 8px 30px rgba(0, 0, 0, .28);
    --wt-shadow-sm: 0 2px 10px rgba(0, 0, 0, .16);
    --wt-r: 14px;
    --wt-r-sm: 9px;
    --wt-maxw: 100%;
}
[data-theme="light"] {
    --wt-bg: #f7f9fa;
    --wt-card: #ffffff;
    --wt-card-2: #f2f5f7;
    --wt-line: #d9e1e8;
    --wt-line-soft: #e8edf1;
    --wt-fg: #0f1419;
    --wt-sub: #536471;
    --wt-faint: #697886;
    --wt-accent: #136ce9;
    --wt-accent-soft: rgba(19, 108, 233, .10);
    --wt-ok: #1a7f37;
    --wt-ok-soft: rgba(26, 127, 55, .10);
    --wt-warn: #9a6700;
    --wt-warn-soft: rgba(154, 103, 0, .11);
    --wt-err: #cf222e;
    --wt-err-soft: rgba(207, 34, 46, .09);
    --wt-zebra: rgba(15, 20, 25, .038);
    --wt-shadow: 0 10px 32px rgba(15, 20, 25, .13);
    --wt-shadow-sm: 0 2px 10px rgba(15, 20, 25, .08);
}

/* 满屏（保留左侧导航）：站点 .app 默认 1280px 居中 */
body.page-webtorrent-full .app,
body.page-webtorrent-full .main-content,
body.page-webtorrent-full .page-container { max-width: 100%; }
body.page-webtorrent-full .main-content { width: 100%; border-right: 0; min-width: 0; }
/* 站点 body{overflow-y:scroll} 会让页内 sticky 全部失效 */
body.page-webtorrent-full { overflow: visible; }

.wt {
    max-width: var(--wt-maxw);
    margin: 0;
    box-sizing: border-box;
    padding: 22px 24px 72px;
    color: var(--wt-fg);
    font-size: 14px;
    line-height: 1.6;
}
.wt *, .wt *::before, .wt *::after { box-sizing: border-box; }
.wt [hidden], .wt-mask[hidden], .wt-toast[hidden] { display: none !important; }
.wt :focus-visible { outline: 2px solid var(--wt-accent); outline-offset: 2px; }

/* ---------- 头部 ---------- */
.wt-hero {
    display: flex; align-items: flex-start; gap: 16px;
    position: relative; padding: 18px 20px; margin-bottom: 14px;
    border: 1px solid var(--wt-line); border-radius: var(--wt-r);
    background: var(--wt-card);
    background-image: linear-gradient(120deg, var(--wt-accent-soft), transparent 56%);
    box-shadow: var(--wt-shadow-sm);
}
.wt-hero-ico { flex: 0 0 auto; width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center; font-size: 26px; background: linear-gradient(135deg, var(--wt-accent-soft), transparent 70%); border: 1px solid var(--wt-line); }
.wt-hero-txt { flex: 1 1 auto; min-width: 0; }
.wt-title { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: .2px; }
.wt-sub { margin: 0; max-width: 82ch; color: var(--wt-sub); font-size: 13px; }
.wt-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wt-tag { padding: 2px 9px; font-size: 11.5px; border-radius: 999px; color: var(--wt-sub); background: var(--wt-card-2); border: 1px solid var(--wt-line-soft); white-space: nowrap; }
.wt-hero-side { flex: 0 0 auto; }
.wt-engine { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; color: var(--wt-warn); background: var(--wt-warn-soft); border: 1px solid var(--wt-line); white-space: nowrap; }
.wt-engine.is-ready { color: var(--wt-ok); background: var(--wt-ok-soft); }
.wt-engine.is-err { color: var(--wt-err); background: var(--wt-err-soft); }

.wt-notice { margin: 0 0 14px; padding: 9px 14px; border-radius: var(--wt-r-sm); font-size: 12.5px; color: var(--wt-sub); background: var(--wt-warn-soft); border: 1px solid var(--wt-line-soft); }
.wt-notice strong { color: var(--wt-warn); margin-right: 2px; }

/* ---------- 统计 ---------- */
.wt-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; margin-bottom: 14px; border: 1px solid var(--wt-line); border-radius: var(--wt-r); background: var(--wt-card); overflow: hidden; }
.wt-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-left: 1px solid var(--wt-line-soft); min-width: 0; }
.wt-stat:first-child { border-left: 0; }
.wt-stat-l { font-size: 11.5px; color: var(--wt-sub); }
.wt-stat-v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wt-stats .wt-stat:nth-child(2) .wt-stat-v { color: var(--wt-accent); }
.wt-stats .wt-stat:nth-child(3) .wt-stat-v,
.wt-stats .wt-stat:nth-child(4) .wt-stat-v { color: var(--wt-ok); }
.wt-stat-chart { padding-bottom: 6px; }
#wtSpark { width: 100%; max-width: 220px; height: 42px; display: block; }

/* ---------- 页签 ---------- */
.wt-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.wt-tab { flex: 0 0 auto; padding: 8px 15px; border: 1px solid var(--wt-line); border-radius: 999px; background: var(--wt-card); color: var(--wt-sub); font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, box-shadow .15s; }
.wt-tab:hover { background: var(--wt-card-2); color: var(--wt-fg); }
.wt-tab.is-on { background: var(--wt-accent); border-color: var(--wt-accent); color: #fff; font-weight: 600; box-shadow: 0 2px 10px var(--wt-accent-soft); }

/* ---------- 卡片 ---------- */
.wt-card { margin-bottom: 14px; padding: 16px 18px; border: 1px solid var(--wt-line); border-radius: var(--wt-r); background: var(--wt-card); box-shadow: var(--wt-shadow-sm); min-width: 0; }
.wt-card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.wt-card-t { margin: 0; font-size: 15px; font-weight: 650; }
.wt-card-hint { font-size: 11.5px; color: var(--wt-faint); }
.wt-mini-t { font-size: 13px; margin: 16px 0 8px; font-weight: 650; }

/* ---------- 表单控件 ---------- */
.wt-area, .wt-input, .wt-code {
    width: 100%; padding: 9px 11px; border: 1px solid var(--wt-line); border-radius: var(--wt-r-sm);
    background: var(--wt-card-2); color: var(--wt-fg); font: inherit; font-size: 13px;
}
.wt-area { min-height: 76px; resize: vertical; line-height: 1.55; word-break: break-all; }
.wt-area-sm { min-height: 54px; }
.wt-area:focus, .wt-input:focus { border-color: var(--wt-accent); }
.wt-area::placeholder, .wt-input::placeholder { color: var(--wt-faint); }
.wt-input[type="search"]::-webkit-search-cancel-button { display: none; }
.wt-code { display: block; padding: 7px 10px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; }
.wt-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin-bottom: 10px; font-size: 12.5px; color: var(--wt-sub); }
.wt-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.wt-check { display: inline-flex; align-items: center; gap: 7px; margin: 4px 0 12px; font-size: 12.5px; color: var(--wt-sub); cursor: pointer; }
.wt-check input { width: 16px; height: 16px; accent-color: var(--wt-accent); }
.wt-add-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wt-inline-hint { font-size: 12px; color: var(--wt-sub); }

.wt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border: 1px solid var(--wt-line); border-radius: var(--wt-r-sm); background: var(--wt-card-2); color: var(--wt-fg); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s; }
.wt-btn:hover { background: var(--wt-line-soft); border-color: var(--wt-accent); }
.wt-btn:active { transform: translateY(1px); }
.wt-btn:disabled { opacity: .5; cursor: not-allowed; }
.wt-btn-pri { background: var(--wt-accent); border-color: var(--wt-accent); color: #fff; font-weight: 600; }
.wt-btn-pri:hover { background: var(--wt-accent); filter: brightness(1.1); }
.wt-btn-ghost { background: transparent; }
.wt-btn-danger { color: var(--wt-err); }
.wt-btn-danger:hover { background: var(--wt-err-soft); border-color: var(--wt-err); }
.wt-btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12px; }
.wt-btn-mini { min-height: 26px; padding: 2px 8px; font-size: 11.5px; }

.wt-drop { margin-top: 12px; padding: 14px; border: 1.5px dashed var(--wt-line); border-radius: var(--wt-r-sm); text-align: center; color: var(--wt-faint); font-size: 12.5px; background: transparent; transition: border-color .15s, background .15s; }
.wt-drop.is-over { border-color: var(--wt-accent); background: var(--wt-accent-soft); color: var(--wt-fg); }
.wt-drop-seed { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 20px 14px; }

/* ---------- 做种文件列表 ---------- */
.wt-seed-files { max-height: 190px; overflow: auto; margin: 10px 0; border: 1px solid var(--wt-line-soft); border-radius: var(--wt-r-sm); }
.wt-seed-file { display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; font-size: 12px; border-bottom: 1px solid var(--wt-line-soft); }
.wt-seed-file:last-child { border-bottom: 0; }
.wt-seed-file:nth-child(even) { background: var(--wt-zebra); }
.wt-seed-file b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-seed-file span { color: var(--wt-faint); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.wt-share-row { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--wt-sub); }
.wt-qr-wrap { margin-top: 12px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wt-qr { padding: 10px; background: #fff; border-radius: 10px; display: inline-block; }
.wt-qr img, .wt-qr canvas { display: block; }
.wt-qr-tip { margin: 0; font-size: 12px; color: var(--wt-sub); }
.wt-seed-stat { margin-top: 10px; padding: 8px 11px; border-radius: var(--wt-r-sm); background: var(--wt-card-2); font-size: 12px; color: var(--wt-sub); }
.wt-seed-list { display: grid; gap: 8px; }

/* ---------- 工具条 / 任务 ---------- */
.wt-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.wt-toolbar .wt-input { flex: 1 1 240px; min-width: 160px; max-width: 360px; }
.wt-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 12px; align-items: start; }
.wt-task { padding: 14px; border: 1px solid var(--wt-line); border-radius: var(--wt-r); background: var(--wt-card); box-shadow: var(--wt-shadow-sm); min-width: 0; contain: layout style; transition: border-color .15s, box-shadow .15s; }
.wt-task:hover { border-color: var(--wt-faint); box-shadow: var(--wt-shadow); }
.wt-task:focus-within { border-color: var(--wt-accent); }
.wt-task.is-done { border-color: var(--wt-ok); }
.wt-task.is-err { border-color: var(--wt-err); }
.wt-task-h { display: flex; align-items: flex-start; gap: 8px; }
.wt-task-name { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.wt-badge { flex: 0 0 auto; padding: 1px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--wt-line); background: var(--wt-card-2); color: var(--wt-sub); white-space: nowrap; }
.wt-badge.is-seed { color: var(--wt-ok); background: var(--wt-ok-soft); border-color: transparent; }
.wt-badge.is-pause { color: var(--wt-warn); background: var(--wt-warn-soft); border-color: transparent; }
.wt-badge.is-err { color: var(--wt-err); background: var(--wt-err-soft); border-color: transparent; }
.wt-hash { display: block; margin: 4px 0 8px; font: 11px ui-monospace, Consolas, monospace; color: var(--wt-faint); word-break: break-all; }
.wt-prog { height: 8px; border-radius: 99px; background: var(--wt-card-2); overflow: hidden; border: 1px solid var(--wt-line-soft); }
/* 进度填充用 transform 缩放（GPU 合成，不触发布局重排），每秒刷新更流畅 */
.wt-prog > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--wt-accent), #59c2ff); border-radius: 99px; transform: scaleX(0); transform-origin: 0 50%; transition: transform .3s ease-out; }
.wt-task.is-done .wt-prog > i { background: var(--wt-ok); }
.wt-task-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 9px 0; font-size: 11.5px; color: var(--wt-sub); font-variant-numeric: tabular-nums; }
.wt-task-meta b { color: var(--wt-fg); font-weight: 600; }
.wt-task-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wt-task-acts .wt-btn { flex: 0 1 auto; }
.wt-files-toggle { width: 100%; margin-top: 10px; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--wt-line-soft); padding: 9px 0 2px; color: var(--wt-accent); cursor: pointer; font: inherit; font-size: 12.5px; }
.wt-files { margin-top: 8px; max-height: 260px; overflow: auto; border: 1px solid var(--wt-line-soft); border-radius: var(--wt-r-sm); }
.wt-file { display: flex; align-items: center; gap: 8px; padding: 6px 9px; border-bottom: 1px solid var(--wt-line-soft); font-size: 12px; }
.wt-file:last-child { border-bottom: 0; }
.wt-file:nth-child(even) { background: var(--wt-zebra); }
.wt-file.is-skip { opacity: .55; }
.wt-file-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-file-z { flex: 0 0 auto; color: var(--wt-faint); font-variant-numeric: tabular-nums; }
.wt-file .wt-btn { flex: 0 0 auto; }
.wt-empty { padding: 40px 18px; border: 1px dashed var(--wt-line); border-radius: var(--wt-r); text-align: center; background: var(--wt-card-2); }

/* 深色滚动条：文件清单 / 做种列表 / 弹窗 / 页签 */
.wt-files, .wt-seed-files, .wt-modal-body, .wt-tabs { scrollbar-width: thin; scrollbar-color: var(--wt-line) transparent; }
.wt-files::-webkit-scrollbar, .wt-seed-files::-webkit-scrollbar, .wt-modal-body::-webkit-scrollbar, .wt-tabs::-webkit-scrollbar { width: 8px; height: 8px; }
.wt-files::-webkit-scrollbar-thumb, .wt-seed-files::-webkit-scrollbar-thumb, .wt-modal-body::-webkit-scrollbar-thumb, .wt-tabs::-webkit-scrollbar-thumb { background: var(--wt-line); border-radius: 99px; }
.wt-files::-webkit-scrollbar-thumb:hover, .wt-seed-files::-webkit-scrollbar-thumb:hover, .wt-modal-body::-webkit-scrollbar-thumb:hover { background: var(--wt-faint); }
.wt-files::-webkit-scrollbar-track, .wt-seed-files::-webkit-scrollbar-track, .wt-modal-body::-webkit-scrollbar-track, .wt-tabs::-webkit-scrollbar-track { background: transparent; }
.wt-empty-ico { font-size: 34px; opacity: .7; }
.wt-empty-t { margin: 10px 0 4px; font-size: 15px; font-weight: 600; }
.wt-empty-s { margin: 0; color: var(--wt-sub); font-size: 12.5px; }

/* ---------- 元信息 / 历史 ---------- */
.wt-meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0; border: 1px solid var(--wt-line-soft); border-radius: var(--wt-r-sm); overflow: hidden; }
.wt-meta-i { display: flex; flex-direction: column; gap: 2px; padding: 8px 11px; border-bottom: 1px solid var(--wt-line-soft); border-right: 1px solid var(--wt-line-soft); min-width: 0; }
.wt-meta-i span { font-size: 11px; color: var(--wt-faint); }
.wt-meta-i b { font-size: 12.5px; font-weight: 600; word-break: break-all; }
.wt-hist { display: grid; gap: 8px; }
.wt-hist-i { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 12px; border: 1px solid var(--wt-line-soft); border-radius: var(--wt-r-sm); background: var(--wt-card-2); }
.wt-hist-n { flex: 1 1 220px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wt-hist-m { flex: 0 0 auto; font-size: 11.5px; color: var(--wt-faint); }

/* ---------- 说明 ---------- */
.wt-help details { border: 1px solid var(--wt-line-soft); border-radius: var(--wt-r-sm); padding: 0 14px; margin-bottom: 9px; background: var(--wt-card-2); }
.wt-help details:last-child { margin-bottom: 0; }
.wt-help summary { padding: 11px 0; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.wt-help ul, .wt-help ol { margin: 0 0 12px; padding-left: 22px; color: var(--wt-sub); font-size: 12.5px; }
.wt-help li { margin-bottom: 5px; }

/* ---------- 弹窗 / toast ---------- */
.wt-mask { position: fixed; inset: 0; z-index: 100010; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0, 0, 0, .62); }
.wt-modal { width: min(920px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column; border: 1px solid var(--wt-line); border-radius: var(--wt-r); background: var(--wt-card); box-shadow: var(--wt-shadow); overflow: hidden; }
.wt-modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--wt-line); }
.wt-modal-t { margin: 0; font-size: 15px; font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
.wt-modal-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.wt-modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 16px; background: var(--wt-card-2); }
.wt-modal-body img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.wt-modal-body video, .wt-modal-body audio { width: 100%; max-height: 70vh; display: block; background: #000; }
.wt-modal-body iframe { width: 100%; height: min(72vh, 760px); border: 0; background: #fff; }
.wt-modal-body pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 12.5px/1.7 ui-monospace, Consolas, monospace; color: var(--wt-fg); }
.wt-pv-tip { color: var(--wt-sub); font-size: 12.5px; }
.wt-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100020; max-width: min(92vw, 560px); padding: 10px 16px; border-radius: 999px; border: 1px solid var(--wt-line); background: var(--wt-card); color: var(--wt-fg); box-shadow: var(--wt-shadow); font-size: 13px; text-align: center; }
.wt-toast.is-err { color: var(--wt-err); border-color: var(--wt-err); }
.wt-toast.is-ok { color: var(--wt-ok); border-color: var(--wt-ok); }

/* ==================== 响应式 ==================== */
@media (min-width: 1600px) { .wt { padding: 26px 34px 84px; } }
@media (max-width: 1200px) {
    .wt-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wt-stat:nth-child(4) { border-left: 0; }
    .wt-stat:nth-child(n+4) { border-top: 1px solid var(--wt-line-soft); }
}
@media (max-width: 900px) {
    .wt { padding: 18px 16px 64px; }
    .wt-hero { padding: 15px; }
    .wt-title { font-size: 20px; }
    .wt-grid2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .wt-tasks { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
    .wt { padding: 14px 12px calc(56px + env(safe-area-inset-bottom, 0px)); }
    .wt-hero { flex-wrap: wrap; }
    .wt-hero-ico { width: 42px; height: 42px; font-size: 22px; }
    .wt-hero-side { width: 100%; }
    .wt-hero-tags { gap: 4px; }
    .wt-tag { font-size: 11px; padding: 2px 7px; }
    .wt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wt-stat { padding: 9px 11px; }
    .wt-stat:nth-child(odd) { border-left: 0; }
    .wt-stat:nth-child(n+3) { border-top: 1px solid var(--wt-line-soft); }
    .wt-stat-v { font-size: 15px; }
    .wt-tab { padding: 9px 13px; font-size: 12.5px; min-height: 40px; }
    .wt-area, .wt-input, .wt-code { font-size: 16px; }
    .wt-btn { min-height: 40px; padding: 8px 13px; }
    .wt-btn-sm, .wt-btn-mini { min-height: 36px; }
    .wt-card { padding: 14px 12px; }
    .wt-toolbar .wt-input { max-width: none; flex: 1 1 100%; }
    .wt-toolbar .wt-btn { flex: 1 1 calc(50% - 4px); }
    .wt-add-row .wt-btn { flex: 1 1 calc(50% - 4px); }
    .wt-mask { padding: 0; align-items: flex-end; }
    .wt-modal { width: 100%; max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; }
    .wt-modal-body { padding: 12px; }
    .wt-modal-body iframe { height: 60vh; }
    .wt-task-acts .wt-btn { flex: 1 1 calc(50% - 4px); }
    .wt-files { max-height: 220px; }
}
@media (max-width: 420px) {
    .wt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wt-stat-chart { grid-column: 1 / -1; }
    #wtSpark { max-width: none; }
    .wt-tab { padding: 8px 11px; }
    .wt-add-row .wt-btn, .wt-toolbar .wt-btn, .wt-task-acts .wt-btn { flex: 1 1 100%; }
    .wt-file { flex-wrap: wrap; }
    .wt-file-n { flex: 1 1 100%; white-space: normal; overflow-wrap: anywhere; }
}
@media (hover: none) { .wt-btn:hover, .wt-tab:hover { background: var(--wt-card-2); } .wt-tab.is-on:hover { background: var(--wt-accent); } }
@media (prefers-reduced-motion: reduce) { .wt * { transition: none !important; animation: none !important; } }
@media print { .wt-tabs, .wt-toolbar, .wt-add-row, .wt-toast, .wt-mask { display: none !important; } .wt { padding: 0; } }
