/* =========================================================
   Ibex Post — client dashboard
   Same tokens as the site (css/style.css): black, white, greys, Inter.
   reset → tokens → base → shell → components → views → responsive
   ========================================================= */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
svg, canvas { display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- tokens ---------- */
:root {
  --white: #FFFFFF;
  --black: #0A0A0A;
  --bg: #F7F7F8;
  --grey-1: #F4F4F5;
  --grey-2: #E4E4E7;
  --grey-3: #A1A1AA;
  --grey-4: #71717A;
  --ok: #15803D;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --r: 12px;
  --side: 248px;
}

/* ---------- base ---------- */
body { background: var(--bg); color: var(--black); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h2 { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.25; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--grey-4); }
.small { font-size: 13px; }
.tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 20px 16px; background: var(--white); border-right: 1px solid var(--grey-2); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; font-size: 16px; letter-spacing: -0.01em; padding: 4px 8px 20px; }
.brand__mark { width: 22px; height: 22px; }
.brand__mark path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.side__label { font-size: 12px; color: var(--grey-4); padding: 0 8px 4px; }
.side__nav { display: grid; gap: 2px; }
.side__nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 8px; color: var(--grey-4); font-weight: 500;
  transition: background 100ms var(--ease), color 100ms var(--ease); }
.side__nav a:hover { background: var(--grey-1); color: var(--black); }
.side__nav a.is-on { background: var(--black); color: var(--white); }
.side__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--black); color: var(--white); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.side__nav a.is-on .side__badge { background: var(--white); color: var(--black); }
.side__user { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px 8px 0; border-top: 1px solid var(--grey-2); line-height: 1.35; }
.side__user b { font-weight: 500; }

.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--grey-2); color: var(--black); font-size: 12px; font-weight: 600; }
.avatar--dark { background: var(--black); color: var(--white); }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }

.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 32px; background: rgba(247,247,248,0.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--grey-2); }
.top__title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; margin-right: auto; }
.top .top__menu { display: none; }
.content { max-width: 1200px; padding: 32px; margin: 0 auto; }
.view { display: grid; gap: 24px; animation: viewIn 300ms var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- components ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 9999px; border: 1px solid transparent; font-weight: 500; white-space: nowrap;
  transition: background 150ms var(--ease), border-color 150ms var(--ease), transform 80ms var(--ease); }
.btn:active { transform: scale(0.98); }
.btn--dark { background: var(--black); color: var(--white); }
.btn--dark:hover { background: #2A2A2E; }
.btn--ghost { background: var(--white); border-color: var(--grey-2); }
.btn--ghost:hover { border-color: var(--grey-3); }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: inherit; transition: background 100ms var(--ease); }
.icon-btn:hover { background: var(--grey-1); }
.link-sm { font-size: 13px; color: var(--grey-4); font-weight: 500; }
.link-sm:hover { color: var(--black); }
button.link-sm { border: 0; background: none; padding: 0; justify-self: start; }

.card { background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--r); padding: 20px; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 9999px; font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid var(--grey-2); color: var(--grey-4); background: var(--white); vertical-align: 3px; }
.pill--dark { background: var(--black); border-color: var(--black); color: var(--white); }
.pill--ok { color: var(--ok); border-color: #BBE5C8; background: #F0FAF3; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 32px; padding: 0 14px; border-radius: 9999px; border: 1px solid var(--grey-2); background: var(--white); color: var(--grey-4); font-weight: 500; font-size: 13px;
  transition: background 100ms var(--ease), color 100ms var(--ease), border-color 100ms var(--ease); }
.chip:hover { color: var(--black); }
.chip.is-on { background: var(--black); border-color: var(--black); color: var(--white); }
.toolbar { display: flex; justify-content: space-between; gap: 16px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stats--3 { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--r); padding: 18px 20px; display: grid; gap: 6px; }
.stat__label { font-size: 13px; color: var(--grey-4); }
.stat__value { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__note { font-size: 12px; color: var(--grey-4); }

.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }

/* stage bar: brief → draft → refine → deliver */
.stages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stages i { height: 4px; border-radius: 2px; background: var(--grey-2); }
.stages i.done { background: var(--black); }
.stages i.now { background: linear-gradient(90deg, var(--black) 50%, var(--grey-2) 50%); }
.stage-label { font-size: 12px; color: var(--grey-4); margin-top: 6px; }

