:root {
  --bg: #0e0f13;
  --surface: #171920;
  --surface-2: #20232b;
  --surface-3: #2a2e38;
  --line: #2c3039;
  --text: #f2f3f5;
  --text-2: #b0b4be;
  --muted: #747a87;
  --accent: #ffd23f;
  --accent-ink: #17140a;
  --good: #3ecf8e;
  --danger: #ff6464;
  --radius: 14px;
  --topbar-h: 56px;
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---------- Chrome ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) 12px 0;
  display: flex; align-items: center; gap: 8px;
  background: rgba(14, 15, 19, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { flex: 1; margin: 0 4px; font-size: 20px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; background: var(--surface-3); }

main {
  max-width: 1100px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  min-height: calc(100vh - var(--topbar-h));
}

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: flex;
  background: rgba(19, 21, 27, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.tabbar a.active { color: var(--accent); }
.tabbar svg { width: 24px; height: 24px; }
body.no-tabs .tabbar { display: none; }
body.no-tabs main { padding-bottom: 32px; }

/* ---------- Generic ---------- */

.section { margin-bottom: 28px; }
.section-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.section-head .count { color: var(--muted); font-size: 14px; }
.section-head .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-weight: 500;
  border: 1px solid var(--line);
}
.btn:hover { background: var(--surface-3); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px 14px; padding-inline: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; }
.chip.active { background: var(--text); color: var(--bg); }
.chip .n { color: var(--muted); font-size: 12px; }
.chip.active .n { color: #555; }

.field { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); outline: none; }
.field:focus { border-color: var(--accent); }
.search-field { position: relative; margin-bottom: 14px; }
.search-field svg { position: absolute; inset-inline-start: 12px; top: 11px; color: var(--muted); }
.search-field .field { padding-inline-start: 42px; }

.empty { text-align: center; color: var(--text-2); padding: 48px 16px; }
.empty .big { font-size: 44px; margin-bottom: 8px; }
.empty h3 { margin: 0 0 6px; color: var(--text); }
.empty .actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.progress.done > i { background: var(--good); }

.check {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--surface-3); color: var(--text-2);
  transition: background .15s, border-color .15s, color .15s, transform .15s;
}
.check:hover { border-color: var(--accent); color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.check.busy { transform: scale(.9); opacity: .6; }
.check.small { width: 34px; height: 34px; }
.check.small svg { width: 18px; height: 18px; }
.check[disabled] { opacity: .35; pointer-events: none; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-3); color: var(--text-2); }
.badge.accent { background: rgba(255, 210, 63, .15); color: var(--accent); }
.badge.good { background: rgba(62, 207, 142, .15); color: var(--good); }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500;
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- New version notice ---------- */

.update-banner {
  position: fixed; z-index: 80; left: 50%; top: calc(var(--topbar-h) + var(--safe-top) + 10px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 16px; padding-inline-start: 16px; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 500; box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
  animation: fade .2s;
}
.update-banner span, .update-banner .btn { white-space: nowrap; }
.update-banner:has(.btn[hidden]) { padding: 10px 18px; }

/* ---------- Sheet (modal) ---------- */

.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet {
  width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + var(--safe-bottom));
  animation: up .2s ease-out;
}
.sheet h3 { margin: 0 0 6px; font-size: 18px; }
.sheet p { margin: 0 0 16px; color: var(--text-2); }
.sheet .stack { display: flex; flex-direction: column; gap: 8px; }
.sheet .stack .btn { height: 46px; }
.sheet label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 20px; } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Profiles ---------- */

