/* Originally Gabe CRM. Colors come from the active workspace (set on <body>). */
:root {
  --accent: #7D5411; --accent2: #A5793F; --paper: #F8F3EC; --ink: #241C14;
  --card: #fff; --line: color-mix(in srgb, var(--ink) 13%, transparent); --line2: color-mix(in srgb, var(--ink) 7%, transparent);
  --muted: color-mix(in srgb, var(--ink) 62%, white); --soft: color-mix(in srgb, var(--accent) 9%, white);
  --good: #1f7a4d; --bad: #b3261e; --warn: #9a5b00; --hot: #c2410c;
  --r: 12px; --shadow: 0 1px 2px rgba(20, 14, 6, .05), 0 6px 20px rgba(20, 14, 6, .05);
  --body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head: "Fraunces", Georgia, serif;
}
body.head-sans { --head: var(--body); }
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
@media (min-width: 1700px) { html { font-size: 18.5px; } }
@media (min-width: 2100px) { html { font-size: 21px; } }
@media (min-width: 2500px) { html { font-size: 23px; } }
body { margin: 0; font: 1rem/1.5 var(--body); color: var(--ink); background: var(--paper); }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }
body.head-sans h1, body.head-sans h2, body.head-sans h3 { font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: 2rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; margin: 1.6rem 0 .3rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
p { margin: 0 0 .8rem; }
small { font-size: .86rem; }
.muted { color: var(--muted); max-width: 46rem; } .dim { color: var(--muted); } .late { color: var(--bad); font-weight: 600; } .good { color: var(--good); }
.hint { color: var(--muted); font-size: .9rem; margin: .3rem 0 .8rem; max-width: 52rem; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin: 0 0 .25rem; }
.eyebrow a { color: inherit; }
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent2) 60%, white); outline-offset: 2px; border-radius: 6px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 15.5rem 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 1.1rem .9rem; display: flex; flex-direction: column; gap: .9rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.ws-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: rgba(255, 255, 255, .09); padding: 4px; border-radius: 11px; }
.ws-btn { width: 100%; border: 0; background: transparent; color: rgba(255, 255, 255, .72); font: 600 .92rem var(--body); padding: .55rem .4rem; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: .45rem; }
.ws-btn:hover { color: #fff; }
.ws-btn.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.ws-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--dot); }
.ws-name { font: 600 1.02rem/1.25 var(--head); padding: 0 .45rem; color: rgba(255, 255, 255, .95); }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: .3rem; }
.nav a { display: flex; align-items: center; gap: .7rem; padding: .62rem .7rem; border-radius: 9px; color: rgba(255, 255, 255, .78); font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.nav a.on { background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; }
.badge { margin-left: auto; background: var(--hot); color: #fff; border-radius: 99px; font-size: .74rem; padding: .05rem .5rem; font-weight: 700; }
.side-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem .45rem 0; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .9rem; color: rgba(255, 255, 255, .8); }
.side-foot .link-btn { color: rgba(255, 255, 255, .8); }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: .8rem; padding: .8rem 1.6rem; position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line2); }
.search { flex: 1; max-width: 34rem; display: flex; align-items: center; gap: .5rem; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 0 .9rem; color: var(--muted); }
.search input { border: 0; background: transparent; padding: .6rem 0; box-shadow: none; }
.search input:focus { outline: none; }
.search:focus-within { border-color: var(--accent2); }
.top .btn.primary { margin-left: auto; }
.menu-btn { display: none; border: 1px solid var(--line); background: var(--card); border-radius: 9px; font-size: 1.2rem; padding: .3rem .7rem; cursor: pointer; }
.page { padding: 1.6rem; max-width: 86rem; margin: 0 auto; }
.page.wide { max-width: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.page-head .muted { margin: 0; max-width: 34rem; }
.head-meta { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin: .5rem 0 0; color: var(--muted); }
.head-meta em { font-style: normal; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: 600 .95rem var(--body); padding: .58rem 1rem; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--accent2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { padding: .32rem .7rem; font-size: .86rem; }
.btn.block { width: 100%; } .btn.big { padding: .9rem 1rem; font-size: 1.08rem; }
.link-btn { background: none; border: 0; padding: 0; font: 600 .9rem var(--body); color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.link-btn:hover { text-decoration: underline; } .link-btn.danger, summary.danger { color: var(--bad); }
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: .58rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent2) 22%, transparent); }
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; padding: 0; accent-color: var(--accent); flex: none; }
input[type=color] { padding: .15rem; height: 2.6rem; }
input[type=file] { padding: .4rem; }
input[readonly] { background: var(--soft); }
textarea { resize: vertical; line-height: 1.5; } textarea.mono { font: .9rem/1.55 ui-monospace, Consolas, monospace; }
label { display: block; font-size: .86rem; font-weight: 600; color: var(--muted); }
label > input, label > select, label > textarea, label > .pair { margin-top: .28rem; font-weight: 400; color: var(--ink); font-size: 1rem; }
label.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 500; color: var(--ink); font-size: .95rem; line-height: 1.4; }
label.check.pad { padding-top: 1.7rem; }
.pair { display: grid; grid-template-columns: 5rem 1fr; gap: .4rem; }
.form > * + *, .form.stack > * + * { margin-top: .85rem; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem 1rem; }
.fgrid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fgrid.four { grid-template-columns: 2fr 1fr 2fr 2fr; }
.span2 { grid-column: span 2; }
.actions { display: flex; gap: .7rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; margin-top: .9rem; } .actions.end { align-self: end; justify-content: flex-start; }
.inline-add { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-add input:not([type=date]):not([type=file]), .inline-add select { flex: 1 1 11rem; }
.inline-add input[type=date] { width: auto; flex: 0 0 auto; }
.narrow, .narrow-field { max-width: 46rem; } .narrow-field { margin: 1rem 0; }
.copy-row { display: flex; gap: .6rem; align-items: flex-end; margin: .7rem 0; }
.grow { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font: 500 .84rem ui-monospace, Consolas, monospace; border: 1px solid var(--line); background: var(--soft); border-radius: 7px; padding: .25rem .5rem; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.switch { width: 2.9rem; height: 1.65rem; border-radius: 99px; border: 0; background: color-mix(in srgb, var(--ink) 22%, white); position: relative; cursor: pointer; padding: 0; flex: none; transition: background .15s; }
.switch span { position: absolute; top: .18rem; left: .18rem; width: 1.29rem; height: 1.29rem; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch.on { background: var(--good); } .switch.on span { transform: translateX(1.25rem); }

/* ---------- cards, lists ---------- */
.card { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.15rem 1.25rem; margin-bottom: 1.1rem; }
.card.quiet { box-shadow: none; background: transparent; border-style: dashed; border-color: var(--line); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .7rem; }
.card-head a { font-size: .9rem; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; align-items: start; }
.grid2 > .card { margin: 0; } .grid2 { margin-bottom: 1.1rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.empty { color: var(--muted); margin: .4rem 0; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--line2); }
.rows > li:first-child { border-top: 0; }
.rows b { font-weight: 600; } .rows small { display: block; color: var(--muted); }
.row-link { display: flex; align-items: center; gap: .8rem; flex: 1; min-width: 0; color: inherit; margin: -.3rem -.5rem; padding: .3rem .5rem; border-radius: 9px; }
.row-link:hover { background: var(--soft); text-decoration: none; }
.right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: none; }
.avatar { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: .88rem; flex: none; }
.datebox { width: 2.9rem; text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: .2rem 0; flex: none; line-height: 1.1; }
.datebox b { display: block; font: 600 1.2rem var(--head); } .datebox small { text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; }
.pill { display: inline-block; font-size: .76rem; font-weight: 700; letter-spacing: .02em; padding: .16rem .6rem; border-radius: 99px; background: color-mix(in srgb, var(--ink) 8%, white); color: color-mix(in srgb, var(--ink) 80%, white); white-space: nowrap; }
.pill.hot { background: #fde4d8; color: #9a3412; } .pill.soon { background: #fdf0c8; color: #7a5200; } .pill.calm { background: #e3eefb; color: #1e4f8f; }
.pill.k-won, .pill.s-sent, .pill.c-complete, .pill.c-signed { background: #dbf3e4; color: #14613a; }
.pill.k-done { background: #e6e9ee; color: #3d4654; } .pill.k-lost, .pill.s-failed { background: #fbe1df; color: #8f1d17; }
.pill.s-held, .pill.c-sent, .pill.c-viewed { background: #fdf0c8; color: #7a5200; }
.pill.a-email { background: #e3eefb; color: #1e4f8f; }
.count { font-size: .78rem; font-weight: 700; background: color-mix(in srgb, var(--ink) 9%, white); border-radius: 99px; padding: .05rem .5rem; }
.flash { margin: 1rem 1.6rem 0; padding: .75rem 1rem; border-radius: 10px; font-weight: 500; border: 1px solid; }
.flash.inline { margin: 0 0 1rem; }
.flash.ok { background: #e7f6ec; border-color: #b5e0c4; color: #14613a; } .flash.bad { background: #fdecea; border-color: #f3bcb7; color: #8f1d17; }
.flash.warn { background: #fff6dd; border-color: #f0d68a; color: #6b4a00; } .flash a { color: inherit; text-decoration: underline; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1rem; margin-bottom: 1.1rem; }
.stat { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); padding: 1rem 1.2rem; }
.stat span { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.stat b { display: block; font: 600 2rem/1.2 var(--head); margin: .15rem 0; } .stat small { color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: .7rem; align-items: baseline; padding: .5rem 0; border-top: 1px solid var(--line2); } .timeline li:first-child { border-top: 0; }
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--accent2); flex: none; transform: translateY(-.05rem); }
.dot.t-lead { background: var(--hot); } .dot.t-payment { background: var(--good); } .dot.t-contract { background: #2563eb; } .dot.t-email { background: #7c3aed; }
.task .tick { width: 1.35rem; height: 1.35rem; border-radius: 50%; border: 2px solid var(--line); background: #fff; cursor: pointer; flex: none; padding: 0; }
.task .tick:hover { border-color: var(--good); }
.task.done .tick { background: var(--good); border-color: var(--good); } .task.done .grow { text-decoration: line-through; color: var(--muted); }
.tasks + .inline-add { margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line2); }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input { flex: 2 1 16rem; } .filters select { flex: 1 1 9rem; width: auto; }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); padding: .8rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tbody tr { cursor: pointer; } .table tbody tr:hover { background: var(--soft); } .table tbody tr:last-child td { border-bottom: 0; }
.table td small { display: block; color: var(--muted); } .table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.plain tbody tr { cursor: default; } .table.plain tbody tr:hover { background: none; } .table.plain td, .table.plain th { padding: .45rem .5rem; }
input.tiny { width: 4.2rem; }

/* ---------- pipeline board ---------- */
.board { display: flex; gap: .9rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; min-height: 60vh; }
.col { flex: 0 0 17.5rem; background: color-mix(in srgb, var(--ink) 4.5%, transparent); border-radius: var(--r); padding: .7rem; border-top: 4px solid var(--accent2); }
.col.k-won { border-top-color: var(--good); } .col.k-done { border-top-color: #8792a2; } .col.k-lost { border-top-color: #c98a86; }
.col header { display: flex; align-items: center; gap: .5rem; padding: .1rem .3rem .6rem; }
.col header h2 { font-size: 1.02rem; } .col header small { margin-left: auto; color: var(--muted); font-weight: 600; }
.cards { display: flex; flex-direction: column; gap: .55rem; min-height: 4rem; }
.col.over { background: color-mix(in srgb, var(--accent2) 22%, transparent); }
.kcard { display: block; background: #fff; border: 1px solid var(--line2); border-radius: 10px; padding: .7rem .8rem; color: inherit; box-shadow: 0 1px 2px rgba(20, 14, 6, .06); cursor: grab; }
.kcard:hover { border-color: var(--accent2); text-decoration: none; } .kcard.dragging { opacity: .4; }
.kcard b { display: block; font-weight: 600; line-height: 1.25; } .kmeta { display: block; color: var(--muted); font-size: .88rem; margin: .1rem 0 .35rem; }
.kfoot { display: flex; justify-content: space-between; font-size: .86rem; font-weight: 600; } .kcard .pill { margin-top: .45rem; }

/* ---------- client page ---------- */
.client-grid { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.1rem; align-items: start; }
.stage-form label { min-width: 13rem; } .stage-select { font-weight: 700; }
.came-from { background: var(--soft); border-left: 4px solid var(--accent2); padding: .6rem .9rem; border-radius: 0 9px 9px 0; margin-bottom: 1rem; }
.tabs { display: flex; gap: .25rem; margin-bottom: .8rem; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; font: 600 .94rem var(--body); color: var(--muted); padding: .6rem .62rem; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.tabs button:hover { color: var(--ink); } .tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.composer { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line2); } .composer > * + * { margin-top: .7rem; }
.composer .actions { justify-content: space-between; }
.note { border-top: 1px solid var(--line2); padding: .8rem 0; } .note.pinned { background: #fffaf0; margin: 0 -.6rem; padding: .8rem .6rem; border-radius: 9px; border: 1px solid #f0e2bd; }
.note-body { white-space: normal; overflow-wrap: anywhere; } .note footer { display: flex; justify-content: space-between; margin-top: .4rem; }
.mini-actions { display: flex; gap: .9rem; align-items: center; flex-wrap: wrap; } .mini-actions form { display: inline-flex; gap: .4rem; align-items: center; }
.paid-form select { width: auto; padding: .3rem .5rem; font-size: .88rem; }
.mail { border-top: 1px solid var(--line2); padding: .7rem 0; } .mail summary { cursor: pointer; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; } .mail summary small { margin-left: auto; }
.mail-body { background: var(--soft); border-radius: 9px; padding: .8rem 1rem; overflow-wrap: anywhere; }
.money-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.money-bar div { background: var(--soft); border-radius: 10px; padding: .6rem .8rem; } .money-bar span { display: block; font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.money-bar b { font: 600 1.35rem var(--head); } .amt { margin-left: .4rem; }
.pay-rows { margin-bottom: 1rem; } .pay-add { padding-top: 1rem; border-top: 1px solid var(--line2); }
.dropzone { border: 2px dashed var(--line); border-radius: var(--r); text-align: center; padding: 1.4rem 1rem; margin-bottom: .6rem; } .dropzone.over { border-color: var(--accent); background: var(--soft); } .dropzone p { margin: 0 0 .2rem; }
.reach { display: flex; gap: .5rem; margin-bottom: .8rem; } .reach .btn { flex: 1; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; margin: 0; font-size: .95rem; } .facts dt { color: var(--muted); } .facts dd { margin: 0; overflow-wrap: anywhere; }
.facts.wide { grid-template-columns: 9rem 1fr; margin: .8rem 0; }
.more { margin-top: .9rem; } .more summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--accent); } .more > *:not(summary) { margin-top: .7rem; }

/* ---------- calendar ---------- */
.cal-nav { display: flex; gap: .4rem; }
.check-date .check-result { margin: .8rem 0 .2rem; padding: .6rem .9rem; border-radius: 9px; } .check-result.free { background: #e7f6ec; color: #14613a; } .check-result.taken { background: #fdecea; color: #8f1d17; }
.legend { display: flex; gap: 1.2rem; flex-wrap: wrap; margin: 0 0 .6rem; font-size: .88rem; color: var(--muted); } .legend i { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .4rem; vertical-align: -.05rem; }
.legend i.open { background: #fff; border: 2px dashed #9aa3b0; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.cal-dow { padding: .5rem .6rem; font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 6.6rem; padding: .35rem .4rem; border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2); display: flex; flex-direction: column; gap: .2rem; }
.cal-day:nth-child(7n) { border-right: 0; } .cal-day.blank { background: color-mix(in srgb, var(--ink) 3%, transparent); }
.cal-num { font-weight: 600; font-size: .9rem; color: var(--muted); } .cal-day.today .cal-num { background: var(--ink); color: #fff; border-radius: 99px; padding: 0 .45rem; align-self: flex-start; }
.cal-day.checked { box-shadow: inset 0 0 0 3px var(--accent2); }
.cal-ev { display: block; font-size: .8rem; font-weight: 600; line-height: 1.25; padding: .2rem .4rem; border-radius: 6px; background: var(--c); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev.open { background: #fff; color: var(--c); border: 1.5px dashed var(--c); } .cal-ev:hover { text-decoration: none; filter: brightness(1.12); }

/* ---------- documents, public pages ---------- */
.paper-doc { padding: 2rem 2.2rem; }
.doc { max-width: 44rem; margin: 0 auto; font-size: 1.02rem; line-height: 1.65; } .doc h1 { font-size: 1.7rem; margin: 0 0 1.2rem; } .doc h2 { font-size: 1.2rem; margin: 1.6rem 0 .5rem; } .doc h3 { margin: 1.2rem 0 .4rem; display: block; }
.doc ul { padding-left: 1.3rem; margin: 0 0 .8rem; } .doc p { max-width: none; }
body.bare { min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth { width: 100%; max-width: 25rem; padding: 2rem; } .auth > * + * { margin-top: .9rem; } .auth-mark { font: 600 1.05rem var(--head); color: var(--accent); letter-spacing: .02em; }
.pub { max-width: 52rem; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; } .pub.narrow { max-width: 30rem; }
.pub-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.2rem; } .pub-brand { font: 600 1.25rem var(--head); }
.pub-foot { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 2rem; }
.sign-card > * + * { margin-top: 1rem; }
.sig-pad-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; } .sig-pad-head { display: flex; justify-content: space-between; padding: .45rem .7rem; font-size: .86rem; font-weight: 600; color: var(--muted); background: var(--soft); }
#sig-pad { display: block; width: 100%; height: 9rem; touch-action: none; cursor: crosshair; background: #fff; }
.sig-block { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; max-width: 44rem; margin: 2.5rem auto 0; }
.sig img { height: 4.6rem; max-width: 100%; object-fit: contain; object-position: left bottom; display: block; } .sig-typed { font: 600 2rem/4.6rem "Caveat", "Segoe Script", cursive; height: 4.6rem; overflow: hidden; }
.sig-line { border-top: 1.5px solid var(--ink); padding-top: .3rem; font-weight: 600; } .sig-line small { display: block; font-weight: 400; color: var(--muted); }
.audit { max-width: 44rem; margin: 1.6rem auto 0; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .8rem; overflow-wrap: anywhere; } .audit b { display: block; color: var(--ink); }
.pay-card { text-align: center; padding: 2rem 1.6rem; } .pay-card > * + * { margin-top: .8rem; } .pay-amount { font: 600 3.2rem/1.1 var(--head); }

/* ---------- responsive ---------- */
@media (max-width: 1250px) { .stats { grid-template-columns: repeat(2, 1fr); } .client-grid { grid-template-columns: minmax(0, 1fr); } .fgrid.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 1000px) { .grid2, .split { grid-template-columns: minmax(0, 1fr); } .fgrid.three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) {
  html { font-size: 16.5px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: 0 auto 0 0; width: 16.5rem; z-index: 50; transform: translateX(-105%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
  .menu-btn { display: block; }
  .top { padding: .7rem 1rem; } .top .btn.primary { padding: .58rem .7rem; }
  .page { padding: 1.1rem 1rem 3rem; } .flash { margin: .8rem 1rem 0; }
  h1 { font-size: 1.6rem; }
  .fgrid, .fgrid.three, .fgrid.four { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .money-bar { grid-template-columns: 1fr 1fr; } .sig-block { grid-template-columns: 1fr; }
  .paper-doc { padding: 1.3rem 1.1rem; } .col { flex-basis: 82vw; }
  .cal-day { min-height: 4.2rem; padding: .2rem; } .cal-ev { font-size: .68rem; padding: .1rem .2rem; } .cal-dow { padding: .4rem .2rem; font-size: .66rem; }
  .copy-row { flex-direction: column; align-items: stretch; } .rows > li { flex-wrap: wrap; }
  label.check.pad { padding-top: 0; }
}
@media print {
  .no-print, .pub-foot { display: none !important; }
  body { background: #fff; } .card { box-shadow: none; border: 0; padding: 0; } .pub { max-width: none; padding: 0; }
}

[hidden] { display: none !important; }
.client-main, .client-side, .page-head > div { min-width: 0; }
.sig-typed.pending { height: 2rem; }

.scroll-x { overflow-x: auto; }
.thread { display: flex; flex-direction: column; gap: .6rem; }
.bubble { max-width: 80%; padding: .6rem .85rem; border-radius: 14px; background: var(--soft); align-self: flex-start; overflow-wrap: anywhere; }
.bubble.out { align-self: flex-end; background: color-mix(in srgb, var(--accent) 14%, white); }
.bubble small { display: block; color: var(--muted); margin-top: .25rem; font-size: .78rem; }
.portal-row { display: flex; justify-content: space-between; gap: .8rem; align-items: center; margin-top: .9rem; padding-top: .8rem; border-top: 1px solid var(--line2); font-size: .95rem; }
.portal-row small { display: block; }
.next-step { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; border-left: 5px solid var(--accent); }
.next-step small { display: block; }

/* ---------- notes edit, google calendar chips, phone app ---------- */
.note-edit { margin-top: .6rem; } .note-edit > * + * { margin-top: .5rem; }
.note > a { display: inline-block; margin-bottom: .2rem; }
.cal-ev.g { background: color-mix(in srgb, var(--ink) 9%, white); color: color-mix(in srgb, var(--ink) 75%, white); font-weight: 500; }
.legend i.g { background: color-mix(in srgb, var(--ink) 14%, white); }
.steps { margin: .4rem 0 .9rem; padding-left: 1.3rem; color: color-mix(in srgb, var(--ink) 85%, white); } .steps li { margin: .3rem 0; }
.tabbar { display: none; }
@media (max-width: 820px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--card); border-top: 1px solid var(--line); padding: .3rem .2rem calc(.3rem + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .35rem 0; font-size: .7rem; font-weight: 600; color: var(--muted); border-radius: 9px; }
  .tabbar a.on { color: var(--accent); } .tabbar a:hover { text-decoration: none; } .tabbar .ico { width: 1.45rem; height: 1.45rem; }
  .page { padding-bottom: 6rem; }
  .top { padding-top: calc(.7rem + env(safe-area-inset-top)); }
}
@media (display-mode: standalone) { .top { backdrop-filter: none; background: var(--paper); } }

/* ---------- titled note cards ---------- */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .8rem; }
.note-card { border: 1px solid var(--line); border-radius: 10px; padding: .85rem .95rem; background: #fff; display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.note-card.pinned { background: #fffaf0; border-color: #f0e2bd; }
.note-card h3 { margin: 0; font-size: 1.05rem; }
.note-card .note-body { overflow-wrap: anywhere; font-size: .96rem; }
.note-card .note-body.clamp { max-height: 11.5rem; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.note-card footer { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-top: auto; padding-top: .4rem; }
.note-card:has(.note-edit:not([hidden])) { grid-column: 1 / -1; }
.note-edit input { margin-bottom: 0; }
.private-line { font-size: .86rem; margin: -.4rem 0 .8rem; }

/* ---------- tags ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .5rem 0 1rem; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: .12rem .55rem; border-radius: 7px; border: 1px solid var(--line); background: #fff; color: color-mix(in srgb, var(--ink) 80%, white); white-space: nowrap; }
a.tag:hover { border-color: var(--accent); text-decoration: none; } .tag.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.table td .tag { margin: .2rem .25rem 0 0; }
