/* Shared components. Loaded after base.css; admin.css / client.css add layout. */

/* ── buttons ─────────────────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 40px; padding: 0 var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--text-sm); font-weight: 500; letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-base);
  user-select: none;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset; }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); box-shadow: var(--glow-accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-outline { background: transparent; }
.btn-danger { background: var(--danger-dim); border-color: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--success-dim); border-color: transparent; color: var(--success); }
.btn-success:hover { background: var(--success); color: #0C0C0D; }
.btn-link { height: auto; padding: 0; background: none; border: 0; color: var(--text-muted); font-weight: 500; }
.btn-link:hover { color: var(--text); background: none; text-decoration: underline; text-underline-offset: 3px; }
.btn-sm { height: 32px; padding: 0 var(--s-3); font-size: var(--text-xs); border-radius: var(--r-sm); }
.btn-lg { height: 48px; padding: 0 var(--s-6); font-size: var(--text-base); border-radius: var(--r-lg); }
.btn-full { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-md); }
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn .spinner { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-text { display: inline-flex; align-items: center; gap: var(--s-2); }
.btn.loading .btn-text { visibility: hidden; }
.btn.loading .spinner { display: block; position: absolute; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── forms ───────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--s-2); }
.form-label { font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-dim); }
.form-label .req { color: var(--accent); }
.form-hint { font-size: var(--text-sm); color: var(--text-dim); }
.field-error { font-size: var(--text-sm); color: var(--danger); }
.inp {
  width: 100%; height: 42px; padding: 0 var(--s-4);
  background: var(--bg-2); color: var(--text);
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.inp::placeholder { color: var(--text-faint); }
.inp:hover { border-color: var(--border-3); }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); background: var(--bg-3); }
.inp:disabled, .inp[readonly] { opacity: .6; }
.inp.is-invalid { border-color: var(--danger); }
.inp-lg { height: 52px; font-size: var(--text-lg); border-radius: var(--r-lg); }
textarea.inp { height: auto; min-height: 96px; padding: var(--s-3) var(--s-4); resize: none; overflow-y: hidden; line-height: 1.5; }
textarea.inp.is-capped { overflow-y: auto; }
select.inp { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23FCF7F1' stroke-opacity='.5' stroke-width='1.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.inp-group { display: flex; }
.inp-group .inp { border-radius: var(--r-md) 0 0 var(--r-md); }
.inp-group .btn { border-radius: 0 var(--r-md) var(--r-md) 0; margin-left: -1px; height: 42px; }
.inp-prefix { display: flex; align-items: center; padding: 0 var(--s-3); background: var(--surface-2); border: 1px solid var(--border-2); border-right: 0; border-radius: var(--r-md) 0 0 var(--r-md); color: var(--text-dim); font-size: var(--text-sm); white-space: nowrap; }
.inp-prefix + .inp { border-radius: 0 var(--r-md) var(--r-md) 0; }
.check { display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; font-size: var(--text-sm); color: var(--text-muted); }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 40px; height: 22px; border-radius: var(--r-pill); background: var(--surface-3); border: 1px solid var(--border-2); position: relative; transition: background var(--t-base), border-color var(--t-base); flex: none; }
.switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: transform var(--t-base), background var(--t-base); }
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--on-accent); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }
.switch-label { font-size: var(--text-sm); }

/* OTP boxes */
.otp { display: flex; gap: var(--s-2); }
.otp-box {
  flex: 1 1 0; min-width: 0; height: 60px; text-align: center;
  font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--r-lg); color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  caret-color: var(--accent);
}
.otp-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); background: var(--bg-3); }
.otp-box.filled { border-color: var(--border-3); }
.otp.is-error .otp-box { border-color: var(--danger); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ── surfaces ────────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.card-pad { padding: var(--s-5); }
.card-hover { transition: border-color var(--t-base), background var(--t-base), transform var(--t-base); }
.card-hover:hover { border-color: var(--border-3); background: var(--surface-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.card-title { font-size: var(--text-sm); font-weight: 600; }
.card-body { padding: var(--s-5); }
.card-accent { border-left: 2px solid var(--accent); }
.section-title { font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-dim); margin-bottom: var(--s-3); }
.section { margin-bottom: var(--s-10); }
.divider { border-top: 1px solid var(--border); }

/* banners */
.banner { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); font-size: var(--text-sm); }
.banner svg { flex: none; margin-top: 2px; }
.banner-error { background: var(--danger-dim); border-color: rgba(224,68,68,.3); color: var(--text); }
.banner-error svg { color: var(--danger); }
.banner-success { background: var(--success-dim); border-color: rgba(76,175,123,.3); }
.banner-success svg { color: var(--success); }
.banner-warning { background: var(--warning-dim); border-color: rgba(212,160,23,.3); }
.banner-warning svg { color: var(--warning); }
.banner-info { background: var(--info-dim); border-color: rgba(126,179,255,.3); }
.banner-info svg { color: var(--info); }
.banner-accent { background: var(--accent-dim); border-color: rgba(197,106,45,.35); }
.banner-accent svg { color: var(--accent); }
.banner .grow { flex: 1; }

/* ── badges & pills ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); font-size: var(--text-xs); font-weight: 500; letter-spacing: 0.02em;
  background: var(--surface-3); color: var(--text-muted); white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge-plain::before { display: none; }
.badge-accent { background: var(--accent-dim); color: var(--accent-hi); }
.badge-success { background: var(--success-dim); color: var(--success); }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-danger { background: var(--danger-dim); color: var(--danger); }
.badge-info { background: var(--info-dim); color: var(--info); }
.badge-muted { background: var(--surface-2); color: var(--text-dim); }
/* stages */
.stage-pre_production  { background: var(--surface-3); color: var(--text-muted); }
.stage-production      { background: var(--info-dim); color: var(--info); }
.stage-post_production { background: rgba(196,165,255,.14); color: #C4A5FF; }
.stage-review          { background: var(--accent-dim); color: var(--accent-hi); }
.stage-revisions       { background: var(--warning-dim); color: var(--warning); }
.stage-delivered       { background: var(--success-dim); color: var(--success); }
.stage-complete        { background: var(--success-dim); color: var(--success); }
/* review */
.review-none              { background: var(--surface-2); color: var(--text-dim); }
.review-awaiting          { background: var(--accent-dim); color: var(--accent-hi); }
.review-approved          { background: var(--success-dim); color: var(--success); }
.review-changes_requested { background: var(--warning-dim); color: var(--warning); }
/* encode */
.encode-uploading, .encode-processing { background: var(--info-dim); color: var(--info); }
.encode-processing::before { animation: pulse 1.2s ease-in-out infinite; }
.encode-ready  { background: var(--success-dim); color: var(--success); }
.encode-failed { background: var(--danger-dim); color: var(--danger); }
@keyframes pulse { 50% { opacity: .3; } }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--border-2); font-size: var(--text-xs); color: var(--text-muted); background: var(--surface); }
.pill.active { border-color: var(--accent); color: var(--accent-hi); background: var(--accent-dim); }
.pill-btn { cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast); }
.pill-btn:hover { border-color: var(--border-3); color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); display: inline-block; }
.dot-accent { background: var(--accent); }
.dot-success { background: var(--success); }
.dot-warning { background: var(--warning); }
.dot-danger { background: var(--danger); }