/* ---------- overview ---------- */
.hello h2 { font-size: 28px; }
.hello p { margin-top: 4px; }
.attention { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: center; }
.attention__thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--black); }
.attention__thumb canvas { width: 100%; height: 100%; }
.attention__body { display: grid; gap: 6px; justify-items: start; }
.attention__body h3 { font-size: 17px; }
.attention__body .btn { margin-top: 8px; }
.attention--clear { grid-template-columns: 1fr; text-align: left; }

.upcoming li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--grey-1); }
.upcoming li:first-child { border-top: 0; padding-top: 0; }
.date { width: 44px; flex: none; text-align: center; border: 1px solid var(--grey-2); border-radius: 8px; padding: 4px 0; line-height: 1.1; }
.date b { display: block; font-size: 16px; font-weight: 600; }
.date span { font-size: 11px; color: var(--grey-4); text-transform: uppercase; }

.plist { display: grid; }
/* fixed column widths so every row's progress lines up */
.prow { display: grid; grid-template-columns: 112px minmax(0, 1fr) 280px 132px; gap: 20px; align-items: center; padding: 16px 12px; margin: 0 -12px;
  border-top: 1px solid var(--grey-1); border-radius: 10px; cursor: pointer; transition: background 100ms var(--ease); }
.prow:first-child { border-top: 0; }
.prow:hover { background: #FAFAFA; }
.prow--you { background: #FAFAFA; }
.prow--you:hover { background: var(--grey-1); }
.prow__thumb { position: relative; width: 112px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: var(--black); color: rgba(255,255,255,0.6); }
.prow__thumb canvas { width: 100%; height: 100%; }
.prow__thumb svg { width: 22px; height: 22px; stroke-width: 1.3; }
.prow__thumb--web { background: var(--grey-1); padding: 10px; display: grid; gap: 4px; align-content: start; place-items: stretch; }
.prow__thumb--web i { display: block; border-radius: 2px; background: var(--grey-2); height: 6px; }
.prow__thumb--web i:first-child { background: var(--black); width: 40%; height: 4px; }
.prow__thumb--web i:nth-child(2) { height: 22px; }
.prow__main { display: grid; gap: 6px; min-width: 0; }
.prow__title { display: grid; line-height: 1.35; }
.prow__title b { font-weight: 600; }
.prow__now { font-size: 13px; color: #3F3F46; }
.prow__now b { font-weight: 600; color: var(--black); }
.prow__progress { display: grid; gap: 8px; }
.steps4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps4 li { display: grid; gap: 6px; }
.steps4 i { height: 4px; border-radius: 2px; background: var(--grey-2); }
.steps4 li.done i { background: var(--black); }
.steps4 li.now i { background: linear-gradient(90deg, var(--black) 50%, var(--grey-2) 50%); }
.steps4 span { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--grey-3); }
.steps4 li.done span, .steps4 li.now span { color: var(--black); }
.steps4 li.now span { font-weight: 600; }
.steps4 svg { width: 11px; height: 11px; stroke-width: 2.2; }
.prow__next { font-size: 12px; color: var(--grey-4); }
.prow__next b { font-weight: 500; color: var(--black); }
.awaiting { display: inline-flex; align-items: center; gap: 6px; justify-self: start; height: 26px; padding: 0 10px; border-radius: 9999px; border: 1px dashed var(--grey-3); font-size: 12px; font-weight: 500; color: var(--grey-4); }
.awaiting svg { width: 13px; height: 13px; }
.prow__side { display: grid; gap: 8px; justify-items: end; }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.health::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.health--ok { color: var(--ok); }
.health--risk { color: #B45309; }
.health--late { color: #B91C1C; }
.pay__text { display: grid; line-height: 1.35; margin-right: auto; }
.pay__text b { font-weight: 600; }
.pay__due { font-weight: 600; white-space: nowrap; }


/* ---------- projects ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pcard { background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--r); overflow: hidden; text-align: left; padding: 0; display: grid; cursor: pointer;
  transition: border-color 150ms var(--ease), transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out); }
.pcard:hover { border-color: var(--grey-3); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.06); }
.pcard__cover { aspect-ratio: 16 / 7; background: var(--black); display: grid; place-items: center; color: rgba(255,255,255,0.5); }
.pcard__cover--light { background: var(--grey-1); color: var(--grey-3); }
.pcard__cover svg { width: 28px; height: 28px; stroke-width: 1.2; }
.pcard__body { padding: 16px 18px 18px; display: grid; gap: 10px; }
.pcard__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pcard__meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--grey-4); }

/* drawer */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(10,10,10,0.3); animation: fade 200ms var(--ease); }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(480px, 100%); background: var(--white); border-left: 1px solid var(--grey-2); padding: 28px; overflow-y: auto;
  transform: translateX(100%); transition: transform 320ms var(--ease-out); }
.drawer.is-open { transform: none; }
.drawer__close { position: absolute; top: 16px; right: 16px; }
.drawer h2 { margin: 8px 0 4px; padding-right: 40px; }
.drawer section { margin-top: 28px; }
.drawer h3 { margin-bottom: 12px; }
.timeline li { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.timeline li::before { content: ''; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--grey-2); }
.timeline li:last-child::before { display: none; }
.timeline__dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--grey-2); background: var(--white); flex: none; margin-top: 2px; z-index: 1; }
.timeline li.done .timeline__dot { background: var(--black); border-color: var(--black); }
.timeline li.now .timeline__dot { border-color: var(--black); box-shadow: inset 0 0 0 3px var(--white), inset 0 0 0 8px var(--black); }
.timeline b { font-weight: 500; display: block; }
.team { display: flex; flex-wrap: wrap; gap: 12px; }
.team li { display: flex; align-items: center; gap: 10px; line-height: 1.3; }
.deliv li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--grey-1); }
.deliv li:first-child { border-top: 0; }
.deliv li .pill { margin-left: auto; }

