:root {
  --carbon: #111111;
  --paper: #F2F0E8;
  --lilac: #C9B6F2;
  --muted: #A8A59C;
  --panel: #1C1C1B;
  --panel-2: #262624;
  --line: #34332F;
  --display: "Rubik", system-ui, sans-serif;
  --text: "Inter Tight", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--carbon);
  color: var(--paper);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
.muted { color: var(--muted); }
.caps, .caps-sm { text-transform: uppercase; letter-spacing: .02em; font-weight: 500; display: flex; justify-content: space-between; gap: 12px; }
.caps { font-size: 12px; }
.caps-sm { font-size: 11px; }

/* print-sheet crop marks */
.crop { position: fixed; width: 18px; height: 18px; border: 0 solid var(--paper); opacity: .55; pointer-events: none; z-index: 5; }
.crop.tl { left: 10px; top: 10px; border-top-width: 1px; border-left-width: 1px; }
.crop.tr { right: 10px; top: 10px; border-top-width: 1px; border-right-width: 1px; }
.crop.bl { left: 10px; bottom: 10px; border-bottom-width: 1px; border-left-width: 1px; }
.crop.br { right: 10px; bottom: 10px; border-bottom-width: 1px; border-right-width: 1px; }

/* layout */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr) 380px; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 36px 24px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 40px; }
.main { padding: 36px 40px 80px; min-width: 0; }
.phone-wrap { position: sticky; top: 0; height: 100vh; padding: 36px 28px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }

/* brand */
.brand { text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.eyes { width: 64px; height: 30px; overflow: visible; }
.eyes ellipse { fill: var(--carbon); stroke: var(--paper); stroke-width: 5; }
.eyes .pupil { fill: var(--lilac); transition: transform .4s ease; }
.eyes .lid { fill: none; stroke: var(--paper); stroke-width: 5; stroke-linecap: round; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 46px; letter-spacing: -0.085em; line-height: .85; }
.wordmark sup { font-family: var(--text); font-size: 14px; font-weight: 500; letter-spacing: 0; vertical-align: top; margin-left: 4px; color: var(--lilac); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { text-decoration: none; padding: 9px 10px; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--paper); }
.nav a.on { color: var(--paper); background: var(--panel); }
.nav a.on::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lilac); margin-right: 10px; vertical-align: 2px; }
.side-foot { margin-top: auto; color: var(--muted); }

/* header */
.topline { color: var(--muted); margin-bottom: 28px; }
.hello h1 { font-family: var(--display); font-weight: 800; font-size: clamp(40px, 5.4vw, 76px); line-height: .9; letter-spacing: -0.06em; margin: 0 0 12px; }
.hello p { margin: 0 0 28px; font-size: 17px; max-width: 640px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 40px; }
.stat { background: var(--carbon); padding: 18px 20px; }
.stat b { display: block; font-family: var(--display); font-weight: 800; font-size: 54px; line-height: 1; letter-spacing: -0.05em; }
.stat span { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .02em; font-weight: 500; }
.stat.hot b { color: var(--lilac); }

/* blocks */
.block { margin-bottom: 44px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--paper); padding-bottom: 10px; margin-bottom: 16px; }
.block-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 28px; letter-spacing: -0.04em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }

