/* DataNex — design system */
:root {
  --bg: #f4f5fa;
  --bg-2: #eceef6;
  --surface: #ffffff;
  --surface-2: #f3f4f9;
  --surface-3: #e9ebf3;
  --border: #e2e5ee;
  --border-strong: #cfd4e2;
  --text: #121624;
  --text-2: #3b4258;
  --muted: #69718a;
  --accent: #6d4aff;
  --accent-2: #06b6d4;
  --accent-soft: rgba(109, 74, 255, .10);
  --accent-text: #5b36f5;
  --danger: #e11d48;
  --danger-soft: rgba(225, 29, 72, .10);
  --ok: #16a34a;
  --ok-soft: rgba(22, 163, 74, .12);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, .12);
  --shadow-sm: 0 1px 2px rgba(16, 22, 40, .06), 0 1px 3px rgba(16, 22, 40, .05);
  --shadow: 0 8px 24px rgba(16, 22, 40, .08), 0 2px 6px rgba(16, 22, 40, .05);
  --shadow-lg: 0 24px 64px rgba(16, 22, 40, .18), 0 4px 12px rgba(16, 22, 40, .08);
  --overlay: rgba(10, 12, 20, .5);
  --grad: linear-gradient(135deg, #6d4aff 0%, #3b82f6 55%, #06b6d4 100%);
  --k-video: #f43f5e;
  --k-audio: #a855f7;
  --k-image: #10b981;
  --k-document: #3b82f6;
  --k-archive: #f59e0b;
  --k-code: #0d9488;
  --k-other: #64748b;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --sidebar: 264px;
  --topbar: 64px;
  --bottomnav: 64px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c13;
    --bg-2: #0e111a;
    --surface: #131722;
    --surface-2: #191e2b;
    --surface-3: #212737;
    --border: #232a3b;
    --border-strong: #323a50;
    --text: #eceff7;
    --text-2: #c3c9d9;
    --muted: #8a92aa;
    --accent: #8b6cff;
    --accent-2: #22d3ee;
    --accent-soft: rgba(139, 108, 255, .16);
    --accent-text: #a993ff;
    --danger: #fb5779;
    --danger-soft: rgba(251, 87, 121, .14);
    --ok: #34d399;
    --ok-soft: rgba(52, 211, 153, .14);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
    --overlay: rgba(3, 4, 8, .66);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c13;
  --bg-2: #0e111a;
  --surface: #131722;
  --surface-2: #191e2b;
  --surface-3: #212737;
  --border: #232a3b;
  --border-strong: #323a50;
  --text: #eceff7;
  --text-2: #c3c9d9;
  --muted: #8a92aa;
  --accent: #8b6cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(139, 108, 255, .16);
  --accent-text: #a993ff;
  --danger: #fb5779;
  --danger-soft: rgba(251, 87, 121, .14);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, .14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .14);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  --overlay: rgba(3, 4, 8, .66);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; word-break: break-all; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 20px; height: 20px; flex: none; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 28px; height: 28px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .92rem; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  text-decoration: none !important;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 20px -6px rgba(109, 74, 255, .6); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--danger); border-color: transparent; color: #fff; }
.btn.danger.soft { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 1rem; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon-only { width: 40px; padding: 0; }
.btn.icon-only.sm { width: 32px; }
.iconbtn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--text-2); position: relative; flex: none;
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }
.iconbtn.active { color: var(--accent-text); background: var(--accent-soft); }
.iconbtn .dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

label { display: block; font-weight: 600; font-size: .86rem; color: var(--text-2); margin-bottom: 12px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=date], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 6px; height: 44px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  font-weight: 500; font-size: .95rem; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
input[type=color] { width: 44px; height: 36px; border: 0; padding: 0; background: none; border-radius: 8px; }
.hint { font-weight: 400; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 500; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background .2s; flex: none; margin: 0; cursor: pointer; border: 1px solid var(--border); }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 9px; font-weight: 600; font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.card.flat { box-shadow: none; }
.card h2 { display: flex; align-items: center; gap: 10px; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: .9rem; margin: 10px 0; background: var(--surface-2); border: 1px solid var(--border); }
.alert.error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.alert.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.alert.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.alert.info { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); border-radius: inherit; transition: width .3s; }
.progress.warn > i { background: var(--warn); }
.progress.danger > i { background: var(--danger); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 12px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- auth & installer ---------- */
.auth-body { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; background:
  radial-gradient(900px 500px at 10% -10%, rgba(109, 74, 255, .22), transparent 60%),
  radial-gradient(800px 500px at 110% 110%, rgba(6, 182, 212, .18), transparent 60%), var(--bg); }
.auth-wrap { width: 100%; max-width: 420px; }
.auth-wrap.wide { max-width: 640px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; margin-bottom: 22px; }
.auth-card { padding: 28px; border-radius: 24px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 1.45rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; }
.auth-tabs button { width: 100%; justify-content: center; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); font-size: .85rem; }
.sec { margin-top: 26px; font-size: 1.05rem; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checks li { display: flex; gap: 10px; align-items: baseline; font-size: .9rem; }
.checks li span { width: 20px; height: 20px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-size: .75rem; font-weight: 800; transform: translateY(4px); }
.checks .ok span { background: var(--ok-soft); color: var(--ok); }
.checks .bad span { background: var(--danger-soft); color: var(--danger); }
.checks .warn span { background: var(--warn-soft); color: var(--warn); }
.steps { padding-left: 20px; line-height: 1.8; }
details.help { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: .9rem; }
details.help summary { cursor: pointer; font-weight: 600; }
details.help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.7; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: hidden;
  background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40;
}
.sidebar > * { flex-shrink: 0; }
.side-head { padding: 18px 16px 12px; display: grid; gap: 14px; }
.side-scroll { flex: 1 1 auto !important; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; padding: 2px 6px; color: var(--text); text-decoration: none !important; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button.navlink {
  display: flex; align-items: center; gap: 12px; height: 38px; flex-shrink: 0; padding: 0 12px; border-radius: 11px;
  color: var(--text-2); font-weight: 600; font-size: .92rem; text-decoration: none !important; border: 0; background: none; width: 100%; text-align: left;
}
.nav a:hover, .nav button.navlink:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent-text); }
.nav a .count { margin-left: auto; font-size: .75rem; color: var(--muted); font-weight: 600; }
.nav .tagdot { width: 10px; height: 10px; border-radius: 50%; margin: 0 5px; flex: none; }
.nav-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 14px 12px 6px; display: flex; align-items: center; }
.nav-title button { margin-left: auto; border: 0; background: none; color: var(--muted); padding: 2px; border-radius: 6px; }
.nav-title button:hover { color: var(--text); background: var(--surface-2); }
.side-foot { padding: 12px 14px 16px; display: grid; gap: 10px; border-top: 1px solid var(--border); background: var(--surface); }
.storage-box { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; }
.storage-box strong { font-size: .88rem; }
.storage-box .progress { margin: 8px 0 6px; }
.plan-box { padding: 12px 14px; border-radius: 14px; background: var(--grad); color: #fff; font-size: .84rem; position: relative; overflow: hidden; }
.plan-box::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.plan-box strong { display: block; font-size: .95rem; }
.plan-box .btn { margin-top: 10px; background: rgba(255, 255, 255, .2); color: #fff; border: 0; height: 32px; }
.plan-box.expired { background: linear-gradient(135deg, #e11d48, #f97316); }

.main { min-width: 0; display: flex; flex-direction: column; background: radial-gradient(900px 320px at 85% -120px, var(--accent-soft), transparent 70%); }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid var(--border);
}
.search { flex: 1 1 auto; max-width: 620px; position: relative; }
.search input { margin: 0; padding: 0 44px; height: 42px; border-radius: 12px; background: var(--surface-2); border-color: transparent; }
.search input:hover { border-color: var(--border); }
.search .icon { position: absolute; left: 15px; top: 11px; color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 9px; min-width: 24px; height: 24px; padding: 0 7px; display: grid; place-items: center; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font: 600 .75rem var(--font); pointer-events: none; }
.search input:focus + kbd { opacity: 0; }
.search input::-webkit-search-cancel-button { display: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.top-sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }
.user-chip { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 10px 0 4px; margin-left: 4px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: background .15s, border-color .15s; max-width: 240px; }
.user-chip:hover { background: var(--surface-2); border-color: var(--border-strong); }
.user-chip .uc-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; text-align: left; }
.user-chip .uc-text b { font-size: .86rem; max-width: 140px; }
.user-chip .uc-text small { font-size: .72rem; color: var(--muted); font-weight: 600; }
.user-chip .uc-chev { color: var(--muted); display: grid; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; border: 0; flex: none; letter-spacing: .02em; }
.menu-toggle { display: none; }
.content { padding: 20px 28px 120px; flex: 1; min-width: 0; width: 100%; max-width: 1680px; margin: 0 auto; }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 18px; min-height: 44px; }
.page-head h1 { margin: 0; font-size: 1.45rem; }
.crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 1.3rem; font-weight: 750; letter-spacing: -.01em; min-width: 0; }
.crumbs a, .crumbs span { color: var(--text); padding: 2px 8px; border-radius: 9px; text-decoration: none !important; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { background: var(--surface-2); color: var(--text); }
.crumbs a.drop-target, .folder-card.drop-target, .nav a.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.crumbs .sep { color: var(--muted); opacity: .6; padding: 0; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: -6px 0 16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .chip { cursor: pointer; height: 32px; padding: 0 14px; font-size: .84rem; flex: none; }
.filters .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- file grid ---------- */
.section-title { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 20px 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.grid.folders { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.folder-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--border); cursor: pointer; user-select: none; transition: border-color .15s, box-shadow .15s, transform .1s; position: relative; min-width: 0;
}
.folder-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.folder-card .ficon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: color-mix(in srgb, var(--fc, var(--accent)) 16%, transparent); color: var(--fc, var(--accent)); }
.folder-card .meta { min-width: 0; flex: 1; }
.folder-card .name { font-weight: 650; font-size: .92rem; }
.folder-card .sub { font-size: .78rem; color: var(--muted); }
.item.selected { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft) !important; }
.more-btn { opacity: 0; transition: opacity .15s; }
.item:hover .more-btn, .item.selected .more-btn { opacity: 1; }
@media (hover: none) { .more-btn { opacity: 1; } }

.file-card {
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; cursor: pointer; user-select: none;
  transition: border-color .15s, box-shadow .2s, transform .15s; position: relative; display: flex; flex-direction: column; min-width: 0;
}
.file-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.thumb { aspect-ratio: 4 / 3; background: var(--surface-2); position: relative; display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s, transform .4s; }
.thumb img.loaded { opacity: 1; }
.file-card:hover .thumb img { transform: scale(1.04); }
.thumb .kicon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: var(--kc, var(--k-other)); box-shadow: 0 10px 24px -8px var(--kc, var(--k-other)); }
.thumb .kicon .icon { width: 28px; height: 28px; }
.thumb .ext { position: absolute; bottom: 8px; left: 8px; font-size: .68rem; font-weight: 800; letter-spacing: .05em; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; text-transform: uppercase; }
.thumb .dur { position: absolute; bottom: 8px; right: 8px; font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-variant-numeric: tabular-nums; }
.thumb .play-badge { position: absolute; inset: 0; margin: auto; width: 48px; height: 48px; border-radius: 50%; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.85); transition: .2s; }
.file-card:hover .play-badge { opacity: 1; transform: scale(1); }
.file-info { padding: 10px 12px 12px; display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.file-info .meta { min-width: 0; flex: 1; }
.file-info .name { font-weight: 600; font-size: .88rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.file-info .sub { font-size: .76rem; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; }
.file-info .tagdots { display: inline-flex; gap: 3px; }
.file-info .tagdots i { width: 7px; height: 7px; border-radius: 50%; }
.file-card .star { position: absolute; top: 8px; right: 8px; color: #fbbf24; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.check {
  position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 8px; background: rgba(0, 0, 0, .35); border: 2px solid #fff;
  display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .15s; z-index: 2;
}
.folder-card .check { position: static; opacity: 1; border-color: var(--border-strong); background: var(--surface-2); display: none; }
.selecting .check { opacity: 1; }
.selecting .folder-card .check { display: grid; }
.item:hover .check { opacity: 1; }
.item.selected .check { background: var(--accent); border-color: var(--accent); opacity: 1; }
.check .icon { width: 14px; height: 14px; opacity: 0; }
.item.selected .check .icon { opacity: 1; }

/* list view */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.list-head, .list-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 110px 150px 44px; align-items: center; gap: 10px; padding: 0 12px; }
.list-head { height: 40px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1px solid var(--border); }
.list-head button { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left; display: inline-flex; align-items: center; gap: 4px; }
.list-row { height: 54px; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; position: relative; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--surface-2); }
.list-row.selected { background: var(--accent-soft); box-shadow: none !important; }
.list-row .check { position: static; opacity: 1; background: transparent; border-color: var(--border-strong); width: 20px; height: 20px; border-radius: 6px; }
.list-row .nm { display: flex; align-items: center; gap: 12px; min-width: 0; }
.list-row .mini { width: 36px; height: 36px; border-radius: 9px; flex: none; display: grid; place-items: center; color: #fff; background: var(--kc, var(--k-other)); overflow: hidden; }
.list-row .mini img { width: 100%; height: 100%; object-fit: cover; }
.list-row .mini .icon { width: 18px; height: 18px; }
.list-row .c { font-size: .84rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) {
  .list-head { display: none; }
  .list-row { grid-template-columns: minmax(0, 1fr) 40px; height: 62px; }
  .list-row .check { display: none; }
  .selecting .list-row { grid-template-columns: 28px minmax(0, 1fr) 40px; }
  .selecting .list-row .check { display: grid; }
  .list-row .c.size, .list-row .c.date { display: none; }
  .list-row .nm .sub { display: block !important; }
}
.list-row .nm .sub { display: none; font-size: .76rem; color: var(--muted); }

/* photos */
.photo-group h3 { font-size: .95rem; margin: 22px 0 10px; color: var(--text-2); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; }
.photos .ph { aspect-ratio: 1; background: var(--surface-2); position: relative; overflow: hidden; cursor: pointer; border-radius: 4px; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s, transform .3s; }
.photos .ph img.loaded { opacity: 1; }
.photos .ph:hover img { transform: scale(1.05); }
.photos .ph .kicon { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.photos .ph.selected { outline: 3px solid var(--accent); outline-offset: -3px; }
.photos .ph .check { opacity: 0; }
.selecting .photos .ph .check, .photos .ph:hover .check { opacity: 1; }
@media (max-width: 600px) { .photos { grid-template-columns: repeat(3, 1fr); gap: 2px; } .photos .ph { border-radius: 0; } }

/* videos */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px 16px; }
.vcard { cursor: pointer; min-width: 0; position: relative; }
.vcard .thumb { aspect-ratio: 16 / 9; border-radius: 14px; }
.vcard .vt { display: flex; gap: 8px; padding: 10px 2px 0; align-items: flex-start; }
.vcard .vt .name { font-weight: 650; font-size: .92rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; word-break: break-word; }
.vcard .vt .sub { font-size: .78rem; color: var(--muted); }
.vcard .resume { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .25); }
.vcard .resume i { display: block; height: 100%; background: var(--danger); }
.vcard.selected .thumb { outline: 3px solid var(--accent); }