/* ---------- review ---------- */
.review { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.review__stage { display: grid; gap: 14px; min-width: 0; }
.review__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.review__title { margin-top: 2px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: flex; padding: 3px; background: var(--grey-1); border-radius: 9999px; }
.seg__btn { height: 30px; padding: 0 14px; border-radius: 9999px; border: 0; background: transparent; color: var(--grey-4); font-weight: 500; font-size: 13px; }
.seg__btn.is-on { background: var(--white); color: var(--black); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--black); cursor: pointer; }
.player canvas { width: 100%; height: 100%; }
.player__big { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px; border-radius: 50%; border: 0; background: rgba(10,10,10,0.72); color: var(--white); display: grid; place-items: center;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
.player__big svg { width: 26px; height: 26px; margin-left: 3px; }
.player.is-playing .player__big { opacity: 0; transform: scale(0.9); pointer-events: none; }
.controls { display: flex; align-items: center; gap: 14px; }
.tc { font-size: 13px; color: var(--grey-4); font-variant-numeric: tabular-nums; flex: none; }
.scrub { position: relative; flex: 1; height: 28px; cursor: pointer; }
.scrub::before { content: ''; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--grey-2); }
.scrub__fill { position: absolute; left: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--black); width: 0; }
.scrub__fill::after { content: ''; position: absolute; right: -6px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--black); box-shadow: 0 0 0 3px var(--white); }
.scrub__marks i { position: absolute; top: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--white); border: 2px solid var(--black); }
.scrub__marks i.is-done { background: var(--grey-3); border-color: var(--grey-3); }
.decide { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; background: var(--white); border: 1px solid var(--grey-2); border-radius: var(--r); }
.decide__btns { display: flex; gap: 8px; flex: none; }

.comments { display: flex; flex-direction: column; max-height: calc(100vh - 128px); position: sticky; top: 88px; }
.clist { flex: 1; overflow-y: auto; margin: 0 -20px; padding: 0 20px; }
.clist li { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--grey-1); }
.clist li:first-child { border-top: 0; }
.clist .avatar { grid-row: span 3; }
.c__who { display: flex; align-items: baseline; gap: 8px; font-weight: 500; }
.c__time { border: 0; background: var(--grey-1); border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.c__time:hover { background: var(--black); color: var(--white); }
.c__text { color: #27272A; }
.c__resolve { justify-self: start; border: 0; background: none; padding: 0; font-size: 12px; color: var(--grey-4); }
.c__resolve:hover { color: var(--black); }
.clist li.is-done .c__text { color: var(--grey-3); text-decoration: line-through; }
.clist__empty { color: var(--grey-4); padding: 8px 0 16px; }
.composer { display: grid; gap: 8px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--grey-2); }
.composer__at { font-size: 12px; color: var(--grey-4); }
.composer__at b { color: var(--black); font-variant-numeric: tabular-nums; }
.composer textarea, .chat__form input, .field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--grey-2); border-radius: 8px; background: var(--white); resize: vertical;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease); }
.composer textarea:focus, .chat__form input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(10,10,10,0.08); }
.composer .btn { justify-self: end; }