.profiles { max-width: 640px; margin: 6vh auto 0; text-align: center; }
.profiles h2 { font-size: 26px; margin: 0 0 28px; }
.profile-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.profile-tile { width: 110px; display: flex; flex-direction: column; align-items: center; gap: 8px; position: relative; }
.profile-tile .face { width: 96px; height: 96px; border-radius: 22px; display: grid; place-items: center; font-size: 48px; transition: transform .15s, box-shadow .15s; }
.profile-tile:hover .face { transform: scale(1.05); box-shadow: 0 0 0 3px var(--text); }
.profile-tile .name { font-weight: 500; color: var(--text-2); }
.profile-tile .sub { font-size: 12px; color: var(--muted); margin-top: -6px; }
.profile-tile.add .face { background: var(--surface-2); color: var(--muted); border: 2px dashed var(--surface-3); }
.profile-tile .edit-badge { position: absolute; top: -6px; inset-inline-start: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; }
.profile-tile .edit-badge svg { width: 16px; height: 16px; }
.login { max-width: 340px; }
.login-error { color: var(--danger); margin: 10px 0 0; font-size: 14px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 10px; font-size: 24px; background: var(--surface-2); }
.emoji-grid button.on { box-shadow: 0 0 0 2px var(--accent); }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-row button { width: 34px; height: 34px; border-radius: 50%; }
.color-row button.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

/* ---------- Watchlist ---------- */

