/* Gouda HQ — one stylesheet for the back office and the client-facing pages. */

@font-face {
  font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations'), url(fonts/archivo-latin-wdth-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2-variations'), url(fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Archivo'; font-style: italic; font-display: swap; font-weight: 100 900; font-stretch: 62% 125%;
  src: url(fonts/archivo-latin-wdth-italic.woff2) format('woff2-variations'), url(fonts/archivo-latin-wdth-italic.woff2) format('woff2');
}
@font-face {
  font-family: 'Signature'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(fonts/mrs-saint-delafield-latin-400-normal.woff2) format('woff2');
}

:root {
  --ink: #15222A;
  --ink-2: #22333C;
  --muted: #56666E;
  --faint: #86949B;
  --paper: #FFFFFF;
  --haze: #F0F3F4;
  --haze-2: #E5EAEC;
  --rule: #D5DCDF;
  --rule-2: #E7ECEE;
  --brand: #E9A825;
  --on-brand: #15222A;
  --ok: #24724F; --ok-bg: #E2F1E8;
  --bad: #B03A2E; --bad-bg: #F9E5E2;
  --wait: #845A06; --wait-bg: #FBF0D5;
  --info: #285B82; --info-bg: #E1ECF5;
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px;
  --font: 'Archivo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --condensed: 72%;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--haze); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.1; font-weight: 700; }
h1 { font-size: 30px; font-stretch: var(--condensed); font-weight: 780; letter-spacing: -0.005em; }
h2 { font-size: 19px; font-stretch: 86%; font-weight: 720; }
h3 { font-size: 15.5px; font-weight: 650; }
p { margin: 0 0 0.8em; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--rule-2); margin: 20px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 3px; }
::selection { background: color-mix(in srgb, var(--brand) 35%, white); }

.num, .money, td.money, .table .num { font-variant-numeric: tabular-nums; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 650; }
.hidden { display: none !important; }
.show-sm { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.stack-lg > * + * { margin-top: 24px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt-0 { margin-top: 0 !important; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--paper); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-brand { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-brand:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--haze-2); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 22px; font-size: 16px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.btn-link.danger { color: var(--bad); }
form.inline { display: inline; }

/* ---------- Forms ---------- */
label { font-weight: 600; font-size: 13.5px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { color: var(--ink); }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date],
input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.35;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
textarea.tall { min-height: 360px; font-size: 14px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2356666E' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent); }
input[readonly] { background: var(--haze); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--ink); margin: 0; flex: none; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; font-size: 14.5px; cursor: pointer; }
.check input { margin-top: 2px; }
.check .hint { display: block; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.prefix { position: relative; }
.prefix > span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.prefix > input { padding-left: 24px; }
.suffix { position: relative; }
.suffix > span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 4px; }
.errors { background: var(--bad-bg); color: var(--bad); border-radius: var(--r-sm); padding: 10px 14px; font-weight: 550; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 650; font-size: 14px; padding: 0; margin-bottom: 8px; }

/* ---------- Panels, tables, chips ---------- */
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--rule-2); flex-wrap: wrap; }
.panel-head .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.panel-body { padding: 20px; }
.panel-body.tight { padding: 14px 20px; }
.panel-foot { padding: 14px 20px; border-top: 1px solid var(--rule-2); }
.panel + .panel, .panel + form, form + .panel { margin-top: 20px; }

.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.table .money, .table .num { text-align: right; white-space: nowrap; }
.table tr.link-row { cursor: pointer; }
.table tr.link-row:hover td { background: #FAFBFB; }
.table a.row-link { text-decoration: none; font-weight: 600; }
.table a.row-link:hover { text-decoration: underline; }
.table tfoot td { border-top: 1px solid var(--rule); font-weight: 650; }
.table-wrap { overflow-x: auto; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--haze-2); color: var(--ink-2); }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-bad { background: var(--bad-bg); color: var(--bad); }
.chip-wait { background: var(--wait-bg); color: var(--wait); }
.chip-info { background: var(--info-bg); color: var(--info); }
.chip-plain::before { display: none; }