/* ---------- files / invoices tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--grey-4); padding: 12px 20px; border-bottom: 1px solid var(--grey-2); background: #FBFBFB; }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--grey-1); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 100ms var(--ease); }
.table tbody tr:hover { background: #FBFBFB; }
.fname { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.ficon { width: 34px; height: 34px; border-radius: 8px; background: var(--grey-1); display: grid; place-items: center; flex: none; }
.table td:last-child { text-align: right; }
.amount { font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---------- messages ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 128px); max-width: 820px; padding: 0; }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--grey-2); line-height: 1.35; }
.chat__head b { font-weight: 600; }
.chat__list { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 72%; display: grid; gap: 4px; }
.msg p { padding: 10px 14px; border-radius: 16px; background: var(--grey-1); border-bottom-left-radius: 4px; }
.msg time { font-size: 11px; color: var(--grey-4); padding: 0 6px; }
.msg--me { align-self: flex-end; justify-items: end; }
.msg--me p { background: var(--black); color: var(--white); border-radius: 16px; border-bottom-right-radius: 4px; }
.chat__day { align-self: center; font-size: 12px; color: var(--grey-4); padding: 4px 0; }
.chat__form { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--grey-2); }
.chat__form input { border-radius: 9999px; padding: 0 16px; height: 40px; }
.chat__form .btn { height: 40px; }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; }
.field.has-error input { border-color: #DC2626; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- start a project: builder ---------- */
.side__start { margin-bottom: 8px; border: 1px dashed var(--grey-3); color: var(--black) !important; }
.side__start:hover { border-style: solid; }
.side__start.is-on { border-color: var(--black); color: var(--white) !important; }
.cart-btn { position: relative; }
.cart-btn__count { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--black); color: var(--white); font-size: 10px; font-weight: 600; display: grid; place-items: center; }

.builder { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.builder__main { min-width: 0; display: grid; gap: 24px; }
.bsteps { display: flex; flex-wrap: wrap; gap: 4px; }
.bsteps button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 6px; border: 0; border-radius: 9999px; background: transparent; color: var(--grey-4); font-weight: 500; white-space: nowrap; }
.bsteps button span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--grey-2); color: var(--grey-4); font-size: 12px; font-weight: 600; }
.bsteps button span svg { width: 12px; height: 12px; stroke-width: 2; }
.bsteps button:not(:disabled):hover { color: var(--black); }
.bsteps button.is-on { background: var(--white); color: var(--black); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.bsteps button.is-on span, .bsteps button.is-done span { background: var(--black); color: var(--white); }
.bsteps button:disabled { opacity: 0.45; cursor: default; }

.bstep { display: grid; gap: 16px; animation: viewIn 260ms var(--ease-out); }
.bstep > h2 { font-size: 26px; }
.bstep > p.muted { margin-top: -10px; }
.builder__nav { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--grey-2); padding-top: 20px; }

.tiles { display: grid; gap: 12px; }
.tiles--3 { grid-template-columns: repeat(3, 1fr); }
.tiles--2 { grid-template-columns: 1fr; }
.tile { position: relative; display: grid; gap: 4px; align-content: start; text-align: left; padding: 18px; border-radius: var(--r); border: 1px solid var(--grey-2); background: var(--white);
  transition: border-color 120ms var(--ease), box-shadow 200ms var(--ease), transform 200ms var(--ease-out); }
