/* ==========================================================================
   WordPromise — Website Preview Portal
   Brand colours (--brand, --ink …) are set per brand in the page <head>.
   ========================================================================== */

:root {
  --brand: #745DA8;
  --brand-deep: #503A7E;
  --brand-soft: #A792DD;
  --brand-tint: #E8E1F5;
  --brand-wash: #F5F2FB;
  --ink: #1B1528;
  --ink-2: #251D38;

  --ground: #F7F6FA;
  --surface: #FFFFFF;
  --surface-2: #FBFAFD;
  --line: #E6E2EE;
  --line-2: #D6D1E0;
  --text: #1F1B26;
  --muted: #5B5668;
  --faint: #6F6A7C;

  --good: #1E7A4C;
  --good-ink: #155C39;
  --good-tint: #E3F2EA;
  --warn: #C2620F;
  --warn-ink: #8A4208;
  --warn-tint: #FBEBDD;
  --info: #1D6FA5;
  --info-ink: #155479;
  --info-tint: #E1EFF8;
  --danger: #B42318;
  --danger-tint: #FDECEA;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(27, 21, 40, .04), 0 4px 16px rgba(27, 21, 40, .05);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--text); background: var(--ground); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--brand-deep); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--mono); font-size: .9em; background: var(--brand-wash); padding: 1px 5px; border-radius: 5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.i { flex-shrink: 0; vertical-align: -3px; }

/* ---------- type ---------- */
.display { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4vw, 48px); line-height: 1.05; letter-spacing: -.01em; margin: 0; color: var(--ink); }
.display em { font-style: italic; color: var(--brand); }
.display--xl { font-size: clamp(40px, 5vw, 62px); line-height: 1.02; }
.display--md { font-size: 32px; line-height: 1.1; }
.h2 { font-size: 26px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.h3 { font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.h4 { font-size: 17px; line-height: 1.35; font-weight: 600; margin: 0; }
.h5 { font-size: 14px; font-weight: 600; margin: 0 0 6px; padding: 0; }
.lead { font-size: 17px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 640px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 500; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.good-text { color: var(--good-ink); }
p { margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- layout helpers ---------- */
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 24px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-gap { display: flex; align-items: center; gap: 10px; }
.row-wrap { flex-wrap: wrap; }
.row-end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.ta-right { text-align: right; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; }
.grid-2--top { align-items: start; margin-top: 20px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 500; line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-deep); color: #fff; }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: var(--brand-deep); color: #fff; }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn--secondary:hover { border-color: var(--brand-soft); background: var(--brand-wash); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: transparent; }
.btn--ghost:hover { background: var(--brand-wash); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #8f1c13; color: #fff; }
.btn--outline-light { background: transparent; color: #F3F0F8; border-color: rgba(255,255,255,.22); }
.btn--outline-light:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn--disabled, .btn[disabled] { background: #E4E0EA; color: #5B5668; cursor: not-allowed; border-color: transparent; }
.btn--lg { min-height: 52px; font-size: 16px; padding: 0 22px; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn--xs { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn--grow { flex: 1; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.icon-btn:hover:not([disabled]) { color: var(--ink); border-color: var(--line-2); background: var(--brand-wash); }
.icon-btn--danger:hover:not([disabled]) { color: var(--danger); border-color: #F3C3BE; background: var(--danger-tint); }
.icon-btn[disabled] { opacity: .35; cursor: default; }
.link-btn { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 14px; color: var(--brand-deep); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.link-quiet { color: var(--muted); text-decoration: none; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 8px; }
.link-quiet:hover { background: var(--brand-wash); color: var(--ink); }
.link-strong { font-weight: 500; text-decoration: none; color: var(--brand-deep); }
.link-strong:hover { text-decoration: underline; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 6px; }
.back-link:hover { color: var(--ink); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--inline { flex-direction: row; align-items: center; gap: 10px; }
.field--grow { flex: 1 1 240px; }
label, .label { font-size: 14px; font-weight: 500; color: var(--text); }
.hint { font-size: 13px; color: var(--faint); line-height: 1.45; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface);
  font: inherit; font-size: 15px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 0; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
input::placeholder, textarea::placeholder { color: #8F899C; }
input[type=file] { font: inherit; font-size: 14px; }
.input--sm { min-height: 38px !important; padding: 7px 11px !important; font-size: 14px !important; border-radius: 8px !important; }
.input--xs { width: 80px !important; min-height: 38px !important; }
.input--mono { font-family: var(--mono) !important; font-size: 13px !important; }
.input--code { font-family: var(--mono) !important; font-size: 18px !important; letter-spacing: .18em; text-transform: uppercase; min-height: 54px !important; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 400; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); flex-shrink: 0; }
.check--row { display: flex; }
.color-row { display: flex; align-items: center; gap: 12px; }
.color-row input[type=color] { width: 52px; height: 44px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); cursor: pointer; }
.input-copy { display: flex; gap: 8px; }
.input-copy input { font-family: var(--mono); font-size: 13px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.add-row { display: flex; gap: 10px; align-items: center; }
.add-row--wrap { flex-wrap: wrap; }
.add-row--wrap > input { flex: 1 1 160px; width: auto; }

/* ---------- segmented controls & tabs ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: #ECE9F1; border-radius: 10px; flex-wrap: wrap; }
.seg label, .seg button, .seg a { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 7px; padding: 8px 14px; font: inherit; font-size: 14px; color: var(--muted); text-decoration: none; cursor: pointer; }
.seg [aria-selected=true], .seg [aria-pressed=true], .seg label:has(input:checked) { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.seg label input { accent-color: var(--ink); }
.seg--icons button { padding: 7px 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 28px 0 20px; overflow-x: auto; }
.tabs a { padding: 12px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--brand); }
.tabs__count { font-size: 12px; background: #ECE9F1; border-radius: 999px; padding: 1px 8px; margin-left: 4px; color: var(--muted); }

/* ---------- cards, badges, alerts ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.card--ink { background: var(--ink); border-color: var(--ink); color: #F3F0F8; }
.card--danger { border-color: #F3C3BE; }
.on-ink-muted { color: #B7AFC8; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge--good { background: var(--good-tint); color: var(--good-ink); }
.badge--warn { background: var(--warn-tint); color: var(--warn-ink); }
.badge--brand { background: var(--brand-tint); color: var(--brand-deep); }
.badge--info { background: var(--info-tint); color: var(--info-ink); }
.badge--neutral { background: #ECE9F1; color: var(--muted); }
.tag { display: inline-flex; font-size: 12px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--line-2); color: var(--text); white-space: nowrap; background: var(--surface); }
.tag--ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip { display: inline-flex; font-size: 13px; font-weight: 500; padding: 4px 11px; border-radius: 999px; }
.chip--ink { background: var(--ink); color: #fff; }
.chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.alert { padding: 12px 16px; border-radius: var(--r); font-size: 14px; line-height: 1.5; border: 1px solid transparent; }
.alert + .alert { margin-top: 8px; }
.alert--success { background: var(--good-tint); color: var(--good-ink); border-color: #C5E5D3; }
.alert--error { background: var(--danger-tint); color: #8A1C12; border-color: #F3C3BE; }
.alert--info { background: var(--info-tint); color: var(--info-ink); border-color: #C3DDF0; }
.empty { padding: 28px; border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); color: var(--muted); text-align: center; background: var(--surface-2); }
.empty--lg { padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-deep); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.avatar--sm { width: 30px; height: 30px; font-size: 11px; background: #ECE9F1; color: var(--muted); }
.avatar--brand { background: var(--brand-tint); color: var(--brand-deep); }
.avatar--dark { background: rgba(255,255,255,.12); color: #fff; width: 30px; height: 30px; font-size: 11px; }
.dot { width: 9px; height: 9px; border-radius: 3px; background: #D6D1E0; display: inline-block; flex-shrink: 0; }
.dot--good { background: var(--good); }
.dot--warn { background: var(--warn); }
.dot--brand { background: var(--brand); }

/* progress */
.bar { height: 6px; border-radius: 999px; background: #ECE9F1; overflow: hidden; }
.bar--w100 { width: 100px; }
.bar--w160 { width: 160px; }
.bar__fill { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.bar__fill--good { background: var(--good); }
.bar__fill--warn { background: var(--warn); }
.bar__fill--brand { background: var(--brand); }
.stackbar { height: 10px; border-radius: 999px; background: #ECE9F1; display: flex; overflow: hidden; }
.stackbar span { height: 100%; }
.stackbar__good { background: var(--good); }
.stackbar__warn { background: var(--warn); }
.stackbar__brand { background: var(--brand); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 7px; }

/* lists */
.filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.filelist li { display: flex; align-items: center; gap: 10px; }
.filelist a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: inherit; min-width: 0; overflow-wrap: anywhere; }
.filelist a:hover { text-decoration: underline; }
.filelist--boxed li { padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.filelist--boxed li a { flex: 1; }
.filelist--ink li { justify-content: space-between; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.12); }
.filelist--ink a { color: #F3F0F8; }
.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.activity li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.activity li > div { display: flex; flex-direction: column; }
.file-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.file-chip:hover { border-color: var(--brand-soft); }

/* menu */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu__panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; z-index: 30; }
.menu__who { padding: 10px 12px; display: flex; flex-direction: column; font-size: 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu__who span { color: var(--faint); font-size: 13px; overflow-wrap: anywhere; }
.menu__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; background: none; border: 0; border-radius: 8px; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.menu__item:hover { background: var(--brand-wash); }

/* ==========================================================================
   Client portal
   ========================================================================== */
.client-body { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__inner { max-width: 1280px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar__inner--wide { max-width: none; }
.topbar__brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); min-width: 0; }
.topbar__logo { height: 34px; width: auto; display: block; }
.topbar__divider { width: 1px; height: 24px; background: var(--line); }
.topbar__title { font-size: 15px; font-weight: 500; white-space: nowrap; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.wordmark { font-size: 19px; font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.wordmark--light { color: #fff; }
.flash-wrap { max-width: 1280px; margin: 16px auto 0; padding: 0 24px; width: 100%; }
.flash-wrap--wide { max-width: none; }
.client-footer { margin-top: auto; padding: 28px 24px; text-align: center; font-size: 13px; color: var(--faint); }
.page { max-width: 1280px; width: 100%; margin: 0 auto; padding: 44px 24px 56px; display: flex; flex-direction: column; gap: 44px; }
@media (max-width: 640px) {
  .topbar__divider, .topbar__title, .hide-sm { display: none; }
  .page { padding-top: 28px; gap: 32px; }
}

/* sign-in */
.signin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.signin__intro { flex: 1 1 560px; min-width: 0; background: var(--ink); color: #F3F0F8; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; position: relative; overflow: hidden; }
.signin__intro::after { content: ""; position: absolute; right: -180px; bottom: -220px; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 38%, transparent), transparent 70%); pointer-events: none; }
.signin__brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; position: relative; z-index: 1; }
.signin__logo { height: 46px; width: auto; display: block; }
.signin__divider { width: 1px; height: 30px; background: rgba(255,255,255,.2); }
.signin__eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: #B7AFC8; }
.signin__copy { display: flex; flex-direction: column; gap: 22px; max-width: 560px; position: relative; z-index: 1; }
.signin__copy .display { color: #fff; }
.signin__copy .display em { color: var(--brand-soft); }
.eyebrow--light { color: #B7AFC8; }
.lead--light { color: #D3CCDF; }
.signin__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 560px; position: relative; z-index: 1; }
.signin__steps li { border-top: 1px solid rgba(255,255,255,.18); padding-top: 14px; font-size: 15px; }
.signin__steps span { display: block; font-size: 13px; color: #B7AFC8; }
.signin__form-wrap { flex: 1 1 480px; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 56px 24px; }
.signin__form { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 24px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link-request summary { list-style: none; }
.link-request summary::-webkit-details-marker { display: none; }
.link-request[open] summary { display: none; }
.link-request__form { padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
@media (max-width: 640px) {
  .signin__intro { padding: 32px 20px; gap: 32px; }
  .signin__steps { grid-template-columns: 1fr; }
}

/* dashboard */
.hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 32px; }
.hero-row__text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.progress-card { flex: 0 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow); }
.progress-card__head { display: flex; justify-content: space-between; align-items: baseline; }
.progress-card__pct { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.state { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 10px; font-size: 14px; font-weight: 500; text-align: center; padding: 8px 12px; }
.state--good { background: var(--good-tint); color: var(--good-ink); }
.state--brand { background: var(--brand-wash); color: var(--brand-deep); }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.page-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s; }
.page-card:hover { border-color: var(--brand-soft); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--text); }
.page-card[hidden] { display: none; }
.page-card__thumb { height: 136px; background: var(--brand-wash); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.sk { display: block; background: color-mix(in srgb, var(--brand) 14%, #fff); border-radius: 4px; }
.sk--line { height: 10px; width: 42%; }
.sk--block { flex: 1; border-radius: 6px; background: color-mix(in srgb, var(--brand) 10%, #fff); }
.sk-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sk--tile { height: 26px; }
.page-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.page-card__title { font-size: 16px; font-weight: 600; }
.split { display: flex; flex-wrap: wrap; gap: 20px; }
.split__main { flex: 1 1 520px; min-width: 0; }
.split__side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; }
.split__side .upload-inline { margin-top: auto; padding-top: 8px; }

/* review */
.is-wide .client-footer { display: none; }
.review { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.review__bar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.review__bar-left, .review__bar-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.review__heading { display: flex; flex-direction: column; }
.review__body { display: flex; flex-wrap: wrap; flex: 1; align-items: stretch; }
.review__preview { flex: 999 1 560px; min-width: 0; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.review__hint { text-align: center; }
.browser { width: 100%; max-width: 1180px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: max-width .25s ease; height: calc(100vh - 200px); min-height: 560px; }
.browser[data-device=tablet] { max-width: 820px; }
.browser[data-device=mobile] { max-width: 400px; }
.browser__chrome { height: 40px; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 12px 0 14px; flex-shrink: 0; }
.browser__dots { display: flex; gap: 6px; }
.browser__dots i { width: 10px; height: 10px; border-radius: 50%; background: #DCD7E4; }
.browser__url { flex: 1; min-width: 0; font-size: 12px; color: var(--faint); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 3px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser__open { color: var(--muted); display: inline-flex; padding: 6px; border-radius: 6px; }
.browser__open:hover { background: var(--brand-wash); color: var(--ink); }
.browser iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.review__panel { flex: 1 1 440px; min-width: 0; max-width: 100%; background: var(--surface); border-left: 1px solid var(--line); padding: 24px 28px 32px; display: flex; flex-direction: column; gap: 22px; }
@media (min-width: 1100px) { .review__panel { max-width: 520px; } }
@media (max-width: 1040px) { .review__panel { border-left: 0; border-top: 1px solid var(--line); } .browser { height: 70vh; min-height: 420px; } }
.steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; }
.steps__item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; }
.steps__item:hover { background: var(--brand-wash); color: var(--ink); }
.steps__item.is-current { background: var(--brand-tint); color: var(--ink); font-weight: 500; }
.steps__num { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; background: #ECE9F1; color: var(--muted); flex-shrink: 0; }
.steps__num--good { background: var(--good); color: #fff; }
.steps__num--warn { background: var(--warn); color: #fff; }
.steps__num--brand { background: var(--brand); color: #fff; }
.steps__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section-head { display: flex; flex-direction: column; gap: 6px; }
.current-copy { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
.current-copy summary { font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.current-copy p { margin-top: 10px; font-size: 15px; line-height: 1.65; color: var(--text); max-height: 280px; overflow-y: auto; }
.history { border-radius: var(--r); background: var(--warn-tint); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.history__head { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--warn-ink); }
.history blockquote, .readonly blockquote { margin: 0; padding-left: 12px; border-left: 3px solid rgba(0,0,0,.12); white-space: normal; }
.history__done { display: flex; gap: 8px; align-items: center; color: var(--good-ink); font-weight: 500; }
.readonly { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choices legend { font-size: 14px; font-weight: 500; margin-bottom: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 78px; padding: 10px 6px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; text-align: center; color: var(--text); background: var(--surface); transition: border-color .15s, background .15s; }
.choice:hover .choice__box { border-color: var(--brand-soft); }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice--good input:checked + .choice__box { background: var(--good-tint); border: 1.5px solid var(--good); color: var(--good-ink); }
.choice--warn input:checked + .choice__box { background: var(--warn-tint); border: 1.5px solid var(--warn); color: var(--warn-ink); }
.choice--brand input:checked + .choice__box { background: var(--brand-tint); border: 1.5px solid var(--brand); color: var(--brand-deep); }
.fb-form { display: flex; flex-direction: column; gap: 18px; }
.fb-form.js-ready [data-when] { display: none; }
.fb-form.js-ready [data-when].is-shown { display: flex; }
.note { border-radius: var(--r); padding: 14px 16px; font-size: 14px; line-height: 1.5; }
.note--good { background: var(--good-tint); color: var(--good-ink); }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--surface-2); padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer; color: var(--muted); font-weight: 400; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-wash); }
.dropzone:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.dropzone__title { font-size: 14px; font-weight: 500; color: var(--ink); }
.dropzone__files { color: var(--brand-deep); font-weight: 500; }
.fb-form__foot { display: flex; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.approve-rest { border-top: 1px dashed var(--line); padding-top: 12px; }
.page-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--good-tint); color: var(--good-ink); }

/* ==========================================================================
   Admin
   ========================================================================== */
.admin { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 236px; max-width: 100%; background: var(--ink); color: #C9C2D6; padding: 24px 14px; display: flex; flex-direction: column; gap: 28px; }
@media (min-width: 900px) { .side { flex: 0 0 248px; position: sticky; top: 0; height: 100vh; } }
.side__brand { display: flex; flex-direction: column; gap: 8px; padding: 0 10px; text-decoration: none; }
.side__logo { height: 30px; width: auto; align-self: flex-start; }
.side__sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #A79FB8; }
.side__nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side__nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: #C9C2D6; text-decoration: none; font-size: 15px; }
.side__nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side__nav a.is-active { background: rgba(255,255,255,.1); color: #fff; }
.side__count { margin-left: auto; background: var(--warn); color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; }
.side__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding: 16px 10px 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.side__user { display: flex; align-items: center; gap: 10px; color: #fff; }
.side__logout { background: none; border: 0; color: #A79FB8; font: inherit; font-size: 14px; display: inline-flex; gap: 8px; align-items: center; cursor: pointer; padding: 6px 0; }
.side__logout:hover { color: #fff; }
@media (max-width: 899px) {
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; }
  .side__nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .side__foot { flex-direction: row; border: 0; padding: 0; margin: 0 0 0 auto; }
  .side__user span:last-child { display: none; }
}
.admin__main { flex: 999 1 640px; min-width: 0; padding: 36px 36px 64px; display: flex; flex-direction: column; gap: 24px; max-width: 1360px; }
.admin__main > .alert + .alert { margin-top: -16px; }
@media (max-width: 640px) { .admin__main { padding: 24px 16px 48px; } }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head p { margin-top: 6px; max-width: 680px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpis--5 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi__label { font-size: 13px; color: var(--muted); }
.kpi__value { font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; color: var(--ink); }
.kpi__value--good { color: var(--good-ink); }
.kpi__value--warn { color: var(--warn-ink); }
.kpi__value--brand { color: var(--brand-deep); }
.kpi__sub { font-size: 13px; color: var(--faint); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.search input { min-width: 240px; min-height: 42px !important; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow-x: auto; }
.table-wrap--flat { border: 0; border-radius: 0; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid #EFEDF3; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table__title { font-weight: 600; color: var(--ink); text-decoration: none; }
.table__title:hover { text-decoration: underline; }
.next-step { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 20px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); border-left-width: 1px; position: relative; }
.next-step--feedback { background: var(--warn-tint); border-color: #F2D3B6; }
.next-step--in_production { background: var(--info-tint); border-color: #C3DDF0; }
.next-step--approved { background: var(--good-tint); border-color: #C5E5D3; }
.next-step--in_review { background: var(--brand-wash); border-color: var(--brand-tint); }
.next-step__text { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.next-step__form { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.next-step__form .field:not(.field--grow) { flex: 0 1 190px; }
.next-step__aside { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.code-box { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--brand-wash); }
.code-box__code { font-family: var(--mono); font-size: 26px; letter-spacing: .14em; font-weight: 500; color: var(--ink); }
.rounds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rounds li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.rounds__no { width: 34px; height: 34px; border-radius: 8px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.rounds__meta { flex: 1; color: var(--muted); }
.pagebox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pagebox__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.pagebox__head::-webkit-details-marker { display: none; }
.pagebox__head::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.pagebox[open] > .pagebox__head::before { transform: rotate(45deg); }
.pagebox__title { font-weight: 600; font-size: 16px; }
.pagebox__url { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pagebox__body { padding: 4px 20px 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.seclist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.seclist__item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.seclist__num { width: 26px; height: 26px; border-radius: 50%; background: #ECE9F1; color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 6px; }
.seclist__form { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.seclist__row { display: flex; gap: 8px; align-items: center; width: 100%; flex-wrap: wrap; }
.seclist__name { flex: 1 1 260px; width: auto !important; font-weight: 500; }
.seclist__anchor { flex: 0 1 180px; width: auto !important; }
.seclist__excerpt { font-size: 13px !important; color: var(--muted) !important; }
.seclist__tools { display: flex; flex-direction: column; gap: 4px; }
.add-row .grow { flex: 1 1 220px; }

/* brief */
.brief-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.brief-options { flex: 1 1 280px; min-width: 0; }
@media (min-width: 1100px) { .brief-options { position: sticky; top: 24px; max-width: 320px; } }
.brief-doc { flex: 999 1 620px; min-width: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.brief-doc__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.brief-doc__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.brief { padding: 32px 36px 36px; display: flex; flex-direction: column; gap: 32px; }
@media (max-width: 640px) { .brief { padding: 24px 18px; } }
.brief__head { display: flex; flex-direction: column; gap: 8px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.brief__instructions { margin-top: 8px; padding: 12px 14px; border-radius: 10px; background: var(--brand-wash); color: var(--brand-deep); font-size: 14px; }
.brief__page { display: flex; flex-direction: column; gap: 14px; }
.brief-item { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--r); border: 1px solid transparent; transition: opacity .2s; }
.brief-item--warn { background: #FDF6EF; }
.brief-item--brand { background: var(--brand-wash); }
.brief-item.is-revised { opacity: .62; border-color: var(--line); background: var(--surface); }
.brief-item__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brief-item__name { font-size: 15px; font-weight: 500; flex: 1; min-width: 0; }
.brief-item__quote, .brief-item__content { font-size: 15px; line-height: 1.6; color: var(--text); }
.brief-item__content { padding: 12px 14px; background: var(--surface); border-radius: 10px; border: 1px solid var(--line); }
.brief-item__note { font-size: 14px; color: var(--muted); }
.brief-item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.brief-item__team summary { cursor: pointer; color: var(--faint); }
.brief-item__team form { margin-top: 8px; align-items: flex-start; }
.revised-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font: inherit; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; }
.revised-toggle:hover { border-color: var(--good); color: var(--good-ink); }
.revised-toggle.is-on { background: var(--good); color: #fff; border-color: var(--good); }

/* brands */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.brand-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.brand-card__swatch { height: 96px; background: var(--bi); display: flex; align-items: center; padding: 20px; border-bottom: 4px solid var(--b); }
.brand-card__swatch img { max-height: 40px; width: auto; }
.brand-card__body { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.logo-slot { height: 80px; border-radius: 10px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: 12px; background: var(--surface-2); }
.logo-slot--dark { background: var(--bi); border-color: var(--bi); }
.logo-slot img { max-height: 52px; width: auto; }
.deflist { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.deflist dt { color: var(--muted); }
.deflist dd { margin: 0; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; align-items: start; }
.form-grid__foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
@media (max-width: 420px) { .form-grid { grid-template-columns: 1fr; } }

/* auth & install */
.auth-body { min-height: 100vh; background: var(--ground); }
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth__card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; display: flex; flex-direction: column; gap: 24px; box-shadow: var(--shadow); }
.auth__logo { height: 40px; width: auto; align-self: flex-start; }
.install { max-width: 760px; margin: 0 auto; padding: 48px 16px 80px; display: flex; flex-direction: column; gap: 20px; }
.install__logo { height: 44px; width: auto; align-self: flex-start; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 20px; font-size: 14px; }
.checks li { display: flex; align-items: center; gap: 8px; }
.checks .ok { color: var(--good-ink); }
.checks .bad { color: var(--danger); font-weight: 500; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* busy overlay while importing */
.busy { position: fixed; inset: 0; background: rgba(27, 21, 40, .55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.busy__box { background: var(--surface); border-radius: var(--r-lg); padding: 28px 32px; display: flex; align-items: center; gap: 16px; max-width: 420px; box-shadow: var(--shadow); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--brand-tint); border-top-color: var(--brand); animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* print: revision brief only */
@media print {
  body { background: #fff; }
  .side, .page-head, .kpis, .brief-options, .brief-doc__bar, .brief-doc__foot, .admin__main > .alert, .brief-item__team, .revised-toggle { display: none !important; }
  .admin__main { padding: 0; }
  .brief-doc { border: 0; }
  .brief { padding: 0; }
  .brief-item { break-inside: avoid; }
}
.page-title-input { flex: 0 1 240px; width: auto !important; }
@media (max-width: 640px) { .page-card__thumb { display: none; } .page-grid { gap: 12px; } }