.flash { padding: 11px 16px; border-radius: var(--r-sm); margin-bottom: 18px; font-weight: 550; background: var(--ok-bg); color: var(--ok); }
.flash-bad { background: var(--bad-bg); color: var(--bad); }
.flash-info { background: var(--info-bg); color: var(--info); }
.notice { padding: 12px 16px; border-radius: var(--r-sm); background: var(--haze); border: 1px solid var(--rule-2); font-size: 14px; }
.notice-wait { background: var(--wait-bg); border-color: transparent; color: #5c3f04; }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--ink); font-size: 17px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 14.5px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.copy { display: flex; gap: 6px; }
.copy input { font-size: 13px; background: var(--haze); }

/* ---------- Back office shell ---------- */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--ink); color: #DCE4E7; padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; text-decoration: none; }
.side-brand img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; background: #fff; }
.side-brand .mark { width: 30px; height: 30px; border-radius: 7px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 800; font-stretch: 75%; font-size: 17px; }
.side-brand span { font-weight: 720; font-stretch: 80%; font-size: 17px; line-height: 1.1; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 7px; text-decoration: none; font-size: 14.5px; font-weight: 520; color: #C9D4D8; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.nav .badge { margin-left: auto; background: var(--brand); color: var(--on-brand); font-size: 11px; font-weight: 750; padding: 1px 7px; border-radius: 99px; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 10px; }
.side-foot { margin-top: auto; padding: 14px 10px 0; font-size: 13px; color: #9FB0B7; }
.side-foot a { color: #C9D4D8; }
.main { padding: 26px 34px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.page-head .crumbs a { color: var(--muted); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.menu-toggle { display: none; }
.content-narrow { max-width: 760px; }
.content-mid { max-width: 980px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cols > .aside { display: flex; flex-direction: column; gap: 20px; }
.cols > .aside > .panel + .panel { margin-top: 0; }

/* KPI strip: one panel, columns split by rules */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); margin-bottom: 20px; }
.kpi { padding: 16px 20px; border-left: 1px solid var(--rule-2); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-size: 30px; font-stretch: 72%; font-weight: 760; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.kpi a { text-decoration: none; }

/* Attention list */
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--rule-2); }
.todo li:last-child { border-bottom: 0; }
.todo .what { flex: 1; min-width: 0; }
.todo .what a { font-weight: 600; text-decoration: none; }
.todo .what a:hover { text-decoration: underline; }
.todo .meta { font-size: 13px; color: var(--muted); }

/* Activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 10px 1fr; gap: 12px; padding: 10px 20px; font-size: 14px; }
.feed li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--rule); margin-top: 6px; }
.feed li.k-paid::before { background: var(--ok); }
.feed li.k-signed::before, .feed li.k-booked::before { background: var(--brand); }
.feed li.k-inquiry::before { background: var(--info); }
.feed .when { font-size: 12.5px; color: var(--faint); }
.feed a { text-decoration: none; }
.feed a:hover { text-decoration: underline; }
.task-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--faint); background: var(--paper); cursor: pointer; padding: 0; display: grid; place-items: center; color: #fff; }
.task-check:hover { border-color: var(--ok); }
.task-check.done { background: var(--ok); border-color: var(--ok); }
.task-check svg { width: 12px; height: 12px; }
.hours-row { display: grid; grid-template-columns: 118px auto auto; gap: 8px 16px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
.hours-row .range { display: flex; align-items: center; gap: 6px; }
.hours-row input[type=time] { width: 126px; padding: 8px 6px 8px 9px; }
.hours-row .range.second input[type=time]:placeholder-shown, .hours-row .range.second input[type=time]:invalid { color: var(--faint); }

/* Pipeline board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.lane { background: var(--haze-2); border-radius: var(--r-md); padding: 10px; min-height: 140px; }
.lane.drop { outline: 2px dashed var(--ink); outline-offset: -2px; }
.lane-head { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 4px 10px; }
.lane-head h3 { font-size: 14.5px; }
.lane-head .meta { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lane-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.deal { background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 11px 12px; cursor: grab; }
.deal:hover { border-color: var(--faint); }
.deal.dragging { opacity: .5; }
.deal a { text-decoration: none; font-weight: 650; display: block; }
.deal a:hover { text-decoration: underline; }
.deal .who { font-size: 13px; color: var(--muted); margin-top: 1px; }
.deal .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 9px 12px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--ink); border-color: var(--ink); }
.tabs a:hover { color: var(--ink); }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters input[type=search] { max-width: 300px; }
.pill-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-links a { padding: 5px 11px; border-radius: 99px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--muted); border: 1px solid var(--rule); background: var(--paper); }
.pill-links a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Line item editor */
.items-editor { width: 100%; border-collapse: collapse; table-layout: fixed; }
.items-editor th { font-size: 12.5px; color: var(--muted); font-weight: 600; text-align: left; padding: 0 6px 8px; }
.items-editor td { padding: 6px; vertical-align: top; border-top: 1px solid var(--rule-2); }
.items-editor td:first-child { padding-left: 0; }
.items-editor textarea { min-height: 38px; height: 38px; font-size: 13.5px; margin-top: 6px; }
.items-editor .c-qty { width: 76px; }
.items-editor .c-price { width: 130px; }
.items-editor .c-billing { width: 138px; }
.items-editor .c-total { width: 110px; text-align: right; padding-top: 16px; font-variant-numeric: tabular-nums; font-weight: 600; }
.items-editor .c-x { width: 36px; padding-top: 10px; }
.items-editor .opt { margin-top: 8px; font-size: 13px; }
.x-btn { width: 28px; height: 28px; border: 0; background: none; border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; }
.x-btn:hover { background: var(--bad-bg); color: var(--bad); }
.totals { margin-left: auto; width: min(100%, 340px); font-size: 14.5px; }
.totals .line { display: flex; justify-content: space-between; padding: 5px 0; font-variant-numeric: tabular-nums; }
.totals .line.total { border-top: 1px solid var(--rule); margin-top: 6px; padding-top: 10px; font-weight: 750; font-size: 16px; }
.sched-row { display: grid; grid-template-columns: minmax(110px, 1fr) 104px 112px minmax(250px, 1.5fr) 32px; gap: 8px; align-items: center; padding: 7px 0; border-top: 1px solid var(--rule-2); }
.sched-row .s-due { display: flex; gap: 6px; align-items: center; min-width: 0; }
.sched-row .s-due select { flex: 1 1 130px; min-width: 0; }
.sched-row .s-due input[type=number] { width: 70px; flex: none; }
.sched-row .s-due input[type=date] { flex: 1 1 140px; min-width: 0; }
.sched-row [data-amt] { flex: none; min-width: 74px; text-align: right; font-variant-numeric: tabular-nums; }
.sched-row:first-child { border-top: 0; }
.chips-list { display: flex; flex-wrap: wrap; gap: 6px; }
.field-chip { border: 1px dashed var(--rule); background: var(--paper); border-radius: 6px; padding: 3px 8px; font-size: 12.5px; cursor: pointer; font-family: inherit; color: var(--ink-2); }
.field-chip:hover { border-color: var(--ink); }

/* Signature pad (shared) */
.sigpad { border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--paper); overflow: hidden; }
.sig-tabs { display: flex; border-bottom: 1px solid var(--rule-2); }
.sig-tabs button { flex: 1; height: 40px; border: 0; background: var(--haze); font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.sig-tabs button[aria-selected='true'] { background: var(--paper); color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.sig-area { position: relative; height: 170px; }
.sig-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sig-area .sig-line { position: absolute; left: 24px; right: 24px; bottom: 40px; border-bottom: 1px solid var(--rule); pointer-events: none; }
.sig-area .sig-x { position: absolute; left: 24px; bottom: 44px; color: var(--faint); font-size: 18px; pointer-events: none; }
.sig-typed { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: 'Signature', cursive; font-size: 54px; color: var(--ink); padding: 0 20px 26px; white-space: nowrap; overflow: hidden; pointer-events: none; }
.sig-tools { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--rule-2); font-size: 13px; color: var(--muted); }
.sig-img { height: 64px; width: auto; display: block; }

/* ---------- Client-facing pages ---------- */
body.pub { font-size: 16px; background: var(--haze); }
.pub-head { background: var(--paper); border-bottom: 1px solid var(--rule); }
.pub-head .in { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pub-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.pub-brand img { max-height: 44px; max-width: 180px; width: auto; object-fit: contain; }
.pub-brand .name { font-weight: 760; font-stretch: 78%; font-size: 21px; line-height: 1.1; }
.pub-head .contact { font-size: 14px; color: var(--muted); text-align: right; }
.pub-wrap { max-width: 1120px; margin: 0 auto; padding: 36px 24px 72px; }
.pub-narrow { max-width: 720px; margin: 0 auto; padding: 40px 24px 72px; }
.pub-foot { max-width: 1120px; margin: 0 auto; padding: 0 24px 40px; font-size: 13px; color: var(--muted); display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }

/* The viewfinder: crop marks frame the title block on every client document. */
.frame {
  --c: var(--brand); --l: 26px; --w: 3px; position: relative; padding: 30px 34px 32px; margin-bottom: 30px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) top left / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--w) var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) var(--w) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--w) var(--l) no-repeat;
}
.frame .kicker { font-size: 15px; color: var(--muted); font-weight: 550; margin-bottom: 8px; }
.hero-title { font-size: clamp(40px, 7.4vw, 78px); font-stretch: 66%; font-weight: 800; line-height: .94; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.hero-sub { font-size: 19px; font-weight: 500; margin-top: 12px; color: var(--ink-2); max-width: 46ch; }
.hero-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 18px; font-size: 14px; color: var(--muted); }
.hero-meta strong { color: var(--ink); font-weight: 650; }

