/* FormandFrame Review. Brand: Frame Black, Bone, Signal (≤2%), Archivo 112% + JetBrains Mono labels. */
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-var.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #0A0A0B; --surface: #141416; --surface-2: #1B1B1E; --surface-3: #242428;
  --line: #2A2A2C; --line-2: #38383C;
  --text: #EEECE7; --soft: #C9C7C2; --muted: #8E8C88; --dim: #5E5C59;
  --signal: #FF5A1F; --signal-soft: rgba(255, 90, 31, .14); --ok: #7ED29B; --ok-soft: rgba(126, 210, 155, .13);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --sans: "Archivo", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --r: 10px; --r-lg: 16px; --top: 60px; --pad: clamp(16px, 3vw, 40px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--sans); font-stretch: 105%; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img, video { display: block; max-width: 100%; }
::selection { background: var(--signal); color: var(--bg); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.lbl, .mono { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-stretch: 100%; }
.mono { text-transform: none; letter-spacing: .02em; font-size: 12px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); vertical-align: middle; margin-right: 8px; }
h1, h2, h3 { font-weight: 600; font-stretch: 112%; letter-spacing: -.02em; margin: 0; line-height: 1.05; }
h1 { font-size: clamp(30px, 4.2vw, 56px); }
h2 { font-size: clamp(22px, 2.4vw, 30px); }
h3 { font-size: 18px; letter-spacing: -.01em; }
.pad { padding: var(--pad); }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 40; height: var(--top); display: flex; align-items: center; gap: 20px; padding: 0 var(--pad); border-bottom: 1px solid var(--line); background: rgba(10, 10, 11, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand img { width: 150px; height: auto; }
.brand-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line-2); padding-left: 12px; }
.top-mid { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; }
.top-mid a:hover { color: var(--text); }
.top-mid .sep { color: var(--dim); }
.top-mid strong { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.navlink { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; transition: color .2s, background .2s; }
.navlink:hover { color: var(--text); }
.navlink.is-on { color: var(--text); background: var(--surface-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text); font: 600 12px/32px var(--sans); text-align: center; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 26px; height: 26px; line-height: 26px; font-size: 10.5px; }
.avatar.studio { background: var(--text); color: var(--bg); }
button.avatar { margin-left: 6px; }
button.avatar:hover { box-shadow: 0 0 0 2px var(--line-2); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(238, 236, 231, .4); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background .2s var(--ease), color .2s, border-color .2s, opacity .2s; user-select: none; }
.btn:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { background: var(--signal); border-color: var(--signal); color: var(--bg); }
.btn.ghost { border-color: transparent; color: var(--soft); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn.danger:hover { background: var(--signal); border-color: var(--signal); }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 10px; font-size: 12px; }
.btn[disabled], .btn.is-busy { opacity: .45; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--soft); transition: background .2s, color .2s; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.is-on { color: var(--bg); background: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.field { display: block; margin: 0 0 22px; }
.field > span { display: block; margin-bottom: 6px; }
.input, .field input, .field textarea, .field select { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); padding: 8px 0 10px; font-size: 16px; color: var(--text); border-radius: 0; transition: border-color .2s; }
.field textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.field select { appearance: none; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238E8C88' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 4px center; padding-right: 22px; }
.field select option { background: var(--surface); }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--text); }
.field input::placeholder, .field textarea::placeholder, .box::placeholder { color: var(--dim); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.box { width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; color: var(--text); font-size: 14px; }
.box:focus { outline: 0; border-color: var(--line-2); background: var(--surface-3); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch b { font-weight: 500; display: block; }
.switch small { color: var(--muted); font-size: 13px; display: block; }
.switch input { appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; cursor: pointer; transition: background .2s var(--ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .2s; }
.switch input:checked { background: var(--text); }
.switch input:checked::after { transform: translateX(16px); background: var(--bg); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 30px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13px; color: var(--soft); display: inline-flex; align-items: center; gap: 6px; transition: all .2s; }
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }

/* status pill */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line-2); color: var(--soft); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.pill.changes { border-color: rgba(255, 90, 31, .5); color: var(--signal); background: var(--signal-soft); }
.pill.changes::before { background: var(--signal); }
.pill.approved { border-color: rgba(126, 210, 155, .45); color: var(--ok); background: var(--ok-soft); }
.pill.approved::before { background: var(--ok); }
.pill.processing::before { background: var(--text); animation: blink 1s infinite; }
.pill.failed { color: var(--signal); }
.pill.held { color: var(--text); border-style: dashed; }
.pill.held::before { background: transparent; border: 1px solid var(--text); width: 5px; height: 5px; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- pages ---------- */
.app { min-height: calc(100vh - var(--top)); }
.boot-loader { display: grid; place-items: center; height: 50vh; }
.boot-loader span, .spinner { width: 22px; height: 22px; border: 2px solid var(--line-2); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.page { padding: clamp(28px, 4vw, 56px) var(--pad) 80px; max-width: 1680px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 34px; }
.page-head .lbl { margin-bottom: 14px; display: block; }
.page-head p { margin: 12px 0 0; color: var(--soft); max-width: 60ch; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -10px 0 22px; }
.search { height: 36px; width: 240px; max-width: 100%; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); padding: 0 14px 0 34px; font-size: 14px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238E8C88' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px center; }
.search:focus { outline: 0; border-color: var(--line-2); }
.empty { border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: clamp(32px, 6vw, 72px) 24px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin-bottom: 8px; font-size: 22px; }
.empty .btn { margin-top: 18px; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px 22px; }
.card { position: relative; display: block; border-radius: var(--r-lg); transition: transform .4s var(--ease); }
.card .thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-lg); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease), opacity .3s; }
.card .thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); }
.card .thumb .ph img { width: 44px; height: 44px; opacity: .3; object-fit: contain; }
.card:hover .thumb img.cover { transform: scale(1.035); }
.card .meta { padding: 14px 2px 0; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card .meta h3 { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta .sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.card .badges { position: absolute; left: 12px; top: 12px; right: 52px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 2; }
.card .badges .pill { background: rgba(10, 10, 11, .72); backdrop-filter: blur(6px); }
.card .badges .pill.changes { background: rgba(40, 14, 4, .8); }
.card .badges .pill.approved { background: rgba(10, 30, 18, .8); }
.card .corner { position: absolute; right: 12px; top: 12px; z-index: 2; font: 500 11px/1 var(--mono); background: rgba(10, 10, 11, .72); backdrop-filter: blur(6px); padding: 6px 8px; border-radius: 6px; color: var(--soft); }
.card .dur { position: absolute; right: 12px; bottom: 12px; z-index: 2; font: 500 11px/1 var(--mono); background: rgba(10, 10, 11, .72); padding: 5px 7px; border-radius: 5px; color: var(--soft); }
.card .count { display: inline-flex; align-items: center; gap: 5px; font: 500 12px/1 var(--mono); color: var(--soft); white-space: nowrap; }
.card .count.hot { color: var(--signal); }
.card .count svg { width: 14px; height: 14px; }
.card .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .08); z-index: 2; }
.card .progress i { display: block; height: 100%; background: var(--text); transition: width .6s var(--ease); }
.card .scrub-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--signal); z-index: 2; pointer-events: none; opacity: 0; }
.card .thumb:hover .scrub-line { opacity: 1; }
.card .thumb .scrub { position: absolute; inset: 0; background-repeat: no-repeat; opacity: 0; transition: opacity .15s; }
.card .thumb:hover .scrub.has { opacity: 1; }
.card .menu-btn { position: absolute; right: 8px; bottom: 8px; z-index: 3; opacity: 0; background: rgba(10, 10, 11, .8); }
.card:hover .menu-btn, .card .menu-btn:focus-visible { opacity: 1; }
.card.is-drop .thumb { border-color: var(--text); box-shadow: 0 0 0 3px rgba(238, 236, 231, .15); }
.card.is-drop .thumb::after { content: "Drop for new version"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 10, 11, .78); font: 500 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; z-index: 4; }
.card.dragging { opacity: .4; }