/* ── avatars ─────────────────────────────────────────────────────────────── */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 600; letter-spacing: .02em; flex: none; border: 1px solid var(--border); }
.avatar-sm { width: 26px; height: 26px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.avatar-xl { width: 64px; height: 64px; font-size: 22px; }
.avatar-accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--bg); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ── tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-3); margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; transition: color var(--t-fast), border-color var(--t-fast); }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { font-size: var(--text-xs); color: var(--text-dim); background: var(--surface-2); padding: 1px 7px; border-radius: var(--r-pill); }
.tab .count-accent { background: var(--accent); color: var(--on-accent); }

/* ── tables ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { text-align: left; font-weight: 500; font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-dim); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tr.row-link { cursor: pointer; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { opacity: .55; }
.table tr:hover .actions .btn { opacity: 1; }

/* ── empty / skeleton ────────────────────────────────────────────────────── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-2); padding: var(--s-16) var(--s-6); color: var(--text-dim); border: 1px dashed var(--border-2); border-radius: var(--r-lg); }
.empty svg { width: 28px; height: 28px; margin-bottom: var(--s-2); color: var(--text-faint); }
.empty-title { color: var(--text-muted); font-weight: 500; }
.empty-sub { font-size: var(--text-sm); max-width: 340px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-3) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── toasts ──────────────────────────────────────────────────────────────── */
.toast-stack { position: fixed; bottom: calc(var(--s-6) + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--s-2); z-index: var(--z-toast); pointer-events: none; width: min(420px, calc(100vw - 32px)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); background: #1C1C1F; border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-2); font-size: var(--text-sm); animation: toast-in var(--t-base) both; }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); flex: none; }
.toast-success::before { background: var(--success); }
.toast-error::before { background: var(--danger); }
.toast-out { animation: toast-out var(--t-base) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ── modal (native: toggle the [hidden] attribute) ───────────────────────── */
.modal { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: var(--s-4); }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(6px); animation: fade var(--t-base) both; }
.modal-box { position: relative; width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow: auto; background: #131315; border: 1px solid var(--border-2); border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: var(--s-6); animation: rise var(--t-base) both; }
.modal-box-lg { max-width: 720px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.modal-title { font-size: var(--text-lg); font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-6); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* ── drawer (side panel) ─────────────────────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: var(--z-drawer); }
.drawer[hidden] { display: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); animation: fade var(--t-base) both; }
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: #131315; border-left: 1px solid var(--border-2); box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: slide-in var(--t-base) both; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border); }
.drawer-body { padding: var(--s-5); overflow: auto; flex: 1; }
.drawer-foot { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--s-2); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } }

