:root {
  --deep: #1F1340;
  --purple: #482E64;
  --purple-2: #5A3E7A;
  --ink: #2E1D44;
  --body: #3B2C52;
  --muted: #5C4677;
  --label: #6B4F92;
  --lav: #CDB8EE;
  --lav-2: #E4D7F5;
  --tint: #EDE6F6;
  --tint-2: #F0EBF6;
  --ground: #FBF9FD;
  --line: #EEE8F5;
  --line-2: #E4DCEF;
  --field: #D6CAE6;
  --water: #D3E9F1;
  --water-ink: #23485A;
  --amber-bg: #FCEFDF;
  --amber-line: #F1D3B1;
  --amber: #8A4606;
  --amber-strong: #B4530A;
  --green-bg: #E4F3E9;
  --green: #1F5E38;
  --red: #A1262B;
  --radius: 12px;
  --serif: 'Gilda Display', Georgia, serif;
  --italic: 'Libre Baskerville', Georgia, serif;
  --sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--purple); }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--purple); margin: 0; line-height: 1.1; }
h1 { font-size: 30px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
.italic { font-family: var(--italic); font-style: italic; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { border-color: var(--lav); color: inherit; }
.list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list > * { padding: 12px 16px; border-bottom: 1px solid #F4F0F9; }
.list > *:last-child { border-bottom: none; }
.list a { text-decoration: none; color: inherit; display: block; }
.alert { background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); text-decoration: none; display: block; }
.alert strong { font-weight: 500; }
.ok { background: var(--green-bg); color: var(--green); border-radius: var(--radius); padding: 12px 16px; }
.err { background: #FBE9EA; color: var(--red); border-radius: var(--radius); padding: 12px 16px; }
.note { background: var(--tint); color: var(--muted); border-radius: var(--radius); padding: 12px 14px; font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--purple); font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--lav); color: var(--purple); }
.btn-primary { background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--purple-2); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.block { width: 100%; }

.chip { display: inline-block; font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px; background: var(--tint-2); color: var(--muted); white-space: nowrap; }
.chip-amber { background: var(--amber-bg); color: var(--amber); }
.chip-green { background: var(--green-bg); color: var(--green); }
.chip-purple { background: var(--tint); color: var(--purple); }
.chip-blue { background: var(--water); color: var(--water-ink); }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 14px; font-weight: 400; }
textarea.input { min-height: 90px; resize: vertical; }
.input:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--lav); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }

.switch { width: 52px; height: 32px; border-radius: 16px; border: none; padding: 3px; display: flex; cursor: pointer; background: var(--field); justify-content: flex-start; }
.switch[aria-checked="true"] { background: var(--purple); justify-content: flex-end; }
.switch span { width: 26px; height: 26px; border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(46, 29, 68, 0.3); }

.bar { height: 8px; border-radius: 4px; background: #E8E0F1; overflow: hidden; }
.bar > div { height: 100%; background: var(--purple); border-radius: 4px; }
.segments { display: grid; gap: 4px; }
.segments > div { height: 8px; border-radius: 4px; background: #E8E0F1; }
.segments > .done { background: var(--purple); }
.segments > .late { background: var(--amber-strong); }
.segments > .now { background: var(--ink); }

.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 500; background: var(--tint); color: var(--purple); }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; font-family: var(--serif); }

