@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* =====================================================================
   Admin: white, blue accents. Plus Jakarta Sans throughout.
   ===================================================================== */
body.admin {
  --serif: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --page: #f7f8fa;
  --r: 10px;
  --h: 40px;
  --h-sm: 32px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--page);
  color: var(--text);
}
body.admin h1, body.admin h2, body.admin h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); letter-spacing: -0.01em; margin: 0; }
.label { display: block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.45rem; }
.hint { font-size: 0.8rem; color: var(--muted); margin: 0.6rem 0 0; line-height: 1.5; }
.muted { color: var(--muted); margin: 0; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 0.85rem; }
.eyebrow { margin: 0; font-size: 0.66rem; letter-spacing: 0.22em; }

/* ---- buttons: one family, same height and radius ---- */
body.admin .btn {
  height: var(--h); padding: 0 1rem; border-radius: var(--r); gap: 0.5rem;
  font-family: var(--sans); font-size: 0.86rem; font-weight: 600; letter-spacing: 0;
  background: #fff; color: var(--ink); border: 1px solid rgba(17, 17, 24, 0.12);
  box-shadow: 0 1px 2px rgba(17, 17, 24, 0.05);
  text-shadow: none; white-space: nowrap; text-decoration: none;
}
body.admin .btn:hover { background: #f9fafb; border-color: rgba(17, 17, 24, 0.2); box-shadow: 0 1px 2px rgba(17, 17, 24, 0.06), 0 4px 10px -4px rgba(17, 17, 24, 0.12); }
body.admin .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body.admin .btn.small { height: var(--h-sm); padding: 0 0.75rem; font-size: 0.8rem; border-radius: 8px; }
body.admin .btn.primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff; border-color: #1f56d1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(29, 78, 216, 0.35), 0 6px 16px -6px rgba(37, 99, 235, 0.6);
}
body.admin .btn.primary:hover { background: linear-gradient(180deg, #4b8ef8, #2f6ef0); filter: none; }
body.admin .btn.primary::after { display: none; }
body.admin .btn.danger { color: var(--danger); border-color: rgba(180, 67, 47, 0.25); }
body.admin .btn.danger:hover { background: #fff5f3; border-color: rgba(180, 67, 47, 0.45); }
body.admin .btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
body.admin .btn.ghost:hover { background: rgba(17, 17, 24, 0.05); color: var(--ink); }
body.admin .btn:disabled { opacity: 0.45; }
body.admin .field { height: var(--h); padding: 0 0.85rem; border-radius: var(--r); font-size: 0.88rem; border-color: rgba(17, 17, 24, 0.12); }
body.admin .field:focus { border-color: #3b82f6; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14); }
body.admin .select { height: var(--h); }

/* ---- sign in ---- */
.login { min-height: 100svh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(80% 60% at 50% 0%, #eef3ff, var(--page) 70%); }
.login-card { width: min(100%, 23rem); display: flex; flex-direction: column; gap: 0.8rem; text-align: center; padding: 2.4rem 2rem 1.8rem; border-radius: 20px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.login-card .brand-mark { margin: 0 auto 0.4rem; width: 52px; height: 52px; border-radius: 14px; }
.login-card h1 { font-size: 2.3rem; }
.login-card .muted { margin-bottom: 0.8rem; font-size: 0.84rem; }

/* ---- layout: sidebar | main ---- */
.app { display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); min-height: 100svh; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(160deg, #1f2a44, #0f1626); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 14px -6px rgba(15, 22, 38, 0.6);
}
.brand-mark svg { width: 62%; height: 62%; fill: none; stroke: #8fb4ff; stroke-width: 3; }
.brand-mark .hub { fill: #8fb4ff; stroke: none; }

.sidebar {
  position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; gap: 1.6rem;
  padding: 1.4rem 1rem 1.2rem; background: #fff; border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.75rem; padding: 0 0.4rem; }
.brand strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.3rem; line-height: 1.1; color: var(--ink); }
.brand span { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 0.1rem; }
.nav { display: flex; flex-direction: column; gap: 0.15rem; }
.nav-label { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #a0a3ad; padding: 0 0.6rem 0.45rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.7rem; width: 100%; height: 38px; padding: 0 0.65rem; border-radius: 9px;
  border: 0; background: none; color: #4b4f5c; font-size: 0.86rem; font-weight: 500; text-align: left; cursor: pointer; text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.8; }
.nav-item:hover { background: #f3f4f7; color: var(--ink); }
.nav-item.active { background: #eef4ff; color: #1d4ed8; font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-count { margin-left: auto; min-width: 1.5rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: #dfe9ff; color: #1d4ed8; font-size: 0.7rem; font-weight: 700; text-align: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 0.6rem; }

/* storage card */
.storage { padding: 0.9rem 0.9rem 0.85rem; border-radius: 12px; background: #f7f8fa; border: 1px solid var(--line); }
.storage-row { display: flex; justify-content: space-between; align-items: center; }
.storage-row .label { margin: 0; font-size: 0.62rem; }
.storage-cost { font-size: 0.68rem; font-weight: 600; color: var(--ok); }
#storageText { display: block; margin: 0.35rem 0 0.55rem; font-size: 0.92rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.storage-bar { height: 6px; border-radius: 6px; background: #e6e8ee; overflow: hidden; }
.storage-bar div { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width 0.6s; }
.storage.over .storage-bar div { background: linear-gradient(90deg, #f59e0b, var(--danger)); }
.storage-sub { display: block; margin-top: 0.45rem; font-size: 0.72rem; color: var(--muted); }

/* ---- main ---- */
.main { min-width: 0; padding: 1.8rem clamp(1.2rem, 3vw, 2.6rem) 3rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.page-head h1 { font-size: clamp(2.3rem, 3.4vw, 3rem); line-height: 1; margin-top: 0.35rem; }
.page-actions { display: flex; gap: 0.5rem; align-items: center; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.6rem; }
.stat { padding: 1rem 1.1rem; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(17, 17, 24, 0.03); }
.stat .label { margin-bottom: 0.4rem; }
.stat strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 2.2rem; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat > span:last-child { display: block; margin-top: 0.4rem; font-size: 0.75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- workspace: list | detail ---- */
.workspace { display: grid; grid-template-columns: minmax(19rem, 25rem) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.list-col, .detail-col { min-width: 0; }
.list-col { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
.list-head h2 { font-size: 1.4rem; }
.list-head h2 span { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.search { position: relative; flex: 0 1 11rem; }
.search svg { position: absolute; left: 0.65rem; top: 50%; width: 15px; height: 15px; margin-top: -7.5px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
body.admin .search .field { height: 34px; padding-left: 2rem; font-size: 0.82rem; background: #f7f8fa; }
.list { max-height: calc(100svh - 18rem); overflow: auto; padding: 0.4rem; }
.lib-item {
  display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 0.85rem; align-items: center; width: 100%;
  padding: 0.55rem; border-radius: 12px; border: 1px solid transparent; background: none; text-align: left; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.lib-item + .lib-item { margin-top: 0.2rem; }
.lib-item:hover { background: #f7f8fa; }
.lib-item.active { background: #f2f6ff; border-color: #cfe0ff; }
.lib-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: linear-gradient(150deg, #eef1f6, #dde3ec); }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-thumb .placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 0.95rem; color: #5b6478; padding: 0.3rem; text-align: center; }
.lib-title { display: block; font-family: var(--serif); font-size: 1.2rem; line-height: 1.15; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; margin-top: 0.3rem; font-size: 0.73rem; color: var(--muted); }

.empty { text-align: center; padding: 2.4rem 1.4rem 2.2rem; }
.empty-art { width: 56px; height: 56px; margin: 0 auto 0.9rem; border-radius: 16px; display: grid; place-items: center; background: #eef4ff; color: #2563eb; }
.empty-art svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.empty h3 { font-size: 1.6rem; }
.empty p { color: var(--muted); font-size: 0.86rem; margin: 0.4rem 0 1.2rem; }
.detail-empty { padding: 3rem 1.5rem; text-align: center; color: var(--muted); background: #fff; border: 1px dashed rgba(17, 17, 24, 0.14); border-radius: 16px; }

/* pills */
.badge { display: inline-flex; align-items: center; gap: 0.35rem; height: 22px; padding: 0 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.warn { background: #fff4ed; color: #c2410c; }
.badge.ok { background: #ecfdf3; color: #047857; }
.badge.gold { background: #eef4ff; color: #1d4ed8; }
.badge.grey { background: #f1f2f5; color: #5b6070; }

/* ---- detail ---- */
.detail { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(17, 17, 24, 0.03), 0 18px 40px -30px rgba(17, 17, 24, 0.25); }
.hero { position: relative; display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.3rem; align-items: center; padding: 1.2rem; border-bottom: 1px solid var(--line); }
.hero-art { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: linear-gradient(150deg, #eef1f6, #dde3ec); box-shadow: 0 10px 24px -14px rgba(17, 17, 24, 0.5); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-art .placeholder { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 1.4rem; color: #5b6478; padding: 1rem; text-align: center; }
body.admin .hero-art .change { position: absolute; right: 0.5rem; bottom: 0.5rem; opacity: 0; transition: opacity 0.2s; background: rgba(255, 255, 255, 0.94); }
.hero-art:hover .change { opacity: 1; }
.hero h2 { font-size: 2.2rem; line-height: 1.02; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: center; margin: 0.6rem 0 1rem; font-size: 0.8rem; color: var(--muted); }
.hero .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: #c3c6cf; }
.hero-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }

.tabs { display: flex; gap: 0.25rem; padding: 0.4rem 1.2rem 0; border-bottom: 1px solid var(--line); }
.tab { position: relative; height: 44px; padding: 0 0.85rem; border: 0; background: none; font-size: 0.86rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab.active { color: #1d4ed8; }
.tab.active::after { content: ''; position: absolute; left: 0.6rem; right: 0.6rem; bottom: -1px; height: 2px; border-radius: 2px; background: #2563eb; }
.tab .n { margin-left: 0.35rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: #f1f2f5; font-size: 0.7rem; color: var(--muted); }
.tab.active .n { background: #dfe9ff; color: #1d4ed8; }
.panel-body { padding: 1.2rem; }
.section + .section { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.section h4 { margin: 0 0 0.25rem; font-size: 0.95rem; font-weight: 700; color: var(--ink); }
.section > p.sub { margin: 0 0 0.9rem; font-size: 0.8rem; color: var(--muted); }
.inline { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

/* codes */
.codes { display: grid; gap: 0.5rem; margin-bottom: 0.9rem; }
.code {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.25rem 0.9rem;
  padding: 0.7rem 0.8rem 0.7rem 0.95rem; border-radius: 12px; background: #fff; border: 1px solid var(--line);
}
.code.revoked { background: #fafafb; }
.code.revoked .code-value { text-decoration: line-through; color: var(--muted); }
.code-id { display: inline-flex; align-items: center; gap: 0.4rem; min-width: 0; }
.code-value { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 1.02rem; font-weight: 600; letter-spacing: 0.1em; color: var(--ink); white-space: nowrap; }
.code-info { grid-column: 1 / -1; grid-row: 2; font-size: 0.76rem; color: var(--muted); }
.code-info b { color: var(--text); font-weight: 600; }
.code-btns { display: flex; gap: 0.35rem; flex-wrap: wrap; justify-content: flex-end; }
.copy-code {
  width: 30px; height: 30px; flex: none; border: 1px solid transparent; border-radius: 8px; background: transparent;
  display: grid; place-items: center; color: var(--muted); cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.copy-code:hover { background: #f3f4f7; color: #2563eb; border-color: var(--line); }
.copy-code svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
.copy-code .i-done { opacity: 0; transform: scale(0.6); transition: opacity 0.2s, transform 0.2s; stroke-width: 2.4; color: var(--ok); }
.copy-code .i-copy { transition: opacity 0.2s; }
.copy-code.done .i-copy { opacity: 0; }
.copy-code.done .i-done { opacity: 1; transform: scale(1); }
.code.revoked .copy-code { display: none; }
.new-code { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.5rem; padding: 0.8rem; border-radius: 12px; background: #f7f8fa; border: 1px dashed rgba(17, 17, 24, 0.14); }
.new-code .select { min-width: 8.5rem; }

/* settings rows */
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 18rem); gap: 1rem; align-items: center; }
.setting + .setting { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.setting h4 { margin: 0; font-size: 0.92rem; font-weight: 700; color: var(--ink); }
.setting p { margin: 0.2rem 0 0; font-size: 0.8rem; color: var(--muted); }
.setting .select.date { width: 100%; }
.setting > .inline { justify-content: flex-end; }
.setting.danger-zone { padding: 1rem; border: 1px solid #fde2dc; border-radius: 12px; background: #fffaf9; }
.setting.danger-zone + .setting, .setting + .setting.danger-zone { border-top: 0; }
body.admin .offset { width: 6rem; }

/* chips (look) */
.chip {
  height: 32px; padding: 0 0.8rem; border: 1px solid rgba(17, 17, 24, 0.12); background: #fff; border-radius: 8px;
  font-size: 0.8rem; font-weight: 600; color: #4b4f5c; cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { background: #f7f8fa; }
.chip.active { background: #eef4ff; color: #1d4ed8; border-color: #9dbcfb; }

/* subtitle look */
.look { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.look-preview {
  display: grid; place-items: end center; aspect-ratio: 16 / 9; padding: 0 0.8rem 1rem; border-radius: 12px; overflow: hidden; text-align: center;
  background: linear-gradient(160deg, #3a4a5c, #1b222b 55%, #48392a);
}
.look-preview span { font-weight: 600; line-height: 1.28; color: var(--sub-color, #fff); padding: 0.06em 0.45em; border-radius: 0.25em;
  text-shadow: 0 0 2px #000, 0 0 6px rgba(0,0,0,0.9), 0 2px 3px rgba(0,0,0,0.9); font-size: 1.1rem; transition: font-size 0.2s; font-family: Inter, var(--sans); }
.look[data-size="s"] .look-preview span { font-size: 0.88rem; }
.look[data-size="l"] .look-preview span { font-size: 1.35rem; }
.look[data-size="xl"] .look-preview span { font-size: 1.65rem; }
.look[data-style="box"] .look-preview span { background: rgba(0,0,0,0.72); text-shadow: none; }
.look[data-style="outline"] .look-preview span { text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000, 0 -2px 0 #000, 0 2px 0 #000, -2px 0 0 #000, 2px 0 0 #000; }
.look[data-color="yellow"] { --sub-color: #ffe14d; }
.look[data-color="gold"] { --sub-color: #f3d79c; }
.look[data-color="cyan"] { --sub-color: #7fe3ff; }
.look[data-color="green"] { --sub-color: #9cf29a; }
.look[data-color="pink"] { --sub-color: #ffb3d1; }
.look-controls { display: grid; gap: 0.8rem; }
.look-row .label { margin-bottom: 0.4rem; }
.look-chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.swatch { width: 32px; height: 32px; border-radius: 8px; border: 1px solid rgba(17, 17, 24, 0.12); background: #fff; display: grid; place-items: center; padding: 0; cursor: pointer; }
.swatch i { width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18); }
.swatch.active { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }

/* ---- add-a-movie sheet ---- */
.sheet-layer {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 1.25rem;
  background: rgba(17, 17, 24, 0.34); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease both;
}
@keyframes fade-in { from { opacity: 0; } }
.sheet {
  width: min(100%, 38rem); max-height: calc(100svh - 2.5rem); overflow: auto; padding: 1.4rem 1.5rem 1.2rem; border-radius: 20px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: sheet-in 0.28s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.sheet-head h2 { font-size: 2rem; margin-top: 0.25rem; }
.icon-close { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; }
.icon-close:hover { background: #f3f4f7; }
.icon-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.drops { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0.8rem; margin-bottom: 1rem; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0.25rem;
  min-height: 9rem; padding: 1rem; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed rgba(17, 17, 24, 0.16); background: #fafbfc; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.drop:hover, .drop.over { border-color: #3b82f6; background: #f5f8ff; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1); }
.drop.has { border-style: solid; border-color: #9dbcfb; background: #f5f8ff; }
.drop-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #eef4ff; color: #2563eb; margin-bottom: 0.4rem; }
.drop-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.drop strong { font-weight: 700; font-size: 0.9rem; word-break: break-all; }
.drop span:not(.drop-icon) { font-size: 0.76rem; color: var(--muted); }
.poster-pick { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; align-items: center; margin-bottom: 1rem; padding: 0.75rem; border-radius: 14px; background: #fafbfc; border: 1px solid var(--line); }
.poster-pick img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #000; }
.poster-pick .hint { margin: 0 0 0.6rem; }
.stack { display: block; margin-bottom: 0.9rem; }
.progress { margin: 0.2rem 0 0.4rem; }
.progress-bar, .dock-bar { height: 8px; border-radius: 8px; background: #e6e8ee; overflow: hidden; }
.progress-bar div, .dock-bar div { height: 100%; width: 0; background: linear-gradient(90deg, #60a5fa, #2563eb); transition: width 0.3s; }
.progress-text { display: flex; justify-content: space-between; margin-top: 0.5rem; font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.progress-text span:first-child { color: #1d4ed8; font-weight: 700; }
#formatNote:empty { display: none; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sheet-foot .hint { margin: 0; }
body.admin .sheet-foot .btn { min-width: 8.5rem; }

/* upload dock */
.dock {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 120; width: 19rem; padding: 0.9rem 1rem; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: sheet-in 0.25s both;
}
.dock-row { display: flex; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.55rem; font-size: 0.84rem; }
.dock-row strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-row span { color: #1d4ed8; font-weight: 700; font-variant-numeric: tabular-nums; }
.dock-detail { display: block; margin-top: 0.45rem; font-size: 0.72rem; color: var(--muted); }

/* ---- confirmation modal ---- */
.modal-layer {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 1.25rem;
  background: rgba(17, 17, 24, 0.38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.2s ease;
}
.modal-layer.open { opacity: 1; }
.modal {
  width: min(100%, 26rem); padding: 1.6rem 1.6rem 1.3rem; border-radius: 20px; text-align: center; overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(0.97); transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
}
.modal-layer.open .modal { transform: none; }
.modal-poster { display: block; width: calc(100% + 3.2rem); margin: -1.6rem -1.6rem 1.2rem; aspect-ratio: 16 / 6; object-fit: cover; filter: saturate(0.85); }
.modal-icon { width: 52px; height: 52px; margin: 0 auto 0.9rem; border-radius: 50%; display: grid; place-items: center; background: #eef4ff; color: #2563eb; }
.modal.danger .modal-icon { background: #fdf0ed; color: var(--danger); box-shadow: 0 0 0 6px #fdf6f4; }
.modal-poster + .modal-icon { margin-top: -2.9rem; position: relative; border: 3px solid #fff; }
.modal-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.modal h3 { font-size: 1.8rem; margin: 0 0 0.45rem; }
.modal p { margin: 0 0 1.4rem; font-size: 0.88rem; line-height: 1.55; color: var(--muted); }
.modal p b { color: var(--text); font-weight: 600; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
body.admin .btn.btn-danger {
  background: linear-gradient(180deg, #e5584a, #c43a2c); color: #fff; border-color: #b23426;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(120, 30, 20, 0.3), 0 6px 16px -6px rgba(196, 58, 44, 0.6);
}
body.admin .btn.btn-danger:hover { background: linear-gradient(180deg, #ea6658, #cc4436); }

/* ---- responsive ---- */
@media (max-width: 1180px) { .workspace { grid-template-columns: minmax(16rem, 21rem) minmax(0, 1fr); } .hero { grid-template-columns: 11rem minmax(0, 1fr); } .look { grid-template-columns: 1fr; } }
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.8rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav { flex-direction: row; flex-wrap: wrap; } .nav-label { display: none; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .storage { min-width: 14rem; }
  .workspace { grid-template-columns: 1fr; }
  .list { max-height: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .setting { grid-template-columns: 1fr; }
  .new-code { grid-template-columns: 1fr; }
  .drops, .poster-pick { grid-template-columns: 1fr; }
  .sheet-foot { flex-direction: column; align-items: stretch; }
}
.lang-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0 0.3rem 0 0.65rem; }
.lang-row .label { margin: 0; }

/* headings and numbers: the same family, heavier and slightly tighter */
body.admin h1, body.admin h2, body.admin h3, .brand strong, .stat strong, .lib-title, .hero h2,
.lib-thumb .placeholder, .hero-art .placeholder, .cal-head strong { font-weight: 700; letter-spacing: -0.025em; }
.page-head h1 { font-size: clamp(1.9rem, 2.6vw, 2.35rem); }
.brand strong { font-size: 1rem; }
.stat strong { font-size: 1.75rem; letter-spacing: -0.03em; }
.list-head h2 { font-size: 1rem; }
.lib-title { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
.hero h2 { font-size: 1.75rem; }
.empty h3 { font-size: 1.25rem; }
.sheet-head h2 { font-size: 1.5rem; }
.modal h3 { font-size: 1.3rem; }
.login-card h1 { font-size: 1.7rem; }
.section h4, .setting h4 { letter-spacing: -0.01em; }
/* language picker beside "Add movie": same height and shape as the buttons */
body.admin .page-actions .lang-btn {
  height: var(--h); padding: 0 0.8rem; border-radius: var(--r); background: #fff; border: 1px solid rgba(17, 17, 24, 0.12);
  box-shadow: 0 1px 2px rgba(17, 17, 24, 0.05); font-size: 0.86rem; color: var(--ink);
}
body.admin .page-actions .lang-btn:hover { background: #f9fafb; border-color: rgba(17, 17, 24, 0.2); }

/* =====================================================================
   Sign in: a dark brand panel beside the form
   ===================================================================== */
.login { background: radial-gradient(70% 60% at 30% 0%, #eaf0ff, var(--page) 65%); }
.login-shell {
  width: min(100%, 58rem); min-height: 34rem; display: grid; grid-template-columns: 1.05fr 1fr; border-radius: 24px; overflow: hidden;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(17, 17, 24, 0.04), 0 40px 90px -40px rgba(17, 17, 24, 0.45);
  animation: sheet-in 0.5s cubic-bezier(.2,.8,.2,1) both;
}
.login-side {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 2rem 2.2rem;
  background: radial-gradient(90% 70% at 50% 0%, #1d2740, #0b0f1a 70%); color: #e8ecf6;
}
.login-beam {
  position: absolute; inset: 0; pointer-events: none;
  background: conic-gradient(from 155deg at 50% -5%, transparent 0deg, rgba(143, 180, 255, 0.12) 14deg, rgba(190, 212, 255, 0.24) 25deg, rgba(143, 180, 255, 0.12) 36deg, transparent 50deg);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%); mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.login-side::after {
  content: ''; position: absolute; inset: 0; opacity: 0.08; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.login-side > * { position: relative; z-index: 1; }
.brand.light { padding: 0; }
.brand.light strong { color: #fff; }
.brand.light span { color: #9aa7c4; }
.brand.light .brand-mark { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14); }
body.admin .login-pitch h2 { color: #fff; font-size: 2rem; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 1.2rem; font-weight: 700; }
.login-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.login-pitch li { display: flex; align-items: center; gap: 0.65rem; font-size: 0.9rem; color: #c9d2e6; }
.login-pitch li svg { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: rgba(96, 165, 250, 0.18); fill: none; stroke: #8fb4ff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.login-foot { margin: 0; font-size: 0.68rem; letter-spacing: 0.22em; text-transform: uppercase; color: #6f7c99; }

.login-form { display: flex; flex-direction: column; padding: 1.4rem 2.4rem 2rem; }
.login-top { display: flex; justify-content: flex-end; }
.login-body { margin: auto 0; display: flex; flex-direction: column; }
.login-body .eyebrow { margin-bottom: 0.5rem; }
body.admin .login-body h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.login-body > .muted { margin: 0.4rem 0 1.6rem; font-size: 0.9rem; }
.pw { position: relative; display: block; }
.pw-lock { position: absolute; left: 0.85rem; top: 50%; width: 17px; height: 17px; margin-top: -8.5px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
body.admin .pw .field { height: 46px; padding: 0 2.9rem 0 2.5rem; font-size: 0.95rem; }
.pw-toggle {
  position: absolute; right: 0.35rem; top: 50%; width: 36px; height: 36px; margin-top: -18px; border: 0; border-radius: 8px; background: none;
  display: grid; place-items: center; color: var(--muted); cursor: pointer;
}
.pw-toggle:hover { background: #f3f4f7; color: var(--ink); }
.pw-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; }
.pw-toggle .i-hide, .pw-toggle.on .i-show { display: none; }
.pw-toggle.on .i-hide { display: block; }
.login-error { min-height: 1.3em; margin: 0.15rem 0 0.7rem; font-size: 0.83rem; font-weight: 500; color: var(--danger); }
.login-form.bad .pw .field { border-color: rgba(196, 58, 44, 0.6); box-shadow: 0 0 0 4px rgba(196, 58, 44, 0.12); }
.login-form.bad .pw { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
body.admin .login-submit { height: 46px; width: 100%; font-size: 0.92rem; }
.login-submit .spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.login-submit.busy .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-note { display: flex; align-items: center; gap: 0.45rem; margin: 1.1rem 0 0; font-size: 0.75rem; color: var(--muted); }
.login-note svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--ok); stroke-width: 1.9; stroke-linejoin: round; }
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; min-height: 0; }
  .login-side { padding: 1.4rem 1.6rem; gap: 1.4rem; }
  .login-pitch ul, .login-foot { display: none; }
  body.admin .login-pitch h2 { font-size: 1.4rem; margin: 0; }
  .login-form { padding: 1.2rem 1.6rem 1.8rem; }
}

/* subtitle file item */
.section h4 .count { margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: #eef4ff; color: #1d4ed8; font-size: 0.72rem; font-weight: 700; vertical-align: middle; }
.file-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0.9rem; align-items: center; padding: 0.75rem 0.85rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.file-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #eef4ff; color: #2563eb; }
.file-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.file-text { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.file-text b { font-size: 0.9rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-text small { font-size: 0.76rem; color: var(--muted); }
.file-btns { display: flex; gap: 0.4rem; }
@media (max-width: 640px) { .file-item { grid-template-columns: auto minmax(0, 1fr); } .file-btns { grid-column: 1 / -1; } }

/* one card, one row: the movie on the left, its tabs on the right */
.detail { display: grid; grid-template-columns: minmax(15rem, 18.5rem) minmax(0, 1fr); align-items: stretch; }
.detail > .hero { grid-template-columns: 1fr; align-content: start; gap: 1rem; padding: 1.1rem; border-bottom: 0; border-right: 1px solid var(--line); background: linear-gradient(180deg, #fafbfc, #fff 60%); }
.detail > .hero h2 { font-size: 1.45rem; }
.detail > .hero .meta { margin: 0.5rem 0 0.9rem; }
.detail > .hero .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
.detail > .hero .hero-actions .btn.primary { grid-column: 1 / -1; }
.detail-main { min-width: 0; }
.detail-main .tabs { padding-top: 0.3rem; }
.detail > .panel-body { grid-column: 1 / -1; }
@media (max-width: 1180px) { .detail { grid-template-columns: 1fr; } .detail > .hero { grid-template-columns: 11rem minmax(0, 1fr); border-right: 0; border-bottom: 1px solid var(--line); } .detail > .hero .hero-actions { display: flex; } }
@media (max-width: 640px) { .detail > .hero { grid-template-columns: 1fr; } }
.sheet-btns { display: flex; gap: 0.5rem; }
.dock-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 0.45rem; }
.dock-foot .dock-detail { margin: 0; }

/* code rows: device limit beside the actions */
body.admin .small-select { height: var(--h-sm); min-width: 8.5rem; font-size: 0.8rem; padding: 0 0.6rem; border-radius: 8px; }

/* subtitles tab: file and timing in one row; a smaller look preview */
.subs-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.subs-row > .section + .section { margin-top: 0; padding-top: 0; border-top: 0; padding-left: 1.4rem; border-left: 1px solid var(--line); }
.subs-row + .look-section { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.look-section .look { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); }
.look-section .look-preview { aspect-ratio: 16 / 8; }
@media (max-width: 900px) {
  .subs-row { grid-template-columns: 1fr; }
  .subs-row > .section + .section { padding-left: 0; border-left: 0; padding-top: 1.2rem; border-top: 1px solid var(--line); }
  .look-section .look { grid-template-columns: 1fr; }
}
body.admin .code-btns .small-select { width: auto; flex: none; min-width: 9.5rem; }
.code-btns { align-items: center; }