.tile:hover { border-color: var(--grey-3); }
.tile.is-on { border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
.tile.is-on::after { content: ''; position: absolute; top: 14px; right: 14px; width: 18px; height: 18px; border-radius: 50%; background: var(--black)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.tile b { font-weight: 600; font-size: 15px; }
.tile .muted { font-size: 13px; }
.tile__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--grey-1); display: grid; place-items: center; margin-bottom: 8px; flex: none; }
.tile__icon svg { width: 20px; height: 20px; }
.tile.is-on .tile__icon { background: var(--black); color: var(--white); }
.tile__price { margin-top: 8px; font-size: 13px; font-weight: 500; }
.tile__price small { color: var(--grey-4); font-weight: 400; }
.tiles--compact .tile { padding: 14px 16px; }
.tile--row { grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding-right: 48px; }
.tile--row .tile__price { margin: 0; }
.tile--row.is-on::after { top: 50%; margin-top: -9px; }
.tile__text { display: grid; gap: 2px; }
.motion-meter { display: flex; gap: 3px; align-items: flex-end; height: 24px; }
.motion-meter i { width: 6px; border-radius: 2px; background: var(--grey-2); }
.motion-meter i:nth-child(1) { height: 30%; } .motion-meter i:nth-child(2) { height: 55%; } .motion-meter i:nth-child(3) { height: 78%; } .motion-meter i:nth-child(4) { height: 100%; }
.motion-meter i.on { background: var(--black); }

.opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.opt { display: grid; gap: 2px; padding: 14px; border-radius: 10px; border: 1px solid var(--grey-2); background: var(--white); text-align: left; transition: border-color 120ms var(--ease), box-shadow 200ms var(--ease); }
.opt b { font-weight: 600; }
.opt span { font-size: 12px; color: var(--grey-4); }
.opt:hover { border-color: var(--grey-3); }
.opt.is-on { border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }

.bsec { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0 0; border-top: 1px solid var(--grey-2); }
.bsec--col { flex-direction: column; align-items: flex-start; }
.bsec h3 { margin-bottom: 2px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--grey-2); border-radius: 9999px; background: var(--white); flex: none; }
.stepper button { width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; display: grid; place-items: center; }
.stepper button:hover:not(:disabled) { background: var(--grey-1); }
.stepper button:disabled { opacity: 0.3; cursor: default; }
.stepper output { min-width: 32px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--grey-2); border-radius: 8px; background: var(--white); resize: vertical; transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease); }
.input:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(10,10,10,0.08); }
.bsec .input { width: auto; }
.hint { font-size: 13px; color: var(--grey-4); margin-top: -4px; }
.linkish { border: 0; background: none; padding: 0; font-weight: 600; color: var(--black); text-decoration: underline; text-underline-offset: 2px; }

.addons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.addon { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px; border-radius: 10px; border: 1px solid var(--grey-2); background: var(--white); text-align: left;
  transition: border-color 120ms var(--ease), box-shadow 200ms var(--ease); }
.addon:hover { border-color: var(--grey-3); }
.addon.is-on { border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
.check { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--grey-3); display: grid; place-items: center; color: transparent; }
.check svg { width: 12px; height: 12px; stroke-width: 2.2; }
.addon.is-on .check { background: var(--black); border-color: var(--black); color: var(--white); }
.addon__text { display: grid; gap: 1px; }
.addon__text b { font-weight: 600; }
.addon__text .muted { font-size: 12px; }
.addon__price { font-weight: 500; font-size: 13px; white-space: nowrap; }
.addon__price small { color: var(--grey-4); font-weight: 400; }

/* live summary ("cart") */
.summary { position: sticky; top: 88px; display: grid; gap: 16px; }
.summary__empty { font-size: 13px; }
.summary__head { display: flex; align-items: center; gap: 12px; line-height: 1.35; }
.summary__head .tile__icon { margin: 0; background: var(--black); color: var(--white); }
.summary__head b { font-weight: 600; }
.summary__lines { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--grey-2); }
.summary__lines li { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; }
.summary__lines li small { display: block; color: var(--grey-4); font-size: 12px; }
.summary__save { color: var(--ok); }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--grey-2); }
.summary__total b { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.summary__facts { display: grid; gap: 8px; font-size: 13px; color: var(--grey-4); }
.summary__facts li { display: flex; align-items: center; gap: 8px; }
.summary__fine { line-height: 1.45; }
.btn--block { width: 100%; justify-content: center; height: 44px; }
.mbar { display: none; }

/* cart */
.cart__items { display: grid; gap: 12px; min-width: 0; }
.citem { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; }
.citem .tile__icon { margin: 0; }
.citem__body { display: grid; gap: 4px; min-width: 0; }
.citem__actions { display: flex; gap: 16px; margin-top: 8px; }
.citem__actions .link-sm, .add-more { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; }
.citem__actions svg, .add-more svg { width: 14px; height: 14px; }
.citem__price { font-size: 18px; font-weight: 600; }
.add-more { justify-self: start; padding: 8px 0; }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 48px 20px; }
.empty .tile__icon { margin: 0 0 8px; }