/* Timeline */
.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; }
.tl-rail { flex: none; width: 28px; display: flex; flex-direction: column; align-items: center; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #fff; border: 2px solid var(--field); color: var(--muted); }
.tl-dot.done { background: var(--purple); border-color: var(--purple); color: #fff; }
.tl-dot.now { background: var(--ink); border-color: var(--ink); color: #fff; }
.tl-dot.late { background: var(--amber-strong); border-color: var(--amber-strong); color: #fff; }
.tl-line { flex: 1; width: 2px; min-height: 18px; background: #DCD2EA; }
.tl-line.done { background: var(--purple); }
.tl-body { flex: 1; padding-bottom: 18px; display: flex; flex-direction: column; gap: 2px; }
.strike { text-decoration: line-through; }

/* Client layout */
.app-client { min-height: 100vh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--ground); }
.brand-band { background-color: var(--purple); background-image: linear-gradient(rgba(60, 36, 88, 0.92), rgba(72, 46, 100, 0.96)); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 20px 22px; }
.brand-band h1 { color: #fff; font-size: 32px; }
.brand-band .eyebrow { color: var(--lav-2); }
.wordmark { font-family: var(--serif); font-size: 22px; color: #fff; text-decoration: none; letter-spacing: 0.02em; }
.wordmark img { height: 30px; width: auto; display: block; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.4); background: transparent; color: #fff; display: grid; place-items: center; text-decoration: none; }
.badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; background: var(--amber-strong); color: #fff; font-size: 10px; display: grid; place-items: center; }
.client-main { flex: 1; padding: 18px 20px 28px; display: flex; flex-direction: column; gap: 20px; }
.tabbar { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-top: 1px solid var(--line); padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
.tabbar a { min-height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--purple); font-weight: 500; }
.back { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink); text-decoration: none; flex: none; }

/* Team layout */
.app-team { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 230px; max-width: 100%; background: var(--deep); color: #fff; padding: 22px 14px; display: flex; flex-direction: column; gap: 20px; }
.side a.nav { min-height: 42px; padding: 0 12px; border-radius: 10px; color: #DCD2EA; text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.side a.nav[aria-current="page"] { background: #33204A; color: #fff; }
.side .tag { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--deep); background: var(--lav); padding: 2px 7px; border-radius: 5px; }
.side .group { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #9C86BC; margin: 8px 12px 0; }
.team-main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 56px; }
.team-main > .inner { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 14px; border-bottom: 1px solid #F4F0F9; vertical-align: top; }
.scroll-x { overflow-x: auto; }

.overlay { position: fixed; inset: 0; background: rgba(31, 19, 64, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 70px 16px; z-index: 20; overflow-y: auto; }
.dialog { width: 100%; max-width: 520px; background: #fff; border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px; z-index: 30; max-width: calc(100% - 32px); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background-color: var(--purple); background-image: linear-gradient(180deg, rgba(52, 30, 78, 0.95), rgba(72, 46, 100, 0.98)); }
.login .panel { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; }

/* Wordmark shown until the logo file is added */
.wordmark-text { display: inline-flex; flex-direction: column; line-height: 1; color: #fff; }
.wordmark-text span { font-family: var(--serif); font-size: 24px; letter-spacing: 0.01em; }
.wordmark-text small { font-family: var(--sans); font-size: 9px; letter-spacing: 0.32em; text-transform: uppercase; color: var(--lav); margin-top: 5px; }

/* Team pages */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
h1.display { font-size: 40px; }
.icon-btn-light { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; color: var(--ink); display: grid; place-items: center; }
.icon-btn-light:hover { border-color: var(--lav); color: var(--purple); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.kpi-label { font-size: 13px; color: var(--muted); }
.kpi-value { font-family: var(--serif); font-size: 34px; line-height: 1.15; color: var(--purple); }
.kpi-note { font-size: 12px; color: var(--muted); }
.kpi-amber { background: var(--amber-bg); border-color: var(--amber-line); }
.kpi-amber .kpi-label { color: var(--amber); font-weight: 500; }
.kpi-amber .kpi-value { color: var(--ink); }

.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-main { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid #F4F0F9; }
.panel-head h2 { font-size: 21px; }
.rows { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #F4F0F9; text-decoration: none; color: inherit; }
.row-item:last-child { border-bottom: none; }
a.row-item:hover { background: #FBF9FD; color: inherit; }
.row-title { display: block; font-weight: 500; font-size: 14px; }
.row-sub { display: block; font-size: 12px; color: var(--muted); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty svg { color: var(--lav); }

.setup { background-color: var(--purple); background-image: radial-gradient(circle at 85% 0%, rgba(205, 184, 238, 0.28), transparent 55%), linear-gradient(135deg, #3A2552, #482E64); color: #fff; border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.setup-steps { display: flex; flex-direction: column; gap: 8px; }
.setup-step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); }
.setup-step.done { opacity: 0.7; }
.setup-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; border: 1px solid rgba(255, 255, 255, 0.45); }
.setup-step.done .setup-num { background: var(--lav); color: var(--deep); border-color: var(--lav); }
.setup-title { display: block; font-weight: 500; font-size: 14px; }
.setup-text { display: block; font-size: 12px; color: var(--lav-2); }
.setup-btn { background: #fff; border-color: #fff; color: var(--purple); flex: none; }
.setup-btn:hover { background: var(--lav-2); color: var(--purple); }

.side { background: var(--deep); background-image: linear-gradient(180deg, #1F1340 0%, #26174A 100%); }
.side a.nav { transition: background 0.15s; }
.side a.nav:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

@media (max-width: 820px) {
  h1.display { font-size: 30px; }
  .side { flex-basis: 100%; padding: 14px; gap: 10px; }
  .side .navs { display: flex; flex-wrap: wrap; gap: 4px; }
  .side .group, .side .who { display: none; }
  .team-main { padding: 18px 16px 40px; }
}

/* ── Phase 2–3 additions ── */
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--purple); color: #fff; font-size: 11px; font-weight: 500; display: grid; place-items: center; flex: none; }
.tabbar a.tab-badge { position: relative; }
.tabbar .badge { top: 2px; right: calc(50% - 22px); }
.alert-soft { background: #fff; border-color: var(--line-2); }
.card-amber { background: var(--amber-bg); border-color: var(--amber-line); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line-2); background: #fff; color: var(--muted); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.tab.on { background: var(--purple); border-color: var(--purple); color: #fff; }
.tr-link { cursor: pointer; }
.tr-link:hover td { background: #FBF9FD; }
.suggest { display: flex; flex-direction: column; gap: 4px; background: linear-gradient(135deg, #fff, var(--tint-2)); }
.file-row { all: unset; display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #F4F0F9; cursor: pointer; }
.file-row:hover { background: #FBF9FD; }
.item-row { border-top: 1px solid var(--line); padding-top: 10px; }

/* Chats */
.room-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #F4F0F9; text-decoration: none; color: inherit; }
.room-row:last-child { border-bottom: none; }
.room-row:hover { background: #FBF9FD; color: inherit; }
.room-row.room-client { background: #F3F9FB; border-left: 3px solid var(--water-ink); }
.room-row.room-client:hover { background: #EAF4F8; }
.room-row.unread .row-title { font-weight: 600; }
.room-preview { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.room-icon { background: var(--tint); color: var(--purple); }
.chat { display: flex; flex-direction: column; height: calc(100vh - 56px); min-height: 420px; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.chat-client { height: calc(100dvh - 90px); border-radius: 0; border: none; margin: -18px -20px -28px; }
.app-client.in-chat .client-main { padding-top: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); padding-top: calc(12px + env(safe-area-inset-top)); }
.chat-client .chat-head { padding-top: calc(12px + env(safe-area-inset-top)); }
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--ground); }
.chat-day { align-self: center; font-size: 11px; color: var(--muted); background: var(--tint-2); border-radius: 999px; padding: 3px 10px; margin: 8px 0; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 78%; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-name { font-size: 11px; color: var(--label); margin: 4px 0 2px 4px; }
.bubble { background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.msg.mine .bubble { background: var(--purple); border-color: var(--purple); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-time { font-size: 10px; opacity: 0.6; align-self: flex-end; }
.file-chip { all: unset; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 10px; border-radius: 10px; background: var(--tint-2); color: var(--ink); font-size: 13px; }
.msg.mine .file-chip { background: rgba(255, 255, 255, 0.14); color: #fff; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }
.composer-input { min-height: 42px !important; max-height: 140px; resize: none; }
.composer-send { width: 42px; padding: 0; flex: none; }

/* Questionnaire scale */
.scale { display: flex; flex-wrap: wrap; gap: 6px; }
.scale-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line-2); background: #fff; cursor: pointer; }
.scale-btn.on { background: var(--purple); border-color: var(--purple); color: #fff; }

/* Money chart */
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 190px; padding: 18px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.bar-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bar-in, .bar-out { width: 40%; max-width: 16px; border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-in, .key-in { background: var(--purple); }
.bar-out, .key-out { background: var(--lav); }
.bar-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Proposal / quote / invoice sheet (also what prints to PDF) */
.doc-sheet { background: #fff; border: 1px solid var(--line); border-radius: 6px; max-width: 820px; width: 100%; margin: 0 auto; box-shadow: 0 10px 30px rgba(46, 29, 68, 0.08); color: var(--ink); overflow: hidden; }
.doc-band { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 30px 40px 26px; background-color: var(--purple); background-image: radial-gradient(circle at 90% 0%, rgba(205, 184, 238, 0.3), transparent 55%), linear-gradient(135deg, #3A2552, #482E64); color: #fff; }
.doc-wordmark { font-family: var(--serif); font-size: 30px; line-height: 1; }
.doc-wordmark-sub { font-size: 9px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--lav); margin-top: 6px; }
.doc-kind { font-family: var(--serif); font-size: 26px; }
.doc-number { font-size: 12px; letter-spacing: 0.08em; color: var(--lav-2); }
.doc-body { padding: 30px 40px; display: flex; flex-direction: column; gap: 18px; }
.doc-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; font-size: 13px; }
.doc-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--label); margin-bottom: 4px; }
.doc-strong { font-weight: 500; }
.doc-muted { color: var(--muted); }
.doc-title { font-size: 30px; margin-top: 8px; }
.doc-intro { font-family: var(--italic); font-style: italic; color: var(--body); line-height: 1.7; margin: 0; white-space: pre-line; }
.doc-section h2 { font-size: 19px; margin-bottom: 6px; }
.doc-section p { margin: 0; line-height: 1.7; white-space: pre-line; font-size: 14px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table th { text-align: left; font-weight: 500; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--label); border-bottom: 1px solid var(--line-2); padding: 8px 6px; }
.doc-table td { padding: 10px 6px; border-bottom: 1px solid #F4F0F9; vertical-align: top; }
.doc-table .num { text-align: right; white-space: nowrap; }
.doc-table tfoot td { border-bottom: none; padding-top: 6px; }
.doc-total td { font-family: var(--serif); font-size: 22px; color: var(--purple); border-top: 1px solid var(--line-2) !important; padding-top: 12px !important; }
.doc-note { background: var(--tint-2); border-radius: 10px; padding: 14px 16px; font-size: 13px; }
.doc-foot { padding: 14px 40px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); text-align: center; }

@media (max-width: 620px) {
  .doc-band, .doc-body { padding-left: 20px; padding-right: 20px; }
  .msg { max-width: 88%; }
  .chat { height: calc(100dvh - 120px); }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body, html { background: #fff !important; }
  .side, .tabbar, .brand-band, .no-print, .toast { display: none !important; }
  .team-main, .client-main { padding: 0 !important; }
  .doc-sheet { box-shadow: none; border: none; max-width: none; }
  .doc-band, .doc-note { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Phase 4: briefs, notes, announcements, meetings, sales ── */
.announce { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius); text-decoration: none; color: var(--ink); background: linear-gradient(135deg, var(--tint), #fff); border: 1px solid var(--lav); }
.people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; padding: 8px; border: 1px solid var(--line-2); border-radius: 10px; }
.note-card { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-height: 120px; }
.note-card:hover { border-color: var(--lav); }
.note-preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.note-title { font-family: var(--serif); font-size: 22px; color: var(--purple); border-color: transparent !important; padding-left: 0 !important; }
.note-body { min-height: 360px !important; border-color: transparent !important; padding-left: 0 !important; line-height: 1.7; }
.transcript { white-space: pre-wrap; font-size: 14px; line-height: 1.75; max-height: 70vh; overflow-y: auto; background: var(--ground); border-radius: 10px; padding: 14px; }
mark { background: #FCE7B7; color: inherit; border-radius: 3px; padding: 0 1px; }
.date-chip { flex: none; width: 46px; height: 50px; border-radius: 10px; background: var(--tint-2); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.date-chip span { font-family: var(--serif); font-size: 20px; color: var(--purple); }
.date-chip small { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-top: 3px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.board-col { background: var(--tint-2); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.board-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; font-weight: 500; font-size: 13px; color: var(--purple); }
.lead-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.stage-select { width: auto !important; min-height: 28px !important; padding: 2px 6px !important; font-size: 12px !important; }
.late-text { color: var(--amber-strong); }
.brief-entry .btn-ghost { opacity: 0.6; }
.brief-entry:hover .btn-ghost { opacity: 1; }
.sign-block { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 30px; margin-top: 26px; }
.sign-line { border-bottom: 1px solid var(--ink); min-height: 40px; display: flex; align-items: flex-end; padding-bottom: 4px; }
.signature, .sign-input { font-family: var(--italic); font-style: italic; font-size: 22px; color: var(--purple); }
details summary { cursor: pointer; }