/* music */
.music-hero { display: flex; gap: 22px; align-items: flex-end; padding: 26px; border-radius: 24px; color: #fff; margin-bottom: 18px; position: relative; overflow: hidden;
  background: radial-gradient(600px 300px at 0% 0%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(135deg, #7c3aed, #db2777 60%, #f97316); }
.music-hero .cover { width: 120px; height: 120px; border-radius: 18px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; flex: none; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, .4); }
.music-hero .cover .icon { width: 54px; height: 54px; }
.music-hero h1 { font-size: 2rem; margin: 4px 0; }
.music-hero .btn { background: #fff; color: #111; border: 0; }
.music-hero .btn.ghost { background: rgba(255, 255, 255, .18); color: #fff; }
@media (max-width: 600px) { .music-hero { flex-direction: column; align-items: flex-start; padding: 20px; } .music-hero .cover { width: 84px; height: 84px; } .music-hero h1 { font-size: 1.5rem; } }
.tracks { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.track { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 70px 40px; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; }
.track:last-child { border-bottom: 0; }
.track:hover { background: var(--surface-2); }
.track .no { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; font-size: .85rem; }
.track .art { width: 40px; height: 40px; border-radius: 9px; background: linear-gradient(135deg, var(--k-audio), #ec4899); display: grid; place-items: center; color: #fff; overflow: hidden; }
.track .art img { width: 100%; height: 100%; object-fit: cover; }
.track .t { min-width: 0; display: flex; align-items: center; gap: 12px; }
.track .t .name { font-weight: 600; font-size: .9rem; }
.track .t .sub { font-size: .76rem; color: var(--muted); }
.track .d { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.track.playing .name, .track.playing .no { color: var(--accent-text); }
.track.selected { background: var(--accent-soft); }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--accent-text); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
.paused .eq i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
@media (max-width: 600px) { .track { grid-template-columns: minmax(0, 1fr) auto 36px; gap: 10px; padding: 10px 8px 10px 12px; } .track .no, .track .tagcol { display: none; } .track .art { width: 46px; height: 46px; border-radius: 11px; } .track .t .name { font-size: .95rem; } }

/* empty states */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .art { width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 28px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.empty .art .icon { width: 44px; height: 44px; }
.empty h2 { color: var(--text); font-size: 1.2rem; }
.dropzone-overlay { position: fixed; inset: 0; z-index: 200; background: color-mix(in srgb, var(--accent) 18%, transparent); backdrop-filter: blur(3px); display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .15s; }
.dropzone-overlay.on { opacity: 1; }
.dropzone-overlay div { padding: 40px 50px; border-radius: 28px; border: 3px dashed #fff; color: #fff; font-weight: 800; font-size: 1.3rem; text-align: center; background: rgba(0, 0, 0, .25); }
.dropzone-overlay .icon { width: 48px; height: 48px; margin: 0 auto 12px; }

/* selection bar */
.selbar {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 150%); z-index: 60;
  display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 16px; border-radius: 18px; background: var(--text); color: var(--bg);
  box-shadow: var(--shadow-lg); transition: transform .25s cubic-bezier(.2, .9, .3, 1.2); max-width: calc(100vw - 24px); overflow-x: auto;
}
.selbar:not(.on) { visibility: hidden; opacity: 0; pointer-events: none; }
.selbar.on { transform: translate(-50%, 0); }
.selbar .iconbtn { color: var(--bg); }
.selbar .iconbtn:hover { background: color-mix(in srgb, var(--bg) 16%, transparent); color: var(--bg); }
.selbar strong { margin-right: 8px; white-space: nowrap; font-size: .9rem; }

/* ---------- mobile ---------- */
.bottomnav { display: none; }
.fab { display: none; }
.backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 39; opacity: 0; pointer-events: none; transition: opacity .2s; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 290px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); padding-bottom: calc(18px + var(--safe-b)); }
  .drawer-open .sidebar { transform: none; }
  .drawer-open .backdrop { opacity: 1; pointer-events: auto; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 0 10px; gap: 6px; }
  .user-chip { border: 0; padding: 0; background: none; height: auto; margin: 0; }
  .side-head { padding-top: max(18px, env(safe-area-inset-top)); }
  .topbar .hide-m { display: none; }
  .content { padding: 14px 14px calc(var(--bottomnav) + 110px + var(--safe-b)); }
  .crumbs { font-size: 1.15rem; }
  .page-head h1 { font-size: 1.25rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 10px; }
  .grid.folders { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .vgrid { grid-template-columns: 1fr; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    height: calc(var(--bottomnav) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--border);
  }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .68rem; font-weight: 600; text-decoration: none !important; }
  .bottomnav a.on { color: var(--accent-text); }
  .fab {
    display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(var(--bottomnav) + 16px + var(--safe-b)); z-index: 36;
    width: 58px; height: 58px; border-radius: 18px; border: 0; background: var(--grad); color: #fff; box-shadow: 0 12px 30px -8px rgba(109, 74, 255, .7);
  }
  .fab .icon { width: 26px; height: 26px; }
  .has-player .fab { bottom: calc(var(--bottomnav) + 88px + var(--safe-b)); }
  .selbar { bottom: calc(var(--bottomnav) + 12px + var(--safe-b)); }
  .search { max-width: none; }
}
@media (max-width: 900px) { .desktop-only { display: none !important; } }
@media (min-width: 901px) { .mobile-only { display: none !important; } }

/* ---------- overlays: modal, menu, toast ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: var(--overlay); animation: fade .15s ease; }
.modal { width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); padding: 24px; animation: pop .2s cubic-bezier(.2, .9, .3, 1.15); border: 1px solid var(--border); }
.modal.wide { max-width: 640px; }
.modal h2 { margin-bottom: 6px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .modal-wrap { align-items: end; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-width: none; padding-bottom: calc(24px + var(--safe-b)); animation: sheet .25s cubic-bezier(.2, .9, .3, 1); max-height: 90dvh; }
  .modal .actions .btn { flex: 1; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
@keyframes sheet { from { transform: translateY(100%); } }

.ctx { position: fixed; z-index: 400; min-width: 220px; max-width: 280px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; animation: pop .12s ease; }
.ctx button { display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 12px; border: 0; background: none; border-radius: 9px; font-weight: 550; font-size: .9rem; color: var(--text-2); text-align: left; }
.ctx button:hover { background: var(--surface-2); color: var(--text); }
.ctx button.danger { color: var(--danger); }
.ctx hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
.ctx .ctx-title { padding: 8px 12px 6px; font-size: .78rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) {
  .ctx.sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; max-width: none; border-radius: 22px 22px 0 0; padding: 10px 10px calc(10px + var(--safe-b)); animation: sheet .2s ease; }
  .ctx.sheet button { height: 48px; font-size: .98rem; }
}

.toasts { position: fixed; z-index: 500; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 24px); pointer-events: none; }
@media (max-width: 900px) { .toasts { bottom: calc(var(--bottomnav) + 16px + var(--safe-b)); } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-weight: 600; font-size: .9rem; box-shadow: var(--shadow-lg); animation: pop .2s ease; }
.toast.error { background: var(--danger); color: #fff; }
.toast.ok .icon { color: var(--ok); }
.toast button { border: 0; background: none; color: inherit; font-weight: 800; text-decoration: underline; padding: 0 0 0 6px; }

/* panel (notifications) */
.panel { position: fixed; z-index: 350; top: 70px; right: 16px; width: 380px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .15s ease; }
.panel-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 700; position: sticky; top: 0; background: var(--surface); }
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: 0; }
.notif.unread { background: var(--accent-soft); }
.notif .ni { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.notif .nt { font-weight: 650; font-size: .9rem; }
.notif .nb { font-size: .84rem; color: var(--text-2); }
.notif time { font-size: .74rem; color: var(--muted); }

/* ---------- uploads panel ---------- */
.uploads {
  position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 380px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s ease;
}
.has-player .uploads { bottom: 100px; }
@media (max-width: 900px) { .uploads { right: 12px; left: 12px; width: auto; max-width: none; bottom: calc(var(--bottomnav) + 12px + var(--safe-b)); } .has-player .uploads { bottom: calc(var(--bottomnav) + 84px + var(--safe-b)); } }
.uploads-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 16px; cursor: pointer; }
.uploads-head .progress { flex: 1; }
.uploads-head strong { font-size: .92rem; white-space: nowrap; }
.uploads-list { max-height: 320px; overflow: auto; border-top: 1px solid var(--border); }
.uploads.min .uploads-list { display: none; }
.up { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--border); }
.up:last-child { border-bottom: 0; }
.up .mini { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: var(--kc, var(--k-other)); }
.up .mini .icon { width: 18px; height: 18px; }
.up .name { font-weight: 600; font-size: .85rem; }
.up .sub { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.up .progress { margin-top: 5px; height: 4px; }
.up.done .sub { color: var(--ok); }
.up.error .sub { color: var(--danger); }

/* ---------- audio player ---------- */
.aplayer {
  position: fixed; left: var(--sidebar); right: 0; bottom: 0; z-index: 50; height: 84px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--border); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 20px;
  animation: slideup .3s ease;
}
@keyframes slideup { from { transform: translateY(100%); } }
.aplayer .now { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.aplayer .art { width: 54px; height: 54px; border-radius: 12px; flex: none; background: linear-gradient(135deg, var(--k-audio), #ec4899); display: grid; place-items: center; color: #fff; overflow: hidden; box-shadow: var(--shadow); }
.aplayer .art img { width: 100%; height: 100%; object-fit: cover; }
.aplayer .title { font-weight: 700; font-size: .92rem; }
.aplayer .artist { font-size: .78rem; color: var(--muted); }
.aplayer .center { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.aplayer .ctrls { display: flex; align-items: center; gap: 6px; }
.aplayer .playbtn { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: grid; place-items: center; transition: transform .1s; }
.aplayer .playbtn:hover { transform: scale(1.06); }
.aplayer .seek { display: flex; align-items: center; gap: 10px; width: 100%; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.aplayer .right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.aplayer .mobile-progress { display: none; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; --p: 0%; --b: 0%; margin: 0; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), color-mix(in srgb, var(--text) 25%, transparent) var(--p), color-mix(in srgb, var(--text) 25%, transparent) var(--b), var(--surface-3) var(--b)); }
.range::-moz-range-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--accent) var(--p), color-mix(in srgb, var(--text) 25%, transparent) var(--p), color-mix(in srgb, var(--text) 25%, transparent) var(--b), var(--surface-3) var(--b)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); margin-top: -5px; box-shadow: var(--shadow-sm); transform: scale(0); transition: transform .15s; }
.range:hover::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { transform: scale(1); }
.range::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 0; }
.vol { width: 100px; }
@media (max-width: 900px) {
  .aplayer { left: 8px; right: 8px; bottom: calc(var(--bottomnav) + 8px + var(--safe-b)); height: 66px; border-radius: 16px; border: 1px solid var(--border); grid-template-columns: minmax(0, 1fr) auto; padding: 0 8px 0 8px; gap: 8px; box-shadow: var(--shadow); overflow: hidden; }
  .aplayer .art { width: 48px; height: 48px; border-radius: 10px; }
  .aplayer .center .seek, .aplayer .right, .aplayer .ctrls .hide-m { display: none; }
  .aplayer .mobile-progress { display: block; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--surface-3); border-radius: 2px; }
  .aplayer .mobile-progress i { display: block; height: 100%; background: var(--accent); }
}

