@font-face {
  font-family: "Inter";
  src: url("/vendor/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- tokens */
:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --canvas: #ebebe7;
  --canvas-dot: #d9d9d3;
  --fg: #17171a;
  --muted: #696971;
  --faint: #9d9da5;
  --line: #e7e7e1;
  --line-2: #d9d9d2;
  --accent: #5b4cf0;
  --accent-2: #4636d6;
  --accent-soft: #efedfe;
  --accent-ring: rgba(91, 76, 240, .22);
  --ok: #15803d;
  --ok-bg: #16a34a;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-bg: #ea8a0c;
  --warn-soft: #fdf2e2;
  --danger: #dc2626;
  --danger-soft: #fdeceb;
  --review: #2563eb;
  --review-soft: #e9f0fd;
  --draft: #71717a;
  --draft-soft: #f0f0ee;
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, .05);
  --shadow: 0 1px 2px rgba(16, 16, 20, .04), 0 6px 20px -6px rgba(16, 16, 20, .12);
  --shadow-lg: 0 2px 6px rgba(16, 16, 20, .05), 0 24px 60px -12px rgba(16, 16, 20, .25);
  --sheet-shadow: 0 1px 3px rgba(0, 0, 0, .06), 0 18px 50px -14px rgba(0, 0, 0, .28);
  --r: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e11; --surface: #16161a; --surface-2: #1b1b20; --canvas: #09090b; --canvas-dot: #1d1d22;
    --fg: #ececf1; --muted: #a2a2ac; --faint: #6c6c75; --line: #26262c; --line-2: #33333b;
    --accent: #8b7eff; --accent-2: #a296ff; --accent-soft: #221f3e; --accent-ring: rgba(139, 126, 255, .3);
    --ok: #4ade80; --ok-bg: #16a34a; --ok-soft: #13291c; --warn: #fbbf24; --warn-bg: #d97706; --warn-soft: #2e2311;
    --danger: #f87171; --danger-soft: #331617; --review: #60a5fa; --review-soft: #142337; --draft: #a1a1aa; --draft-soft: #222227;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 60px -12px rgba(0, 0, 0, .7);
    --sheet-shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 24px 60px -16px rgba(0, 0, 0, .85);
    color-scheme: dark;
  }
}

/* ---------- base */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 14.5px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ic { flex: none; }
.row-tight { display: flex; align-items: center; gap: 8px; }
.only-small { display: none !important; }
::selection { background: var(--accent-ring); }

