:root {
  --bg: #0d0f13;
  --bg-2: #13161c;
  --surface: #181c23;
  --surface-2: #1f242d;
  --surface-3: #282e39;
  --line: #2a303b;
  --line-2: #363d4a;
  --text: #f1f3f6;
  --text-2: #b4bac5;
  --muted: #868e9c;
  --accent: #ff6b3d;
  --accent-2: #ff8a63;
  --accent-ink: #1a0b05;
  --review: #5aa2ff;
  --changes: #ffb020;
  --approved: #34d27b;
  --danger: #ff5a5f;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --topbar: 56px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 620; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.spacer { flex: 1; }
.icon { flex-shrink: 0; display: block; }
#app { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 560; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { background: var(--surface-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }
.btn-success { background: var(--approved); border-color: var(--approved); color: #04170b; }
.btn-success:hover:not(:disabled) { background: #4fe08f; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-icon { padding: 0; width: 36px; }
.btn-sm.btn-icon { width: 30px; }
.icon-btn { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--text-2); padding: 6px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { border: 0; background: none; color: var(--accent); padding: 0; display: inline-flex; align-items: center; gap: 4px; font-weight: 560; }
.link-btn:hover { text-decoration: underline; }
input:not([type=checkbox]):not([type=range]), select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 11px; outline: none;
  transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 107, 61, .18); }
textarea { resize: vertical; }
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 560; color: var(--text-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 0; }
.form-error:empty { display: none; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; }
.section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 2px; font-weight: 600; }