/* full-screen audio view */
.aview { position: fixed; inset: 0; z-index: 260; display: flex; flex-direction: column; color: #fff; background: #0b0b12; animation: sheet .3s cubic-bezier(.2, .9, .3, 1); overflow: hidden; }
.aview .bgart { position: absolute; inset: -60px; background-size: cover; background-position: center; filter: blur(60px) saturate(1.6) brightness(.55); transform: scale(1.2); transition: background-image .5s; }
.aview .bgart.grad { background: radial-gradient(circle at 30% 20%, #7c3aed, transparent 55%), radial-gradient(circle at 80% 70%, #db2777, transparent 55%), radial-gradient(circle at 20% 90%, #0891b2, transparent 50%), #0b0b12; filter: blur(30px) brightness(.8); }
.aview > * { position: relative; }
.aview-top { display: flex; align-items: center; padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top)); }
.aview-top .iconbtn { color: #fff; }
.aview-top .iconbtn:hover { background: rgba(255, 255, 255, .12); }
.aview-top .lbl { flex: 1; text-align: center; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; opacity: .75; }
.aview-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 40px; padding: 10px 48px 40px; min-height: 0; max-width: 1200px; width: 100%; margin: 0 auto; }
.aview-main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; gap: 26px; }
.aview .bigart { width: min(400px, 70vw, 46vh); aspect-ratio: 1; border-radius: 26px; background: linear-gradient(135deg, #7c3aed, #db2777); display: grid; place-items: center; box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .7); overflow: hidden; position: relative; }
.aview .bigart img { width: 100%; height: 100%; object-fit: cover; }
.aview .bigart .icon { width: 40%; height: 40%; opacity: .9; }
.aview canvas.viz { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 40%; pointer-events: none; mix-blend-mode: screen; opacity: .9; }
.aview .meta { text-align: center; width: 100%; max-width: 520px; }
.aview .meta .t { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.aview .meta .a { opacity: .7; font-size: .95rem; }
.aview .seekwrap { width: 100%; max-width: 520px; }
.aview .times { display: flex; justify-content: space-between; font-size: .78rem; opacity: .7; font-variant-numeric: tabular-nums; margin-top: 4px; }
.aview .range::-webkit-slider-runnable-track { background: linear-gradient(90deg, #fff var(--p), rgba(255, 255, 255, .35) var(--p), rgba(255, 255, 255, .35) var(--b), rgba(255, 255, 255, .15) var(--b)); }
.aview .range::-moz-range-track { background: linear-gradient(90deg, #fff var(--p), rgba(255, 255, 255, .35) var(--p), rgba(255, 255, 255, .35) var(--b), rgba(255, 255, 255, .15) var(--b)); }
.aview .range::-webkit-slider-thumb { background: #fff; transform: scale(1); }
.aview .bigctrls { display: flex; align-items: center; justify-content: center; gap: 18px; }
.aview .bigctrls .iconbtn { color: #fff; width: 48px; height: 48px; }
.aview .bigctrls .iconbtn:hover { background: rgba(255, 255, 255, .12); }
.aview .bigctrls .iconbtn.active { color: #c4b5fd; background: rgba(255, 255, 255, .1); }
.aview .bigplay { width: 76px; height: 76px; border-radius: 50%; border: 0; background: #fff; color: #111; display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transition: transform .12s; }
.aview .bigplay:hover { transform: scale(1.05); }
.aview .bigplay .icon { width: 34px; height: 34px; }
.aview .extra { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.aview .extra .btn { background: rgba(255, 255, 255, .12); border: 0; color: #fff; }
.aview .queue { background: rgba(0, 0, 0, .28); border-radius: 22px; overflow: auto; min-height: 0; border: 1px solid rgba(255, 255, 255, .08); }
.aview .queue h3 { padding: 16px 18px 8px; margin: 0; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; opacity: .7; position: sticky; top: 0; background: rgba(10, 10, 20, .6); backdrop-filter: blur(10px); }
.aview .q { display: flex; align-items: center; gap: 12px; padding: 8px 18px; cursor: pointer; }
.aview .q:hover { background: rgba(255, 255, 255, .07); }
.aview .q.on { background: rgba(255, 255, 255, .12); }
.aview .q .qa { width: 38px; height: 38px; border-radius: 8px; background: rgba(255, 255, 255, .12); flex: none; display: grid; place-items: center; overflow: hidden; }
.aview .q .qa img { width: 100%; height: 100%; object-fit: cover; }
.aview .q .qn { font-size: .88rem; font-weight: 600; }
.aview .q .qd { font-size: .74rem; opacity: .6; }
@media (max-width: 900px) {
  .aview-body { grid-template-columns: 1fr; padding: 0 22px calc(28px + var(--safe-b)); }
  .aview .queue { display: none; }
  .aview.show-queue .queue { display: block; position: absolute; inset: 0 12px calc(12px + var(--safe-b)); z-index: 2; background: rgba(15, 15, 25, .95); }
}

/* ---------- media viewer (images/video/doc) ---------- */
.viewer { position: fixed; inset: 0; z-index: 250; background: #000; color: #fff; display: flex; flex-direction: column; animation: fade .2s ease; }
.viewer-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent); transition: opacity .3s, transform .3s;
}
.viewer-top .ttl { flex: 1; min-width: 0; }
.viewer-top .ttl .n { font-weight: 700; font-size: .95rem; }
.viewer-top .ttl .s { font-size: .76rem; opacity: .7; }
.viewer .iconbtn { color: #fff; }
.viewer .iconbtn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.viewer-stage { flex: 1; display: grid; place-items: center; overflow: hidden; position: relative; touch-action: none; }
.viewer-stage > img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: transform .2s ease, opacity .25s; will-change: transform; }
.viewer-stage > img.dragging { transition: none; }
.viewer .nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); backdrop-filter: blur(8px); color: #fff; display: grid; place-items: center; transition: background .15s, opacity .3s; }
.viewer .nav-arrow:hover { background: rgba(255, 255, 255, .25); }
.viewer .nav-arrow.prev { left: 16px; }
.viewer .nav-arrow.next { right: 16px; }
@media (hover: none) { .viewer .nav-arrow { display: none; } }
.viewer.idle .viewer-top, .viewer.idle .nav-arrow, .viewer.idle .filmstrip { opacity: 0; pointer-events: none; }
.viewer .filmstrip { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 6px; padding: 14px; padding-bottom: max(14px, var(--safe-b)); overflow-x: auto; justify-content: safe center; background: linear-gradient(0deg, rgba(0, 0, 0, .7), transparent); transition: opacity .3s; scrollbar-width: none; }
.viewer .filmstrip img { width: 54px; height: 54px; border-radius: 8px; object-fit: cover; opacity: .5; cursor: pointer; flex: none; border: 2px solid transparent; background: #222; }
.viewer .filmstrip img.on { opacity: 1; border-color: #fff; }
.viewer .doc-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.viewer .text-view { width: min(1000px, 100%); height: 100%; overflow: auto; padding: 80px 24px 40px; font: 13px/1.6 var(--mono); white-space: pre-wrap; word-break: break-word; color: #e5e7eb; background: #0d1117; }
.viewer .nopreview { text-align: center; padding: 20px; }
.viewer .nopreview .kicon { width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center; margin: 0 auto 18px; background: var(--kc); }
.viewer .nopreview .kicon .icon { width: 44px; height: 44px; }
.viewer .nopreview .btn { margin-top: 16px; }

/* ---------- video player ---------- */
.vp { position: relative; width: 100%; height: 100%; background: #000; display: grid; place-items: center; overflow: hidden; user-select: none; -webkit-user-select: none; }
.vp video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.vp.fill video { object-fit: cover; }
.vp video::cue { background: rgba(0, 0, 0, .65); color: #fff; font-family: var(--font); font-size: 1.15em; line-height: 1.4; }
.vp-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .25) 22%, transparent 40%, transparent 75%, rgba(0, 0, 0, .5) 100%); transition: opacity .3s; }
.vp-center { position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, .16); backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px); transition: opacity .25s, transform .25s; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
.vp-center .icon { width: 38px; height: 38px; }
.vp-center:hover { transform: scale(1.06); background: rgba(255, 255, 255, .24); }
.vp.playing .vp-center { opacity: 0; transform: scale(.7); pointer-events: none; }
.vp-spin { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .2); border-top-color: #fff; animation: spin .8s linear infinite; display: none; pointer-events: none; }
.vp.waiting .vp-spin { display: block; }
.vp.waiting .vp-center { opacity: 0; }
.vp-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 18px 12px; padding-bottom: max(12px, var(--safe-b)); transition: opacity .3s, transform .3s; }
.vp-progress { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.vp-track { position: relative; width: 100%; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .22); transition: height .15s; }
.vp-progress:hover .vp-track, .vp-progress.drag .vp-track { height: 7px; }
.vp-buf, .vp-played, .vp-hover { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; }
.vp-buf { background: rgba(255, 255, 255, .38); }
.vp-hover { background: rgba(255, 255, 255, .22); opacity: 0; }
.vp-progress:hover .vp-hover { opacity: 1; }
.vp-played { background: linear-gradient(90deg, #8b6cff, #22d3ee); }
.vp-knob { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(139, 108, 255, .45), 0 2px 8px rgba(0, 0, 0, .5); transform: scale(0); transition: transform .15s; }
.vp-progress:hover .vp-knob, .vp-progress.drag .vp-knob { transform: scale(1); }
.vp-tip { position: absolute; bottom: 26px; transform: translateX(-50%); padding: 4px 9px; border-radius: 8px; background: rgba(15, 15, 20, .9); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; opacity: 0; transition: opacity .12s; white-space: nowrap; }
.vp-progress:hover .vp-tip, .vp-progress.drag .vp-tip { opacity: 1; }
.vp-ctrls { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.vp-ctrls .iconbtn { color: #fff; width: 42px; height: 42px; border-radius: 50%; }
.vp-ctrls .iconbtn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.vp-ctrls .iconbtn .icon { width: 22px; height: 22px; }
.vp-time { font-size: .86rem; font-weight: 600; font-variant-numeric: tabular-nums; margin: 0 8px; opacity: .95; white-space: nowrap; }
.vp-vol { display: flex; align-items: center; }
.vp-vol .range { width: 0; opacity: 0; transition: width .2s, opacity .2s; }
.vp-vol:hover .range, .vp-vol:focus-within .range { width: 84px; opacity: 1; margin-right: 6px; }
.vp .range::-webkit-slider-runnable-track { background: linear-gradient(90deg, #fff var(--p), rgba(255, 255, 255, .3) var(--p)); }
.vp .range::-moz-range-track { background: linear-gradient(90deg, #fff var(--p), rgba(255, 255, 255, .3) var(--p)); }
.vp .range::-webkit-slider-thumb { background: #fff; transform: scale(1); }
.vp-title { position: absolute; top: 0; left: 0; right: 0; padding: 16px 20px; font-weight: 700; font-size: 1rem; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); transition: opacity .3s; pointer-events: none; }
.vp.idle { cursor: none; }
.vp.idle.playing .vp-bar, .vp.idle.playing .vp-shade, .vp.idle.playing .vp-title { opacity: 0; }
.vp.idle.playing .vp-bar { transform: translateY(10px); }
.vp-menu { position: absolute; right: 16px; bottom: 76px; min-width: 210px; background: rgba(18, 18, 26, .92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 14px; padding: 6px; border: 1px solid rgba(255, 255, 255, .1); animation: pop .15s ease; z-index: 6; max-height: 60%; overflow: auto; }
.vp-menu .mh { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; opacity: .6; padding: 8px 12px 4px; font-weight: 700; }
.vp-menu button { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; height: 36px; padding: 0 12px; border: 0; background: none; border-radius: 9px; color: #fff; font-size: .88rem; font-weight: 550; }
.vp-menu button:hover { background: rgba(255, 255, 255, .1); }
.vp-menu button.on::after { content: "✓"; color: #a78bfa; font-weight: 800; }
.vp-ripple { position: absolute; top: 0; bottom: 0; width: 38%; display: grid; place-items: center; pointer-events: none; opacity: 0; }
.vp-ripple.l { left: 0; border-radius: 0 50% 50% 0 / 0 100% 100% 0; }
.vp-ripple.r { right: 0; border-radius: 50% 0 0 50% / 100% 0 0 100%; }
.vp-ripple.show { animation: ripple .6s ease; }
.vp-ripple div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: .85rem; }
@keyframes ripple { 0% { opacity: 0; background: rgba(255, 255, 255, 0); } 25% { opacity: 1; background: rgba(255, 255, 255, .14); } 100% { opacity: 0; background: rgba(255, 255, 255, 0); } }
.vp-osd { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); padding: 10px 18px; border-radius: 14px; background: rgba(0, 0, 0, .6); font-weight: 700; font-size: .95rem; pointer-events: none; opacity: 0; transition: opacity .2s; display: flex; align-items: center; gap: 8px; backdrop-filter: blur(8px); }
.vp-osd.show { opacity: 1; }
.vp-error { position: absolute; inset: 0; display: none; place-items: center; text-align: center; padding: 24px; background: rgba(0, 0, 0, .7); }
.vp.err .vp-error { display: grid; }
.vp-error .btn { margin-top: 14px; }
.vp-next { position: absolute; right: 20px; bottom: 90px; display: none; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: rgba(18, 18, 26, .9); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .1); max-width: 340px; cursor: pointer; }
.vp-next.show { display: flex; animation: pop .2s ease; }
.vp-next img, .vp-next .ph { width: 96px; aspect-ratio: 16/9; border-radius: 8px; object-fit: cover; background: #222; flex: none; }
.vp-next .lbl { font-size: .72rem; opacity: .7; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.vp-next .nm { font-size: .86rem; font-weight: 650; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) {
  .vp-bar { padding: 0 10px 8px; }
  .vp-ctrls .iconbtn { width: 38px; height: 38px; }
  .vp-ctrls .m-hide { display: none; }
  .vp-time { font-size: .78rem; margin: 0 4px; }
  .vp-center { width: 70px; height: 70px; }
  .vp-vol { display: none; }
}

/* ---------- admin & account ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); position: relative; overflow: hidden; }
.stat .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat .val { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .78rem; color: var(--muted); }
.stat .si { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cols.even { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .cols, .cols.even { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; font-weight: 650; font-size: .92rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none !important; display: inline-flex; align-items: center; gap: 8px; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--accent-text); border-bottom-color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.t th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr:hover td { background: var(--surface-2); }
table.t .code { font-family: var(--mono); font-weight: 700; letter-spacing: .04em; font-size: .86rem; white-space: nowrap; }
.codes-out { font-family: var(--mono); font-size: .9rem; line-height: 1.75; min-height: 220px; letter-spacing: .03em; }
.duration-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 6px 0 16px; }
.duration-pick button { border: 1.5px solid var(--border); background: var(--surface-2); border-radius: 14px; padding: 14px 8px; text-align: center; transition: .15s; }
.duration-pick button strong { display: block; font-size: 1.35rem; font-weight: 800; }
.duration-pick button span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.duration-pick button.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.duration-pick button.on strong { color: var(--accent-text); }
@media (max-width: 480px) { .duration-pick { grid-template-columns: repeat(2, 1fr); } }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .b i { width: 100%; max-width: 30px; border-radius: 6px 6px 3px 3px; background: var(--grad); min-height: 3px; position: relative; }
.bars .b span { font-size: .66rem; color: var(--muted); }
.bars .b i:hover::after { content: attr(data-v); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 2px 6px; border-radius: 6px; font-size: .7rem; white-space: nowrap; font-weight: 700; }
.kind-bars { display: grid; gap: 10px; }
.kind-bars .kb { display: grid; grid-template-columns: 100px 1fr 80px; gap: 10px; align-items: center; font-size: .85rem; }
.kind-bars .kb .progress > i { background: var(--kc); }
.kind-bars .kb .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.plan-card { padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); text-align: center; }
.plan-card strong { display: block; font-size: 1.15rem; }
.plan-card .price { font-size: 1.4rem; font-weight: 800; color: var(--accent-text); margin-top: 4px; }
.redeem-input { font-family: var(--mono) !important; text-transform: uppercase; letter-spacing: .08em; font-weight: 700 !important; text-align: center; height: 52px !important; font-size: 1.05rem !important; }
.locked-screen { max-width: 560px; margin: 30px auto; text-align: center; }
.locked-screen .art { width: 110px; height: 110px; margin: 0 auto 20px; border-radius: 32px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 20px 50px -15px rgba(109, 74, 255, .6); }
.locked-screen .art .icon { width: 52px; height: 52px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; margin: 6px 0 14px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: .9rem; flex-wrap: wrap; }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner .btn { margin-left: auto; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.tag-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pick button { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--surface-2); font-weight: 600; font-size: .86rem; }
.tag-pick button i { width: 10px; height: 10px; border-radius: 50%; }
.tag-pick button.on { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); }
.tag-pick button.mixed { border-style: dashed; border-color: var(--tc); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.colors button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; background: var(--c); }
.colors button.on { border-color: var(--surface); box-shadow: 0 0 0 2px var(--c); }
.tree { max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: 14px; padding: 6px; background: var(--surface-2); }
.tree button { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; border: 0; background: none; border-radius: 9px; font-weight: 550; font-size: .9rem; text-align: left; color: var(--text-2); }
.tree button:hover { background: var(--surface); }
.tree button.on { background: var(--accent-soft); color: var(--accent-text); }
.tree button:disabled { opacity: .4; }
.share-link { display: flex; gap: 8px; }
.share-link input { margin: 0; font-family: var(--mono); font-size: .82rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; font-size: .88rem; color: var(--muted); }

/* public share page */
.share-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.share-top { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface); }
.share-main { flex: 1; display: grid; place-items: center; padding: 24px 16px; }
.share-box { width: 100%; max-width: 1000px; }
.share-media { border-radius: 20px; overflow: hidden; background: #000; box-shadow: var(--shadow-lg); aspect-ratio: 16 / 9; max-height: 75vh; }
.share-media.img { aspect-ratio: auto; background: var(--surface-2); display: grid; place-items: center; }
.share-media.img img { max-height: 75vh; width: auto; margin: auto; }
.share-meta { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.share-audio { padding: 40px 24px; border-radius: 24px; color: #fff; text-align: center; background: radial-gradient(500px 300px at 0 0, rgba(255, 255, 255, .15), transparent), linear-gradient(135deg, #7c3aed, #db2777); }
.share-audio audio { width: 100%; margin-top: 20px; }

/* ---------- scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--muted) 70%, transparent); }
::-webkit-scrollbar-corner { background: transparent; }
.side-scroll { scrollbar-color: transparent transparent; }
.side-scroll:hover { scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }

/* ---------- home hero & quick access ---------- */
.hero-strip { margin: 4px 0 26px; }
.hero-strip .hello h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.025em; margin: 0 0 2px; }
.hero-strip .hello p { margin: 0 0 18px; }
.quick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.qtile { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; overflow: hidden; transition: transform .15s, box-shadow .2s, border-color .15s; }
.qtile::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--qc); opacity: .08; transition: opacity .2s, transform .3s; }
.qtile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--qc) 45%, var(--border)); }
.qtile:hover::after { opacity: .16; transform: scale(1.15); }
.qtile .qi { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, var(--qc), color-mix(in srgb, var(--qc) 60%, #000)); box-shadow: 0 8px 18px -8px var(--qc); }
.qtile .qt { display: flex; flex-direction: column; min-width: 0; }
.qtile .qt b { font-size: .95rem; }
.qtile .qt small { color: var(--muted); font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1250px) { .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .hero-strip .hello h1 { font-size: 1.35rem; }
  .quick { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 46%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 2px 14px 6px; scrollbar-width: none; }
  .quick::-webkit-scrollbar { display: none; }
  .qtile { scroll-snap-align: start; padding: 12px; gap: 10px; }
  .qtile .qi { width: 38px; height: 38px; border-radius: 11px; }
}

/* page header polish */
.page-head .toolbar .btn.sm { height: 36px; }
.file-card { box-shadow: var(--shadow-sm); }

/* viewer toolbar fades together with the video controls */
.viewer-top.faded { opacity: 0; pointer-events: none; transform: translateY(-8px); }

/* =====================================================================
   Plans, account & admin (v1.1)
   ===================================================================== */
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--accent-text); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sec-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 10px; }
@media (max-width: 560px) { .grid4 { grid-template-columns: 1fr 1fr; } }
.inp-sm { margin: 0 !important; height: 36px !important; width: auto !important; font-size: .86rem !important; padding: 0 12px !important; }
.avatar.sm { width: 32px; height: 32px; font-size: .74rem; }
.avatar.lg { width: 58px; height: 58px; font-size: 1.2rem; }

/* sidebar plan box (themed by plan colour) */
.plan-box { display: grid; gap: 2px; color: #fff !important; text-decoration: none !important; background: linear-gradient(135deg, var(--pc, #6d4aff), color-mix(in srgb, var(--pc, #6d4aff) 55%, #06b6d4)); }
.plan-box span { opacity: .9; font-size: .8rem; }
.plan-box strong { display: flex; align-items: center; gap: 6px; }
.plan-box .pb-bar { display: block; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .25); margin-top: 8px; overflow: hidden; opacity: 1; }
.plan-box .pb-bar i { display: block; height: 100%; background: #fff; border-radius: inherit; }
.plan-box .btn { justify-self: start; }

/* plan chip */
.plan-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, transparent); white-space: nowrap; }
.plan-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--pc); }

/* pricing cards */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; align-items: stretch; }
.pcard { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; text-align: left; }
.pcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--pc); }
.pcard::after { content: ""; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--pc) 22%, transparent), transparent 70%); pointer-events: none; }
.pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--pc) 40%, var(--border)); }
.pcard.hl { border-color: color-mix(in srgb, var(--pc) 55%, var(--border)); box-shadow: 0 20px 50px -24px var(--pc); }
.pcard.cur { outline: 2px solid var(--pc); outline-offset: -2px; }
.pcard.archived { opacity: .6; }
.pc-ribbon { position: absolute; top: 14px; right: 14px; z-index: 1; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 4px 9px; border-radius: 99px; color: #fff; background: var(--pc); }
.pc-ribbon.cur { background: var(--text); color: var(--bg); }
.pc-ribbon.off { background: var(--surface-3); color: var(--muted); }
.pc-ribbon + .pc-ribbon { top: 44px; }
.pc-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 70px; }
.pc-head h3 { font-size: 1.2rem; font-weight: 800; margin: 2px 0 2px; }
.pc-head p { font-size: .84rem; color: var(--muted); margin: 0; line-height: 1.4; }
.pc-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 55%, #000)); box-shadow: 0 10px 22px -10px var(--pc); }
.pc-quota b { display: block; font-size: 2rem; font-weight: 850; letter-spacing: -.03em; line-height: 1.05; background: linear-gradient(135deg, var(--text), var(--pc)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pc-quota span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.pc-price { font-size: 1.35rem; font-weight: 800; }
.pc-price small { font-size: .82rem; color: var(--muted); font-weight: 600; }
.pc-save { font-size: .78rem; color: var(--ok); font-weight: 700; margin-top: -10px; }
.pc-feat { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .88rem; flex: 1; align-content: start; }
.pc-feat li { display: flex; gap: 9px; align-items: flex-start; color: var(--text-2); }
.pc-feat li .icon { color: var(--pc); margin-top: 2px; }
.pc-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
.pc-prices span { padding: 8px; border-radius: 12px; background: var(--surface-2); text-align: center; display: grid; }
.pc-prices small { font-size: .7rem; color: var(--muted); font-weight: 700; }
.pc-prices b { font-size: .9rem; }
.pcard .btn.primary { background: var(--pc); box-shadow: 0 10px 24px -12px var(--pc); }
.pcard.compact { padding: 18px; gap: 10px; }
.pcard.compact .pc-quota b { font-size: 1.6rem; }
.pc-stats { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .78rem; color: var(--muted); }
.pc-stats b { display: block; color: var(--text); font-size: 1.05rem; }
.pc-actions { display: flex; gap: 8px; align-items: center; }
.pc-actions .btn { flex: 1; }
.pcard.add { align-items: center; justify-content: center; text-align: center; min-height: 280px; border: 2px dashed var(--border-strong); background: transparent; color: var(--muted); cursor: pointer; gap: 6px; --pc: var(--accent); }
.pcard.add::before, .pcard.add::after { display: none; }
.pcard.add:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.pcard.add b { color: var(--text); font-size: 1rem; }

/* rings */
.ring { position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; }
.ring-bg { stroke: color-mix(in srgb, currentColor 18%, transparent); }
.ring-fg { stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label b { font-size: 1.5rem; font-weight: 850; letter-spacing: -.02em; }
.ring-label small { font-size: .7rem; opacity: .75; font-weight: 600; max-width: 80px; }

/* account: plan hero */
.plan-hero { position: relative; display: flex; gap: 28px; align-items: center; justify-content: space-between; padding: 30px; border-radius: 26px; color: #fff; overflow: hidden; margin-bottom: 18px;
  background: radial-gradient(600px 260px at 0% 0%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 45%, #0b1020)); box-shadow: 0 30px 60px -30px var(--pc); }
.plan-hero::after { content: ""; position: absolute; right: -80px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .06); }
.ph-main { position: relative; z-index: 1; min-width: 0; }
.ph-top { display: flex; align-items: center; gap: 10px; }
.ph-label { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.plan-hero .badge { background: rgba(255, 255, 255, .2); color: #fff; }
.plan-hero h2 { font-size: 2.4rem; font-weight: 850; letter-spacing: -.03em; margin: 6px 0 2px; }
.ph-sub { opacity: .9; margin: 0; }
.ph-facts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: .86rem; font-weight: 600; opacity: .95; }
.ph-facts span { display: inline-flex; align-items: center; gap: 6px; }
.ph-btn { background: #fff !important; color: #111 !important; border: 0 !important; }
.ph-btn.ghost { background: rgba(255, 255, 255, .16) !important; color: #fff !important; }
.ph-rings { position: relative; z-index: 1; display: flex; gap: 18px; color: #fff; }
@media (max-width: 760px) {
  .plan-hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .plan-hero h2 { font-size: 1.9rem; }
  .ph-rings { align-self: stretch; justify-content: space-around; }
}
.queue-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; background: var(--accent-soft); color: var(--text); margin-bottom: 18px; font-size: .9rem; }
.queue-box > .icon { color: var(--accent-text); margin-top: 2px; }
.queue-box div div { margin-top: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--text-2); }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .acc-grid { grid-template-columns: 1fr; } }
.acc-sec { margin-top: 30px; }
.usage-total b { font-size: 1.9rem; font-weight: 850; letter-spacing: -.02em; display: block; }
.usage-total span { color: var(--muted); font-size: .88rem; }
.stackbar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-3); margin: 16px 0 14px; gap: 2px; }
.stackbar i { display: block; height: 100%; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .84rem; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend small { color: var(--muted); }
.redeem-hero { display: flex; gap: 10px; max-width: 520px; margin: 22px auto 0; }
.redeem-hero input { margin: 0; flex: 1; }
.redeem-hero .btn { height: 52px; }
@media (max-width: 520px) { .redeem-hero { flex-direction: column; } }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-height: 380px; overflow: auto; }
.timeline li { position: relative; display: flex; gap: 12px; padding: 0 0 16px; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--pc); background: color-mix(in srgb, var(--pc) 15%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pc) 30%, transparent); }
.tl-t { font-size: .9rem; }
.tl-d { font-size: .82rem; color: var(--text-2); }
.timeline time { font-size: .74rem; color: var(--muted); }

/* lifecycle explainer */
.lc-bar { display: flex; border-radius: 16px; overflow: hidden; margin-bottom: 16px; border: 1px solid var(--border); }
.lc-seg { flex: 1; padding: 12px 14px; position: relative; display: grid; gap: 2px; min-width: 0; }
.lc-seg + .lc-seg { border-left: 1px solid var(--border); }
.lc-seg b { font-size: .86rem; }
.lc-seg small { font-size: .74rem; color: var(--muted); }
.lc-seg.ok { background: var(--ok-soft); }
.lc-seg.ok b { color: var(--ok); }
.lc-seg.warn { background: var(--warn-soft); }
.lc-seg.warn b { color: var(--warn); }
.lc-seg.off { background: var(--surface-2); }
.lc-seg.danger { background: var(--danger-soft); }
.lc-seg.danger b { color: var(--danger); }
@media (max-width: 600px) { .lc-bar { flex-direction: column; } .lc-seg + .lc-seg { border-left: 0; border-top: 1px solid var(--border); } }
.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 13px 16px; font-weight: 650; font-size: .92rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary > .icon:last-child { margin-left: auto; color: var(--muted); transition: transform .2s; }
.faq details[open] summary > .icon:last-child { transform: rotate(180deg); }
.faq .fi { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.faq p { margin: 0; padding: 0 16px 14px 58px; color: var(--text-2); font-size: .9rem; }

/* redeem scenario */
.scenario { --pc: var(--accent); }
.sc-top { padding: 18px 20px; margin: -24px -24px 16px; color: #fff; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 50%, #0b1020)); border-radius: 22px 22px 0 0; }
.sc-top h2 { color: #fff; margin: 4px 0 6px; font-size: 1.5rem; }
.sc-top code { background: rgba(255, 255, 255, .18); color: #fff; }
.sc-kind { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.sc-lead { font-size: .95rem; color: var(--text-2); }
.sc-rows { display: grid; gap: 8px; margin: 12px 0; }
.sc-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; }
.sc-row > span { color: var(--muted); font-weight: 600; }
.sc-row div { display: flex; align-items: center; gap: 8px; }
.sc-row s { color: var(--muted); }
.sc-row b.up { color: var(--ok); }
.sc-row b.down { color: var(--warn); }
.sc-opts { display: grid; gap: 10px; margin: 12px 0; }
.sc-opt { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--border); cursor: pointer; margin: 0; font-weight: 400; color: var(--text); transition: border-color .15s, background .15s; }
.sc-opt:has(input:checked) { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 8%, transparent); }
.sc-opt input { margin-top: 3px; accent-color: var(--pc); }
.sc-opt p { margin: 4px 0 0; font-size: .86rem; color: var(--text-2); }
.sc-warn { display: flex; gap: 8px; align-items: flex-start; line-height: 1.45; }
.celebrate { text-align: center; padding: 8px 4px 0; }
.cb-icon { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 26px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 50%, #000)); box-shadow: 0 20px 40px -14px var(--pc); animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); }
.cb-icon .icon { width: 40px; height: 40px; }

/* auth page plans */
.auth-page { display: block !important; padding: 40px 16px 60px; }
.auth-page .auth-wrap { margin: 0 auto; }
.auth-plans { max-width: 1100px; margin: 48px auto 0; text-align: center; }
.auth-plans h2 { font-size: 1.7rem; font-weight: 850; }
.auth-plans .pgrid { margin-top: 20px; text-align: left; }

/* modals */
.modal.xwide { max-width: 1020px; }
.plan-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; align-items: start; }
.pe-preview { position: sticky; top: 0; display: grid; gap: 10px; }
.pe-preview .pcard:hover { transform: none; }
@media (max-width: 860px) { .plan-editor { grid-template-columns: 1fr; } .pe-preview { position: static; order: -1; } }

/* admin */
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 16px; }
.admin-head h1 { margin: 6px 0 0; font-size: 1.7rem; font-weight: 850; letter-spacing: -.02em; }
.admin-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; width: fit-content; max-width: 100%; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 12px; color: var(--muted); font-weight: 650; font-size: .9rem; white-space: nowrap; text-decoration: none !important; transition: background .15s, color .15s; }
.admin-tabs a:hover { color: var(--text); background: var(--surface-2); }
.admin-tabs a.on { background: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; position: relative; overflow: hidden; transition: transform .15s, box-shadow .2s; }
.kpi::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--kc); opacity: .08; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-i { width: 48px; height: 48px; border-radius: 15px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--kc), color-mix(in srgb, var(--kc) 55%, #000)); box-shadow: 0 10px 22px -10px var(--kc); }
.kpi > div { display: grid; min-width: 0; }
.kpi-l { font-size: .8rem; color: var(--muted); font-weight: 650; }
.kpi-v { font-size: 1.55rem; font-weight: 850; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-s { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; }
@media (max-width: 520px) { .dash-grid { grid-template-columns: 1fr; } }
.donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; }
.dn-v { font: 850 1.6rem var(--font); fill: var(--text); }
.dn-l { font: 600 .7rem var(--font); fill: var(--muted); }
.donut-legend { display: grid; gap: 10px; flex: 1; min-width: 180px; }
.donut-legend div { display: grid; grid-template-columns: 12px 1fr auto; gap: 2px 10px; align-items: center; font-size: .88rem; }
.donut-legend i { width: 12px; height: 12px; border-radius: 4px; }
.donut-legend small { grid-column: 2 / 4; color: var(--muted); font-size: .75rem; }
.mini-list { display: grid; gap: 4px; }
.mini-list > div { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.mini-list > div:hover { background: var(--surface-2); }
.mini-list b { display: block; font-size: .88rem; }
.mini-list small { display: block; font-size: .76rem; color: var(--muted); }

.gen-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .gen-layout { grid-template-columns: 1fr; } }
.plan-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.plan-pick button { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface-2); position: relative; transition: .15s; }
.plan-pick button i { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); margin-bottom: 4px; }
.plan-pick button small { color: var(--muted); font-weight: 600; font-size: .78rem; }
.plan-pick button.on { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 18%, transparent); }
.duration-pick button em { display: block; font-style: normal; font-size: .76rem; color: var(--ok); font-weight: 700; margin-top: 2px; }
.ticket { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-radius: 18px; color: #fff; position: relative; overflow: hidden; flex-wrap: wrap;
  background: radial-gradient(300px 160px at 100% 0%, rgba(255, 255, 255, .2), transparent 60%), linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 45%, #0b1020)); }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; background: var(--surface); }
.ticket::before { left: -11px; }
.ticket::after { right: -11px; }
.ticket div { display: grid; }
.ticket span { font-size: .72rem; opacity: .8; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; }
.ticket b { font-size: 1.3rem; }
.ticket small { opacity: .9; }
.ticket code { background: rgba(0, 0, 0, .25); color: #fff; padding: 8px 12px; border-radius: 10px; font-size: .9rem; letter-spacing: .06em; }
.gen-out .codes-out { margin-top: 14px; }
.bulkbar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--accent-soft); margin-bottom: 12px; }
.bulkbar span { margin-right: auto; font-weight: 650; color: var(--accent-text); }

.user-list { display: grid; gap: 8px; }
.user-row { display: grid; grid-template-columns: 44px minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, 1fr) 110px 24px; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s, transform .1s; }
.user-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.user-row .avatar { width: 42px; height: 42px; }
.ur-name { display: grid; min-width: 0; }
.ur-name small { color: var(--muted); font-size: .8rem; }
.ur-plan { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.ur-plan small { width: 100%; font-size: .76rem; }
.ur-usage { display: grid; gap: 6px; font-size: .78rem; color: var(--muted); }
.ur-usage .progress { display: block; height: 5px; }
.ur-chev { color: var(--muted); }
@media (max-width: 900px) {
  .user-row { grid-template-columns: 42px minmax(0, 1fr) 20px; }
  .ur-plan, .ur-usage { grid-column: 2 / 3; }
  .ur-last { display: none; }
  .ur-chev { grid-row: 1; grid-column: 3; }
}
.ud { --pc: var(--accent); }
.ud-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.ud-head h2 { margin: 0; }
.ud-head p { margin: 0; font-size: .86rem; }
.ud-head .avatar { background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 50%, #000)); }
.ud-stats { display: flex; gap: 18px; align-items: center; padding: 16px; border-radius: 18px; background: var(--surface-2); flex-wrap: wrap; margin-bottom: 18px; color: var(--text); }
.ud-facts { display: grid; gap: 6px; font-size: .86rem; flex: 1; min-width: 200px; }
.ud-facts small { color: var(--text-2); }
.ud-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .ud-cols { grid-template-columns: 1fr; } }
.ud-box { border: 1px solid var(--border); border-radius: 18px; padding: 18px; }
.ud-box h3 { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.ud-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 520px) { .settings-grid { grid-template-columns: 1fr; } }
.savebar { position: sticky; bottom: 16px; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 20px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border); box-shadow: var(--shadow-lg); z-index: 5; }
@media (max-width: 900px) { .savebar { bottom: calc(var(--bottomnav) + 12px + var(--safe-b)); } .savebar .muted { display: none; } .savebar .btn { width: 100%; } }
.token-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; }
.token-row code { flex: 1; background: none; }
.phone-notif { padding: 14px 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--shadow); max-width: 380px; }
.pn-app { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.pn-app img { width: 18px; height: 18px; border-radius: 5px; }
.phone-notif p { margin: 2px 0 0; font-size: .88rem; color: var(--text-2); }

/* =====================================================================
   Sign-in / sign-up (v1.2)
   ===================================================================== */
.auth2-body { background: var(--bg); min-height: 100%; }
.auth2 { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(440px, 1fr); min-height: 100vh; min-height: 100dvh; }
.a2-hero { position: relative; overflow: hidden; background: #070811; color: #fff; padding: 34px clamp(28px, 4vw, 64px); display: flex; flex-direction: column; gap: 28px; isolation: isolate; }
.a2-mesh { position: absolute; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }
.a2-mesh i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .7; animation: a2drift 22s ease-in-out infinite alternate; }
.a2-mesh i:nth-child(1) { width: 560px; height: 560px; left: -140px; top: -160px; background: #6d4aff; }
.a2-mesh i:nth-child(2) { width: 480px; height: 480px; right: -160px; top: 30%; background: #2563eb; animation-delay: -7s; opacity: .55; }
.a2-mesh i:nth-child(3) { width: 420px; height: 420px; left: 25%; bottom: -220px; background: #06b6d4; animation-delay: -13s; opacity: .45; }
.a2-mesh.soft { position: fixed; }
.a2-mesh.soft i { opacity: .16; }
@keyframes a2drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(60px, 40px) scale(1.12); } 100% { transform: translate(-40px, 70px) scale(.94); } }
.a2-grid { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 30% 20%, #000 0%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 30% 20%, #000 0%, transparent 70%); }
.a2-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.a2-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 1.3rem; letter-spacing: -.02em; color: inherit !important; text-decoration: none !important; }
.a2-toplink { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 99px; color: #fff !important; text-decoration: none !important; font-weight: 650; font-size: .88rem; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(12px); transition: background .15s; }
.a2-toplink:hover { background: rgba(255, 255, 255, .16); }
.a2-copy { max-width: 600px; margin-top: clamp(10px, 4vh, 48px); }
.a2-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 99px; font-size: .8rem; font-weight: 700; color: #c4b5fd; background: rgba(139, 108, 255, .14); border: 1px solid rgba(139, 108, 255, .3); }
.a2-copy h1 { font-size: clamp(2.3rem, 3.8vw, 3.7rem); line-height: 1.04; font-weight: 850; letter-spacing: -.035em; margin: 18px 0 16px; }
.a2-copy h1 span, .pr-hero h1 span { background: linear-gradient(100deg, #a78bfa 0%, #60a5fa 45%, #22d3ee 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.a2-copy > p { font-size: 1.06rem; line-height: 1.6; color: rgba(255, 255, 255, .72); max-width: 520px; margin: 0; }
.a2-feats { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px 22px; }
.a2-feats li { display: flex; gap: 12px; align-items: flex-start; }
.a2-feats li > .icon { width: 40px; height: 40px; padding: 10px; border-radius: 12px; flex: none; color: #c4b5fd; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }
.a2-feats b { display: block; font-size: .92rem; }
.a2-feats small { color: rgba(255, 255, 255, .58); font-size: .82rem; }
.a2-foot { margin-top: auto; font-size: .8rem; color: rgba(255, 255, 255, .45); }

/* floating product mockup */
.a2-mock { position: relative; height: 300px; margin-top: 6px; max-width: 680px; }
.mk { position: absolute; display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 18px; color: #fff; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); animation: a2float 7s ease-in-out infinite; }
.mk b { display: block; font-size: .84rem; }
.mk small { display: block; font-size: .72rem; color: rgba(255, 255, 255, .6); }
@keyframes a2float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.mk-player { left: 0; top: 18px; width: 300px; flex-direction: column; align-items: stretch; gap: 10px; }
.mk-screen { position: relative; aspect-ratio: 16 / 8.4; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 70% 30%, rgba(251, 191, 36, .6), transparent 40%), radial-gradient(circle at 20% 80%, rgba(37, 99, 235, .8), transparent 50%), linear-gradient(135deg, #1e1b4b, #0f172a); }
.mk-play { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .22); backdrop-filter: blur(8px); }
.mk-dur { position: absolute; right: 8px; bottom: 8px; font-size: .68rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .6); }
.mk-bar { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.mk-bar i { display: block; height: 100%; width: 38%; border-radius: inherit; background: linear-gradient(90deg, #8b6cff, #22d3ee); animation: a2play 9s linear infinite; }
.mk-bar.up { margin-top: 8px; }
.mk-bar.up i { animation: a2up 4.5s ease-in-out infinite; background: linear-gradient(90deg, #10b981, #22d3ee); }
@keyframes a2play { from { width: 22%; } to { width: 78%; } }
@keyframes a2up { 0% { width: 8%; } 80%, 100% { width: 100%; } }
.mk-storage { left: 52%; top: 0; width: 230px; animation-delay: -2s; }
.mk-ring { position: relative; width: 56px; height: 56px; flex: none; display: grid; place-items: center; }
.mk-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.mk-ring circle { fill: none; stroke: rgba(255, 255, 255, .15); stroke-width: 7; }
.mk-ring circle.fg { stroke: #a78bfa; stroke-linecap: round; stroke-dasharray: 163; stroke-dashoffset: 59; }
.mk-ring b { font-size: .78rem; }
.mk-upload { left: 40%; top: 200px; width: 290px; animation-delay: -4s; }
.mk-ic, .mk-art { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #10b981, #0891b2); }
.mk-music { left: 60%; top: 100px; width: 220px; animation-delay: -5.5s; }
.mk-art { background: linear-gradient(135deg, #a855f7, #ec4899); }
.mk-music .eq i { background: #f0abfc; }
@media (max-height: 820px) { .a2-feats { display: none; } }
@media (max-width: 1280px) { .mk-music { display: none; } .mk-upload { top: 190px; } }

/* form side */
.a2-main { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px; background:
  radial-gradient(600px 300px at 100% 0%, var(--accent-soft), transparent 70%), var(--bg); }
.a2-mobile-top { display: none; }
.a2-card { width: 100%; max-width: 420px; animation: a2in .5s cubic-bezier(.2, .9, .3, 1); }
@keyframes a2in { from { opacity: 0; transform: translateY(14px); } }
.a2-head h2 { font-size: 2rem; font-weight: 850; letter-spacing: -.03em; margin: 0 0 6px; }
.a2-head p { color: var(--muted); margin: 0 0 26px; }
.a2-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 24px; }
.a2-tabs a { position: relative; z-index: 1; height: 40px; display: grid; place-items: center; font-weight: 700; font-size: .9rem; color: var(--muted); text-decoration: none !important; transition: color .2s; }
.a2-tabs a.on { color: var(--text); }
.a2-tab-ink { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
.is-register .a2-tab-ink { transform: translateX(100%); }
.a2-field { margin-bottom: 16px; }
.a2-field label { display: block; font-size: .84rem; font-weight: 650; color: var(--text-2); margin-bottom: 7px; }
.a2-field label em { font-style: normal; font-weight: 500; color: var(--muted); }
.a2-inp { position: relative; }
.a2-inp > .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 18px; height: 18px; transition: color .15s; }
.a2-inp input { margin: 0; height: 52px; padding: 0 46px 0 46px; border-radius: 14px; font-size: 1rem; background: var(--surface); border: 1.5px solid var(--border); }
.a2-inp input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.a2-inp:focus-within > .icon { color: var(--accent-text); }
.a2-inp input.a2-code { font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; font-weight: 700; }
.a2-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); display: grid; place-items: center; }
.a2-eye:hover { color: var(--text); background: var(--surface-2); }
.a2-strength { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 5px; align-items: center; margin: -6px 0 16px; }
.a2-strength i { height: 4px; border-radius: 99px; background: var(--surface-3); transition: background .25s; }
.a2-strength span { font-size: .74rem; color: var(--muted); margin-left: 8px; white-space: nowrap; }
.a2-strength[data-s="1"] i:nth-child(-n+1) { background: var(--danger); }
.a2-strength[data-s="2"] i:nth-child(-n+2) { background: var(--warn); }
.a2-strength[data-s="3"] i:nth-child(-n+3) { background: #84cc16; }
.a2-strength[data-s="4"] i:nth-child(-n+4) { background: var(--ok); }
.a2-codeinfo { margin: -8px 0 14px; font-size: .84rem; display: none; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; }
.a2-codeinfo:not(:empty) { display: flex; }
.a2-codeinfo .spinner { width: 14px; height: 14px; border-width: 2px; }
.a2-codeinfo.loading { background: var(--surface-2); color: var(--muted); }
.a2-codeinfo.ok { color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--pc) 30%, transparent); }
.a2-codeinfo.ok b { color: var(--text); }
.a2-codeinfo.bad { color: var(--danger); background: var(--danger-soft); }
.a2-row { display: flex; justify-content: space-between; margin: -4px 0 12px; font-size: .84rem; }
.a2-err { min-height: 22px; color: var(--danger); font-size: .86rem; font-weight: 600; margin-bottom: 6px; }
.a2-submit { position: relative; width: 100%; height: 54px; border: 0; border-radius: 14px; color: #fff; font-weight: 750; font-size: 1.02rem; display: flex; align-items: center; justify-content: center; gap: 10px; overflow: hidden;
  background: linear-gradient(100deg, #6d4aff, #3b82f6 55%, #06b6d4); background-size: 160% 100%; box-shadow: 0 14px 30px -12px rgba(109, 74, 255, .75); transition: background-position .4s, transform .1s, box-shadow .2s; }
.a2-submit:hover { background-position: 100% 0; box-shadow: 0 18px 36px -12px rgba(109, 74, 255, .9); }
.a2-submit:active { transform: scale(.985); }
.a2-submit .a2-arrow { transform: rotate(180deg); transition: transform .2s; }
.a2-submit:hover .a2-arrow { transform: rotate(180deg) translateX(-4px); }
.a2-submit.busy span, .a2-submit.busy .a2-arrow { opacity: 0; }
.a2-submit.busy::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .7s linear infinite; }
.a2-submit.done { background: var(--ok); }
.a2-card.shake { animation: a2shake .4s; }
@keyframes a2shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.a2-alt { text-align: center; margin-top: 20px; color: var(--muted); font-size: .9rem; }
.a2-alt a { font-weight: 700; }
.a2-planlink { display: flex; align-items: center; gap: 14px; margin-top: 26px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text) !important; text-decoration: none !important; transition: border-color .15s, transform .15s, box-shadow .2s; }
.a2-planlink:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.a2-planlink > span:nth-child(2) { flex: 1; min-width: 0; }
.a2-planlink b { display: block; font-size: .9rem; }
.a2-planlink small { color: var(--muted); font-size: .8rem; }
.a2-pl-dots { display: flex; }
.a2-pl-dots i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); margin-left: -7px; }
.a2-pl-dots i:first-child { margin-left: 0; }
.a2-legal { display: flex; align-items: center; gap: 6px; justify-content: center; margin: 22px 0 0; color: var(--muted); font-size: .78rem; }

@media (max-width: 1060px) {
  .auth2 { grid-template-columns: 1fr; }
  .a2-hero { padding: 22px 20px 64px; gap: 0; }
  .a2-mock, .a2-feats, .a2-foot { display: none; }
  .a2-copy { margin-top: 26px; }
  .a2-copy h1 { font-size: clamp(1.9rem, 7.5vw, 2.6rem); margin: 14px 0 10px; }
  .a2-copy > p { font-size: .95rem; }
  .a2-toplink { height: 34px; padding: 0 12px; font-size: .8rem; }
  .a2-main { margin-top: -36px; border-radius: 28px 28px 0 0; padding: 30px 20px calc(30px + var(--safe-b)); justify-content: flex-start; box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .5); }
  .a2-head h2 { font-size: 1.6rem; }
  .a2-head p { margin-bottom: 20px; }
}

/* =====================================================================
   Public pricing page
   ===================================================================== */
.pricing { position: relative; min-height: 100vh; isolation: isolate; overflow-x: hidden; }
.pr-top { max-width: 1200px; margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pr-top nav { display: flex; align-items: center; gap: 10px; }
.pr-navlink { font-weight: 650; color: var(--text-2) !important; padding: 0 10px; }
.pr-hero { max-width: 760px; margin: 0 auto; padding: 40px 20px 34px; text-align: center; }
.pr-hero .a2-pill { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.pr-hero h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 850; letter-spacing: -.035em; line-height: 1.05; margin: 18px 0 14px; }
.pr-hero p { font-size: 1.08rem; color: var(--muted); margin: 0 auto 28px; max-width: 580px; }
.pr-dur { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 5px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.pr-dur button { position: relative; height: 42px; padding: 0 18px; border: 0; border-radius: 12px; background: none; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; transition: background .2s, color .2s; }
.pr-dur button:hover { color: var(--text); }
.pr-dur button.on { background: var(--text); color: var(--bg); }
.pr-dur em { font-style: normal; font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); }
.pr-dur button.on em { background: var(--ok); color: #fff; }
.pr-grid { max-width: 1200px; margin: 0 auto; padding: 18px 20px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 350px)); justify-content: center; gap: 22px; align-items: stretch; }
.pr-grid.swap .pr-card { animation: a2in .4s cubic-bezier(.2, .9, .3, 1) both; }
.pr-grid.swap .pr-card:nth-child(2) { animation-delay: .05s; }
.pr-grid.swap .pr-card:nth-child(3) { animation-delay: .1s; }
.pr-grid.swap .pr-card:nth-child(4) { animation-delay: .15s; }
.pr-card { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 28px 26px; border-radius: 26px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s; }
.pr-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pr-card.hl { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(150deg, var(--pc), color-mix(in srgb, var(--pc) 30%, #22d3ee)) border-box; box-shadow: 0 30px 70px -30px var(--pc); }
@media (min-width: 900px) { .pr-card.hl { transform: translateY(-10px); } .pr-card.hl:hover { transform: translateY(-14px); } }
.pr-badge { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); padding: 5px 14px; border-radius: 99px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #fff; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 50%, #22d3ee)); box-shadow: 0 8px 20px -8px var(--pc); white-space: nowrap; }
.pr-name { display: flex; gap: 12px; align-items: center; }
.pr-name h3 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.pr-name p { margin: 2px 0 0; font-size: .84rem; color: var(--muted); }
.pr-quota { font-size: 2.6rem; font-weight: 850; letter-spacing: -.04em; line-height: 1; color: var(--pc); }
.pr-quota small { display: block; font-size: .84rem; font-weight: 600; letter-spacing: 0; color: var(--muted); margin-top: 6px; }
.pr-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--border); }
.pr-price b { font-size: 2rem; font-weight: 850; letter-spacing: -.02em; }
.pr-price b.na { color: var(--muted); }
.pr-price span { color: var(--muted); font-size: .9rem; font-weight: 600; }
.pr-per { font-size: .84rem; color: var(--muted); margin-top: -10px; min-height: 20px; }
.pr-per em { font-style: normal; font-weight: 800; font-size: .74rem; padding: 2px 8px; border-radius: 99px; background: var(--ok-soft); color: var(--ok); margin-left: 4px; }
.pr-card .btn.primary { background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 55%, #22d3ee)); box-shadow: 0 14px 28px -14px var(--pc); }
.pr-card .pc-feat { gap: 10px; }
.pr-steps { max-width: 1100px; margin: 50px auto 0; padding: 0 20px; text-align: center; }
.pr-steps h2, .pr-faq h2 { font-size: 1.7rem; font-weight: 850; letter-spacing: -.02em; }
.pr-steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; text-align: left; }
.pr-steps-grid > div { padding: 22px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); }
.pr-steps-grid span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 850; color: #fff; background: var(--grad); margin-bottom: 12px; }
.pr-steps-grid b { font-size: 1.02rem; }
.pr-steps-grid p { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
@media (max-width: 760px) { .pr-steps-grid { grid-template-columns: 1fr; } }
.pr-faq { max-width: 820px; margin: 50px auto 0; padding: 0 20px; }
.pr-faq h2 { text-align: center; margin-bottom: 20px; }
.pr-foot { max-width: 1200px; margin: 60px auto 0; padding: 26px 24px 40px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: .86rem; }
.pr-foot .a2-brand { color: var(--text) !important; font-size: 1.05rem; }
@media (max-width: 600px) {
  .pr-top { padding: 16px; }
  .pr-top .pr-navlink { display: none; }
  .pr-hero { padding-top: 20px; }
  .pr-dur button { padding: 0 12px; height: 38px; font-size: .86rem; }
  .pr-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   Family / group plans (v1.3)
   ===================================================================== */
.pr-seats { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; height: 28px; padding: 0 12px; border-radius: 99px; font-size: .8rem; font-weight: 700; color: var(--pc); background: color-mix(in srgb, var(--pc) 13%, transparent); margin-top: -4px; }
.ph-shared { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 12px; background: rgba(255, 255, 255, .16); font-weight: 650; font-size: .9rem; }

.group-strip { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 20px; margin: 4px 0 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, color-mix(in srgb, var(--pc) 16%, var(--surface)), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--pc) 30%, var(--border)); }
.gs-avatars { display: flex; }
.gs-avatars .avatar { border: 2px solid var(--surface); margin-left: -10px; }
.gs-avatars .avatar:first-child { margin-left: 0; }
.gs-text { flex: 1; min-width: 200px; display: grid; }
.gs-text b { font-size: 1.05rem; }
.gs-text small { color: var(--muted); }
.gs-use { display: grid; gap: 6px; min-width: 200px; }
.gs-use small { color: var(--muted); font-size: .78rem; }
.gs-use .progress { display: block; }
.gs-use .progress > i { background: var(--pc); }

.group-card { margin-bottom: 18px; border-color: color-mix(in srgb, var(--pc) 30%, var(--border)); position: relative; overflow: hidden; }
.group-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--pc), color-mix(in srgb, var(--pc) 40%, #22d3ee)); }
.gc-head { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.gc-head h2 { margin: 2px 0; display: flex; align-items: center; gap: 4px; }
.gc-head p { margin: 0; }
.gc-icon { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 50%, #000)); box-shadow: 0 12px 26px -12px var(--pc); }
.gc-invite { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--surface-2); }
.gc-invite label { margin-bottom: 8px; }
.gc-invite .share-link { flex-wrap: wrap; }
.gc-invite .share-link input { flex: 1; min-width: 200px; }
.gc-usage { margin-top: 18px; }
.gc-members { display: grid; gap: 8px; margin-top: 18px; }
.gm { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(140px, 220px) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.gm .avatar { width: 40px; height: 40px; }
.gm-info { display: grid; min-width: 0; }
.gm-info small { color: var(--muted); font-size: .78rem; }
.gm-use { display: grid; gap: 5px; font-size: .78rem; color: var(--muted); }
.gm-use .progress { display: block; height: 5px; }
.gm-act { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.gm.add { grid-template-columns: auto 1fr; border-style: dashed; color: var(--muted); background: transparent; cursor: pointer; font-weight: 650; text-align: left; }
.gm.add:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.gc-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@media (max-width: 700px) {
  .gm { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .gm-use { grid-column: 2 / 4; grid-row: 2; }
}

.join-card { text-align: center; --pc: #10b981; }
.jc-icon { width: 76px; height: 76px; margin: 4px auto 12px; border-radius: 24px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--pc), color-mix(in srgb, var(--pc) 50%, #000)); box-shadow: 0 18px 36px -14px var(--pc); }
.jc-icon .icon { width: 34px; height: 34px; }
.join-card h2 { margin: 8px 0 12px; font-size: 1.35rem; }
.jc-facts { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.jc-facts span { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: color-mix(in srgb, var(--pc) 12%, transparent); color: var(--pc); font-weight: 700; font-size: .84rem; }
.jc-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; text-align: left; }
.jc-list li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .9rem; }
.jc-list li .icon { color: var(--pc); }
.join-card .actions { justify-content: center; }

.a2-invite { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; margin-bottom: 20px; background: color-mix(in srgb, var(--pc) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent); animation: a2in .4s ease; }
.a2-inv-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #fff; background: var(--pc); }
.a2-invite > div { flex: 1; display: grid; gap: 2px; }
.a2-invite b { font-size: .92rem; }
.a2-invite small { color: var(--muted); font-size: .8rem; }

/* playing track highlight (all sizes) */
.track.playing { background: var(--accent-soft); }
.track.playing .art { box-shadow: 0 0 0 2px var(--accent); }

/* Audio artwork is always 1:1: fixed square boxes, image cropped (never stretched). */
.track .art, .aplayer .art, .aview .q .qa, .up .mini, .list-row .mini { position: relative; flex: none; aspect-ratio: 1 / 1; }
.track .t { min-width: 0; }
.track .art img, .aplayer .art img, .aview .q .qa img, .list-row .mini img, .aview .bigart img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; object-position: center; display: block; }
.aview .bigart { flex: none; height: auto; }
.aview .bigart canvas.viz { z-index: 1; }
.thumb.sq { background: #111; }
.thumb.sq .sq-bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(18px) brightness(.6) saturate(1.3); transform: none !important; }
.thumb.sq .sq-art { position: relative; height: 82%; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .7); z-index: 1; }
.thumb.sq .sq-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb.sq .dur, .thumb.sq .play-badge { z-index: 2; }
.file-card:hover .thumb.sq .sq-art img { transform: scale(1.04); }

/* Full-screen player: fit the real visible height (dvh) and never overflow */
.aview { height: 100vh; height: 100dvh; }
.aview-body { overflow: hidden; }
.aview-main { overflow-y: auto; overflow-x: hidden; justify-content: safe center; gap: clamp(10px, 2.4vh, 26px); padding: 6px 0; scrollbar-width: none; min-width: 0; }
.aview-main::-webkit-scrollbar { display: none; }
.aview .bigart { width: min(400px, 78vw, calc(100vh - 430px)); width: min(400px, 78vw, calc(100dvh - 430px)); min-width: 150px; }
.aview .meta, .aview .seekwrap { min-width: 0; }
.aview .meta .t { font-size: clamp(1.15rem, 3.2vh, 1.5rem); }
@media (max-height: 640px) { .aview .extra .btn span { display: none; } .aview .bigplay { width: 64px; height: 64px; } .aview-top { padding-top: 8px; padding-bottom: 4px; } }
.aplayer .now > .ellipsis { min-width: 0; flex: 1; }
.aplayer .center, .aplayer .right { min-width: 0; }

/* =====================================================================
   Cine (TMDB) + simultaneous screens + devices (v1.4)
   ===================================================================== */
.cn-hero { position: relative; min-height: min(58vh, 540px); border-radius: 26px; overflow: hidden; margin: 0 0 26px; display: flex; align-items: flex-end; color: #fff; isolation: isolate;
  background: #0b0d14 var(--bd) center 20% / cover no-repeat; }
.cn-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(5, 6, 12, .95) 0%, rgba(5, 6, 12, .7) 38%, rgba(5, 6, 12, .1) 75%), linear-gradient(0deg, rgba(5, 6, 12, .9) 0%, transparent 45%); }
.cn-hero-in { padding: clamp(22px, 4vw, 48px); max-width: 640px; }
.cn-kicker { display: inline-block; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #fbbf24; }
.cn-hero h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.02; margin: 8px 0 12px; text-shadow: 0 4px 30px rgba(0, 0, 0, .5); }
.cn-meta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .9rem; font-weight: 600; opacity: .95; margin-bottom: 12px; }
.cn-star { color: #fbbf24; font-weight: 800; }
.cn-genre { padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .14); font-size: .78rem; }
.cn-over { font-size: 1rem; line-height: 1.55; opacity: .88; margin: 0 0 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cn-over.full { -webkit-line-clamp: unset; display: block; }
.cn-play { background: #fff !important; color: #111 !important; border: 0 !important; }
.cn-play:hover { background: #e5e7eb !important; }
.cn-more { background: rgba(255, 255, 255, .16) !important; color: #fff !important; border: 0 !important; backdrop-filter: blur(10px); }
.cn-more:hover { background: rgba(255, 255, 255, .26) !important; }
.cn-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; }
.cn-toolbar h1 { margin: 0; font-size: 1.5rem; font-weight: 850; }
.cn-row { margin: 18px 0 8px; }
.cn-row-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cn-row-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; }
@media (hover: none) { .cn-scroll { display: none; } }
.cn-track { display: grid; grid-auto-flow: column; gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px 14px; scrollbar-width: none; overscroll-behavior-x: contain; }
.cn-track::-webkit-scrollbar { display: none; }
.cn-track.poster { grid-auto-columns: clamp(130px, 13vw, 180px); }
.cn-track.wide { grid-auto-columns: clamp(220px, 22vw, 320px); }
.cn-poster, .cn-wide { scroll-snap-align: start; border: 0; padding: 0; background: none; text-align: left; color: var(--text); display: grid; gap: 4px; cursor: pointer; min-width: 0; }
.cn-pimg { position: relative; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #1e1b4b, #312e81); box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s; }
.cn-pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cn-poster:hover .cn-pimg, .cn-poster:focus-visible .cn-pimg { transform: translateY(-4px) scale(1.03); box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .7); }
.cn-fallback { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; text-align: center; padding: 12px; color: rgba(255, 255, 255, .85); }
.cn-fallback .icon { margin: 0 auto; }
.cn-fallback b { font-size: .85rem; line-height: 1.25; }
.cn-vote { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 8px; font-size: .72rem; font-weight: 800; color: #fbbf24; background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); }
.cn-badge { position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 8px; font-size: .68rem; font-weight: 800; color: #fff; background: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.cn-ptitle { font-weight: 700; font-size: .88rem; margin-top: 4px; }
.cn-psub { font-size: .76rem; color: var(--muted); }
.cn-wimg { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); transition: transform .25s; }
.cn-wimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cn-wide:hover .cn-wimg { transform: translateY(-3px); }
.cn-wplay { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .5); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; z-index: 1; }
.cn-wide:hover .cn-wplay, .cn-ep:hover .cn-wplay { opacity: 1; }
@media (hover: none) { .cn-wplay { opacity: .9; } }
.cn-dur { position: absolute; right: 8px; bottom: 10px; font-size: .7rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff; z-index: 1; }
.cn-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .25); z-index: 1; }
.cn-prog i { display: block; height: 100%; background: #e11d48; }

/* detail sheet */
.cn-detail { position: fixed; inset: 0; z-index: 240; overflow-y: auto; background: #07080d; color: #fff; animation: fade .2s ease; overscroll-behavior: contain; }
.cn-d-bd { position: fixed; inset: 0; background: center 15% / cover no-repeat; opacity: .55; }
.cn-d-bd::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, #07080d 8%, rgba(7, 8, 13, .75) 50%, rgba(7, 8, 13, .4) 100%), linear-gradient(90deg, rgba(7, 8, 13, .85), transparent 70%); }
.cn-d-close { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; z-index: 3; color: #fff !important; background: rgba(0, 0, 0, .45) !important; backdrop-filter: blur(8px); border-radius: 50% !important; }
.cn-d-body { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: clamp(60px, 10vh, 120px) clamp(16px, 4vw, 40px) 60px; }
.cn-d-top { display: grid; grid-template-columns: minmax(160px, 280px) minmax(0, 1fr); gap: clamp(20px, 4vw, 44px); align-items: end; }
.cn-d-poster { position: relative; aspect-ratio: 2 / 3; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, #1e1b4b, #312e81); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9); }
.cn-d-poster img { width: 100%; height: 100%; object-fit: cover; }
.cn-d-info h1 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); font-weight: 900; letter-spacing: -.03em; line-height: 1.05; margin: 8px 0 6px; }
.cn-d-info .muted { color: rgba(255, 255, 255, .6); }
.cn-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cn-tag { font-style: italic; opacity: .75; margin: 0 0 8px; }
.cn-seasons { margin-top: 34px; }
.cn-seasons .seg { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .1); overflow-x: auto; max-width: 100%; }
.cn-seasons .seg button { color: rgba(255, 255, 255, .65); white-space: nowrap; }
.cn-seasons .seg button.on { background: #fff; color: #111; }
.cn-eps { display: grid; gap: 10px; margin-top: 16px; }
.cn-ep { display: grid; grid-template-columns: clamp(130px, 22vw, 220px) minmax(0, 1fr); gap: 16px; align-items: center; padding: 10px; border-radius: 16px; border: 0; background: rgba(255, 255, 255, .05); color: #fff; text-align: left; cursor: pointer; transition: background .15s; }
.cn-ep:hover { background: rgba(255, 255, 255, .1); }
.cn-ep.missing { opacity: .4; cursor: default; }
.cn-ep-img { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.cn-ep-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cn-ep-txt { display: grid; gap: 4px; min-width: 0; }
.cn-ep-txt b { font-size: .98rem; }
.cn-ep-txt small { color: rgba(255, 255, 255, .6); font-size: .8rem; }
.cn-ep-ov { font-size: .84rem; color: rgba(255, 255, 255, .75); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cn-h3 { margin: 34px 0 12px; font-size: 1.1rem; }
.cn-cast { display: grid; grid-auto-flow: column; grid-auto-columns: 110px; gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.cn-cast > div { display: grid; gap: 4px; text-align: center; min-width: 0; }
.cn-cast span { aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: rgba(255, 255, 255, .1); display: grid; place-items: center; }
.cn-cast img { width: 100%; height: 100%; object-fit: cover; }
.cn-cast b { font-size: .8rem; }
.cn-cast small { font-size: .72rem; color: rgba(255, 255, 255, .55); }
.cn-credit { margin-top: 40px; font-size: .74rem; color: rgba(255, 255, 255, .4); }
@media (max-width: 700px) {
  .cn-hero { min-height: 62vh; border-radius: 20px; margin: 0 -2px 20px; }
  .cn-hero::before { background: linear-gradient(0deg, rgba(5, 6, 12, .98) 0%, rgba(5, 6, 12, .6) 55%, rgba(5, 6, 12, .1) 100%); }
  .cn-hero .btn.lg { height: 44px; padding: 0 16px; font-size: .92rem; }
  .cn-d-top { grid-template-columns: 1fr; }
  .cn-d-poster { width: 46%; max-width: 200px; }
  .cn-ep { grid-template-columns: 120px minmax(0, 1fr); gap: 10px; }
  .cn-ep-ov { display: none; }
}
.fx-res { display: grid; gap: 8px; margin-top: 14px; max-height: 52vh; overflow: auto; }
.fx-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-align: left; color: var(--text); }
.fx-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.fx-item > span { width: 54px; aspect-ratio: 2 / 3; flex: none; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.fx-item img { width: 100%; height: 100%; object-fit: cover; }
.fx-item p { margin: 4px 0 0; font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* simultaneous screens */
.vp-wait { display: grid; place-items: center; width: 100%; height: 100%; }
.vp-limit { max-width: 520px; margin: auto; padding: 28px 22px; text-align: center; color: #fff; }
.vl-icon { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 24px; display: grid; place-items: center; background: linear-gradient(135deg, #e11d48, #f97316); box-shadow: 0 20px 40px -14px #e11d48; }
.vp-limit h2 { color: #fff; margin: 0 0 8px; }
.vp-limit p { opacity: .8; }
.vl-list { display: grid; gap: 8px; margin: 16px 0 20px; text-align: left; }
.vl-item { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .08); }
.vl-item > div { flex: 1; min-width: 0; display: grid; }
.vl-item small { opacity: .65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vl-dev { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(225, 29, 72, .25); color: #fda4af; flex: none; }
.vl-hint { font-size: .78rem; opacity: .55 !important; margin-top: 16px; }
.vp-limit .btn:not(.primary) { background: rgba(255, 255, 255, .12); color: #fff; border: 0; }
.vp-stopped { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; text-align: center; padding: 20px; background: rgba(0, 0, 0, .78); backdrop-filter: blur(6px); color: #fff; }
.vp-stopped h2 { color: #fff; margin: 10px 0 6px; }
.vp-stopped p { opacity: .8; max-width: 380px; }
.vp-stopped .icon { margin: 0 auto; }

/* devices */
.dev-list { display: grid; gap: 8px; }
.dev { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.dev > div { flex: 1; min-width: 0; display: grid; }
.dev small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-ic { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.dev-ic.live { background: var(--ok-soft); color: var(--ok); animation: livepulse 2s ease-in-out infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 15%, transparent); } }

/* =====================================================================
   Shared libraries + public link seats (v1.5)
   ===================================================================== */
.avatar.xs { width: 22px; height: 22px; font-size: .62rem; margin: 0 -1px; }
.lib-head { display: flex; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 22px; margin: 4px 0 14px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%); border: 1px solid var(--border); }
.lib-head h1 { margin: 4px 0 2px; font-size: 1.5rem; font-weight: 850; }
.lib-head p { margin: 0; }
.lib-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.lib-tabs::-webkit-scrollbar { display: none; }
.lib-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 650; font-size: .9rem; white-space: nowrap; text-decoration: none !important; }
.lib-tabs a:hover { border-color: var(--border-strong); color: var(--text); }
.lib-tabs a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.lib-card { margin-bottom: 18px; }
.ls-list { display: grid; gap: 8px; margin-top: 12px; }
.ls-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.ls-item.invite { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); }
.ls-main { flex: 1; min-width: 200px; }
.ls-scope { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.ls-scope .chip { height: 24px; font-size: .74rem; }
.ls-act { display: flex; gap: 6px; align-items: center; }
.ls-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.ls-cat { margin: 0; cursor: pointer; }
.ls-cat input { position: absolute; opacity: 0; pointer-events: none; }
.ls-cat span { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface-2); font-weight: 600; color: var(--text-2); transition: .15s; }
.ls-cat span b { font-size: .86rem; font-weight: 650; }
.ls-cat input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.ls-cat input:focus-visible + span { outline: 2px solid var(--accent); }
.ls-tree { max-height: 220px; }
.ls-f { display: flex; align-items: center; gap: 8px; height: 36px; margin: 0; font-weight: 500; color: var(--text-2); cursor: pointer; border-radius: 9px; padding-right: 8px; }
.ls-f:hover { background: var(--surface); }
.share-busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 20px; color: #fff; background: radial-gradient(circle at 50% 30%, #1e1b4b, #000); }
.share-busy .sb-ic { font-size: 42px; }
.share-busy h2 { color: #fff; margin: 10px 0 6px; }
.share-busy p { opacity: .75; max-width: 420px; }
.share-media { position: relative; }

.modal > h2, .modal form > h2 { display: flex; align-items: center; gap: 10px; }

/* =====================================================================
   Contextual search (v1.6)
   ===================================================================== */
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 8px 0 14px; border-radius: 14px; background: var(--surface-2); border: 1.5px solid transparent; transition: border-color .15s, box-shadow .15s, background .15s; }
.search:hover { border-color: var(--border); }
.search:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search > .icon { position: static !important; flex: none; color: var(--muted); }
.search:focus-within > .icon { color: var(--accent-text); }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0 !important; margin: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; font-size: .95rem; }
.search kbd { position: static; flex: none; }
.s-scope { display: none; flex: none; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; font-size: .74rem; font-weight: 800; color: var(--accent-text); background: var(--accent-soft); white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.search.scoped .s-scope { display: inline-flex; }
.s-clear { flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.s-clear:hover { background: var(--border-strong); color: var(--text); }
.search:focus-within kbd, .s-clear:not(.hidden) ~ kbd { display: none; }
.s-cancel { display: none; border: 0; background: none; color: var(--accent-text); font-weight: 700; padding: 0 4px; flex: none; }
.search { position: relative; }
.s-panel { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60; padding: 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: pop .14s ease; }
.sp-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 10px; font-size: .84rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.sp-head b { color: var(--text); }
.sp-all { margin-left: auto; font-weight: 700; font-size: .8rem; }
.sp-title { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 4px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sp-title button { border: 0; background: none; color: var(--accent-text); font-weight: 700; font-size: .74rem; text-transform: none; letter-spacing: 0; }
.sp-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 8px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font-weight: 550; text-align: left; }
.sp-item:hover { background: var(--surface-2); color: var(--text); }
.sp-item > span { flex: 1; min-width: 0; }
.sp-item .icon:last-child { color: var(--muted); }
.sp-tip { padding: 10px 8px 6px; font-size: .86rem; color: var(--muted); }

mark { background: color-mix(in srgb, #fbbf24 38%, transparent); color: inherit; border-radius: 4px; padding: 0 1px; }

.search-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 4px 0 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.search-head h1 { margin: 6px 0 0; font-size: 1.45rem; font-weight: 850; letter-spacing: -.02em; }
.sr-empty { padding: 50px 20px; }
.sr-group { margin-bottom: 22px; }
.sr-ghead { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .95rem; margin-bottom: 8px; }
.sr-ghead .btn { margin-left: auto; }
.sr-list { display: grid; gap: 6px; }
.sr-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto 40px; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: border-color .15s, background .15s; }
.sr-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.sr-thumb { position: relative; width: 46px; height: 46px; border-radius: 11px; overflow: hidden; display: grid; place-items: center; color: #fff; background: var(--kc); flex: none; }
.sr-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sr-main { display: grid; gap: 2px; min-width: 0; }
.sr-main b { font-size: .92rem; font-weight: 650; }
.sr-path { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--muted) !important; min-width: 0; max-width: 100%; justify-self: start; }
.sr-path:hover { color: var(--accent-text) !important; text-decoration: none; }
.sr-meta { font-size: .78rem; color: var(--muted); text-align: right; line-height: 1.35; white-space: nowrap; }
.ph-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: .7rem; font-weight: 600; color: #fff; background: linear-gradient(0deg, rgba(0, 0, 0, .75), transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-name mark { color: #fff; }
.cn-sr { margin-bottom: 26px; }
.cn-sr h2 { font-size: 1.1rem; font-weight: 800; margin-bottom: 12px; }
.cn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.cn-grid.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

@media (max-width: 900px) {
  .sr-row { grid-template-columns: 44px minmax(0, 1fr) 36px; }
  .sr-meta { display: none; }
  .search { height: 42px; }
  .s-scope { max-width: 90px; }
  body.search-open .topbar .menu-toggle, body.search-open .topbar .top-actions { display: none; }
  body.search-open .s-cancel { display: block; }
  body.search-open .search { max-width: none; }
  .s-panel { position: fixed; top: var(--topbar); left: 8px; right: 8px; }
  .search-head h1 { font-size: 1.2rem; }
  .cn-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
  .cn-grid.wide { grid-template-columns: 1fr; }
}
.search .s-panel .icon, .search .s-clear .icon { position: static !important; left: auto; top: auto; color: inherit; }
.sp-head > .icon { flex: none; }
.sp-item > .icon:first-child { color: var(--muted); flex: none; }

/* =====================================================================
   Search suggestions (v1.6.1)
   ===================================================================== */
@media (min-width: 901px) {
  .s-panel { left: -6px; right: auto; width: max(100%, 560px); max-width: calc(100vw - 340px); }
}
.s-panel { max-height: min(72vh, 620px); overflow-y: auto; overscroll-behavior: contain; padding: 8px; }
.sp-head { position: sticky; top: -8px; z-index: 1; background: var(--surface); margin: -8px -8px 6px; padding: 12px 16px 10px; }
.sg-spin { width: 14px; height: 14px; margin-left: auto; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes sgIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.sg-in { animation: sgIn .32s cubic-bezier(.2, .9, .3, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.sg-list { display: grid; gap: 2px; }
.sg-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--text); text-align: left; cursor: pointer; transition: background .12s; }
.sg-row:hover, .sg-row.on { background: var(--surface-2); }
.sg-row.on { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sg-art { position: relative; width: 48px; height: 48px; border-radius: 12px; overflow: hidden; flex: none; display: grid; place-items: center; color: #fff; background: var(--kc, var(--surface-3)); box-shadow: var(--shadow-sm); }
.sg-art.poster { width: 42px; height: 63px; border-radius: 8px; background: linear-gradient(135deg, #1e1b4b, #312e81); }
.sg-art.square { border-radius: 10px; }
.sg-art.folder { background: color-mix(in srgb, var(--kc) 18%, transparent); color: var(--kc); box-shadow: none; }
.sg-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .35s, transform .5s; }
.sg-art img.ok { opacity: 1; transform: none; }
.sg-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sg-txt b { font-size: .93rem; font-weight: 650; }
.sg-txt small { font-size: .8rem; color: var(--muted); }
.sg-side { display: flex; align-items: center; gap: 8px; flex: none; }
.sg-vote { font-size: .76rem; font-weight: 800; color: #f59e0b; }
.sg-dur { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sg-badge { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); }
.sg-badge.b-movie { background: color-mix(in srgb, #f43f5e 16%, transparent); color: #f43f5e; }
.sg-badge.b-series { background: color-mix(in srgb, #8b5cf6 16%, transparent); color: #8b5cf6; }
.sg-badge.b-episode { background: color-mix(in srgb, #6366f1 14%, transparent); color: #6366f1; }
.sg-badge.b-audio { background: color-mix(in srgb, var(--k-audio) 16%, transparent); color: var(--k-audio); }
.sg-badge.b-image { background: color-mix(in srgb, var(--k-image) 16%, transparent); color: var(--k-image); }
.sg-badge.b-document { background: color-mix(in srgb, var(--k-document) 16%, transparent); color: var(--k-document); }
.sg-badge.b-folder { background: var(--accent-soft); color: var(--accent-text); }
.sg-play { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 6px 16px -6px var(--accent); transform: scale(.9); transition: transform .15s; }
.sg-row:hover .sg-play, .sg-row.on .sg-play { transform: scale(1); }
.sg-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px; }
.sg-ph { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.sg-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s, transform .3s; }
.sg-ph img.ok { opacity: 1; }
.sg-ph:hover img, .sg-ph.on img { transform: scale(1.06); }
.sg-ph.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.sg-sk-ph { aspect-ratio: 1; border-radius: 12px; }
.sg-sk { display: flex; align-items: center; gap: 12px; padding: 8px 10px; animation: sgIn .3s both; animation-delay: calc(var(--i) * 60ms); }
.sg-sk-img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.sg-sk-img.poster { width: 42px; height: 63px; border-radius: 8px; }
.sg-sk-txt { flex: 1; display: grid; gap: 8px; }
.sg-sk-txt i { display: block; height: 12px; border-radius: 6px; width: 70%; }
.sg-sk-txt i + i { width: 42%; height: 10px; }
.sg-more { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 12px 14px; border: 0; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; background: none; color: var(--accent-text); font-weight: 700; font-size: .88rem; text-align: left; cursor: pointer; }
.sg-more:hover { background: var(--surface-2); }
.sg-more kbd { margin-left: auto; font: 600 .7rem var(--font); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border-strong); color: var(--muted); }
.sg-empty { display: grid; justify-items: center; gap: 6px; padding: 24px 12px 20px; text-align: center; color: var(--muted); }
.sg-empty > .icon { width: 30px; height: 30px; color: var(--accent-text); }
.sg-empty b { color: var(--text); }
@media (max-width: 900px) {
  .s-panel { max-height: calc(100dvh - var(--topbar) - 20px); }
  .sg-photos { grid-template-columns: repeat(3, 1fr); }
  .sg-more kbd, .sg-dur { display: none; }
  .sg-row { padding: 8px 6px; }
}