/* ── dropdown menu ───────────────────────────────────────────────────────── */
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: #17171A; border: 1px solid var(--border-2); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: var(--s-1); z-index: 20; animation: rise var(--t-fast) both; }
.menu-list[hidden] { display: none; }
.menu-item { display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); font-size: var(--text-sm); color: var(--text-muted); text-align: left; }
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item.danger { color: var(--danger); }
.menu-sep { border-top: 1px solid var(--border); margin: var(--s-1) 0; }

/* ── page header ─────────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-8); flex-wrap: wrap; }
.page-head .display { font-size: var(--text-3xl); }
.page-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-sm); color: var(--text-dim); margin-bottom: var(--s-3); }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 14px; height: 14px; }

/* ── stat tiles ──────────────────────────────────────────────────────────── */
.stat { padding: var(--s-5); }
.stat-num { font-family: var(--font-display); font-size: 40px; line-height: 1; letter-spacing: -0.02em; margin-top: var(--s-2); }
.stat-label { font-size: var(--text-xs); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-dim); }
.stat-sub { font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--s-2); }

/* ── stepper (project stage) ─────────────────────────────────────────────── */
.stepper { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s-1); }
.step { display: flex; flex-direction: column; gap: var(--s-2); }
.step-bar { height: 3px; border-radius: 2px; background: var(--surface-3); transition: background var(--t-base); }
.step.done .step-bar { background: var(--text-dim); }
.step.active .step-bar { background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.step-label { font-size: var(--text-xs); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.done .step-label { color: var(--text-dim); }
.step.active .step-label { color: var(--text); }
@media (max-width: 640px) { .step-label { display: none; } .step.active .step-label { display: block; } }

/* ── media tiles ─────────────────────────────────────────────────────────── */
.thumb { position: relative; aspect-ratio: 16 / 9; background: var(--bg-3); border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-faint); }
.thumb-ph svg { width: 28px; height: 28px; }
.thumb-dur { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: var(--r-sm); background: rgba(0,0,0,.7); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--t-base); background: rgba(0,0,0,.25); }
.thumb-play span { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; color: var(--on-accent); box-shadow: var(--glow-accent); }
.thumb-play svg { margin-left: 3px; }
a:hover .thumb-play, .tile:hover .thumb-play { opacity: 1; }
.tile { display: block; }
.tile-title { font-weight: 500; margin-top: var(--s-3); }
.tile-meta { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-xs); color: var(--text-dim); margin-top: var(--s-1); flex-wrap: wrap; }
.file-tile { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.file-icon { width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex: none; }
.progress { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width var(--t-base); }

/* ── player ──────────────────────────────────────────────────────────────── */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-3); user-select: none; -webkit-user-select: none; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.player-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); color: var(--text-muted); text-align: center; padding: var(--s-6); }
.player-msg svg { width: 32px; height: 32px; color: var(--text-faint); }
.player:fullscreen, .player:-webkit-full-screen { border-radius: 0; border: 0; aspect-ratio: auto; width: 100%; height: 100%; }