/* ---------- avatar, pills ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #111; flex-shrink: 0; letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.pending { background: var(--surface-3); color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-review { color: var(--review); background: rgba(90, 162, 255, .13); }
.st-changes { color: var(--changes); background: rgba(255, 176, 32, .13); }
.st-approved { color: var(--approved); background: rgba(52, 210, 123, .13); }
.pstatus { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 5px; text-transform: uppercase; letter-spacing: .04em; border: 0; }
.ps-active { color: var(--approved); background: rgba(52, 210, 123, .12); }
.ps-on_hold { color: var(--changes); background: rgba(255, 176, 32, .12); }
.ps-completed { color: var(--review); background: rgba(90, 162, 255, .12); }
.ps-archived { color: var(--muted); background: var(--surface-2); }
.pstatus.as-btn { cursor: pointer; }

/* ---------- topbar ---------- */
.topbar { height: var(--topbar); display: flex; align-items: center; gap: 18px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(13, 15, 19, .92);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.topbar.compact { height: 48px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 16.5px; letter-spacing: -.02em; }
.logo-mark { position: relative; width: 22px; height: 22px; display: inline-block; }
.logo-mark span { position: absolute; width: 11px; height: 11px; border: 3px solid var(--accent); border-radius: 2px; }
.logo-mark span:first-child { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.logo-mark span:last-child { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.topnav { display: flex; gap: 4px; }
.topnav a { padding: 6px 10px; border-radius: 6px; color: var(--text-2); font-weight: 550; }
.topnav a.active, .topnav a:hover { color: var(--text); background: var(--surface); }
.bell { position: relative; }
.badge { position: absolute; top: 0; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 750;
  display: flex; align-items: center; justify-content: center; }
.avatar-btn { border: 0; background: none; padding: 0; border-radius: 50%; }

/* ---------- menus, modals, toasts ---------- */
.menu { position: fixed; z-index: 100; min-width: 200px; max-width: min(360px, calc(100vw - 16px)); max-height: min(70vh, 560px); overflow: auto; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 5px; animation: pop .12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: 6px; color: var(--text); }
.menu-item:hover:not(:disabled) { background: var(--surface-2); }
.menu-item:disabled { opacity: 1; cursor: default; }
.menu-item.active { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--accent); }
.menu-item.danger { color: var(--danger); }
.menu-hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 0; }
.menu-header { padding: 8px 10px 4px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.emoji-menu { min-width: 0; display: grid; grid-template-columns: repeat(4, 40px); }
.emoji-menu .menu-item { justify-content: center; font-size: 19px; padding: 6px; }
.status-menu { min-width: 280px; }
.status-hist { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 2px 0; }
.hist-row { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.ver-item { display: flex; align-items: center; gap: 10px; width: 100%; }
.ver-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ver-meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overlay { position: fixed; inset: 0; background: rgba(5, 6, 9, .72); z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow: auto; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 460px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); }
.modal.wide { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 0 20px; }
.modal-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.toasts { position: fixed; z-index: 200; right: 16px; top: 64px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; width: min(400px, calc(100vw - 32px)); }
.toast { background: var(--surface-3); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 9px; box-shadow: var(--shadow); font-size: 13.5px; animation: pop .15s; transition: opacity .3s; max-width: 100%; }
.toast-success { border-color: rgba(52, 210, 123, .5); }
.toast-error { border-color: rgba(255, 90, 95, .6); background: #2a1719; }
.toast.out { opacity: 0; }
.notice { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.notice.success { border-color: rgba(52, 210, 123, .4); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: var(--mono); font-size: 12.5px; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- pages ---------- */
.page { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.container { width: 100%; max-width: 1320px; margin: 0 auto; padding: 28px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.head-main { min-width: 0; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 6px 12px; border-radius: 6px; color: var(--text-2); font-weight: 550; white-space: nowrap; }
.tab.active { background: var(--surface-3); color: var(--text); }
.tabs.small .tab { padding: 4px 9px; font-size: 12.5px; }
.search { position: relative; display: flex; align-items: center; min-width: 240px; color: var(--muted); }
.search.grow { flex: 1; }
.search .icon { position: absolute; left: 11px; }
.search-input { padding-left: 34px !important; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 10px; font-size: 13px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 64px 20px; max-width: 460px; margin: 0 auto; }
.empty-icon { width: 60px; height: 60px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--accent); margin-bottom: 6px; }
.empty .btn { margin-top: 8px; }
.span-all { grid-column: 1 / -1; }
.grid-loading { grid-column: 1 / -1; display: flex; justify-content: center; padding: 40px; }
.sentinel { height: 1px; }
.load-more { width: 100%; border: 0; background: none; color: var(--accent); padding: 10px; font-weight: 560; }
.center-screen { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }

/* project cards */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.project-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.project-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.project-thumbs { aspect-ratio: 16 / 8; display: grid; grid-auto-flow: column; gap: 2px; background: var(--bg-2); }
.project-thumbs img { width: 100%; height: 100%; object-fit: cover; min-width: 0; }
.project-thumbs.empty { display: flex; align-items: center; justify-content: center; color: var(--line-2); background: linear-gradient(135deg, var(--bg-2), var(--surface-2)); }
.project-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.project-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.project-row h3 { font-size: 15px; font-weight: 620; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-meta { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; min-height: 20px; }
.project-foot { display: flex; align-items: center; gap: 12px; }
.project-foot span { display: inline-flex; align-items: center; gap: 4px; }
.card-menu { margin: -4px -6px -4px 0; }
.review-bar { display: flex; height: 4px; border-radius: 2px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.rb-approved { background: var(--approved); } .rb-changes_requested { background: var(--changes); } .rb-in_review { background: var(--review); }

/* asset grid */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.folder-card { grid-column: span 1; display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.folder-card:hover { border-color: var(--line-2); }
.folder-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.folder-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-icon { width: 38px; height: 38px; border-radius: 9px; background: rgba(255, 107, 61, .12); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.asset-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: border-color .15s, transform .15s; }
.asset-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.asset-thumb { position: relative; aspect-ratio: 16 / 9; background: #000; display: flex; align-items: center; justify-content: center; }
.asset-thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb-ph { color: var(--line-2); }
.thumb-state { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(0, 0, 0, .6); font-size: 13px; font-weight: 560; }
.thumb-state.error { color: var(--danger); }
.ver-badge, .dur { position: absolute; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; padding: 2px 7px; border-radius: 5px; background: rgba(0, 0, 0, .7); }
.ver-badge { left: 8px; color: var(--accent-2); }
.dur { right: 8px; font-family: var(--mono); }
.asset-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.asset-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.asset-meta { display: flex; align-items: center; gap: 10px; }
.asset-meta .small { display: inline-flex; align-items: center; gap: 4px; }
.dropzone { position: fixed; inset: 0; z-index: 80; background: rgba(13, 15, 19, .85); border: 3px dashed var(--accent); display: none; align-items: center; justify-content: center; pointer-events: none; }
.dropzone.show { display: flex; }
.dropzone > div { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--accent); font-size: 18px; }

/* members & shares */
.invite-form { display: flex; gap: 8px; }
.invite-form select { width: 130px; flex-shrink: 0; }
.role-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 12.5px; }
.role-legend div { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.member-list, .share-list { display: flex; flex-direction: column; gap: 4px; }
.member { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.member-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.member-info strong, .member-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-select { width: 120px !important; padding: 6px 28px 6px 10px !important; font-size: 13px; }
.role-tag { font-size: 12.5px; color: var(--text-2); text-transform: capitalize; }
.share-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.share-row.off { opacity: .6; }
.share-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.share-actions { display: flex; gap: 4px; flex-shrink: 0; }
.share-state { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--approved); }
.share-state.turned-off, .share-state.expired { color: var(--danger); }

/* notifications */
.notif-panel { width: 380px; padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 8px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.notif-list { display: flex; flex-direction: column; padding: 4px; }
.notif { display: flex; gap: 10px; padding: 10px; border-radius: 8px; color: var(--text-2); }
.notif:hover { background: var(--surface-2); }
.notif.unread { color: var(--text); }
.notif.unread .notif-icon { background: rgba(255, 107, 61, .16); color: var(--accent); }
.notif-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
.notif-time { font-size: 11.5px; color: var(--muted); }
.notif-empty { padding: 24px 16px; text-align: center; }
.notif-list > .spinner { margin: 20px auto; }

/* upload tray */
.upload-tray { position: fixed; right: 16px; bottom: 16px; z-index: 70; width: 340px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.tray-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.tray-list { max-height: 300px; overflow: auto; }
.tray-item { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.tray-row { display: flex; align-items: center; gap: 4px; }
.tray-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 560; font-size: 13px; }
.tray-row .icon-btn { padding: 3px; }
.tray-detail { font-size: 12px; color: var(--muted); }
.tray-detail.error { color: var(--danger); }
.progress { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.progress.done span { background: var(--approved); }
.progress.failed span { background: var(--danger); }

/* ---------- auth ---------- */
.auth-wrap { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.auth-side { padding: 36px 48px; display: flex; flex-direction: column; justify-content: space-between; background:
  radial-gradient(600px 400px at 20% 110%, rgba(255, 107, 61, .22), transparent 60%), radial-gradient(500px 300px at 90% 0%, rgba(90, 162, 255, .12), transparent 60%), var(--bg-2);
  border-right: 1px solid var(--line); }
.auth-pitch { max-width: 460px; display: flex; flex-direction: column; gap: 16px; margin-bottom: 8vh; }
.auth-pitch h1 { font-size: 38px; line-height: 1.1; letter-spacing: -.03em; }
.auth-pitch p { color: var(--text-2); font-size: 15.5px; }
.auth-points { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); }
.auth-points li { display: flex; align-items: center; gap: 10px; }
.auth-points .icon { color: var(--accent); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.auth-card > .form, .auth-card > div.form { margin-top: 14px; }
.auth-card .btn { height: 42px; }
.auth-foot { margin-top: 12px; color: var(--muted); font-size: 13.5px; }
.auth-foot a { color: var(--accent); }
.share-landing { flex: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(700px 400px at 50% 120%, rgba(255, 107, 61, .18), transparent 60%), var(--bg); }
.share-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 20px; box-shadow: var(--shadow); }
.share-title { display: flex; flex-direction: column; gap: 4px; }
.share-title h1 { font-size: 22px; overflow-wrap: anywhere; }
.share-card .btn { height: 42px; }

/* ---------- review workspace ---------- */
.review-page { flex: none; height: calc(100vh - 48px); height: calc(100dvh - 48px); overflow: hidden; }
.review-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg); min-height: 52px; }
.back { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 7px; color: var(--text-2); flex-shrink: 0; }
.back:hover { background: var(--surface); color: var(--text); }
.rh-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rh-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; }
.ver-btn, .status-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 7px; font-weight: 650; font-size: 13px; flex-shrink: 0; }
.status-btn { padding: 0 6px 0 4px; }
.ver-btn:hover, .status-btn:hover { background: var(--surface-2); }
.review { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; }
.player-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #07080a; }
.player-col:fullscreen { background: #000; }
.old-banner { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: rgba(255, 176, 32, .1); color: var(--changes); font-size: 13px; border-bottom: 1px solid rgba(255, 176, 32, .25); flex-wrap: wrap; }
.old-banner .link-btn { color: var(--changes); margin-left: auto; }
.stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: hidden; }
.frame { position: relative; background: #000; box-shadow: 0 0 0 1px rgba(255, 255, 255, .04); }
.player-video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.annot-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.annot-canvas.editing { pointer-events: auto; cursor: crosshair; outline: 2px solid var(--accent); outline-offset: -2px; }
.big-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%; border: 0; background: rgba(13, 15, 19, .65);
  color: #fff; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); transition: transform .15s, background .15s; padding-left: 5px; }
.big-play:hover { transform: translate(-50%, -50%) scale(1.06); background: var(--accent); color: var(--accent-ink); }
.stage-msg { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-width: 360px; }
.draw-bar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 5px; background: rgba(19, 22, 28, .94);
  border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); z-index: 3; max-width: calc(100% - 16px); overflow-x: auto; }
.db-btn { width: 32px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--text-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.db-btn:hover { background: var(--surface-2); color: var(--text); }
.db-btn.on { background: var(--surface-3); color: var(--accent); }
.db-sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 3px; flex-shrink: 0; }
.swatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; flex-shrink: 0; margin: 0 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4) inset; }
.swatch.on { border-color: #fff; }
.db-done { border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 650; height: 32px; padding: 0 12px; border-radius: 7px; margin-left: 4px; flex-shrink: 0; }

.timeline { position: relative; padding: 14px 16px 4px; }
.tl-track { position: relative; height: 22px; cursor: pointer; touch-action: none; }
.tl-track::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 4px; background: var(--surface-3); border-radius: 2px; }
.tl-buffer, .tl-fill { position: absolute; left: 0; top: 9px; height: 4px; border-radius: 2px; }
.tl-buffer { background: var(--line-2); }
.tl-fill { background: var(--accent); }
.tl-track:hover::before, .tl-track:hover .tl-fill, .tl-track:hover .tl-buffer { top: 8px; height: 6px; }
.tl-head { position: absolute; top: 4px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.tl-tip { position: absolute; bottom: 26px; transform: translateX(-50%); background: var(--surface-3); padding: 2px 7px; border-radius: 5px; font: 600 11.5px var(--mono); white-space: nowrap; pointer-events: none; }
.tl-markers { position: relative; height: 16px; margin-top: 2px; }
.marker { position: absolute; top: 0; width: 12px; height: 12px; margin-left: -6px; padding: 0; border-radius: 50%; background: var(--c); border: 2px solid #07080a; transition: transform .12s; }
.marker:hover, .marker.active { transform: scale(1.45); z-index: 2; }
.marker.active { box-shadow: 0 0 0 2px #fff; }
.marker.resolved { opacity: .35; }
.controls { display: flex; align-items: center; gap: 2px; padding: 4px 10px 10px; }
.ctl { display: flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; border: 0; background: none; color: var(--text-2); border-radius: 7px; }
.ctl:hover { background: var(--surface); color: var(--text); }
.ctl.on { color: var(--accent); background: rgba(255, 107, 61, .12); }
.ctl.time { font: 600 13px var(--mono); padding: 0 10px; color: var(--text); gap: 0; white-space: nowrap; }
.ctl-select { width: auto !important; height: 32px; padding: 0 8px !important; background: transparent !important; border-color: transparent !important; font-weight: 600; font-size: 13px; text-align: center; }
.ctl-select:hover { background-color: var(--surface) !important; }
.vol-wrap { display: flex; align-items: center; }
.vol { width: 80px; accent-color: var(--accent); }

.panel { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--bg-2); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.c-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.c-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); padding: 48px 24px; }
.comment { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; cursor: pointer; transition: border-color .15s; }
.comment:hover { border-color: var(--line-2); }
.comment.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.comment.resolved > .c-body { color: var(--muted); }
.c-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.c-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.c-who strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-who .small { font-size: 11.5px; }
.c-head .icon-btn { padding: 4px; }
.c-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.mention { color: var(--accent-2); font-weight: 600; background: rgba(255, 107, 61, .1); border-radius: 4px; padding: 0 2px; }
.tc-badge { display: inline-flex; align-items: center; gap: 4px; border: 0; background: rgba(255, 107, 61, .14); color: var(--accent-2); font: 650 11.5px var(--mono); padding: 3px 7px; border-radius: 5px; flex-shrink: 0; }
.tc-badge:hover { background: rgba(255, 107, 61, .25); }
.resolve-btn { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line-2); background: none; color: transparent; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 0; }
.resolve-btn:hover { border-color: var(--approved); color: var(--approved); }
.resolve-btn.on { background: var(--approved); border-color: var(--approved); color: #04170b; }
.c-resolved { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--approved); }
.c-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.c-actions .link-btn { margin-left: auto; color: var(--text-2); font-size: 12.5px; padding: 3px 4px; }
.c-actions .link-btn:hover { color: var(--text); text-decoration: none; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 13px; }
.reaction span { font-size: 11.5px; font-weight: 650; color: var(--text-2); }
.reaction.mine { border-color: var(--accent); background: rgba(255, 107, 61, .12); }
.react-add { padding: 3px; }
.c-atts { display: flex; flex-wrap: wrap; gap: 6px; }
.c-att-img img { display: block; max-width: 140px; max-height: 90px; border-radius: 6px; border: 1px solid var(--line-2); object-fit: cover; }
.c-att { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: 12.5px; padding: 5px 9px; border-radius: 7px; background: var(--bg-2); border: 1px solid var(--line-2); }
.c-att span:not(.muted) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.replies { display: flex; flex-direction: column; gap: 8px; border-left: 2px solid var(--line-2); margin-left: 12px; padding-left: 12px; }
.reply { display: flex; flex-direction: column; gap: 5px; }
.c-editing { display: flex; flex-direction: column; gap: 6px; }
.row-end { display: flex; justify-content: flex-end; gap: 6px; }

.composer-wrap { border-top: 1px solid var(--line); padding: 10px 12px 12px; background: var(--bg-2); display: flex; flex-direction: column; gap: 8px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.as-who { display: flex; align-items: center; gap: 6px; }
.as-who strong { color: var(--text-2); }
.composer { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px; transition: border-color .15s; }
.composer:focus-within { border-color: var(--accent); }
.composer.inline { margin-top: 2px; cursor: default; }
.c-field { position: relative; }
.c-input { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 4px !important; resize: none; min-height: 38px; font-size: 13.5px; }
.composer-row { display: flex; align-items: center; gap: 2px; }
.kbd-hint { font-size: 11px; color: var(--muted); margin-right: 8px; font-family: var(--mono); }
.c-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted); font: 650 11.5px var(--mono); }
.chip.on { color: var(--accent-2); border-color: rgba(255, 107, 61, .4); background: rgba(255, 107, 61, .1); }
.chip button { border: 0; background: none; color: inherit; padding: 0; display: flex; }
.att-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.att-chips:empty { display: none; }
.att-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 3px 6px 3px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 12px; }
.att-chip span:not(.spinner) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip .spinner { width: 12px; height: 12px; }
.att-chip button { border: 0; background: none; color: var(--muted); padding: 0; display: flex; }
.mention-sug { position: absolute; bottom: 100%; left: 0; margin-bottom: 6px; min-width: 220px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; box-shadow: var(--shadow); padding: 4px; z-index: 10; }
.sug-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; background: none; border-radius: 6px; text-align: left; }
.sug-item.on, .sug-item:hover { background: var(--surface-3); }
.c-readonly { display: flex; align-items: center; gap: 8px; padding: 8px 4px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .review { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  /* Mobile review: a fixed-height app screen — player on top, scrolling comments, composer pinned at the bottom. */
  .topbar.compact { display: none; }
  .review-page { height: 100vh; height: 100dvh; }
  .review { display: flex; flex-direction: column; min-height: 0; }
  .player-col { flex: none; }
  .stage { flex: none; height: min(56.25vw, 38dvh); padding: 0; }
  .panel { border-left: 0; flex: 1; min-height: 0; border-top: 1px solid var(--line); }
  .panel-head { padding: 6px 8px; }
  .c-list { padding: 6px; }
  .composer-wrap { padding: 8px; box-shadow: 0 -8px 20px rgba(0, 0, 0, .3); }
  .as-who { display: none; }
  .c-input { min-height: 24px; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .topbar { padding: 0 12px; gap: 10px; }
  .container { padding: 18px 16px 48px; }
  h1 { font-size: 21px; }
  .search { min-width: 0; width: 100%; }
  .toolbar { gap: 10px; }
  .tabs { max-width: 100%; }
  .project-grid, .asset-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .project-info, .asset-info { padding: 9px 10px 10px; }
  .project-foot span:last-child { display: none; }
  .head-actions .btn span { display: none; }
  .head-actions .btn { padding: 0; width: 36px; }
  .head-actions .btn-primary { width: auto; padding: 0 12px; }
  .head-actions .btn-primary span { display: inline; }
  .form-grid, .role-legend { grid-template-columns: 1fr; }
  .invite-form { flex-wrap: wrap; }
  .invite-form input { flex: 1 1 100%; }
  .invite-form select { flex: 1; }
  .share-row { flex-direction: column; align-items: stretch; }
  .review-head { padding: 6px 8px; gap: 6px; }
  .review-head .btn span { display: none; }
  .review-head .btn { padding: 0; width: 30px; }
  .review-head .btn-success { width: auto; padding: 0 10px; }
  .review-head .btn-success span { display: inline; }
  .review-head { flex-wrap: wrap; row-gap: 6px; }
  .rh-title { flex: 1 1 calc(100% - 44px); }
  .review-head .spacer, .review-head a[href*="/download"] { display: none; }
  .composer:not(.inline) { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: center; }
  .composer:not(.inline) .c-field, .composer:not(.inline) .att-chips { grid-column: 1 / -1; }
  .composer:not(.inline) .c-chips { grid-row: 3; }
  .composer:not(.inline) .composer-row { grid-row: 3; grid-column: 2; }
  .panel-head .icon-btn .small { display: none; }
  .status-btn .pill { padding: 0 7px; }
  .controls { padding: 0 4px 4px; gap: 0; }
  .ctl { min-width: 34px; height: 34px; }
  .ctl.time { font-size: 12px; padding: 0 6px; }
  .ctl.time .dur { display: none; }
  .timeline { padding: 4px 12px 0; }
  .tl-markers { height: 12px; margin-top: 0; }
  .marker { width: 12px; height: 12px; margin-left: -6px; }
  .overlay { padding: 16px 12px; align-items: flex-end; }
  .modal { border-radius: 14px; }
  .notif-panel { width: calc(100vw - 16px); }
}
@media (max-width: 400px) {
  .project-grid, .asset-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