/* ---------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg);
  font-size: 13.5px; font-weight: 560; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .06s, opacity .12s;
}
.btn:hover { border-color: var(--faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn:focus-visible, .icon-btn:focus-visible, .chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.btn.primary { background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(70, 54, 214, .3), inset 0 1px 0 rgba(255, 255, 255, .15); }
.btn.primary:hover { filter: brightness(1.07); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0e0e11; } }
.btn.approve { background: var(--ok-bg); border-color: transparent; color: #fff; }
.btn.approve:hover { filter: brightness(1.06); }
.btn.warn { background: var(--warn-bg); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(127, 127, 127, .1); }
.btn.danger, .menu-item.danger, .link-btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 12px; }
.btn.block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: transparent; color: var(--muted);
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: rgba(127, 127, 127, .12); color: var(--fg); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 560; font-size: 12.5px; display: inline-flex; gap: 4px; align-items: center; }
.link-btn:hover { text-decoration: underline; }

.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.5; }
select.input { padding-right: 28px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.input.sm { height: 30px; font-size: 13px; border-radius: 8px; padding: 0 9px; }
select.input.sm { width: auto; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field-label em { font-style: normal; font-weight: 450; color: var(--faint); margin-left: 6px; }
.error { color: var(--danger); font-size: 13px; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(127, 127, 127, .1); gap: 2px; }
.seg button { border: 0; background: none; height: 28px; min-width: 30px; padding: 0 8px; border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 560; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.seg button span { color: var(--faint); font-weight: 500; }
.seg.small { width: 100%; }
.seg.small button { flex: 1; }
.zoom .zoom-val { min-width: 48px; font-variant-numeric: tabular-nums; }

.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; background: rgba(127, 127, 127, .12); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }

.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.s-draft { background: var(--draft-soft); color: var(--draft); }
.s-review { background: var(--review-soft); color: var(--review); }
.s-changes { background: var(--warn-soft); color: var(--warn); }
.s-approved { background: var(--ok-soft); color: var(--ok); }

.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; font-weight: 650; color: #fff; background: hsl(var(--h, 250) 55% 52%); letter-spacing: .02em; }
.avatar.owner { background: var(--fg); color: var(--bg); }

.switch { width: 40px; height: 24px; border-radius: 99px; border: 0; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.switch.on { background: var(--accent); }
.switch.on i { transform: translateX(16px); }

.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .7s linear infinite; display: inline-block; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.kbd-hint { font-size: 11.5px; color: var(--faint); }

/* ---------- menu, modal, toast */
.menu-wrap { position: relative; display: inline-flex; }
.menu { position: absolute; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; z-index: 60; animation: pop .12s ease-out; }
.menu.right { right: 0; }
.menu.left { left: 0; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; font-size: 13.5px; text-align: left; }
.menu-item:hover { background: rgba(127, 127, 127, .1); }
.menu-item .ic { color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(12, 12, 16, .38); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: 100%; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: rise .18s cubic-bezier(.2, .9, .3, 1.2); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.modal-body { padding: 10px 20px 8px; overflow-y: auto; }
.modal-body form > p { margin-bottom: 16px; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 520; box-shadow: var(--shadow-lg); animation: rise .2s; max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger); color: #fff; }
.toast.ok .ic { color: #4ade80; }

/* ---------- auth & empty screens */
.center-screen { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-bg { background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth-card { width: 100%; max-width: 380px; padding: 30px 28px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.auth-card .input { text-align: left; }
.auth-card h2 { font-size: 20px; letter-spacing: -.015em; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; justify-content: center; }
.logo-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #6d5dfc, #4338ca); box-shadow: 0 4px 12px -4px rgba(67, 56, 202, .6); }
.brand-mark { font-weight: 750; font-size: 15px; letter-spacing: -.02em; }
.brand-mark.big { font-size: 18px; }
.lock-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin: 4px auto 0; background: var(--accent-soft); color: var(--accent); }

/* ---------- dashboard */
.dash { max-width: 1180px; margin: 0 auto; padding: 0 28px 64px; }
.dash-top { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.dash-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 22px 0 26px; }
.dash-hero h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 4px; }
.stats { display: flex; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; min-width: 128px; box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--review); }
.stat.warn b { color: var(--warn); }
.stat.accent b { color: var(--accent); }
.stat span { font-size: 12.5px; color: var(--muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.chip { height: 32px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 560; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.chip:hover { color: var(--fg); border-color: var(--faint); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip.add { border-style: dashed; }
.camp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.camp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease, border-color .18s; outline: none; }
.camp-card:hover, .camp-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.camp-card.archived { opacity: .7; }
.camp-thumbs { height: 168px; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 16px) / 3); justify-content: center; gap: 8px; padding: 14px 14px 0; background: var(--canvas); background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px); background-size: 14px 14px; overflow: hidden; }
.camp-thumbs img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 7px 7px 0 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); background: #fff; transition: transform .25s ease; }
.camp-card:hover .camp-thumbs img { transform: translateY(-4px); }
.camp-thumbs-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--faint); font-size: 13px; grid-column: 1 / -1; margin-top: -14px; }
.camp-body { padding: 14px 16px 15px; }
.camp-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.camp-top h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
.badge-count { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 650; }
.stack-bar { display: flex; height: 6px; border-radius: 99px; background: var(--draft-soft); overflow: hidden; margin-bottom: 10px; }
.stack-bar i { display: block; height: 100%; }
.stack-bar .approved { background: var(--ok-bg); }
.stack-bar .changes { background: var(--warn-bg); }
.stack-bar .review { background: var(--review); opacity: .75; }
.camp-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 550; }
.camp-foot .muted { font-weight: 450; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-empty { text-align: center; padding: 72px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; border: 1.5px dashed var(--line-2); border-radius: 20px; }
.dash-empty h2 { font-size: 20px; letter-spacing: -.015em; }
.dash-empty p { max-width: 400px; margin-bottom: 8px; }
.drop-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }

/* ---------- review layout */
.review { height: 100dvh; display: grid; grid-template-rows: 60px 1fr; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 14px 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 20; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar .sep { width: 1px; height: 22px; background: var(--line-2); }
.title-block { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.title-block h1 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { width: 120px; height: 6px; border-radius: 99px; background: var(--draft-soft); overflow: hidden; margin-left: 6px; flex: none; }
.progress i { display: block; height: 100%; background: var(--ok-bg); border-radius: 99px; transition: width .4s ease; }
.who-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 560; }

.review-body { display: grid; grid-template-columns: 236px minmax(0, 1fr) 368px; min-height: 0; }

/* rail */
.rail { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; transition: background .15s; }
.rail.drop-over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.rail-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px 16px; font-size: 12px; font-weight: 650; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.rail-list { list-style: none; margin: 0; padding: 6px 10px 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.rail-item { display: flex; gap: 10px; padding: 7px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.rail-item:hover { background: rgba(127, 127, 127, .07); }
.rail-item.on { background: var(--accent-soft); border-color: var(--accent-ring); }
.rail-item.dragging { opacity: .4; }
.rail-thumb { position: relative; width: 62px; height: 78px; flex: none; border-radius: 7px; overflow: hidden; background: var(--canvas); box-shadow: 0 0 0 1px var(--line) inset; }
.rail-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.rail-count { position: absolute; right: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 2px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; }
.rail-meta { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; }
.rail-name { font-size: 13px; font-weight: 580; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rail-name em { font-style: normal; color: var(--faint); font-weight: 600; margin-right: 5px; font-variant-numeric: tabular-nums; }
.rail-status { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.rail-status.approved { color: var(--ok); }
.rail-status.changes { color: var(--warn); }
.rail-status.in_review { color: var(--review); }
.rail-item.uploading { cursor: default; }
.up-bar { position: absolute; left: 8px; right: 8px; top: 50%; height: 4px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.rail-drop { margin: 0 10px 12px; height: 44px; border-radius: 11px; border: 1.5px dashed var(--line-2); background: none; color: var(--muted); font-size: 12.5px; font-weight: 560; display: flex; align-items: center; justify-content: center; gap: 7px; }
.rail-drop:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* stage */
.stage-area { isolation: isolate; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--canvas); background-image: radial-gradient(var(--canvas-dot) 1.1px, transparent 1.1px); background-size: 18px 18px; position: relative; }
.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.tb-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.design-title { font-size: 16px; font-weight: 650; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.banner { margin: 0 16px 6px; padding: 9px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.canvas-wrap { flex: 1; overflow: auto; padding: 8px 24px 140px; min-height: 0; }
.canvas-inner { display: flex; justify-content: center; gap: 28px; min-width: min-content; }
.canvas-inner .col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.col-label { font-size: 12px; font-weight: 650; color: var(--muted); background: var(--surface); padding: 3px 10px; border-radius: 99px; box-shadow: var(--shadow-sm); }
.col-label.current { color: var(--accent); }
.sheet { background: #fff; border-radius: 12px; box-shadow: var(--sheet-shadow); position: relative; }
.sheet > img { border-radius: 0 0 12px 12px; }
/* Mobile designs sit in a phone frame. The bezel is a box-shadow so it adds no width (the design keeps
   its exact size) and nothing is clipped (no overflow:hidden, so the comment popover can extend out). */
.sheet.phone { border-radius: 26px; margin: 10px; box-shadow: 0 0 0 9px #121214, 0 0 0 10px #34343a, var(--sheet-shadow); }
.sheet.phone .inbox { border-radius: 26px 26px 0 0; padding: 22px 14px 12px; }
.sheet.phone > img, .sheet.phone .stage img, .sheet.phone .skeleton { border-radius: 0 0 26px 26px; }
.stage { position: relative; }
.stage img { border-radius: 0 0 12px 12px; user-select: none; -webkit-user-drag: none; transition: opacity .25s; }
.stage img.loading { opacity: 0; position: absolute; top: 0; }
.stage.can-comment { cursor: crosshair; }
.skeleton { border-radius: 0 0 12px 12px; background: linear-gradient(90deg, #f1f1ef 25%, #e7e7e4 50%, #f1f1ef 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* inbox preview (always light: it's how the email looks) */
.inbox { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid #ececea; background: #fff; border-radius: 12px 12px 0 0; color: #1f1f23; font-size: 13px; }
.inbox.empty { cursor: pointer; }
.inbox.empty:hover .inbox-sub { color: #5b4cf0; }
.inbox-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; background: hsl(var(--h) 55% 50%); }
.inbox-text { min-width: 0; flex: 1; }
.inbox-row { display: flex; justify-content: space-between; gap: 10px; }
.inbox-row b { font-weight: 650; }
.inbox-row span { color: #8a8a92; font-size: 12px; flex: none; }
.inbox-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #1f1f23; }
.inbox-sub b { font-weight: 600; }
.inbox-sub span, .inbox-sub.muted { color: #74747c; }

/* pins */
.pin {
  position: absolute; z-index: 3; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50% 50% 50% 4px;
  display: grid; place-items: center; background: var(--accent); color: #fff; border: 2.5px solid #fff; font-size: 12.5px; font-weight: 750;
  box-shadow: 0 3px 10px rgba(30, 20, 120, .35); cursor: pointer; transition: transform .14s ease, box-shadow .14s;
  font-variant-numeric: tabular-nums; padding: 0;
}
.pin:hover { transform: scale(1.12); }
.pin.active { transform: scale(1.18); box-shadow: 0 0 0 5px var(--accent-ring), 0 4px 14px rgba(30, 20, 120, .4); z-index: 4; }
.pin.owner { background: #18181b; }
.pin.resolved { background: #16a34a; opacity: .7; transform: scale(.85); }
.pin.resolved:hover, .pin.resolved.active { opacity: 1; }
.pin.draft { background: var(--accent); border-style: dashed; animation: pulse-pin 1.4s ease-in-out infinite; pointer-events: none; }
@keyframes pulse-pin { 50% { box-shadow: 0 0 0 8px var(--accent-ring); } }

.popover { position: absolute; z-index: 30; width: 290px; transform: translate(22px, -14px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 10px; cursor: default; animation: pop .14s ease-out; }
.popover.flip { transform: translate(calc(-100% - 22px), -14px); }
.popover textarea { min-height: 76px; }
.popover-who { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; margin: 0 0 8px 2px; color: var(--muted); }
.popover-foot, .composer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }

/* decision bar */
.decision-bar { position: absolute; z-index: 15; left: 50%; bottom: 18px; transform: translateX(-50%); width: min(620px, calc(100% - 32px)); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--line); border-radius: 16px; padding: 10px 10px 10px 18px; box-shadow: var(--shadow-lg); z-index: 15; }
.decision-state { font-size: 13.5px; font-weight: 560; min-width: 0; }
.ok-text { color: var(--ok); display: inline-flex; gap: 6px; align-items: center; }
.warn-text { color: var(--warn); }
.hint-toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; background: var(--fg); color: var(--bg); padding: 9px 15px; border-radius: 99px; font-size: 13px; font-weight: 550; box-shadow: var(--shadow-lg); z-index: 14; pointer-events: none; animation: rise .4s .6s both; }

/* empty stage */
.empty-stage { flex: 1; display: grid; place-items: center; padding: 24px; }
.big-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 56px 48px; border-radius: 22px; border: 2px dashed var(--line-2); background: var(--surface); cursor: pointer; max-width: 520px; transition: border-color .15s, background .15s; }
.big-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.big-drop h2 { font-size: 20px; letter-spacing: -.015em; }
.big-drop .btn { margin-top: 10px; }

/* panel */
.panel { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-tabs { display: flex; align-items: center; gap: 4px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.panel-tabs > button:not(.icon-btn) { border: 0; background: none; padding: 9px 10px 11px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; }
.panel-tabs > button.on { color: var(--fg); border-bottom-color: var(--accent); }
.panel-tabs > button span { font-size: 11.5px; color: var(--accent); font-weight: 700; }
.panel-tabs .icon-btn { margin-left: auto; }

.comments { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.comments > .seg { margin: 12px 14px 4px; width: auto; }
.thread-list { flex: 1; overflow-y: auto; padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.thread { border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px 10px; background: var(--surface); cursor: pointer; transition: border-color .12s, box-shadow .12s, background .12s; }
.thread:hover { border-color: var(--line-2); }
.thread.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.thread.resolved { background: var(--surface-2); }
.thread.resolved .thread-body { color: var(--muted); }
.thread-head { display: flex; align-items: center; gap: 8px; }
.thread-num { width: 22px; height: 22px; border-radius: 50% 50% 50% 3px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 11px; font-weight: 750; flex: none; }
.thread.resolved .thread-num { background: #16a34a; }
.thread-num.general { background: var(--draft-soft); color: var(--muted); border-radius: 6px; }
.thread-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 7px; min-width: 0; flex: 1; font-size: 12.5px; }
.thread-who b { font-weight: 640; font-size: 13px; }
.thread-who span { color: var(--faint); }
.vtag { font-style: normal; font-weight: 650; color: var(--warn); }
.resolve { width: 28px; height: 28px; }
.resolve:hover { color: var(--ok); background: var(--ok-soft); }
.resolve.on { color: var(--ok); }
.thread-body { margin: 7px 0 2px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.reply { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.reply .thread-body { margin-top: 3px; }
.thread-actions { display: flex; gap: 14px; margin-top: 6px; }
.thread-actions .link-btn { color: var(--muted); }
.thread-actions .link-btn:hover { color: var(--accent); }
.composer { margin-top: 8px; }
.composer.compact textarea { min-height: 58px; }
.general-box { border-top: 1px solid var(--line); padding: 12px 14px 14px; }
.general-box .composer { margin: 0; }
.panel-empty { text-align: center; color: var(--faint); padding: 40px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13px; line-height: 1.55; }

/* details */
.details { overflow-y: auto; padding: 4px 16px 24px; }
.details section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.details section:last-child { border-bottom: 0; }
.details h4 { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin-bottom: 12px; }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.section-head h4 { margin: 0; }
.inline-edit { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: 1px solid transparent; background: var(--surface-2); padding: 8px 11px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; min-height: 38px; }
.inline-edit .ic { color: var(--faint); opacity: 0; transition: opacity .12s; }
.inline-edit:hover { border-color: var(--line-2); }
.inline-edit:hover .ic { opacity: 1; }
.inline-edit.empty { color: var(--faint); }
.inline-input { font-size: 13.5px; }
.status-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.status-opt { border: 1.5px solid transparent; background: none; padding: 1px; border-radius: 99px; opacity: .55; transition: opacity .12s; }
.status-opt:hover { opacity: .9; }
.status-opt.on { opacity: 1; border-color: currentColor; }
.versions { display: flex; flex-direction: column; gap: 6px; }
.version { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 11px; border: 1px solid transparent; }
.version:hover { background: var(--surface-2); }
.version.on { border-color: var(--accent-ring); background: var(--accent-soft); }
.version img { width: 40px; height: 50px; object-fit: cover; object-position: top; border-radius: 5px; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.version-info { flex: 1; display: flex; flex-direction: column; font-size: 12.5px; cursor: pointer; min-width: 0; }
.version-info b { font-size: 13.5px; }
.version-info span { color: var(--muted); }
.version-actions { display: flex; }
.version-actions .icon-btn { width: 30px; height: 30px; }
.mobile-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); font-size: 12.5px; flex-wrap: wrap; }
.mobile-row .muted { display: inline-flex; gap: 6px; align-items: center; }
.busy-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.decision { display: flex; gap: 10px; font-size: 13px; margin-bottom: 10px; }
.decision .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; }
.dot.ok { background: var(--ok-bg); }
.dot.warn { background: var(--warn-bg); }
.decision-note { margin-top: 4px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); white-space: pre-wrap; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.activity b { font-weight: 620; }

/* share modal */
.share-link { display: flex; gap: 8px; margin: 14px 0 6px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.toggle-row b { font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.toggle-row p { margin-top: 2px; }
.note { padding: 10px 12px; border-radius: 10px; font-size: 13px; margin-bottom: 12px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- responsive */
@media (max-width: 1180px) {
  .review-body { grid-template-columns: 210px minmax(0, 1fr); }
  .panel { position: fixed; top: 60px; right: 0; bottom: 0; width: min(380px, 100%); z-index: 30; box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
  .review.panel-open .panel { transform: none; }
  .only-small { display: inline-grid !important; }
  .progress { display: none; }
}
@media (max-width: 760px) {
  .review { grid-template-rows: 56px 1fr; }
  .review-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-head, .rail-drop { display: none; }
  .rail-list { flex-direction: row; overflow-x: auto; padding: 8px 10px; }
  .rail-item { flex-direction: column; width: 84px; flex: none; gap: 4px; padding: 5px; }
  .rail-thumb { width: 72px; height: 72px; }
  .rail-meta .rail-status { display: none; }
  .rail-name { font-size: 11.5px; -webkit-line-clamp: 1; }
  .panel { top: 56px; }
  .topbar-right .btn { font-size: 0; gap: 0; padding: 0 10px; }
  .who-chip { font-size: 0; gap: 0; padding: 0 4px; }
  .title-block .small { display: none; }
  .stage-toolbar { padding: 8px 12px; }
  .design-title { max-width: 180px; font-size: 14.5px; }
  .canvas-wrap { padding: 4px 12px 150px; }
  .decision-bar { bottom: 12px; padding: 8px 8px 8px 14px; }
  .decision-state { font-size: 12.5px; }
  .dash { padding: 0 16px 48px; }
  .dash-hero h1 { font-size: 23px; }
  .stats { width: 100%; }
  .stat { flex: 1; min-width: 0; padding: 10px 12px; }
  .stat b { font-size: 20px; }
  .popover { width: 240px; }
  .decision-bar { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .decision-state { width: 100%; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
  .decision-bar .row-tight { width: 100%; }
  .decision-bar .row-tight .btn { flex: 1; }
  .hint-toast { bottom: 124px; font-size: 12.5px; white-space: nowrap; }
}