/* centre play button, shown until the first play */
.pl-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); box-shadow: var(--glow-accent); transition: transform var(--t-fast), opacity var(--t-base), background var(--t-fast); z-index: 3; }
.pl-big svg { margin-left: 4px; }
.pl-big:hover { transform: translate(-50%, -50%) scale(1.06); background: var(--accent-hi); }
.player.is-started .pl-big { opacity: 0; pointer-events: none; }

.pl-spinner { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border: 2px solid rgba(252,247,241,.25); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; opacity: 0; pointer-events: none; transition: opacity var(--t-base); z-index: 2; }
.player.is-waiting .pl-spinner, .pl-spinner.is-on { opacity: 1; }
.player-msg .pl-spinner { position: static; margin: 0; }

/* control bar */
.pl-controls { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 10px; background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.35) 60%, transparent); z-index: 4; transition: opacity var(--t-slow), transform var(--t-slow); }
.player.is-idle .pl-controls { opacity: 0; transform: translateY(6px); pointer-events: none; }
.player.is-idle { cursor: none; }
.player:not(.is-started) .pl-controls { opacity: 0; pointer-events: none; }

.pl-bar { display: flex; align-items: center; gap: 4px; }
.pl-spacer { flex: 1; }
.pl-btn { height: 34px; min-width: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-md); color: var(--text); opacity: .88; transition: opacity var(--t-fast), background var(--t-fast); }
.pl-btn:hover, .pl-btn[aria-expanded="true"] { opacity: 1; background: rgba(252,247,241,.12); }
.pl-text { font-size: var(--text-xs); font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.pl-i-pause, .pl-i-mute { display: none; }
.player.is-playing .pl-i-play { display: none; }
.player.is-playing .pl-i-pause { display: inline-flex; }
.player.is-muted .pl-i-vol { display: none; }
.player.is-muted .pl-i-mute { display: inline-flex; }
.pl-time { font-size: var(--text-xs); font-variant-numeric: tabular-nums; color: rgba(252,247,241,.85); padding: 0 6px; white-space: nowrap; }
.pl-time-sep { opacity: .5; }

/* volume */
.pl-vol { display: flex; align-items: center; }
.pl-vol-range { width: 0; opacity: 0; transition: width var(--t-base), opacity var(--t-base); accent-color: var(--accent); height: 4px; cursor: pointer; }
.pl-vol:hover .pl-vol-range, .pl-vol-range:focus { width: 76px; opacity: 1; margin-right: 6px; }

/* scrub bar */
.pl-scrub { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; margin-bottom: 4px; touch-action: none; }
.pl-rail { position: relative; width: 100%; height: 4px; border-radius: 2px; background: rgba(252,247,241,.22); overflow: visible; transition: height var(--t-fast); }
.pl-scrub:hover .pl-rail, .player.is-scrubbing .pl-rail { height: 6px; }
.pl-buffer, .pl-progress { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; width: 0; }
.pl-buffer { background: rgba(252,247,241,.35); }
.pl-progress { background: var(--accent); }
.pl-handle { position: absolute; right: -7px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--accent); transform: scale(0); transition: transform var(--t-fast); }
.pl-scrub:hover .pl-handle, .player.is-scrubbing .pl-handle { transform: scale(1); }
.pl-hover { position: absolute; bottom: 22px; transform: translateX(-50%); padding: 3px 7px; border-radius: var(--r-sm); background: rgba(12,12,13,.92); border: 1px solid var(--border-2); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity var(--t-fast); }
.pl-scrub:hover .pl-hover { opacity: 1; }