/* ---------- budget mode ---------- */
.seg--wide { align-self: start; justify-self: start; }
.budget { display: grid; gap: 20px; }
.money { position: relative; display: flex; align-items: center; max-width: 220px; }
.money span { position: absolute; left: 12px; color: var(--grey-4); font-weight: 500; }
.money .input { padding-left: 26px; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.budget__results { display: grid; gap: 10px; }
.pick { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--grey-2); border-radius: var(--r); background: var(--white); justify-items: start; }
.pick--best { border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
.pick b { font-weight: 600; }
.pick__foot { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 8px; }
.pick__foot b { font-size: 18px; }

/* ---------- make an offer ---------- */
.offer-btn { justify-self: start; display: grid; gap: 1px; text-align: left; margin-top: 12px; padding: 10px 14px; border: 1px dashed var(--grey-3); border-radius: 10px; background: var(--white);
  transition: border-color 120ms var(--ease), background 120ms var(--ease); }
.offer-btn b { font-weight: 600; }
.offer-btn span { font-size: 12px; color: var(--grey-4); }
.offer-btn:hover { border-style: solid; border-color: var(--black); }
.offer__note { margin-top: 10px; }
.offer { display: grid; gap: 12px; margin-top: 14px; padding: 16px; border-radius: 10px; background: var(--grey-1); animation: viewIn 240ms var(--ease-out); }
.offer--ok { display: flex; align-items: center; gap: 12px; background: #F0FAF3; color: var(--ok); }
.offer--ok b { font-weight: 600; }
.offer--ok svg { width: 20px; height: 20px; stroke-width: 2; }
.offer__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.offer__head b { font-weight: 600; }
.offer__head .muted { display: inline-flex; align-items: center; gap: 4px; }
.offer__head svg { width: 13px; height: 13px; }
.offer__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.offer .money { max-width: 160px; }
.offer .chip { height: 28px; padding: 0 12px; font-size: 12px; }
.offer__choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: grid; gap: 6px; align-content: start; justify-items: start; padding: 14px; border-radius: 10px; border: 1px solid var(--grey-2); background: var(--white); }
.choice--best { border-color: var(--black); }
.choice__price { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.choice__list { display: grid; gap: 4px; font-size: 12px; color: var(--grey-4); }
.choice__list li { display: flex; align-items: center; gap: 6px; }
.choice__list svg { width: 12px; height: 12px; }
.choice .btn { margin-top: 6px; }
.citem__price { display: grid; justify-items: end; gap: 2px; }
.citem__offer { grid-column: 2 / -1; min-width: 0; }
.citem__offer:empty { display: none; }
.citem__price b { font-size: 18px; font-weight: 600; }
.citem__price s { font-size: 13px; }

/* ---------- cart: deal, quick edits, suggestions, later, promo, quote ---------- */
.deal { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); background: var(--black); color: var(--white); font-size: 13px; }
.deal b { font-weight: 600; }
.citem__wide { grid-column: 2 / -1; min-width: 0; display: grid; gap: 12px; }
.citem__wide .citem__actions { margin-top: 0; flex-wrap: wrap; gap: 8px 16px; }
.quick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stepper--sm button { width: 32px; height: 32px; }
.stepper--sm output { min-width: 24px; font-size: 13px; }
.seg--sm .seg__btn { height: 28px; padding: 0 12px; font-size: 12px; }
.quick__more { display: grid; gap: 8px; padding: 14px; border-radius: 10px; background: var(--grey-1); }
.quick__more .chip { height: 30px; font-size: 12px; }
.quick__more .chip small { color: inherit; opacity: 0.6; margin-left: 2px; }
.sugs { display: grid; gap: 4px; }
.sugs h3 { margin-bottom: 8px; }
.sug { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 0; border-top: 1px solid var(--grey-1); }
.sug b { font-weight: 600; }
.later { display: grid; gap: 4px; margin-top: 8px; }
.later h3 { margin-bottom: 4px; }
.later__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 16px; border: 1px dashed var(--grey-3); border-radius: 10px; background: var(--white); line-height: 1.35; }
.later__row b { font-weight: 500; }
.later__btns { display: flex; align-items: center; gap: 4px; flex: none; }
.summary__lines s { font-size: 12px; margin-right: 4px; }
.linkish--sm { font-size: 12px; font-weight: 500; color: var(--grey-4); }
.promo details summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--grey-4); list-style: none; }
.promo details summary::-webkit-details-marker { display: none; }
.promo details summary:hover { color: var(--black); }
.promo__row { display: flex; gap: 8px; margin-top: 8px; }
.promo__row .input { text-transform: uppercase; }
.promo__msg { margin-top: 6px; color: #B45309; }
.quote-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quote-btns .btn { justify-content: center; padding: 0 8px; }
.included { border-top: 1px solid var(--grey-2); padding-top: 14px; }
.included summary { cursor: pointer; font-weight: 600; font-size: 13px; list-style: none; }
.included summary::-webkit-details-marker { display: none; }
.included ul { display: grid; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--grey-4); }
.included li { display: flex; gap: 8px; align-items: flex-start; }
.included svg { width: 14px; height: 14px; margin-top: 1px; color: var(--ok); stroke-width: 2; }

