/* Waypoint — Alexi Hall
   Brand: Archivo (headings), Josefin Sans (body), Space Mono (eyebrows, numbers).
   The UI stays quiet so the content leads. */

:root {
  --bg: #F2F1EE;
  --surface: #FFFFFF;
  --surface-2: #F8F7F4;
  --line: #DEDCD6;
  --line-soft: #ECEAE5;
  --ink: #131313;
  --ink-2: #1C1C1C;
  --muted: #64635F;
  --grey: #929292;
  --ochre: #C9A876;
  --teal: #4A5C5A;
  --rust: #B3703F;
  --canvas: #8A8A86;
  --focus: #4A5C5A;

  --review-bg: #E2E9E8; --review-fg: #2F3D3B;
  --changes-bg: #F5E7DB; --changes-fg: #85471B;
  --muted-bg: #ECEAE5; --muted-fg: #55544F;

  --radius: 10px;
  --radius-sm: 7px;
  --head: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --body: 'Josefin Sans', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --shadow: 0 1px 2px rgba(19, 19, 19, 0.04), 0 2px 10px rgba(19, 19, 19, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.mono { font-family: var(--mono); letter-spacing: 0; }
.eyebrow { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.pad { padding: 16px; }
.error-text { color: var(--changes-fg); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-xs { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

.boot, .loading { padding: 64px 24px; text-align: center; color: var(--muted); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--body); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.btn:hover { border-color: #C9C6BE; background: var(--surface-2); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2A2A29; }
.btn.danger { background: var(--changes-fg); border-color: var(--changes-fg); color: #fff; }
.btn.warn { border-color: var(--rust); color: var(--changes-fg); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--line-soft); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 44px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-2); cursor: pointer; text-decoration: none; flex: none;
}
.icon-btn:hover { background: var(--line-soft); }
.icon-btn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.icon { display: inline-flex; line-height: 0; }

.link-btn { border: 0; background: none; padding: 2px 0; color: var(--ink-2); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.link-btn:hover { text-decoration-color: currentColor; }

.input {
  width: 100%; min-height: 40px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); line-height: 1.4;
}
textarea.input { resize: vertical; }
.input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.select-sm { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; max-width: 220px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; }
.field-error { color: var(--changes-fg); font-size: 13px; }
.check, .confirm-box { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; }
.check input, .confirm-box input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.confirm-box { padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.switch-row { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.switch-row input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--line); position: relative; cursor: pointer; margin: 0; transition: background 0.15s; }
.switch-row input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch-row input:checked { background: var(--teal); }
.switch-row input:checked::after { transform: translateX(16px); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--muted-bg); color: var(--muted-fg); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.review { background: var(--review-bg); color: var(--review-fg); }
.chip.changes { background: var(--changes-bg); color: var(--changes-fg); }
.chip.approved { background: var(--ink); color: #fff; }

.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted-fg); }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  min-height: 56px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--line-soft);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 24px; }
.topbar-right { gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { display: block; height: 18px; width: auto; }
.login-header .brand-logo { height: 20px; }
.brand-name { font: 700 15px/1 var(--head); }
.brand-sep { width: 1px; height: 16px; background: var(--line); }
.brand-product { font: 500 15px/1 var(--head); color: var(--muted); }
.topnav { display: flex; gap: 20px; }
.topnav a { text-decoration: none; font-weight: 600; color: var(--muted); padding: 6px 0; border-bottom: 2px solid transparent; }
.topnav a.on, .topnav a:hover { color: var(--ink); }
.topnav a.on { border-bottom-color: var(--ochre); }
.user-email { font-size: 13px; color: var(--muted); }

.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 24px 80px; display: flex; flex-direction: column; gap: 24px; }
.page.wide { max-width: 1320px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 30px; font-weight: 700; }
.crumbs { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 17px; font-weight: 600; }

.empty { padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h2 { font-size: 20px; }
.empty p { color: var(--muted); max-width: 46ch; }
.empty .row { margin-top: 8px; }

/* ---------- Home ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); text-decoration: none; box-shadow: var(--shadow); transition: border-color 0.12s, transform 0.12s; }
.project-card:hover { border-color: var(--ochre); }
.project-card-head { display: flex; align-items: center; gap: 10px; }
.type-badge { width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--teal); }
.project-card-title { font-size: 18px; font-weight: 600; }
.project-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.segs { display: flex; gap: 4px; }
.seg { flex: 1; height: 4px; border-radius: 2px; background: var(--line-soft); }
.seg.done { background: var(--ink); }
.seg.now { background: var(--ochre); }

.table-wrap { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; min-width: 820px; }
.table th { text-align: left; font: 400 11px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table a { text-decoration: none; }

/* ---------- Project ---------- */
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.stage-card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.stage-card.current { border-color: var(--ochre); box-shadow: 0 0 0 1px var(--ochre), var(--shadow); }
.stage-card.locked { background: var(--surface-2); box-shadow: none; }
.stage-top { display: flex; align-items: center; gap: 10px; }
.stage-num { width: 26px; height: 26px; border-radius: 50%; background: var(--line-soft); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.stage-card.current .stage-num { background: var(--ochre); color: var(--ink); }
.stage-name { font-size: 15px; font-weight: 600; flex: 1; min-width: 0; }
.vpills { display: flex; gap: 6px; flex-wrap: wrap; }
.vpill { height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font: 400 12px/1 var(--mono); cursor: pointer; color: var(--muted-fg); }
.vpill.draft { border-style: dashed; }
.vpill.review { background: var(--review-bg); border-color: transparent; color: var(--review-fg); }
.vpill.changes { color: var(--grey); text-decoration: line-through; }
.vpill.approved { background: var(--ink); border-color: var(--ink); color: #fff; }
.vpill.on { outline: 2px solid var(--ochre); outline-offset: 1px; }
.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line-soft); }

.split { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.split > .card:first-child { flex: 999 1 600px; min-width: 0; }
.split > .activity { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.asset-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.asset-thumb { aspect-ratio: 4 / 3; border-radius: 8px; background: var(--canvas); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.asset-thumb img { max-width: 92%; max-height: 92%; object-fit: contain; }
.asset-thumb:hover { outline: 2px solid var(--ochre); outline-offset: 1px; }
.thumb-ph { width: 40%; height: 40%; border-radius: 4px; background: rgba(255, 255, 255, 0.15); }
.asset-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.asset-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }

.dropzone { border: 1.5px dashed #BDBAB2; border-radius: var(--radius); background: var(--surface-2); padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; cursor: pointer; color: var(--muted-fg); }
.dropzone strong { color: var(--ink); font-size: 15px; }
.dropzone:hover, .dropzone.over { border-color: var(--teal); background: #EEF2F1; }
.upload-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.upload-list li { display: flex; flex-direction: column; gap: 6px; }
.bar { height: 4px; border-radius: 2px; background: var(--line-soft); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--teal); transition: width 0.2s; }
.upload-list li.failed .bar-fill { background: var(--rust); }

.decision-note { margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--changes-bg); display: flex; flex-direction: column; gap: 6px; }
.decision-note p { white-space: pre-wrap; }

.events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.events li { display: flex; gap: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grey); margin-top: 6px; flex: none; }
.dot.approved { background: var(--ink); }
.dot.changes { background: var(--rust); }
.dot.review { background: var(--teal); }
.dot.warn { background: var(--ochre); }

/* ---------- Clients ---------- */
.login-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.login-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; }
.login-header { display: flex; align-items: center; gap: 10px; padding: 24px 32px; }
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line-soft); border-top: 3px solid var(--ochre); border-radius: 14px; padding: 40px; display: flex; flex-direction: column; gap: 18px; box-shadow: var(--shadow); }
.login-card-inner { display: flex; flex-direction: column; gap: 18px; }
.login-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.login-card .link-btn { align-self: center; font-weight: 500; color: var(--muted); }
.login-card .link-btn.inline { align-self: auto; display: inline; padding: 0; color: inherit; font-weight: 600; }
.auth-eyebrow { margin: 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }
.auth-lede { margin: 0; line-height: 1.55; }
.auth-msgs:empty { display: none; }
.auth-notice { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--line-soft); }
.auth-notice.warn { background: var(--changes-bg); border-color: transparent; color: var(--changes-fg); }
.auth-notice.ok { background: var(--review-bg); border-color: transparent; color: var(--review-fg); }
.auth-notice strong { font-weight: 700; word-break: break-all; }
.auth-notice .block-line { display: block; margin-top: 6px; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }
.google-btn { gap: 10px; background: var(--surface); }
.google-btn .g-mark { display: inline-flex; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { width: 100%; padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; padding: 6px 8px; font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); cursor: pointer; border-radius: 6px; }
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pw-rules { list-style: none; margin: -6px 0 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pw-rules li::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; border: 1.5px solid var(--line); vertical-align: 0; }
.pw-rules li.ok { color: var(--review-fg); }
.pw-rules li.ok::before { background: var(--teal); border-color: var(--teal); }
.account-email { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.account-email-value { font-weight: 600; word-break: break-all; }
.center { text-align: center; align-self: center; }
.acct-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.acct-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grey); flex: none; }
.acct-status.ok .dot { background: var(--teal); }
.acct-status.warn { color: var(--changes-fg); }
.acct-status.warn .dot { background: var(--rust); }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.login-footer { text-align: center; padding: 24px; font-size: 12px; color: var(--muted); }