.card { background: var(--panel); border: 1px solid transparent; padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--line); }
.card:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.card.sel { border-color: var(--lilac); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card h3 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.card .proj { color: var(--muted); font-size: 13px; }
.chip { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.chip.late { background: var(--lilac); color: var(--carbon); }
.wait { display: flex; align-items: center; gap: 10px; }
.wait b { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: -0.05em; line-height: 1; }
.wait small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.btn { border: 1px solid var(--paper); background: transparent; padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--paper); color: var(--carbon); }
.btn.primary { background: var(--lilac); border-color: var(--lilac); color: var(--carbon); }
.btn.primary:hover { filter: brightness(1.06); }
.row-btns { display: flex; gap: 8px; }

/* design thumbnails (drawn, no images) */
.art { position: relative; aspect-ratio: 2 / 1; overflow: hidden; }
.opts .art { aspect-ratio: 4 / 3; }
.opts .art .tag { font-size: 9px; left: 5px; top: 4px; }
.art i { position: absolute; display: block; }
.art.circle i { width: 46%; aspect-ratio: 1; border-radius: 50%; left: 27%; top: 8%; }
.art.arch i { width: 38%; height: 80%; border-radius: 999px 999px 0 0; left: 31%; bottom: 0; }
.art.stack i { width: 30%; height: 64%; bottom: 0; border: 3px solid currentColor; }
.art.stack i:nth-child(1) { left: 14%; } .art.stack i:nth-child(2) { left: 52%; height: 48%; }
.art.wave i { left: -10%; right: -10%; height: 40%; bottom: -8%; border-radius: 50% 50% 0 0; }
.art.plus i { width: 14%; height: 56%; left: 43%; top: 22%; }
.art.plus i:nth-child(2) { width: 34%; height: 18%; left: 33%; top: 41%; }
.art .tag { position: absolute; left: 8px; top: 6px; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

/* new client brief */
.brief dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.brief dt { color: var(--muted); }
.brief dd { margin: 0; }
.swatches { display: flex; gap: 4px; }
.swatches span { width: 22px; height: 22px; border: 1px solid var(--line); }
.kw { display: flex; flex-wrap: wrap; gap: 6px; }
.kw span { font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }

/* phone */
.phone-label { color: var(--muted); }
.phone { position: relative; flex: 1; min-height: 0; max-height: 760px; border: 2px solid var(--line); border-radius: 38px; background: #0B0B0B; display: flex; flex-direction: column; overflow: hidden; }
.phone-notch { width: 96px; height: 22px; border-radius: 0 0 14px 14px; background: var(--line); margin: 0 auto; flex: none; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--lilac); color: var(--carbon); font-weight: 600; font-size: 13px; display: grid; place-items: center; flex: none; }
.chat-name { font-weight: 600; }
.chat-sub { font-size: 12px; color: var(--muted); }
.chat { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 9px 12px; font-size: 14px; border-radius: 14px; white-space: pre-line; word-wrap: break-word; }
.msg time { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right; }
.msg.in { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.msg.out { align-self: flex-end; background: #2A2633; border-bottom-right-radius: 4px; }
.msg.kernd { align-self: flex-end; background: #2A2633; border-bottom-right-radius: 4px; }
.msg.kernd::before { content: "via Kernd"; display: block; font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--lilac); margin-bottom: 3px; }
.sys { align-self: center; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 2px 0; }
.msg.design { padding: 6px; width: 82%; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; }
.swipe-card.big .opts { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.swipe-hint { display: flex; gap: 6px; margin-top: 6px; }
.swipe-hint button { flex: 1; border: 0; border-radius: 10px; padding: 8px; font-size: 13px; font-weight: 600; cursor: pointer; background: var(--panel-2); }
.swipe-hint button.yes { background: var(--lilac); color: var(--carbon); }
.voice { display: flex; align-items: center; gap: 8px; min-width: 200px; }
.voice .play { width: 30px; height: 30px; border-radius: 50%; background: var(--lilac); flex: none; position: relative; }
.voice .play::after { content: ""; position: absolute; left: 11px; top: 9px; border-left: 10px solid var(--carbon); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.voice .bars { display: flex; align-items: center; gap: 2px; flex: 1; height: 26px; }
.voice .bars i { width: 3px; background: var(--muted); border-radius: 2px; }
.voice small { font-size: 11px; color: var(--muted); }
.chat-input { display: flex; gap: 8px; padding: 10px 12px 18px; border-top: 1px solid var(--line); flex: none; }
.fake-input { flex: 1; background: var(--panel-2); border-radius: 999px; padding: 9px 14px; color: var(--muted); font-size: 14px; }
.mic { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--lilac); display: grid; place-items: center; cursor: pointer; flex: none; }
.mic svg { width: 18px; height: 18px; fill: none; stroke: var(--carbon); stroke-width: 2; stroke-linecap: round; }
.mic svg rect { fill: var(--carbon); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--paper); color: var(--carbon); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 20; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* tabs: only on small screens */
.tabs { display: none; }

@media (max-width: 1180px) {
  .app { grid-template-columns: 190px minmax(0, 1fr) 340px; }
  .main { padding: 32px 28px 80px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; align-items: center; justify-content: space-between; padding: 22px 16px 14px; border-right: 0; border-bottom: 1px solid var(--line); gap: 12px; }
  .wordmark { font-size: 36px; }
  .eyes { width: 48px; height: 22px; }
  .nav, .side-foot { display: none; }
  .main { padding: 22px 16px 80px; }
  .topline { margin-bottom: 18px; }
  .tabs { display: flex; gap: 0; border: 1px solid var(--line); margin-bottom: 22px; }
  .tabs button { flex: 1; background: transparent; border: 0; padding: 10px; font-weight: 600; cursor: pointer; color: var(--muted); }
  .tabs button[aria-selected="true"] { background: var(--paper); color: var(--carbon); }
  .stats { margin-bottom: 30px; }
  .stat { padding: 14px 12px; }
  .stat b { font-size: 40px; }
  .stat span { font-size: 11px; }
  .phone-wrap { position: static; height: auto; padding: 0 16px 40px; border-left: 0; display: none; }
  .phone { height: 72vh; max-height: none; }
  body.show-phone .phone-wrap { display: flex; }
  body.show-phone .main > :not(.topline):not(.hello):not(.tabs) { display: none; }
  body.show-phone .main { padding-bottom: 12px; }
}
.card-foot { flex-wrap: wrap; row-gap: 10px; }
.card-foot > span:first-child { flex: 1 1 140px; }
.row-btns { flex: none; margin-left: auto; }

/* ---------- Phase 2 ---------- */
[hidden] { display: none !important; }
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border: 1px dashed var(--line); margin-bottom: 28px; }
.demo-clock { flex-direction: column; gap: 2px; margin-right: auto; color: var(--muted); }
.demo-clock b { font-size: 15px; color: var(--paper); text-transform: none; letter-spacing: 0; font-weight: 600; }
.btn.ghost { border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--carbon); }
.empty { color: var(--muted); margin: 0; padding: 18px 0; grid-column: 1 / -1; }

.seg { display: flex; border: 1px solid var(--line); flex: none; }
.seg button { flex: 1; background: transparent; border: 0; padding: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--paper); color: var(--carbon); }
.chat-who { flex: 1; min-width: 0; }
.chat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; font-size: 20px; line-height: 1; }
.icon-btn:hover { border-color: var(--paper); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--paper); stroke-width: 2; stroke-linecap: round; }
.msg .swipe-hint { margin-top: 8px; }
.msg .swipe-hint button { padding: 7px 10px; }
.sys { text-align: center; }