.wl-list { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) { .wl-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wl-card { display: flex; align-items: center; gap: 12px; padding: 10px; padding-inline-end: 12px; background: var(--surface); border-radius: var(--radius); transition: opacity .25s, transform .25s; }
.wl-card.leaving { opacity: 0; transform: scale(.97); }
.wl-thumb { flex: none; width: 128px; aspect-ratio: 16 / 9; border-radius: 10px; background: var(--surface-3) center / cover no-repeat; cursor: pointer; }
.wl-body { flex: 1; min-width: 0; cursor: pointer; }
.wl-show { text-align: right; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-ep { color: var(--text-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The code is an LTR island inside RTL text: the gap goes on its physical left, toward the episode name. */
.wl-ep b { color: var(--accent); font-weight: 700; margin-left: 6px; direction: ltr; unicode-bidi: isolate; }
.wl-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.wl-meta .progress { flex: 1; max-width: 140px; }
@media (max-width: 420px) { .wl-thumb { width: 96px; } }

/* Watchlist grid view */
.view-toggle { padding: 2px; }
.view-toggle button { height: 30px; width: 36px; padding: 0; display: grid; place-items: center; }
.view-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wl-grid { display: grid; gap: 14px 10px; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
.wl-tile { min-width: 0; transition: opacity .25s, transform .25s; }
.wl-tile.leaving { opacity: 0; transform: scale(.97); }
.wl-tile .poster { cursor: pointer; }
.wl-tile .check { position: absolute; bottom: 6px; inset-inline-end: 6px; background: rgba(14, 15, 19, .75); border-color: rgba(255, 255, 255, .35); color: #fff; backdrop-filter: blur(4px); }
.wl-tile .check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.wl-tile .progress { margin-top: 6px; }
.wl-tile .pname { margin-top: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.wl-tile .psub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-tile .psub b { color: var(--accent); direction: ltr; unicode-bidi: isolate; }

.poster-row { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: thin; }
.poster-row .poster-card { width: 112px; flex: none; }

/* ---------- Poster grid ---------- */

.poster-grid { display: grid; gap: 14px 10px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
@media (min-width: 640px) { .poster-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
.poster-card { position: relative; display: block; min-width: 0; }
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .noimg { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; font-size: 13px; color: var(--muted); }
.poster .fav { position: absolute; top: 6px; inset-inline-end: 6px; font-size: 14px; filter: drop-shadow(0 1px 2px #000); }
.poster .tag { position: absolute; bottom: 6px; inset-inline-start: 6px; }
.poster-card .progress { margin-top: 6px; }
.poster-card .pname { margin-top: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-card .psub { font-size: 12px; color: var(--muted); }
.poster-card .add-btn { position: absolute; top: 6px; inset-inline-start: 6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(14, 15, 19, .8); color: var(--text); backdrop-filter: blur(4px); }
.poster-card .add-btn.on { background: var(--accent); color: var(--accent-ink); }
.poster-card .add-btn svg { width: 18px; height: 18px; }

.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.toolbar .search-field { flex: 1; margin: 0; }
.toolbar select.field { width: auto; padding: 0 10px; }

/* ---------- Search filters ---------- */

.filter-btn { position: relative; flex: none; height: 44px; border-radius: 12px; }
.filter-btn .count { position: absolute; top: -6px; inset-inline-start: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 12px; display: grid; place-items: center; }
.active-filters { margin-top: -4px; }
.hint { color: var(--muted); font-size: 13px; margin: -6px 0 12px; }
.hint-inline { color: var(--muted); font-size: 12px; }
.filters .seg { display: flex; flex-wrap: wrap; }
.filters .seg button { flex: 1; white-space: nowrap; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-wrap .chip { height: 32px; font-size: 13px; }
.chip.provider img { width: 20px; height: 20px; border-radius: 5px; }
.year-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--text-2); }
.year-row .field { height: 38px; flex: 1; }
.filters .toggle { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--text); font-size: 14px; }
.filters .toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.filter-actions { position: sticky; bottom: calc(-20px - var(--safe-bottom)); display: flex; gap: 8px; margin: 20px -20px calc(-20px - var(--safe-bottom)); padding: 12px 20px calc(12px + var(--safe-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.filter-actions .primary { flex: 1; height: 46px; }

/* ---------- Swipe back ---------- */

main.swiping { transition: none; }
main.swipe-release { transition: transform .2s ease-out, opacity .2s ease-out; }

/* ---------- Upcoming ---------- */

.day { margin-bottom: 22px; }
.day-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.day-head h3 { margin: 0; font-size: 16px; }
.day-head .rel { font-size: 13px; color: var(--accent); font-weight: 500; }
.up-item { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: var(--surface); margin-bottom: 8px; }
.up-item img, .up-item .ph { width: 46px; height: 69px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.up-item .t { font-weight: 700; }
.up-item .s { font-size: 14px; color: var(--text-2); }
.up-item .s b { color: var(--accent); direction: ltr; unicode-bidi: isolate; }
.up-item .n { font-size: 12px; color: var(--muted); }
.day-head .spacer { flex: 1; }
.day-head .view-toggle { align-self: center; }
.up-grid { display: grid; gap: 14px 10px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); margin-bottom: 8px; }
.up-tile .psub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-tile .psub b { color: var(--accent); direction: ltr; unicode-bidi: isolate; }

/* ---------- Show page ---------- */

.hero { position: relative; margin: -16px -16px 0; min-height: 230px; background: var(--surface) center / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(14, 15, 19, .25), var(--bg) 96%); }
.show-head { position: relative; z-index: 1; display: flex; gap: 16px; align-items: flex-end; margin-top: -130px; }
.show-head .poster { width: 120px; flex: none; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }
.show-head h2 { margin: 0 0 4px; font-size: 24px; line-height: 1.2; font-weight: 800; }
.show-head .orig { color: var(--text-2); font-size: 14px; margin-bottom: 6px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--text-2); font-size: 13px; }
.meta span + span::before { content: "·"; margin-inline-end: 10px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.seg button.on { background: var(--text); color: var(--bg); }
.fav-btn.on { color: #ff5f7e; border-color: rgba(255, 95, 126, .4); }
.fav-btn.on svg { fill: currentColor; }
.overview { color: var(--text-2); margin: 0 0 18px; max-width: 70ch; }
.progress-box { background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 18px; }
.progress-box .row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.progress-box .row b { font-weight: 700; }
.progress-box .progress { height: 6px; }
.progress-box .next { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.progress-box .next b { color: var(--accent); direction: ltr; unicode-bidi: isolate; }

.season { background: var(--surface); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.season-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.season-head .info { flex: 1; min-width: 0; }
.season-head .name { font-weight: 700; }
.season-head .sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.season-head .sub .progress { width: 90px; }
.season-head .chev { color: var(--muted); transition: transform .2s; }
.season.open .chev { transform: rotate(180deg); }
.episodes { border-top: 1px solid var(--line); }
.ep { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.ep:last-child { border-bottom: 0; }
.ep .num { width: 30px; flex: none; color: var(--muted); font-weight: 700; text-align: center; direction: ltr; }
.ep .still { width: 96px; flex: none; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--surface-3) center / cover no-repeat; }
.ep .body { flex: 1; min-width: 0; cursor: pointer; }
.ep .t { font-weight: 500; }
.ep .d { font-size: 12px; color: var(--muted); }
.ep .ov { font-size: 13px; color: var(--text-2); margin-top: 6px; display: none; }
.ep.expanded .ov { display: block; }
.ep.unaired .t { color: var(--muted); }
@media (max-width: 480px) { .ep .still { display: none; } }

/* ---------- Trailer ---------- */

.trailer-btn { background: #ff3b30; border-color: transparent; color: #fff; font-weight: 700; }
.trailer-btn:hover { background: #ff5147; }
.trailer-btn svg { stroke: none; }
.sheet.wide { max-width: 760px; }
.trailer-sheet .video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.trailer-sheet iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trailer-list { display: flex; gap: 10px; overflow-x: auto; margin-top: 12px; padding-bottom: 4px; }
.trailer-item { flex: none; width: 160px; text-align: start; border-radius: 10px; padding: 4px; border: 2px solid transparent; }
.trailer-item.on { border-color: var(--accent); }
.trailer-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; }
.trailer-item span { display: flex; flex-direction: column; margin-top: 4px; font-size: 12px; }
.trailer-item b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trailer-item small { color: var(--muted); }

/* ---------- Stats ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 24px; }
.tile { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; }
.tile .label { font-size: 13px; color: var(--text-2); }
.tile .value { font-size: 30px; font-weight: 800; line-height: 1.15; margin-top: 4px; }
.tile .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 2px; font-size: 16px; }
.card .desc { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.cards-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cards-2 { grid-template-columns: 1fr 1fr; } .cards-2 .card { margin-bottom: 0; } }

.bars { direction: ltr; position: relative; }
.bars .plot { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 160px; border-bottom: 1px solid var(--surface-3); }
.bars .grid-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.bars .grid-line span { position: absolute; top: -9px; left: 0; font-size: 11px; color: var(--muted); background: var(--surface); padding-right: 4px; }
.bars .col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bars .col i { display: block; width: 100%; min-height: 0; background: var(--accent); border-radius: 4px 4px 0 0; transition: filter .1s; }
.bars .col:hover i { filter: brightness(1.2); }
.bars .col.dim i { opacity: .35; }
.bars .xlabels { display: flex; gap: 2px; margin-top: 6px; }
.bars .xlabels span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }
.bars.with-axis .plot, .bars.with-axis .xlabels { margin-left: 34px; }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar .top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.hbar .top span:last-child { color: var(--text-2); }
.hbar .track { height: 8px; border-radius: 4px; background: var(--surface-3); }
.hbar .track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }

.top-shows { display: grid; gap: 8px; }
.top-show { display: flex; align-items: center; gap: 12px; }
.top-show .rank { width: 20px; text-align: center; color: var(--muted); font-weight: 700; }
.top-show img, .top-show .ph { width: 36px; height: 54px; border-radius: 6px; object-fit: cover; background: var(--surface-2); flex: none; }
.top-show .t { flex: 1; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-show .v { font-size: 13px; color: var(--text-2); text-align: end; }

.tooltip { position: fixed; z-index: 70; pointer-events: none; background: var(--text); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 500; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }

/* ---------- Settings ---------- */

.settings-list { display: flex; flex-direction: column; gap: 14px; max-width: 680px; }
.settings-list .card p { color: var(--text-2); margin: 6px 0 12px; font-size: 14px; }
.profile-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.profile-row:last-child { border-bottom: 0; }
.profile-row .face { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 22px; }
.profile-row .name { flex: 1; font-weight: 500; }
.import-status { margin-top: 12px; font-size: 14px; color: var(--text-2); }
.import-status .progress { height: 6px; margin: 8px 0; }
.import-status details { margin-top: 8px; }
.import-status ul { max-height: 200px; overflow: auto; padding-inline-start: 20px; color: var(--muted); }
.warn-box { border: 1px solid rgba(255, 210, 63, .4); background: rgba(255, 210, 63, .08); border-radius: var(--radius); padding: 14px; }
.warn-box code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; direction: ltr; unicode-bidi: isolate; font-size: 13px; }
.cmd { direction: ltr; text-align: left; white-space: pre-wrap; word-break: break-all; margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.attribution { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.attribution svg { width: 90px; height: auto; flex: none; }
.ltr { direction: ltr; unicode-bidi: isolate; }
