@font-face { font-family: 'Outfit'; src: url(fonts/outfit-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Lora'; src: url(fonts/lora-latin-wght-normal.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Lora'; src: url(fonts/lora-latin-wght-italic.woff2) format('woff2'); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --paper: #F4F1EA;
  --paper-2: #EDE8DE;
  --card: #FFFEFB;
  --ink: #1B2A33;
  --ink-2: #44525A;
  --muted: #78817F;
  --line: #E2DCD0;
  --line-2: #D3CBBB;
  --slate: #24415A;
  --slate-2: #3A5A75;
  --slate-soft: #E3E9EE;
  --clay: #A9572F;
  --clay-soft: #F5E6DC;
  --olive: #56703F;
  --olive-soft: #E5EBDC;
  --ochre: #A27A1E;
  --ochre-soft: #F3EBD3;
  --r: 14px;
  --r-s: 9px;
  --shadow: 0 1px 2px rgba(27, 42, 51, .04), 0 6px 24px -12px rgba(27, 42, 51, .14);
  --serif: 'Lora', Georgia, serif;
  --sans: 'Outfit', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--slate-2); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0; }
svg { flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 26px 18px 18px; border-right: 1px solid var(--line); background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--slate); padding: 0 8px; }
.mark { width: 34px; height: 34px; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand-txt b { font: 500 23px/1 var(--serif); color: var(--ink); letter-spacing: -.01em; }
.brand-txt small { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 38px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  text-decoration: none; color: var(--ink-2); font-weight: 450; transition: background .2s, color .2s;
}
.nav a svg { width: 19px; height: 19px; color: var(--muted); }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.nav a[aria-current="page"] svg { color: var(--slate); }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--clay); color: #fff; font-size: 11.5px; font-weight: 600; display: grid; place-items: center; }
.nav-sep { height: 1px; background: var(--line); margin: 14px 12px; }
.side-foot { margin-top: auto; }
.client-chip { display: flex; gap: 11px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.client-chip b { display: block; font-weight: 550; font-size: 13.5px; }
.client-chip small { color: var(--muted); font-size: 12.5px; }

.av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: .02em; flex: none; }
.av.sm { width: 26px; height: 26px; font-size: 10px; }
.av.lg { width: 44px; height: 44px; font-size: 14px; }
.av-mc, .av-me { background: var(--slate); color: #F4F1EA; }
.av-a { background: #E7D9C9; color: #6E4527; }
.av-b { background: #DCE3D3; color: #3F5530; }
.av-c { background: #E2E0EC; color: #4A4670; }
.av-d { background: #D8E2E8; color: #2B4A60; }
.av-x { background: var(--paper-2); color: var(--ink-2); }

.mtop, .tabbar { display: none; }
.main { padding: 34px 44px 80px; max-width: 1240px; width: 100%; outline: none; }

/* ---------- headers ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.ph h1 { font: 400 34px/1.15 var(--serif); letter-spacing: -.015em; margin-top: 6px; }
.ph h1 em { font-style: italic; color: var(--slate); }
.ph p.lead { color: var(--ink-2); margin-top: 8px; max-width: 620px; }
.h2 { font: 500 19px/1.3 var(--serif); letter-spacing: -.005em; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-h a, .link { color: var(--slate-2); font-size: 13.5px; font-weight: 500; text-decoration: none; background: none; border: 0; padding: 0; }
.sec-h a:hover, .link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.pad { padding: 22px 24px; }
.grid { display: grid; gap: 20px; }
.g-dash { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; }

/* attention */
.attn { padding: 6px; }
.attn-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.attn-h .pill { margin-left: 10px; }
.todo {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 11px; transition: background .2s;
}
.todo + .todo { border-top: 1px solid var(--line); border-radius: 0 0 11px 11px; }
.todo:hover { background: #FBF9F4; }
.todo .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; }
.todo .ic svg { width: 20px; height: 20px; }
.ic-sign { background: var(--clay-soft); color: var(--clay); }
.ic-pay { background: var(--ochre-soft); color: var(--ochre); }
.ic-ask { background: var(--slate-soft); color: var(--slate); }
.ic-ok { background: var(--olive-soft); color: var(--olive); }
.todo b { font-weight: 550; display: block; }
.todo small { color: var(--muted); font-size: 13px; display: block; margin-top: 1px; }
.todo.done { opacity: .55; }
.todo.done b { text-decoration: line-through; text-decoration-color: var(--line-2); }
.all-clear { padding: 18px; display: flex; gap: 14px; align-items: center; color: var(--olive); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink);
  font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background .2s, border-color .2s, transform .1s;
}
.btn:hover { background: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--slate); border-color: var(--slate); color: #F7F5F0; }
.btn.primary:hover { background: #1C3549; }
.btn.clay { background: var(--clay); border-color: var(--clay); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; height: 46px; font-size: 15px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.pill { font-family: var(--sans); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.clay { background: var(--clay-soft); color: var(--clay); }
.pill.ochre { background: var(--ochre-soft); color: #86641A; }
.pill.olive { background: var(--olive-soft); color: var(--olive); }
.pill.slate { background: var(--slate-soft); color: var(--slate); }
.pill.grey { background: var(--paper-2); color: var(--ink-2); }
.pill.plain::before { display: none; }

/* project hero on dashboard */
.proj-hero { padding: 22px 24px; }
.hero-top { display: grid; grid-template-columns: minmax(0, 1fr) 236px; gap: 24px; align-items: start; }
.proj-hero .plan { background: #EFEBE2; border: 1px solid var(--line); border-radius: 11px; display: grid; place-items: center; padding: 10px; }
.proj-hero .plan svg { width: 100%; height: auto; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; margin-top: 6px; }
.prog { margin-top: 18px; }
.prog-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.prog-top b { font-weight: 600; color: var(--ink); }
.bar { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--slate); border-radius: 3px; transform-origin: left; animation: grow .7s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* stage timeline */
.stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 22px; position: relative; }
.stage { position: relative; padding-top: 22px; font-size: 12.5px; }
.stage::before { content: ''; position: absolute; top: 6px; left: 0; right: 0; height: 2px; background: var(--line); }
.stage.done::before, .stage.current::before { background: var(--slate); }
.stage.current::before { background: linear-gradient(90deg, var(--slate) 50%, var(--line) 50%); }
.stage .dot { position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 2px solid var(--line-2); }
.stage.done .dot { background: var(--slate); border-color: var(--slate); }
.stage.current .dot { border-color: var(--slate); box-shadow: 0 0 0 4px var(--slate-soft); }
.stage.current .dot::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--slate); }
.stage b { display: block; font-weight: 550; color: var(--ink); }
.stage span { color: var(--muted); }
.stage.next b { color: var(--ink-2); font-weight: 450; }

/* side cards */
.visit { display: flex; gap: 16px; align-items: center; }
.cal { width: 56px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); text-align: center; flex: none; background: var(--card); }
.cal i { display: block; font-style: normal; background: var(--clay); color: #fff; font-size: 10.5px; letter-spacing: .12em; padding: 3px 0; font-weight: 600; }
.cal b { display: block; font: 500 24px/1.25 var(--serif); padding: 3px 0 4px; }
.visit small { display: block; color: var(--muted); font-size: 13px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; font-size: 14px; }
.feed li + li { border-top: 1px dashed var(--line); }
.feed time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.feed b { font-weight: 550; }
.money { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.money div small { display: block; color: var(--muted); font-size: 12.5px; }
.money div b { font: 500 22px/1.3 var(--serif); }
.contact-row { display: flex; gap: 12px; align-items: center; }
.contact-row + .contact-row { margin-top: 12px; }
.contact-row small { display: block; color: var(--muted); font-size: 12.5px; }
.contact-row .btn { margin-left: auto; }

/* ---------- projects ---------- */
.ptabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.ptab { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 16px; text-align: left; min-width: 0; display: flex; gap: 12px; align-items: center; transition: border-color .2s, box-shadow .2s; }
.ptab b { display: block; font-weight: 550; font-size: 14px; }
.ptab small { color: var(--muted); font-size: 12.5px; }
.ptab[aria-pressed="true"] { border-color: var(--slate); box-shadow: 0 0 0 3px var(--slate-soft); }
.ptab .mini { width: 34px; height: 34px; border-radius: 8px; background: #EFEBE2; display: grid; place-items: center; }
.ptab .mini svg { width: 26px; height: 26px; }
.g-proj { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.ms { list-style: none; margin: 0; padding: 0; position: relative; }
.ms li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 14px; padding: 0 0 20px; position: relative; }
.ms li::before { content: ''; position: absolute; left: 11px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.ms li:last-child::before { display: none; }
.ms li:last-child { padding-bottom: 0; }
.ms .m-ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); background: var(--card); }
.ms .m-ic svg { width: 13px; height: 13px; }
.ms .done .m-ic { background: var(--olive); border-color: var(--olive); color: #fff; }
.ms .current .m-ic { border-color: var(--slate); }
.ms .current .m-ic::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--slate); }
.ms .decision .m-ic { border-color: var(--clay); background: var(--clay-soft); color: var(--clay); }
.ms b { font-weight: 550; }
.ms p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.ms time { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.ms .next b { color: var(--ink-2); font-weight: 450; }
.plan-card { background: #EFEBE2; padding: 18px; border-radius: var(--r); border: 1px solid var(--line); }
.plan-card svg { width: 100%; height: auto; display: block; }
.plan-cap { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }

/* ---------- documents ---------- */
.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--r); padding: 26px; display: flex; align-items: center; gap: 18px;
  background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(36, 65, 90, .018) 10px 20px), var(--card); transition: border-color .2s, background-color .2s;
}
.drop.over { border-color: var(--slate); background: var(--slate-soft); }
.drop .ic { width: 50px; height: 50px; border-radius: 13px; background: var(--slate-soft); color: var(--slate); display: grid; place-items: center; }
.drop .ic svg { width: 24px; height: 24px; }
.drop b { font-weight: 550; display: block; }
.d-mob { display: none; }
.drop small { color: var(--muted); font-size: 13px; }
.drop .btn { margin-left: auto; }
.uploads { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.up { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; }
.up .bar { margin-top: 7px; height: 4px; }
.up .bar i { animation: none; transition: width .2s linear; width: 0; }
.up small { color: var(--muted); font-size: 12.5px; }
.up .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; font-size: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 26px 0 12px; }
.chip { height: 32px; padding: 0 13px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip .n { opacity: .6; margin-left: 4px; }

.table { width: 100%; }
.row {
  display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.2fr) 110px 150px 120px; gap: 16px; align-items: center;
  padding: 13px 20px; border-top: 1px solid var(--line); font-size: 14px;
}
.row.head { border-top: 0; color: var(--muted); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; padding-top: 14px; padding-bottom: 10px; }
.row.click { cursor: pointer; transition: background .15s; }
.row.click:hover { background: #FBF9F4; }
.row.sel { background: #F7F4EC; }
.fname { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fname > span { min-width: 0; }
.fname b { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fname small { color: var(--muted); font-size: 12.5px; }
.ftype { width: 34px; height: 40px; border-radius: 5px; position: relative; display: grid; place-items: end center; padding-bottom: 5px; font-size: 8.5px; font-weight: 700; letter-spacing: .06em; color: #fff; flex: none; }
.ftype::after { content: ''; position: absolute; top: 0; right: 0; width: 10px; height: 10px; background: linear-gradient(225deg, var(--card) 50%, rgba(0,0,0,.18) 50%); }
.ft-pdf { background: #B65A3A; }
.ft-dwg { background: #3A5A75; }
.ft-jpg { background: #6F8656; }
.ft-xls { background: #4E7A62; }
.ft-doc { background: #50618A; }
.muted { color: var(--muted); }
.r-act { display: flex; justify-content: flex-end; gap: 6px; }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); }
.icon-btn:hover { background: var(--paper-2); }
.icon-btn svg { width: 17px; height: 17px; }
.versions { grid-column: 1 / -1; background: #FAF8F3; border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; margin-top: 4px; }
.ver { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; font-size: 13.5px; }
.ver + .ver { border-top: 1px dashed var(--line); }
.ver .vtag { font-weight: 600; font-size: 12px; color: var(--slate); background: var(--slate-soft); border-radius: 6px; text-align: center; padding: 2px 0; }
.ver.old .vtag { color: var(--ink-2); background: var(--paper-2); }

/* ---------- invoices ---------- */
.g-inv { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
.inv-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.inv-sum .card { padding: 18px 20px; }
.inv-sum small { color: var(--muted); font-size: 12.5px; display: block; }
.inv-sum b { font: 500 25px/1.35 var(--serif); display: block; }
.inv-sum span { font-size: 12.5px; color: var(--ink-2); }
.row.inv { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 104px 100px; }
.row.inv .fname small { white-space: nowrap; }
.amt { text-align: right; font-weight: 550; }
.paper-wrap { container-type: inline-size; }
.paper {
  background: #fff; border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 40px -18px rgba(27, 42, 51, .35);
  aspect-ratio: 1 / 1.414; padding: 6.5cqw 7cqw; font-size: 2.05cqw; line-height: 1.5; color: #222; position: relative; overflow: hidden;
}
.paper .p-top { display: flex; justify-content: space-between; align-items: flex-start; }
.paper .p-brand { display: flex; gap: 1.6cqw; align-items: center; color: var(--slate); }
.paper .p-brand svg { width: 6cqw; height: 6cqw; }
.paper .p-brand b { font: 500 4cqw/1 var(--serif); color: #1B2A33; }
.paper h3 { font: 500 4.2cqw/1.1 var(--serif); text-align: right; }
.paper .p-sm { color: #6b6b6b; font-size: 1.75cqw; }
.paper .p-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4cqw; margin: 6cqw 0 4.5cqw; }
.paper .p-lbl { text-transform: uppercase; letter-spacing: .12em; font-size: 1.5cqw; color: #8a8a8a; margin-bottom: .6cqw; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { text-align: left; font-weight: 600; font-size: 1.6cqw; letter-spacing: .08em; text-transform: uppercase; color: #777; border-bottom: .25cqw solid #1B2A33; padding: 1cqw 0; }
.paper td { padding: 1.4cqw 0; border-bottom: 1px solid #ece8e0; vertical-align: top; }
.paper .num { text-align: right; white-space: nowrap; }
.paper .tot { margin-left: auto; width: 52%; margin-top: 3cqw; }
.paper .tot div { display: flex; justify-content: space-between; padding: .8cqw 0; }
.paper .tot .grand { border-top: .25cqw solid #1B2A33; margin-top: .8cqw; padding-top: 1.4cqw; font-weight: 600; font-size: 2.5cqw; }
.paper .p-foot { position: absolute; left: 7cqw; right: 7cqw; bottom: 5cqw; display: grid; grid-template-columns: 1fr auto; gap: 3cqw; align-items: end; font-size: 1.6cqw; color: #6b6b6b; border-top: 1px solid #ece8e0; padding-top: 2cqw; }
.paper .qr { width: 11cqw; height: 11cqw; }
.stamp {
  position: absolute; top: 62%; left: 10%; transform: rotate(-12deg); border: .5cqw solid var(--olive); color: var(--olive);
  font: 700 5.4cqw/1 var(--sans); letter-spacing: .14em; padding: 1.2cqw 2.4cqw; border-radius: 1.2cqw; opacity: .85;
  animation: stamp .5s var(--ease) both;
}
.stamp small { display: block; font-size: 1.6cqw; letter-spacing: .08em; font-weight: 600; margin-top: .6cqw; text-align: center; }
@keyframes stamp { from { transform: rotate(-12deg) scale(1.6); opacity: 0; } }
.inv-actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; flex-wrap: wrap; }
.inv-actions .grow { flex: 1; }

/* ---------- messages ---------- */
.msgs { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 190px); min-height: 520px; overflow: hidden; }
.threads { border-right: 1px solid var(--line); overflow-y: auto; }
.thread-b { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 16px 18px; border-bottom: 1px solid var(--line); position: relative; }
.thread-b:hover { background: #FBF9F4; }
.thread-b[aria-pressed="true"] { background: #F6F3EB; }
.thread-b[aria-pressed="true"]::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--slate); }
.thread-b b { font-weight: 550; display: flex; align-items: center; gap: 8px; }
.thread-b .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--clay); }
.thread-b small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.convo { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.convo-h { padding: 16px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.convo-h small { color: var(--muted); font-size: 13px; display: block; }
.convo-h .people { margin-left: auto; display: flex; }
.convo-h .people .av { border: 2px solid var(--card); margin-left: -8px; }
.stream { flex: 1; overflow-y: auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; background: #FCFBF8; }
.msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; max-width: 640px; }
.msg .who { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.msg .who b { color: var(--ink); font-weight: 550; margin-right: 6px; }
.bubble { background: var(--card); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 11px 15px; font-size: 14.5px; }
.bubble.q { border-color: #E8C9B6; background: #FDF7F2; }
.msg.me { margin-left: auto; grid-template-columns: minmax(0, 1fr) 34px; }
.msg.me .av { order: 2; }
.msg.me .who { text-align: right; }
.msg.me .bubble { background: var(--slate); border-color: var(--slate); color: #F4F1EA; border-radius: 14px 4px 14px 14px; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.compose { border-top: 1px solid var(--line); padding: 14px 18px 16px; background: var(--card); }
.sugg { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sugg button { border: 1px solid var(--line); background: var(--paper); border-radius: 16px; padding: 5px 12px; font-size: 13px; color: var(--ink-2); }
.sugg button:hover { border-color: var(--slate-2); color: var(--ink); }
.compose form { display: flex; gap: 10px; align-items: flex-end; }
.compose textarea { flex: 1; min-width: 0; resize: none; border: 1px solid var(--line-2); border-radius: 11px; padding: 10px 14px; min-height: 44px; max-height: 120px; background: var(--card); line-height: 1.45; }
.compose textarea:focus { outline: none; border-color: var(--slate-2); box-shadow: 0 0 0 3px var(--slate-soft); }
.compose .btn { height: 44px; }

/* ---------- settings ---------- */
.g-set { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.row.mem { grid-template-columns: minmax(0, 1.8fr) 130px 110px 40px; }
.row.mem select { border: 1px solid var(--line); border-radius: 8px; background: var(--card); height: 32px; padding: 0 8px; font-size: 13.5px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field input, .field select { height: 42px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 13px; background: var(--card); font-size: 15px; color: var(--ink); font-weight: 400; min-width: 0; width: 100%; }
.field input:focus, .field select:focus { outline: none; border-color: var(--slate-2); box-shadow: 0 0 0 3px var(--slate-soft); }
.invite { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 10px; align-items: end; padding: 16px 20px; border-top: 1px solid var(--line); background: #FBF9F4; border-radius: 0 0 var(--r) var(--r); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; font-size: 14px; }
.toggle + .toggle { border-top: 1px dashed var(--line); }
.toggle small { display: block; color: var(--muted); font-size: 12.5px; }
.sw { position: relative; width: 40px; height: 23px; flex: none; }
.sw input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.sw span { position: absolute; inset: 0; border-radius: 12px; background: var(--line-2); transition: background .2s; pointer-events: none; }
.sw span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.sw input:checked + span { background: var(--slate); }
.sw input:checked + span::after { transform: translateX(17px); }
.sw input:focus-visible + span { outline: 2px solid var(--slate-2); outline-offset: 2px; }

/* ---------- modal ---------- */
.modal { border: 0; padding: 0; border-radius: 18px; background: var(--card); color: var(--ink); width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 30px 80px -20px rgba(20, 30, 38, .45); }
.modal::backdrop { background: rgba(27, 42, 51, .42); backdrop-filter: blur(2px); }
.modal[open] { animation: pop .28s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.m-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 0; }
.m-h h2 { font: 500 22px/1.25 var(--serif); }
.m-h small { color: var(--muted); font-size: 13px; display: block; margin-top: 3px; }
.m-b { padding: 18px 24px 24px; }
.doc-sum { border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; background: #FBF9F4; }
.doc-sum div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px 0; font-size: 14px; }
.doc-sum div + div { border-top: 1px dashed var(--line); }
.doc-sum dt { color: var(--muted); }
.doc-sum dd { margin: 0; }
.sigpad { margin-top: 18px; }
.sigpad .lbl { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.canvas-wrap { position: relative; border: 1px solid var(--line-2); border-radius: 12px; background: #fff; height: 170px; overflow: hidden; }
.canvas-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.canvas-wrap .base { position: absolute; left: 24px; right: 24px; bottom: 38px; border-bottom: 1px solid var(--line-2); pointer-events: none; }
.canvas-wrap .hint { position: absolute; left: 24px; bottom: 12px; font-size: 12px; color: var(--muted); pointer-events: none; }
.canvas-wrap .x { position: absolute; left: 24px; bottom: 44px; font: italic 20px var(--serif); color: var(--line-2); pointer-events: none; }
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 18px; font-size: 13.5px; color: var(--ink-2); }
.agree input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--slate); flex: none; }
.m-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.m-foot .grow { flex: 1; font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.m-foot .grow svg { width: 15px; height: 15px; }
.done-state { text-align: center; padding: 16px 0 6px; }
.done-state .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--olive-soft); color: var(--olive); display: grid; place-items: center; margin: 0 auto 14px; }
.done-state .tick svg { width: 30px; height: 30px; }
.done-state h3 { font: 500 22px/1.3 var(--serif); }
.done-state p { color: var(--ink-2); margin-top: 6px; }
.audit { text-align: left; margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-size: 13px; color: var(--ink-2); background: #FBF9F4; }
.audit div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.audit div span:last-child { text-align: right; }
.sig-img { max-width: 220px; height: 70px; object-fit: contain; display: block; margin: 8px auto 0; }

.paytabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
.paytab { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 12px; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.paytab[aria-pressed="true"] { border-color: var(--slate); box-shadow: 0 0 0 3px var(--slate-soft); }
.paytab svg { width: 30px; height: 20px; }
.pay-amt { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: 12px; background: var(--paper); margin-bottom: 18px; }
.pay-amt b { font: 500 26px/1.2 var(--serif); }
.pay-amt small { color: var(--muted); font-size: 13px; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fgrid .full { grid-column: 1 / -1; }
.mbway-wait { text-align: center; padding: 10px 0; }
.ring { width: 92px; height: 92px; margin: 6px auto 14px; position: relative; }
.ring > svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 500 26px var(--serif); }
.spin { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 12px 30px -10px rgba(0,0,0,.4); animation: pop .3s var(--ease); }
.toast svg { width: 17px; height: 17px; color: #B9CDA5; }

/* ribbon */
.ribbon {
  position: fixed; right: 14px; bottom: 14px; z-index: 50; font-size: 11.5px; font-weight: 500; letter-spacing: .02em;
  padding: 5px 10px; border-radius: 999px; background: rgba(255, 254, 251, .92); border: 1px solid var(--line-2); color: var(--ink-2); text-decoration: none;
}
.ribbon:hover { color: var(--ink); border-color: var(--ink-2); }

.view { animation: fade .35s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .main { padding: 30px 28px 80px; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .mtop { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; justify-content: space-between; padding: 12px 16px; background: rgba(244, 241, 234, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  .mtop .mark { width: 30px; height: 30px; }
  .mtop-acc { text-decoration: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255, 254, 251, .97); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); text-decoration: none; padding: 5px 0; position: relative; }
  .tabbar a svg { width: 21px; height: 21px; }
  .tabbar a[aria-current="page"] { color: var(--slate); font-weight: 550; }
  .tabbar .count { position: absolute; top: 1px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--clay); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; font-weight: 600; }
  .ribbon { bottom: auto; top: 17px; right: 64px; }
  .main { padding: 22px 16px 110px; }
  .g-dash, .g-proj, .g-inv, .g-set { grid-template-columns: minmax(0, 1fr); }
  .msgs { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; }
  .threads { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .thread-b { flex: 0 0 auto; width: auto; max-width: 220px; border-bottom: 0; border-right: 1px solid var(--line); padding: 12px 16px; }
  .thread-b small { display: none; }
  .thread-b[aria-pressed="true"]::before { left: 12px; right: 12px; top: auto; bottom: 0; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .stream { height: 52vh; min-height: 320px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .ph { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
  .ph h1 { font-size: 27px; }
  .pad { padding: 18px; }
  .todo { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 14px 12px; }
  .todo .ic { width: 38px; height: 38px; }
  .todo .btn { grid-column: 2; justify-self: start; }
  .attn-h { padding: 14px 12px 8px; }
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
  .hero-top { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .proj-hero { padding: 18px; }
  .stage { font-size: 12px; }
  .row.head { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px 16px; }
  .row > .c-proj, .row > .c-date { display: none; }
  .row.inv { grid-template-columns: minmax(0, 1fr) auto; }
  .row.inv .c-due { grid-column: 1; font-size: 13px; }
  .row.inv .amt { grid-row: 1; grid-column: 2; }
  .row.inv .c-st { grid-column: 2; grid-row: 2; justify-self: end; }
  .row.doc .c-st { grid-column: 1; }
  .row.doc .r-act { grid-column: 2; grid-row: 1 / span 2; }
  .row.mem { grid-template-columns: minmax(0, 1fr) auto; }
  .row.mem .c-last { display: none; }
  .row.mem .c-del { grid-column: 2; grid-row: 1; }
  .row.mem .c-role { grid-column: 1; }
  .drop { flex-direction: column; align-items: flex-start; padding: 20px; }
  .drop .btn { margin-left: 0; }
  .drop .d-desk { display: none; }
  .drop .d-mob { display: inline; }
  .row .fname b { white-space: normal; }
  .inv-sum { grid-template-columns: 1fr 1fr; gap: 10px; }
  .inv-sum .card:first-child { grid-column: 1 / -1; }
  .inv-sum .card { padding: 14px 16px; }
  .inv-sum b { font-size: 21px; }
  .invite { grid-template-columns: 1fr 1fr; }
  .invite .field:first-child { grid-column: 1 / -1; }
  .modal { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .m-h { padding: 20px 18px 0; }
  .m-b { padding: 16px 18px 22px; }
  .doc-sum div { grid-template-columns: 1fr; gap: 2px; }
  .fgrid { grid-template-columns: 1fr 1fr; }
  .money b { font-size: 19px; }
  .ptabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 18px; padding: 2px 16px 4px; }
  .ptab { flex: 0 0 auto; }
  .convo-h .people { display: none; }
  .msg .who time { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