/* checkout */
.checkout { display: grid; gap: 18px; padding: 28px; }
.checkout .back { display: inline-flex; align-items: center; gap: 4px; justify-self: start; }
.checkout .back svg { width: 14px; height: 14px; }
.checkout h2 { margin-bottom: 2px; }
.terms { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--grey-4); cursor: pointer; padding: 12px; border-radius: 8px; border: 1px solid transparent; }
.terms input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--black); flex: none; }
.terms.has-error { border-color: #DC2626; background: #FEF2F2; }
.field.has-error .input { border-color: #DC2626; }

/* ---------- files, grouped by project ---------- */
.fgroups { display: grid; gap: 16px; }
.fgroup { display: grid; gap: 20px; scroll-margin-top: 88px; transition: box-shadow 400ms var(--ease); }
.fgroup.is-focus { box-shadow: 0 0 0 2px var(--black); }
.fgroup__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.fgroup__head > span:first-child { display: grid; line-height: 1.35; }
.fsec { display: grid; gap: 8px; }
.fsec h4 { margin: 0; font-size: 12px; font-weight: 600; color: var(--grey-4); text-transform: uppercase; letter-spacing: 0.04em; }
.fsec__hint { margin-top: 2px; }
.need { display: grid; gap: 8px; }
.need__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--grey-2);
  transition: border-color 120ms var(--ease), background 120ms var(--ease); }