/* ---------- Dialogs and toasts ---------- */
.backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(19, 19, 19, 0.5); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { width: 100%; background: var(--surface); border-radius: 14px; padding: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; gap: 20px; max-height: calc(100vh - 48px); overflow: auto; }
.modal-title { font-size: 21px; font-weight: 700; }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.summary { margin: 0; display: flex; flex-direction: column; }
.summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.summary > div:last-child { border-bottom: 1px solid var(--line-soft); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; text-align: right; }
.note.warn { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--changes-bg); color: var(--changes-fg); font-size: 13px; }
.shortcuts { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.shortcuts div { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.shortcuts dt { width: 130px; flex: none; }
.shortcuts dd { margin: 0; }
kbd { font: 400 11.5px/1 var(--mono); padding: 4px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); }

#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 9px; font-size: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); max-width: min(520px, 90vw); transition: opacity 0.3s, transform 0.3s; }
.toast.error { background: var(--changes-fg); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- Review screen ---------- */
.viewer-loading { min-height: 100vh; }
.viewer { height: 100vh; display: flex; flex-direction: column; background: var(--canvas); overflow: hidden; }
.v-bar { flex: none; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px 0 6px; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.v-bar-left, .v-bar-mid, .v-bar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v-bar-left { flex: 1; }
.v-bar-right { flex: 1; justify-content: flex-end; }
.v-crumb { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.v-body { flex: 1; min-height: 0; display: flex; }

.v-tools { width: 52px; flex: none; background: var(--surface); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; overflow-y: auto; }
.tool { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.tool:hover { background: var(--line-soft); }
.tool.on { background: var(--review-bg); color: var(--teal); }
.tool-sep { width: 24px; height: 1px; background: var(--line-soft); margin: 6px 0; flex: none; }
.swatches { display: flex; flex-direction: column; gap: 9px; padding: 4px 0; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.18); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.wline { display: block; width: 18px; background: currentColor; border-radius: 2px; }
.v-tools .grow { flex: 1; min-height: 8px; }

.rail { flex: none; width: 36px; border: 0; background: var(--surface); border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 12px; cursor: pointer; color: var(--ink-2); }
.rail.right { border-right: 0; border-left: 1px solid var(--line-soft); }
.rail:hover { background: var(--surface-2); }
.rail-count { font: 700 11px/1 var(--mono); color: var(--changes-fg); }

.v-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.v-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; background: var(--canvas); cursor: crosshair; touch-action: none; outline: none; user-select: none; }
.v-stage[data-tool="select"] { cursor: default; }
.v-stage[data-tool="hand"], .v-stage.space { cursor: grab; }
.v-stage.panning { cursor: grabbing; }
.v-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.v-world.pixelated .v-img { image-rendering: pixelated; }
.v-img { max-width: none; user-select: none; -webkit-user-drag: none; box-shadow: 0 4px 24px rgba(0, 0, 0, 0.16); }
.v-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.v-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; padding: 24px; text-align: center; }

.v-status { flex: none; height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 10px 0 14px; background: var(--surface); border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.v-status .mono { font-size: 12px; }
.zoom-val { width: 48px; text-align: center; }
.bg-swatch { width: 22px; height: 22px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.15); cursor: pointer; padding: 0; }
.bg-swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }

.v-panel { width: 340px; flex: none; background: var(--surface); border-left: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; }
.v-panel-head { flex: none; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line-soft); }
.v-panel-title { font-size: 15px; font-weight: 600; }
.c-filter { flex: none; display: flex; gap: 6px; padding: 12px 16px; }
.c-list { flex: 1; min-height: 0; overflow-y: auto; }
.thread { padding: 14px 16px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; cursor: pointer; }
.thread:hover { background: var(--surface-2); }
.thread.on { background: #EEF2F1; box-shadow: inset 3px 0 0 var(--teal); }
.thread.resolved .thread-text { color: var(--muted); }
.thread-head { display: flex; align-items: center; gap: 10px; }
.num { width: 22px; height: 22px; border-radius: 50%; color: #fff; font: 700 11px/22px var(--mono); text-align: center; flex: none; }
.num.general { background: var(--line-soft); color: var(--muted-fg); display: inline-flex; align-items: center; justify-content: center; }
.thread-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.thread-kinds { margin-left: auto; text-align: right; }
.thread-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; padding-left: 32px; }
.thread > .mono { padding-left: 32px; }
.reply { margin-left: 32px; padding: 8px 0 0 12px; border-left: 2px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.reply .thread-text { padding-left: 0; }
.reply .link-btn { align-self: flex-start; }
.reply-form { margin-left: 32px; display: flex; flex-direction: column; gap: 8px; }
.thread-actions { display: flex; gap: 16px; padding-left: 32px; }
.c-composer { flex: none; border-top: 1px solid var(--line-soft); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.c-pending { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.c-pending .link-btn { margin-left: auto; }
.c-input { min-height: 72px; }

/* Phones: simple centred preview */
.simple-viewer { min-height: 100vh; display: flex; flex-direction: column; background: var(--canvas); }
.simple-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); }
.simple-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.simple-stage img { max-width: 100%; max-height: 60vh; object-fit: contain; }
.simple-note { background: var(--surface); border-radius: 18px 18px 0 0; padding: 22px 20px 30px; display: flex; flex-direction: column; gap: 10px; }

@media (max-width: 899px) {
  .topbar { padding: 8px 16px; }
  .user-email { display: none; }
  .page { padding: 24px 16px 64px; }
  .page-title { font-size: 26px; }
  .login-card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