/* note markers */
.pl-marker { position: absolute; top: 50%; width: 12px; height: 18px; margin: -9px 0 0 -6px; display: flex; align-items: center; justify-content: center; z-index: 2; }
.pl-marker::before { content: ''; width: 4px; height: 12px; border-radius: 2px; background: var(--text); box-shadow: 0 0 0 2px rgba(0,0,0,.6); transition: transform var(--t-fast), background var(--t-fast); }
.pl-marker.is-resolved::before { background: rgba(252,247,241,.4); }
.pl-marker:hover::before { transform: scaleY(1.35); background: var(--accent-hi); }
.pl-tip { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 260px; padding: 6px 9px; border-radius: var(--r-md); background: rgba(12,12,13,.95); border: 1px solid var(--border-2); font-size: 12px; line-height: 1.35; color: var(--text); text-align: left; white-space: normal; opacity: 0; pointer-events: none; transition: opacity var(--t-fast); }
.pl-marker:hover .pl-tip, .pl-marker:focus-visible .pl-tip { opacity: 1; }
.pl-scrub:has(.pl-marker:hover) .pl-hover { opacity: 0; }

/* menus */
.pl-menu-wrap { position: relative; }
.pl-menu { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 140px; padding: 4px; border-radius: var(--r-md); background: rgba(18,18,20,.97); border: 1px solid var(--border-2); box-shadow: var(--shadow-2); z-index: 5; }
.pl-menu[hidden] { display: none; }
.pl-menu-title { padding: 6px 10px 4px; font-size: 10px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-dim); }
.pl-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 7px 10px; border-radius: var(--r-sm); font-size: var(--text-sm); color: var(--text-muted); text-align: left; }
.pl-opt:hover { background: var(--surface-3); color: var(--text); }
.pl-opt.active { color: var(--text); }
.pl-opt.active::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pl-opt small { color: var(--text-dim); font-size: 11px; }

/* right-click menu (replaces the browser's, so native controls can't be turned on) */
.pl-ctx { position: absolute; z-index: 8; min-width: 210px; padding: 4px; border-radius: var(--r-md); background: rgba(18,18,20,.97); border: 1px solid var(--border-2); box-shadow: var(--shadow-3); backdrop-filter: blur(8px); animation: rise var(--t-fast) both; }
.pl-ctx[hidden] { display: none; }
.pl-ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm); font-size: var(--text-sm); color: var(--text-muted); text-align: left; }
.pl-ctx-item:hover, .pl-ctx-item:focus-visible { background: var(--surface-3); color: var(--text); outline: none; }
.pl-ctx-item svg { flex: none; opacity: .8; }
.pl-ctx-label { flex: 1; }
.pl-ctx-check { display: none; color: var(--accent); }
.pl-ctx-item[aria-checked="true"] .pl-ctx-check { display: inline-flex; }
.pl-ctx-item .pl-i-pause { display: none; }
.player.is-playing .pl-ctx-item .pl-i-play { display: none; }
.player.is-playing .pl-ctx-item .pl-i-pause { display: inline-flex; }
.pl-ctx-sep { height: 1px; margin: 4px 6px; background: var(--border); }
.pl-ctx-foot { padding: 6px 10px 4px; font-size: 10px; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-faint); }

@media (hover: none) and (pointer: coarse) {
  .pl-vol-range { display: none; }
  .pl-btn { height: 40px; min-width: 40px; }
  .pl-scrub { height: 26px; }
  .pl-handle { transform: scale(1); }
}
@media (max-width: 520px) {
  .pl-controls { padding: 22px 8px 6px; }
  .pl-big { width: 60px; height: 60px; }
}