.need__item.is-drag { border-color: var(--black); border-style: dashed; background: var(--grey-1); }
.need__item.is-ok { background: #FAFAFA; }
.need__state { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--grey-3); }
.need__state.missing { border-color: var(--black); border-style: dashed; }
.need__state.ok { background: var(--ok); border-color: var(--ok); color: var(--white); }
.need__state svg { width: 12px; height: 12px; stroke-width: 2.4; }
.need__text { display: grid; line-height: 1.35; }
.need__text b { font-weight: 600; }
.need__tag { font-weight: 500; color: var(--grey-4); white-space: nowrap; }
.need__item:not(.is-ok) .need__state.missing ~ .need__tag { color: var(--black); }
.need__item.is-ok .need__tag { color: var(--ok); }
.need__btns { display: flex; gap: 6px; }
.need__btns svg { width: 14px; height: 14px; }
.need__btns [data-up] svg { transform: rotate(180deg); }
.linkform { grid-column: 2 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linkform .input { flex: 1; min-width: 200px; }
.flist { display: grid; }
.flist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--grey-1); }
.flist li:first-child { border-top: 0; }
.flist__text { display: grid; line-height: 1.35; margin-right: auto; min-width: 0; }
.flist__text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flist__text a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- review: real videos, links, cut picker ---------- */
.revpick select { width: auto; max-width: 320px; height: 38px; padding: 0 12px; font-weight: 500; }
.player video, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--black); }
.player__link { position: absolute; inset: 0; display: grid; place-items: center; background: var(--black); color: var(--white); }
.player__msg { display: grid; gap: 10px; justify-items: center; text-align: center; max-width: 360px; padding: 24px; }
.player__msg .btn--dark { background: var(--white); color: var(--black); }
.player__msg p { color: var(--grey-3); }
.attention__icon { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,0.7); }
.attention__icon svg { width: 32px; height: 32px; stroke-width: 1.2; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden].controls { display: none !important; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 70; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px;
  background: var(--black); color: var(--white); padding: 12px 18px; border-radius: 9999px; font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: opacity 200ms var(--ease), transform 300ms var(--ease-out); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) and (min-width: 901px) {
  .prow { grid-template-columns: 96px minmax(0, 1fr) 132px; }
  .prow__thumb { width: 96px; }
  .prow__progress { grid-column: 2 / -1; grid-row: 2; }
  .prow__side { grid-row: 1; grid-column: 3; }
}
@media (max-width: 1320px) {
  .tiles--3 { grid-template-columns: repeat(2, 1fr); }
  .addons { grid-template-columns: 1fr; }
  .opts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .builder { grid-template-columns: 1fr; }
  #view-new .summary { display: none; }
  .mbar { position: sticky; bottom: 12px; z-index: 15; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 10px 10px 20px;
    background: var(--white); border: 1px solid var(--grey-2); border-radius: 9999px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
  .mbar span { display: grid; line-height: 1.2; }
  .mbar b { font-size: 18px; }
  .mbar[hidden] { display: none; }
  #view-cart .summary { position: static; }
}
@media (max-width: 1100px) {
  .review { grid-template-columns: 1fr; }
  .comments { position: static; max-height: none; }
  .clist { max-height: 360px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 55; width: var(--side); transform: translateX(-100%); transition: transform 280ms var(--ease-out); box-shadow: 0 0 48px rgba(0,0,0,0.12); }
  .side.is-open { transform: none; }
  .top .top__menu { display: grid; }
  .top { padding: 0 16px; }
  .content { padding: 20px 16px 32px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats--3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 88px minmax(0, 1fr); gap: 12px 14px; align-items: start; }
  .prow__thumb { width: 88px; }
  .prow__progress, .prow__side { grid-column: 1 / -1; }
  .prow__side { display: flex; justify-content: space-between; align-items: center; }
}
@media (max-width: 600px) {
  .attention { grid-template-columns: 1fr; }
  .decide { flex-direction: column; align-items: stretch; }
  .decide__btns .btn { flex: 1; justify-content: center; }
  .review__head { flex-direction: column; align-items: flex-start; }
  .hide-sm { display: none; }
  .table th, .table td { padding: 12px 14px; }
  .field-row { grid-template-columns: 1fr; }
  .tiles--3, .addons { grid-template-columns: 1fr; }
  .need__item { grid-template-columns: auto minmax(0, 1fr) auto; }
  .need__btns { grid-column: 2 / -1; }
  .linkform { grid-column: 1 / -1; }
  .tile--row { grid-template-columns: auto 1fr; }
  .tile--row .tile__price { grid-column: 2; }
  .bsec { flex-wrap: wrap; }
  .citem { grid-template-columns: 1fr auto; }
  .citem .tile__icon { display: none; }
  .builder__nav .btn { flex: 1; justify-content: center; }
  .builder__nav { gap: 8px; }
  .offer__choices { grid-template-columns: 1fr; }
  .citem__price { grid-column: 2; grid-row: 1; }
  .citem__offer { grid-column: 1 / -1; }
  .citem__wide { grid-column: 1 / -1; }
  .quote-btns { grid-template-columns: 1fr; }
  .checkout { padding: 20px; }
  .msg { max-width: 88%; }
  .top .btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* signed-in person at the bottom of the sidebar (Studio and client area) */
.side__me { width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--grey-2); border-radius: 0; cursor: pointer; font: inherit; color: inherit; }
.side__me .role { display: grid; flex: 1; min-width: 0; }
.side__me .role b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__me-more { color: var(--grey-3); letter-spacing: 1px; }
.side__me:hover .side__me-more { color: var(--black); }