.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.doc-main > section { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 28px 32px; }
.doc-main > section + section { margin-top: 20px; }
.doc-main h2 { font-size: 24px; font-stretch: 78%; font-weight: 760; margin-bottom: 14px; }
.doc-aside { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
.letter { font-size: 17px; line-height: 1.6; }
.letter p { max-width: 62ch; }
.letter .from { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: 15px; }
.letter .from .sig-img { height: 46px; }

.steps { list-style: none; display: flex; gap: 6px; margin: 0 0 22px; padding: 0; counter-reset: step; flex-wrap: wrap; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); padding-right: 14px; }
.steps li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--rule); display: grid; place-items: center; font-size: 13px; background: var(--paper); }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: '✓'; background: var(--ink); border-color: var(--ink); color: #fff; }
.steps li.current { color: var(--ink); }
.steps li.current::before { border-color: var(--ink); background: var(--brand); color: var(--on-brand); }

.offer { list-style: none; margin: 0; padding: 0; }
.offer li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; padding: 16px 0; border-top: 1px solid var(--rule-2); align-items: start; }
.offer li:first-child { border-top: 0; padding-top: 4px; }
.offer .pick { padding-top: 3px; }
.offer .pick input { width: 20px; height: 20px; }
.offer .pick.fixed { width: 20px; }
.offer .name { font-weight: 680; font-size: 17px; }
.offer .desc { color: var(--muted); font-size: 15px; margin-top: 4px; white-space: pre-line; }
.offer .tag { display: inline-block; font-size: 12px; font-weight: 650; color: var(--wait); background: var(--wait-bg); border-radius: 99px; padding: 1px 8px; margin-left: 8px; vertical-align: 2px; }
.offer .price { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.offer .price .per { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.offer li.off .name, .offer li.off .price { color: var(--faint); }

.summary { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; }
.summary h3 { font-size: 15px; margin-bottom: 4px; color: var(--muted); font-weight: 600; }
.due-now { font-size: 46px; font-stretch: 68%; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.due-note { font-size: 14px; color: var(--muted); margin-top: 6px; }
.sum-lines { margin-top: 16px; border-top: 1px solid var(--rule-2); padding-top: 12px; font-size: 14.5px; }
.sum-lines .line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.sum-lines .line span:first-child { color: var(--muted); }
.sum-lines .line.total { font-weight: 700; border-top: 1px solid var(--rule-2); margin-top: 6px; padding-top: 10px; }
.sum-lines .line.total span:first-child { color: var(--ink); }
.sched { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--rule-2); font-size: 14.5px; }
.sched li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.sched li .when { display: block; font-size: 13px; color: var(--muted); }
.sched li.paid { color: var(--faint); }
.sched li.paid .amt::after { content: ' paid'; font-size: 12px; color: var(--ok); font-weight: 650; }
.sched li.late .when { color: var(--bad); font-weight: 600; }

.contract { font-size: 15.5px; line-height: 1.65; }
.contract-box { border: 1px solid var(--rule-2); border-radius: var(--r-md); background: #FBFCFC; }
.contract-box .contract { max-height: 460px; overflow-y: auto; padding: 20px 22px; -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent); mask-image: linear-gradient(to bottom, #000 82%, transparent); }
.contract-box.open .contract { max-height: none; overflow: visible; -webkit-mask-image: none; mask-image: none; }
.contract-box .toggle { display: flex; justify-content: center; padding: 8px; border-top: 1px solid var(--rule-2); }
.contract.full { max-height: none; overflow: visible; padding: 0; }
.contract h1 { font-size: 26px; font-stretch: 78%; margin: 0 0 16px; }
.contract h2 { font-size: 17px; font-stretch: 100%; font-weight: 700; margin: 24px 0 8px; }
.contract h3 { font-size: 15.5px; margin: 18px 0 6px; }
.contract ul, .contract ol { padding-left: 22px; margin: 0 0 0.8em; }
.contract li { margin: 3px 0; }
.contract .missing { background: var(--wait-bg); color: var(--wait); border-radius: 4px; padding: 0 3px; }
.sig-block { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.sig-block .who { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.sig-block .pending { height: 64px; border-bottom: 1px solid var(--rule); display: flex; align-items: flex-end; padding-bottom: 6px; color: var(--faint); font-size: 14px; }
.audit { font-size: 12.5px; color: var(--muted); margin-top: 24px; border-top: 1px dashed var(--rule); padding-top: 14px; overflow-wrap: anywhere; }
.audit dt { font-weight: 650; color: var(--ink-2); }

.paybox { display: flex; flex-direction: column; gap: 12px; }
.paybox .opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-md); cursor: pointer; font-weight: 500; }
.paybox .opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.paybox .opt .amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.secure { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.secure svg { width: 14px; height: 14px; }

.inv-head { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; font-size: 14.5px; margin-bottom: 22px; }
.inv-head .k { color: var(--muted); font-size: 13px; }
.inv-items { width: 100%; border-collapse: collapse; font-size: 15px; }
.inv-items th { text-align: left; font-size: 13px; color: var(--muted); font-weight: 600; padding: 0 0 10px; border-bottom: 1px solid var(--rule); }
.inv-items td { padding: 12px 0; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.inv-items .money, .inv-items .num { text-align: right; padding-left: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv-items .desc { color: var(--muted); font-size: 14px; white-space: pre-line; }

.portal-list { list-style: none; margin: 0; padding: 0; }
.portal-list li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--rule-2); flex-wrap: wrap; }
.portal-list li:first-child { border-top: 0; }
.portal-list .what { flex: 1; min-width: 200px; }
.portal-list .what a { font-weight: 650; text-decoration: none; }
.portal-list .what a:hover { text-decoration: underline; }

/* Booking */
.book-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 28px; align-items: start; }
.book-info { font-size: 15px; }
.book-info .facts { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; color: var(--ink-2); }
.days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.day { border: 1px solid var(--rule); background: var(--paper); border-radius: 8px; padding: 8px 2px; text-align: center; cursor: pointer; font: inherit; color: var(--ink); }
.day .dow { font-size: 12px; color: var(--muted); display: block; }
.day .dnum { font-size: 20px; font-weight: 720; font-stretch: 80%; display: block; line-height: 1.2; }
.day .mon { font-size: 11.5px; color: var(--muted); display: block; }
.day:disabled { opacity: .38; cursor: default; background: transparent; }
.day[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }
.day[aria-pressed='true'] .dow, .day[aria-pressed='true'] .mon { color: #C9D4D8; }
.week-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 18px; }
.time { height: 42px; border: 1px solid var(--rule); border-radius: 8px; background: var(--paper); font: inherit; font-weight: 650; cursor: pointer; font-variant-numeric: tabular-nums; color: var(--ink); }
.time:hover { border-color: var(--ink); }
.time[aria-pressed='true'] { background: var(--brand); border-color: var(--ink); color: var(--on-brand); }
.tz-line { font-size: 13.5px; color: var(--muted); margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tz-line select { width: auto; min-height: 32px; padding: 4px 30px 4px 8px; font-size: 13.5px; }
.pub-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 28px 32px; }
.type-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.type-list a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 22px; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); text-decoration: none; }
.type-list a:hover { border-color: var(--ink); }
.type-list .t-name { font-weight: 700; font-size: 18px; }
.type-list .t-meta { color: var(--muted); font-size: 14px; }

.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin-bottom: 18px; }
.done-mark svg { width: 28px; height: 28px; }

/* Embedded inquiry form sits inside someone else's page: no chrome. */
body.embed { background: transparent; }
body.embed .pub-narrow { padding: 8px 4px; max-width: none; }

/* Simple centered pages (login, setup, messages) */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.center-card { width: min(100%, 440px); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 32px; }
.center-card.wide { width: min(100%, 620px); }
.center-card h1 { margin-bottom: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--rule-2); }
}
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 10px 12px; }
  .side-brand { padding: 4px 6px; }
  .menu-toggle { display: inline-flex; position: absolute; top: 10px; right: 12px; }
  .side .nav, .side .side-foot { display: none; }
  .side.open .nav, .side.open .side-foot { display: flex; }
  .side.open .nav { margin-top: 10px; }
  .main { padding: 20px 16px 48px; }
  .doc-grid, .book-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-grid { display: flex; flex-direction: column; gap: 20px; align-items: stretch; }
  .doc-main { display: contents; }
  .doc-main > section + section { margin-top: 0; }
  .doc-main > section { order: 1; }
  .doc-main > .late { order: 3; }
  .doc-aside { position: static; order: 2; }
  .doc-aside.first-mobile { order: 0; }
  .hours-row { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sched-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; grid-template-areas: "label label x" "value kind kind" "due due due"; }
  .sched-row > :nth-child(1) { grid-area: label; }
  .sched-row > :nth-child(2) { grid-area: value; }
  .sched-row > :nth-child(3) { grid-area: kind; }
  .sched-row > :nth-child(4) { grid-area: due; }
  .sched-row > :nth-child(5) { grid-area: x; }
}
@media (max-width: 640px) {
  h1 { font-size: 26px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi { border-left: 0; border-top: 1px solid var(--rule-2); }
  .kpi:first-child { border-top: 0; }
  .pub-wrap, .pub-narrow { padding: 22px 16px 56px; }
  .pub-head .in { padding: 12px 16px; }
  .pub-head .contact { display: none; }
  .frame { padding: 22px 20px 24px; --l: 20px; }
  .doc-main > section, .pub-card { padding: 22px 18px; border-radius: var(--r-md); }
  .inv-head { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .sig-block { grid-template-columns: minmax(0, 1fr); }
  .days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .items-editor thead { display: none; }
  .items-editor tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-top: 1px solid var(--rule-2); padding: 8px 0; }
  .items-editor td { border: 0; padding: 0; width: auto !important; }
  .items-editor td.c-name { grid-column: 1 / -1; }
  .items-editor .c-total { text-align: left; padding-top: 10px; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .table th:last-child, .table td:last-child { padding-right: 14px; }
  .hide-sm { display: none; }
  .show-sm { display: block; }
  .center-card { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
@media print {
  body, body.pub { background: #fff; font-size: 12pt; }
  .pub-head, .pub-foot, .no-print, .doc-aside, .steps, .side, .page-head .actions { display: none !important; }
  .pub-wrap, .pub-narrow { padding: 0; max-width: none; }
  .doc-grid { display: block; }
  .doc-main > section { border: 0; padding: 0; }
  .contract { max-height: none; overflow: visible; }
  .frame { padding: 12px 18px; }
  a { text-decoration: none; }
}