/* ── comments / messages ─────────────────────────────────────────────────── */
.thread { display: flex; flex-direction: column; gap: var(--s-4); }
.msg { display: flex; gap: var(--s-3); }
.msg-body { flex: 1; min-width: 0; }
.msg-meta { display: flex; align-items: center; gap: var(--s-2); font-size: var(--text-xs); color: var(--text-dim); margin-bottom: 4px; flex-wrap: wrap; }
.msg-author { color: var(--text); font-weight: 500; font-size: var(--text-sm); }
.msg-text { white-space: pre-wrap; word-break: break-word; color: var(--text-muted); }
.msg.mine .msg-text { color: var(--text); }
.msg.studio .avatar { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tc { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: var(--r-sm); background: var(--accent-dim); color: var(--accent-hi); font-size: var(--text-xs); font-variant-numeric: tabular-nums; cursor: pointer; }
.tc:hover { background: var(--accent); color: var(--on-accent); }
.msg.resolved { opacity: .5; }
.msg.is-flash { animation: note-flash 1.6s ease; border-radius: var(--r-md); }
@keyframes note-flash { 0%, 40% { background: var(--accent-dim); box-shadow: 0 0 0 6px var(--accent-dim); } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }
.composer { display: flex; flex-direction: column; gap: var(--s-2); }
.composer .inp { min-height: 72px; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; }
.composer-bar > .btn, .composer-bar > .row-sm { margin-left: auto; }

/* ── misc ────────────────────────────────────────────────────────────────── */
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 4px; color: var(--text-muted); background: var(--surface); }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item.link { transition: background var(--t-fast); border-radius: var(--r-md); padding-left: var(--s-2); padding-right: var(--s-2); margin: 0 calc(-1 * var(--s-2)); }
.list-item.link:hover { background: var(--surface-2); }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--border-2); }
.tl-item { position: relative; padding: var(--s-2) 0; font-size: var(--text-sm); }
.tl-item::before { content: ''; position: absolute; left: -19px; top: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); border: 2px solid var(--bg); }
.tl-item.accent::before { background: var(--accent); }
.tl-time { color: var(--text-dim); font-size: var(--text-xs); margin-left: var(--s-2); }
.copy-field { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); background: var(--bg-2); border: 1px solid var(--border-2); border-radius: var(--r-md); font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-muted); }
.copy-field span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); width: 16px; height: 16px; pointer-events: none; }
.search .inp { padding-left: 38px; }
.notice-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ── auth layout ─────────────────────────────────────────────────────────── */
.layout-auth { display: flex; flex-direction: column; min-height: 100dvh; }
.auth-bg { position: fixed; inset: 0; pointer-events: none; background:
  radial-gradient(60% 50% at 70% -10%, rgba(197,106,45,.18), transparent 60%),
  radial-gradient(40% 40% at 10% 100%, rgba(252,247,241,.04), transparent 60%); }
.auth-wrap { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--s-8) var(--s-4); gap: var(--s-6); }
.auth-card { width: 100%; max-width: 420px; background: rgba(18,18,20,.8); backdrop-filter: blur(12px); border: 1px solid var(--border-2); border-radius: var(--r-xl); padding: var(--s-8); box-shadow: var(--shadow-3); animation: rise var(--t-slow) both; }
.auth-head { margin-bottom: var(--s-6); }
.auth-head .display { margin: 0; }
.auth-head .eyebrow { margin: var(--s-2) 0 var(--s-4); }
.auth-head .muted { font-size: var(--text-sm); }
.auth-card .banner { margin-bottom: var(--s-4); }
.auth-links { display: flex; justify-content: center; gap: var(--s-5); margin-top: var(--s-6); font-size: var(--text-sm); }
.auth-foot { font-size: var(--text-xs); color: var(--text-faint); }
.auth-foot a:hover { color: var(--text-muted); }
.choose-item { display: flex; align-items: center; gap: var(--s-3); width: 100%; padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); text-align: left; transition: border-color var(--t-fast), background var(--t-fast); }
.choose-item:hover { border-color: var(--accent); background: var(--surface-2); }
.choose-item svg { margin-left: auto; color: var(--text-dim); }
.choose-text { display: flex; flex-direction: column; }
.choose-name { font-weight: 500; }
@media (max-width: 480px) { .auth-card { padding: var(--s-6); border-radius: var(--r-lg); } .otp-box { height: 52px; font-size: 22px; } }