/* project layout */
.project-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; }
.side { position: sticky; top: calc(var(--top) + 24px); display: flex; flex-direction: column; gap: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel h3 { font-size: 17px; }
.share-item { padding: 14px 0; border-top: 1px solid var(--line); }
.share-item:first-of-type { border-top: 0; padding-top: 0; }
.share-item .t { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.share-item .flags { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 6px 0 10px; font-size: 12px; color: var(--muted); }
.share-item .flags span::before { content: "· "; color: var(--dim); }
.share-item .flags span:first-child::before { content: ""; }
.share-item .people { margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.person { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.person .who { flex: 1; min-width: 0; }
.person .who b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who small { color: var(--muted); display: block; font-size: 12px; }
.feed { display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow: auto; }
.feed .it { font-size: 13px; color: var(--soft); line-height: 1.45; }
.feed .it b { color: var(--text); font-weight: 500; }
.feed .it time { display: block; color: var(--dim); font: 11px var(--mono); margin-top: 2px; }
.dropzone { position: fixed; inset: 0; z-index: 90; background: rgba(10, 10, 11, .86); display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .2s; }
.dropzone.on { opacity: 1; }
.dropzone div { border: 1.5px dashed var(--text); border-radius: 24px; padding: 60px 80px; text-align: center; }
.dropzone h2 { margin-bottom: 8px; }

/* uploads tray */
.tray { position: fixed; right: 20px; bottom: 20px; z-index: 80; width: 360px; max-width: calc(100vw - 32px); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); overflow: hidden; }
.tray-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.tray-list { max-height: 300px; overflow: auto; }
.up { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.up:last-child { border-bottom: 0; }
.up .n { display: flex; justify-content: space-between; gap: 10px; }
.up .n b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up .bar { height: 3px; background: var(--surface-3); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.up .bar i { display: block; height: 100%; background: var(--text); width: 0; transition: width .3s; }
.up.done .bar i { background: var(--ok); }
.up.err .bar i { background: var(--signal); }
.up .s { color: var(--muted); font: 11px var(--mono); margin-top: 6px; display: flex; justify-content: space-between; }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(5, 5, 6, .72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s var(--ease); }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; padding: 28px; animation: rise .35s var(--ease); }
.modal.wide { max-width: 720px; }
.modal h2 { margin-bottom: 6px; }
.modal .lead { color: var(--soft); margin: 0 0 24px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.modal .close { float: right; margin: -10px -10px 0 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.linkbox { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 14px; }
.linkbox input { flex: 1; min-width: 0; background: none; border: 0; color: var(--soft); font: 12.5px var(--mono); }
.linkbox input:focus { outline: 0; }
.recips { display: flex; flex-direction: column; gap: 8px; }
.recip { display: grid; grid-template-columns: 1fr 1.3fr 30px; gap: 8px; }

/* menus & toasts */
.menu { position: fixed; z-index: 120; min-width: 200px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px; box-shadow: 0 16px 50px rgba(0, 0, 0, .55); animation: rise .2s var(--ease); max-height: 70vh; overflow: auto; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--soft); }
.menu button:hover, .menu a:hover, .menu .is-on { background: var(--surface-3); color: var(--text); }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .danger:hover { color: var(--signal); }
.menu small { margin-left: auto; color: var(--dim); font: 11px var(--mono); }
.menu .head { padding: 8px 12px 4px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: rise .3s var(--ease); pointer-events: auto; max-width: 90vw; }
.toast.err { background: var(--signal); }

/* login / message */
body.is-login .top, body.is-message .top { border-bottom-color: transparent; background: transparent; }
.center-card { min-height: calc(100vh - var(--top) - 40px); display: grid; place-items: center; padding: 24px var(--pad); }
.center-card .inner { width: 100%; max-width: 420px; }
.center-card h1 { margin: 16px 0 12px; }
.center-card p { color: var(--soft); margin: 0 0 30px; }
.center-card .alt { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.center-card .alt button { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.msg-big { font-size: clamp(44px, 8vw, 110px) !important; }

/* settings */
.settings { display: grid; grid-template-columns: 200px minmax(0, 760px); gap: 48px; }
.settings nav { position: sticky; top: calc(var(--top) + 32px); align-self: start; display: flex; flex-direction: column; gap: 2px; }
.settings nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; }
.settings nav a:hover, .settings nav a.is-on { color: var(--text); background: var(--surface); }
.settings section { margin-bottom: 56px; scroll-margin-top: calc(var(--top) + 24px); }
.settings section > h2 { margin-bottom: 8px; }
.settings section > p { color: var(--soft); margin: 0 0 22px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0 10px 10px 0; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.r { text-align: right; white-space: nowrap; }
pre.code { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; overflow: auto; font: 12.5px/1.6 var(--mono); color: var(--soft); white-space: pre; }
code { font: 12.5px var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 5px; color: var(--soft); }
.secret { background: var(--signal-soft); border: 1px solid rgba(255, 90, 31, .4); border-radius: var(--r); padding: 14px; margin: 14px 0; }
.secret code { background: none; color: var(--text); word-break: break-all; font-size: 13px; }

/* =================== review =================== */
body.is-review { overflow: hidden; }
body.is-review .app { height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); min-height: 0; }
.rv { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: 100%; }
.rv.no-side { grid-template-columns: minmax(0, 1fr) 0; }
.rv-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.rv-bar { display: flex; align-items: center; gap: 10px; padding: 10px var(--pad); min-height: 58px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rv-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.rv-title h1 { font-size: 20px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vsel { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); font: 500 12px var(--mono); color: var(--text); flex: none; }
.vsel:hover { border-color: var(--muted); }
.vsel svg { width: 12px; height: 12px; }
.stage-wrap { position: relative; flex: 1; min-height: 0; background: #050506; display: flex; }
.stage { position: relative; flex: 1; min-width: 0; display: flex; overflow: hidden; }
.stage.split > .view { width: 50%; }
.view { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; }
.view + .view { border-left: 1px solid var(--line); }
.view video, .view img.media { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.view video { width: 100%; height: 100%; }
.view .vlabel { position: absolute; left: 12px; top: 12px; z-index: 6; font: 500 11px var(--mono); letter-spacing: .08em; background: rgba(10, 10, 11, .75); padding: 5px 8px; border-radius: 6px; color: var(--soft); pointer-events: none; }
.wipe-handle { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); z-index: 8; cursor: ew-resize; transform: translateX(-1px); }
.wipe-handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--text); box-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.stage.wipe .view.b { position: absolute; inset: 0; z-index: 3; }
.overlay { position: absolute; z-index: 5; pointer-events: none; }
.overlay svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.overlay.drawing-on { pointer-events: auto; cursor: crosshair; }
.overlay.pin-on { pointer-events: auto; cursor: copy; }
.pinm { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg) translate(9px, -9px); background: var(--signal); color: var(--bg); display: grid; place-items: center; font: 700 11px var(--sans); box-shadow: 0 2px 10px rgba(0, 0, 0, .6); border: 2px solid var(--bg); pointer-events: auto; cursor: pointer; animation: pop .3s var(--ease); }
.pinm span { transform: rotate(45deg); }
.pinm.draft { background: var(--text); }
.pinm.resolved { background: var(--muted); }
@keyframes pop { from { transform: rotate(-45deg) translate(9px, -9px) scale(.3); opacity: 0; } }
.guides { position: absolute; z-index: 4; pointer-events: none; }
.guides .safe { position: absolute; border: 1px dashed rgba(238, 236, 231, .45); }
.guides .mask { position: absolute; background: rgba(0, 0, 0, .62); }
.guides .cross { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px; }
.guides .cross::before, .guides .cross::after { content: ""; position: absolute; background: rgba(238, 236, 231, .6); }
.guides .cross::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.guides .cross::after { top: 50%; left: 0; right: 0; height: 1px; }
.guides .glabel { position: absolute; font: 10px var(--mono); color: rgba(238, 236, 231, .7); letter-spacing: .08em; }
.big-play { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px; border-radius: 50%; background: rgba(238, 236, 231, .92); color: var(--bg); display: grid; place-items: center; z-index: 6; transition: transform .3s var(--ease), opacity .3s, background .2s; }
.big-play:hover { transform: scale(1.06); background: var(--signal); }
.big-play svg { width: 28px; height: 28px; margin-left: 4px; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--soft); z-index: 7; padding: 24px; }
.stage-msg .bar { width: 220px; height: 3px; background: var(--surface-3); border-radius: 2px; margin: 16px auto 0; overflow: hidden; }
.stage-msg .bar i { display: block; height: 100%; background: var(--text); transition: width .6s; }
.flash { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 9; background: rgba(10, 10, 11, .8); padding: 7px 12px; border-radius: 999px; font: 500 12px var(--mono); color: var(--text); pointer-events: none; animation: fade .2s; }
.zoom-ind { position: absolute; right: 12px; bottom: 12px; z-index: 6; }

/* transport */
.transport { border-top: 1px solid var(--line); padding: 8px var(--pad) 10px; background: var(--bg); user-select: none; }
.timeline { position: relative; height: 34px; cursor: pointer; touch-action: none; }
.tl-track { position: absolute; left: 0; right: 0; top: 19px; height: 4px; background: var(--surface-3); border-radius: 2px; }
.tl-buf { position: absolute; left: 0; top: 0; bottom: 0; background: var(--line-2); border-radius: 2px; }
.tl-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--text); border-radius: 2px; }
.tl-head { position: absolute; top: 13px; width: 2px; height: 16px; background: var(--text); margin-left: -1px; border-radius: 1px; pointer-events: none; }
.timeline:hover .tl-track { height: 6px; top: 18px; }
.tl-range { position: absolute; top: 17px; height: 8px; background: rgba(255, 90, 31, .4); border-radius: 2px; pointer-events: none; }
.tl-range.draft { background: rgba(238, 236, 231, .35); outline: 1px solid var(--text); }
.tl-mark { position: absolute; top: 2px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--signal); border: 2px solid var(--bg); cursor: pointer; transition: transform .2s var(--ease); z-index: 2; }
.tl-mark.resolved { background: var(--dim); }
.tl-mark.is-on, .tl-mark:hover { transform: scale(1.35); }
.tl-mark.studio { background: var(--text); }
.tl-hover { position: absolute; bottom: 40px; transform: translateX(-50%); z-index: 20; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.tl-hover .img { background-repeat: no-repeat; }
.tl-hover .t { font: 500 11px var(--mono); text-align: center; padding: 4px 6px; color: var(--text); }
.tl-hover .c { font-size: 12px; padding: 0 8px 6px; max-width: 220px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.controls { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.controls .tc { font: 500 13px var(--mono); color: var(--text); padding: 0 10px; min-width: 112px; text-align: left; letter-spacing: .02em; cursor: pointer; }
.controls .tc small { color: var(--dim); }
.controls .rate { font: 500 12px var(--mono); width: auto; padding: 0 9px; border-radius: 999px; }
.controls .vol { width: 80px; accent-color: var(--text); }
.controls .spacer { flex: 1; }

/* composer */
.composer { border-top: 1px solid var(--line); padding: 12px var(--pad) 14px; background: var(--bg); }
.composer.disabled { color: var(--muted); font-size: 14px; }
.comp-box { display: flex; gap: 12px; align-items: flex-start; }
.comp-in { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; transition: border-color .2s, background .2s; }
.comp-in:focus-within { border-color: var(--line-2); background: var(--surface-2); }
.comp-in textarea { display: block; width: 100%; resize: none; background: transparent; border: 0; padding: 12px 14px 4px; color: var(--text); font-size: 15px; line-height: 1.45; min-height: 46px; max-height: 180px; }
.comp-in textarea:focus { outline: 0; }
.comp-tools { display: flex; align-items: center; gap: 2px; padding: 4px 6px 6px 8px; flex-wrap: wrap; }
.comp-tools .at { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; font: 500 12px var(--mono); color: var(--signal); background: var(--signal-soft); }
.comp-tools .at.off { color: var(--muted); background: var(--surface-3); }
.comp-tools .at button { color: inherit; opacity: .7; }
.comp-tools .tool.is-on { background: var(--text); color: var(--bg); }
.swatches { display: inline-flex; gap: 4px; margin: 0 4px; }
.swatches button { width: 16px; height: 16px; border-radius: 50%; border: 2px solid transparent; }
.swatches button.is-on { border-color: var(--text); }
.comp-send { margin-left: auto; }
.reply-to { font-size: 12px; color: var(--muted); padding: 0 0 8px 44px; display: flex; gap: 8px; align-items: center; }

/* sidebar */
.rv-side { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.side-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; min-height: 58px; }
.tabs { display: flex; gap: 2px; }
.tabs button { height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; color: var(--muted); }
.tabs button.is-on { background: var(--surface-2); color: var(--text); }
.tabs button b { font: 500 11px var(--mono); color: var(--dim); margin-left: 4px; }
.filters { display: flex; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.filters .chip { height: 26px; font-size: 12px; padding: 0 10px; }
.clist { flex: 1; overflow: auto; overscroll-behavior: contain; }
.cm { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .2s; position: relative; }
.cm:hover { background: var(--surface); }
.cm.is-on { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--signal); }
.cm.resolved > .cm-body, .cm.resolved > .cm-top .who { opacity: .5; }
.cm-top { display: flex; align-items: center; gap: 9px; }
.cm-top .who { flex: 1; min-width: 0; font-size: 13.5px; }
.cm-top .who b { font-weight: 600; }
.cm-top .who time { color: var(--dim); font-size: 12px; margin-left: 6px; }
.cm-num { font: 600 11px var(--mono); color: var(--dim); }
.cm-tc { font: 500 11.5px var(--mono); color: var(--signal); background: var(--signal-soft); padding: 2px 7px; border-radius: 5px; white-space: nowrap; }
.cm.resolved .cm-tc { color: var(--muted); background: var(--surface-3); }
.cm-body { margin: 8px 0 0 35px; font-size: 14.5px; line-height: 1.5; color: var(--text); white-space: pre-wrap; word-wrap: break-word; }
.cm-tags { margin: 6px 0 0 35px; display: flex; gap: 6px; flex-wrap: wrap; }
.cm-tags span { font: 500 10.5px var(--mono); color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.cm-tags svg { width: 12px; height: 12px; }
.cm-acts { margin: 6px 0 0 29px; display: flex; gap: 2px; opacity: .0; transition: opacity .2s; }
.cm:hover .cm-acts, .cm.is-on .cm-acts, .cm-acts:focus-within { opacity: 1; }
.cm-acts .btn { color: var(--muted); }
.cm-acts .btn:hover { color: var(--text); }
.cm-acts .done { color: var(--ok); }
.replies { margin: 10px 0 0 35px; border-left: 1px solid var(--line-2); padding-left: 12px; display: flex; flex-direction: column; gap: 10px; }
.reply .who { font-size: 13px; }
.reply .who b { font-weight: 600; }
.reply .who time { color: var(--dim); font-size: 12px; margin-left: 6px; }
.reply .body { font-size: 14px; color: var(--soft); white-space: pre-wrap; word-wrap: break-word; margin-top: 2px; }
.reply .x { color: var(--dim); font-size: 12px; margin-left: 6px; }
.reply .x:hover { color: var(--signal); }
.cm-edit textarea { width: 100%; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.info { padding: 16px; overflow: auto; flex: 1; }
.info dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0 0 24px; font-size: 13.5px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; color: var(--text); word-break: break-word; }
.dec { padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.dec b { font-weight: 600; }
.dec q { display: block; color: var(--soft); margin-top: 4px; }
.dec q::before, .dec q::after { content: ""; }
.decide { display: flex; gap: 8px; }
.decide .btn.ok:hover { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.status-wrap { display: flex; align-items: center; gap: 8px; }
.kbd { display: inline-block; min-width: 22px; padding: 2px 6px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--line-2); font: 500 11px var(--mono); text-align: center; color: var(--text); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; color: var(--soft); align-items: center; }
.guest-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--soft); }
.items-nav { display: flex; gap: 4px; }

/* guest home */
.guest-hero { padding: clamp(36px, 6vw, 90px) var(--pad) 36px; max-width: 1680px; margin: 0 auto; }
.guest-hero .lbl { display: block; margin-bottom: 18px; }
.guest-hero h1 { font-size: clamp(38px, 6.5vw, 96px); max-width: 16ch; }
.guest-hero p { color: var(--soft); max-width: 62ch; margin: 18px 0 0; font-size: 17px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .project-grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .rv { grid-template-columns: minmax(0, 1fr) 330px; }
}
@media (max-width: 860px) {
  :root { --top: 54px; }
  .brand img { width: 118px; }
  .brand-tag { display: none; }
  .navlink { padding: 8px 10px; }
  .top-mid { display: none; }
  .settings { grid-template-columns: 1fr; gap: 20px; }
  .settings nav { position: static; flex-direction: row; overflow: auto; }
  .grid2 { grid-template-columns: 1fr; }
  body.is-review { overflow: auto; }
  body.is-review .app { height: auto; }
  .rv, .rv.no-side { display: block; }
  .rv-main { border-right: 0; }
  .stage-wrap { height: 56vw; min-height: 220px; max-height: 62vh; flex: none; }
  .rv-side { min-height: 60vh; border-top: 1px solid var(--line); }
  .clist { overflow: visible; }
  .controls .vol, .hide-sm { display: none !important; }
  .controls .tc { min-width: 0; font-size: 12px; padding: 0 6px; }
  .controls .tc small { display: none; }
  .rv-bar { gap: 6px; padding: 8px 12px; }
  .rv-title { flex: 1 1 0; min-width: 0; gap: 8px; }
  .rv-title h1 { font-size: 17px; }
  .decide { order: 5; flex: 1 1 100%; }
  .decide .btn { flex: 1; }
  .transport, .composer { padding-left: 12px; padding-right: 12px; }
  .comp-tools .icon-btn.sm { width: 34px; height: 34px; }
  .cm-acts { opacity: 1; }
  .recip { grid-template-columns: 1fr 30px; }
  .recip input:first-child { grid-column: 1 / -1; }
  .tray { right: 16px; left: 16px; width: auto; bottom: 16px; }
  .modal { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.view.b .vlabel { left: auto; right: 12px; top: 50px; }
.linkish { background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: inherit; }