/* deck inside the phone */
.phone { position: relative; }
.deck { position: absolute; inset: 22px 0 0 0; background: #0B0B0B; z-index: 3; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px 18px; }
.deck-top { display: flex; justify-content: space-between; align-items: baseline; }
.deck-top span { color: var(--muted); font-size: 13px; }
.deck-hint { color: var(--muted); font-size: 12px; text-align: center; margin: 0; }
.deck-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.deck .deck-btns { justify-content: stretch; }
.deck .deck-btns .btn { flex: 1; padding: 10px 8px; }
.deck-close { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; margin-top: auto; }

.swipe-card { position: relative; touch-action: pan-y; cursor: grab; user-select: none; transition: transform .25s ease; border: 1px solid var(--line); background: var(--panel); padding: 8px; }
.swipe-card.drag { transition: none; cursor: grabbing; }
.swipe-card .art { aspect-ratio: 3 / 4; pointer-events: none; }
.swipe-card.big .art { aspect-ratio: 4 / 3; }
.swipe-card.big .opts { gap: 8px; }
.swipe-card img { pointer-events: none; }
.stamp { position: absolute; top: 18px; z-index: 2; font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -0.03em; padding: 4px 12px; border: 3px solid; text-transform: uppercase; opacity: 0; transition: opacity .1s; pointer-events: none; }
.stamp.yes { left: 18px; color: var(--lilac); transform: rotate(-10deg); background: var(--carbon); }
.stamp.no { right: 18px; color: var(--paper); transform: rotate(10deg); background: var(--carbon); }
.swipe-card[data-dir="right"] .stamp.yes, .swipe-card[data-dir="left"] .stamp.no { opacity: 1; }

.art.img { background: var(--panel-2); }
.art.img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art.img .tag { background: var(--carbon); color: var(--paper); padding: 2px 5px; }

/* timeline */
.timeline { flex: 1; min-height: 0; overflow-y: auto; border: 1px solid var(--line); padding: 18px; }
.timeline h3 { margin: 0 0 16px; font-size: 16px; }
.timeline ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.timeline li:first-child { border-top: 0; }
.timeline time { color: var(--paper); font-size: 12px; font-weight: 600; }
.timeline time small { color: var(--muted); font-weight: 400; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .72); display: grid; place-items: center; padding: 16px; }
.modal-box { position: relative; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--carbon); border: 1px solid var(--paper); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.modal-x { position: absolute; right: 14px; top: 14px; }
.modal-title { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: -0.05em; line-height: .95; margin: 0; padding-right: 40px; }
.modal .caps-sm { margin: 0; padding-right: 44px; }
body.modal-open { overflow: hidden; }
.small { font-size: 13px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; }
.field.check { flex-direction: row; align-items: center; gap: 10px; color: var(--paper); }
.field input[type="number"], .field select, .field input[type="file"] { background: var(--panel); color: var(--paper); border: 1px solid var(--line); padding: 9px 10px; font: inherit; font-size: 14px; }
.field input[type="file"] { padding: 8px; }
.field .num { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.field .num input { width: 100px; }
.field input:focus-visible, .field select:focus-visible, .btn:focus-visible, .icon-btn:focus-visible, .seg button:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.field input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--lilac); }
.err { color: #F09595; font-size: 13px; margin: 0; min-height: 1em; }

@media (max-width: 900px) {
  .demo-bar { margin-bottom: 20px; }
  .demo-clock { width: 100%; flex-direction: row; justify-content: space-between; }
  .demo-bar .btn { flex: 1 1 auto; }
  .seg { display: none; }
  .timeline { display: none; }
  .modal-box { padding: 22px 18px; }
  .modal-title { font-size: 28px; }
  body.show-phone .main > .demo-bar { display: flex !important; }
}

/* ---------- Phase 3 ---------- */
.voice button.play { border: 0; cursor: pointer; }
.tx { margin-top: 6px; font-size: 12px; color: var(--muted); }
.tx summary { cursor: pointer; font-weight: 600; color: var(--lilac); }
.msg.revs { width: 86%; }
.msg.revs b { display: block; margin-bottom: 6px; }
.msg.revs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.msg.revs li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.35; }
.msg.revs li .box { width: 16px; height: 16px; border: 2px solid var(--lilac); flex: none; margin-top: 1px; display: grid; place-items: center; font-size: 11px; color: var(--carbon); }
.msg.revs li.done .box { background: var(--lilac); }
.msg.revs li.done span:last-child { text-decoration: line-through; color: var(--muted); }
.rev-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rev-foot .src { color: var(--lilac); font-weight: 600; }
.rev-mini { display: flex; flex-direction: column; gap: 6px; }
.rev-mini .bar { height: 6px; background: var(--panel-2); }
.rev-mini .bar i { display: block; height: 100%; background: var(--lilac); }
.rev-mini small { color: var(--muted); font-size: 12px; }
.voice-sheet textarea { background: var(--panel); color: var(--paper); border: 1px solid var(--line); padding: 10px; font: inherit; font-size: 14px; resize: vertical; min-height: 110px; }
.voice-sheet textarea:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
.rec-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; text-align: left; }
.rec-btn .dot { width: 28px; height: 28px; border-radius: 50%; background: var(--lilac); flex: none; }
.rec-btn .rec-label { flex: 1; font-weight: 600; }
.rec-btn .rec-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.rec-btn[aria-pressed="true"] { border-color: var(--lilac); }
.rec-btn[aria-pressed="true"] .dot { border-radius: 6px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.82); } }
@media (prefers-reduced-motion: reduce) { .rec-btn[aria-pressed="true"] .dot { animation: none; } }
.checklist { display: flex; flex-direction: column; gap: 10px; }
.checklist .field.check { align-items: flex-start; font-size: 15px; }
.checklist input { margin-top: 2px; flex: none; }
.voice-sheet { overflow-y: auto; }
.row-btns { flex-wrap: wrap; justify-content: flex-end; }
