/* NAI — the shell's stylesheet. The account's one colour comes from brandCss() (core/brand.ts) as custom properties;
   everything else here is the platform's, which is what lets the palette turn dark without touching anyone's brand.
   The look: a white sidebar, a cool grey ground, white cards, one colour for the action and the selected item. */

:root {
	--paper: #f5f6f8;
	--sheet: #ffffff;
	--ink: #1b1f24;
	--ink-soft: #3d4650;
	--ink-faint: #5b6470;
	--line: #e3e6ea;
	--line-strong: #cdd2d8;
	--fill: #eceef1;
	--wait: #7a4b00;
	--wait-soft: #fff1d6;
	--ok: #0b5a3c;
	--ok-soft: #ddf3e8;
	--crit: #a3301f;
	--crit-soft: #fbe6e2;
	--accent: #0f766e;
	--on-accent: #ffffff;
	--accent-text: #0f766e;
	--accent-soft: color-mix(in srgb, var(--accent) 12%, var(--sheet));
	--r-card: 16px;
	--r-control: 10px;
	--s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
	--measure: 68ch;
	--dur: 140ms;
	--display: "Space Grotesk", "Inter", system-ui, sans-serif;
	--sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, monospace;
	color-scheme: light;
}

/* Dark: follows the system unless the viewer chose (data-theme on <html>). */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--paper: #0f1318; --sheet: #171c23; --ink: #e9edf2; --ink-soft: #c0c8d2; --ink-faint: #98a2ae; --line: #2a323c; --line-strong: #3a4450; --fill: #222a33;
		--wait: #f3cf8a; --wait-soft: #33290f; --ok: #8fdcb8; --ok-soft: #12291f; --crit: #f2a69a; --crit-soft: #331813;
		color-scheme: dark;
	}
}
:root[data-theme="dark"] {
	--paper: #0f1318; --sheet: #171c23; --ink: #e9edf2; --ink-soft: #c0c8d2; --ink-faint: #98a2ae; --line: #2a323c; --line-strong: #3a4450; --fill: #222a33;
	--wait: #f3cf8a; --wait-soft: #33290f; --ok: #8fdcb8; --ok-soft: #12291f; --crit: #f2a69a; --crit-soft: #331813;
	color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0; max-width: var(--measure); }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); font-size: 14px; }
.mono { font-family: var(--mono); font-size: 0.9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The frame: the sidebar, then the page. */
.app { display: flex; align-items: stretch; min-height: 100vh; }
.side { flex: none; width: 248px; background: var(--sheet); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: var(--s5); }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 4px 8px; }
.side-body { display: flex; flex-direction: column; gap: var(--s5); flex: 1; }
.content { flex: 1; min-width: 0; padding: 32px 40px 56px; }
.content > * { max-width: 1040px; margin-left: auto; margin-right: auto; }

.mark { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--ink); min-width: 0; }
.mark img { height: 36px; width: auto; max-width: 120px; object-fit: contain; flex: none; }
.mark .dot { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--display); font-weight: 600; font-size: 17px; }
.mark-text { display: flex; flex-direction: column; min-width: 0; }
.mark-name { font-family: var(--display); font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark-ws { font-size: 13px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 12px; border-radius: var(--r-control); text-decoration: none; color: var(--ink); font-weight: 500; }
.side-nav a svg { flex: none; color: var(--ink-faint); }
.side-nav a:hover { background: var(--paper); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
.side-nav a[aria-current="page"] svg { color: var(--accent-text); }
.side-top a { border: 1px solid var(--line); }
.side-label { padding: 0 12px; margin-bottom: -16px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.side-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); padding: 12px; border-radius: var(--r-control); background: var(--paper); font-size: 13px; }
.side-foot .who { flex: 1 0 100%; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 13px; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkbtn:hover { color: var(--ink); }
.menu-toggle { display: none; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--sheet); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; }

/* A phone: the sidebar becomes a bar across the top, and its links fold behind Menu (only when scripts run). */
@media (max-width: 800px) {
	.app { flex-direction: column; }
	.side { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: var(--s3); }
	.side-head { padding: 0; }
	.content { padding: 24px 16px 40px; }
	.js .menu-toggle { display: inline-block; }
	.js .side-body { display: none; }
	.js.menu-open .side-body { display: flex; }
}

/* Settings: its pages listed beside the one that's open. */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s6); align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: var(--s5); }
.settings-nav a { min-height: 40px; display: flex; align-items: center; padding: 0 12px; border-radius: var(--r-control); text-decoration: none; color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
.settings-nav a:hover { background: var(--sheet); color: var(--ink); }
.settings-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
@media (max-width: 800px) {
	.settings { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
	.settings-nav { flex-direction: row; overflow-x: auto; position: static; }
}

/* The workflow builder: When, Only if, then the steps, joined down the left like a flow. */
.flow { display: grid; gap: var(--s4); max-width: 900px; }
.flow > * { min-width: 0; }
.flow-card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4) var(--s5); display: grid; gap: var(--s3); scroll-margin-top: var(--s4); }
.flow-kicker { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.flow-then { margin-top: var(--s2); scroll-margin-top: var(--s4); }
.flow-step { border-left: 3px solid var(--accent); }
.flow-step-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.flow-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: var(--s2); align-items: center; }
.flow-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.flow-fields .wide { grid-column: 1 / -1; }
.flow-add { border-style: dashed; background: transparent; }
.flow-in { margin-left: var(--s6); }
.flow-in--2 { margin-left: calc(var(--s6) * 2); }
.flow-in--3 { margin-left: calc(var(--s6) * 3); }
.flow-match { width: auto; }
/* The map: the workflow drawn top to bottom, a choice splitting into a Yes and a No column that join again. */
.map-card { overflow-x: auto; padding: var(--s5) var(--s4); }
.map { display: flex; flex-direction: column; align-items: center; min-width: min-content; padding: var(--s2) 0; }
.map-col { display: flex; flex-direction: column; align-items: center; flex: 1; }
.map-node { display: block; width: 240px; border: 1px solid var(--line-strong); border-left: 3px solid var(--accent); border-radius: var(--r-control); background: var(--paper); color: var(--ink); text-decoration: none; font-size: 14px; scroll-margin-top: var(--s4); }
a.map-node, .map-node > summary { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; }
.map-node > summary { list-style: none; cursor: grab; }
.map-node > summary::-webkit-details-marker { display: none; }
.map-node:hover { border-color: var(--ink-faint); border-left-color: var(--accent); }
.map-node span { color: var(--ink-soft); font-size: 13px; overflow-wrap: anywhere; }
/* An open box is wide enough for its fields. */
.map-node[open] { width: min(560px, 82vw); background: var(--sheet); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.map-node[open] > summary { border-bottom: 1px solid var(--line); }
.map-edit { display: grid; gap: var(--s3); padding: var(--s4); font-size: 16px; }
.map-edit .faint, .map-edit .hint { font-size: 14px; }
.map-tools { justify-content: flex-end; }
.map-node.is-dragging { opacity: 0.45; }
.map-plus.is-over summary { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); transform: scale(1.35); }
.map-moving .map-plus summary { border-style: dashed; }
.map-start { border-left-color: var(--ink-faint); }
.map-if, .map-if:hover { border-left-color: var(--wait); }
.map-wait, .map-wait:hover { border-left-color: var(--ok); }
.map-line { width: 2px; min-height: 16px; background: var(--line-strong); }
.map-fill { flex: 1; }
.map-plus { position: relative; display: flex; flex-direction: column; align-items: center; }
.map-plus::before, .map-plus::after { content: ""; width: 2px; height: 8px; background: var(--line-strong); }
.map-plus::before { order: 0; }
.map-plus summary { order: 1; list-style: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--sheet); color: var(--ink-soft); display: grid; place-items: center; font-weight: 600; line-height: 1; cursor: pointer; }
.map-plus summary::-webkit-details-marker { display: none; }
.map-plus summary:hover, .map-plus[open] summary { border-color: var(--accent); color: var(--accent-text); }
.map-plus::after { order: 2; }
.map-menu { position: absolute; top: 36px; z-index: 5; display: grid; grid-template-columns: repeat(2, max-content); gap: var(--s1); padding: var(--s2); border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--sheet); box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); }
.map-branch { display: flex; align-items: stretch; gap: var(--s4); border-top: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); margin-top: 8px; }
.map-arm { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 236px; }
.map-arm::before { content: ""; width: 2px; height: 8px; background: var(--line-strong); }
.map-tag { font-size: 12px; font-weight: 600; color: var(--ink-faint); padding: 2px 8px; border-radius: 99px; background: var(--fill); }
.map-stop { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); padding-top: 4px; }
.flow-if { border-left-color: var(--wait); }
.flow-mark { border-style: dashed; background: transparent; padding-top: var(--s2); padding-bottom: var(--s2); }
.flow-mark select { width: auto; min-width: 160px; height: 36px; }
.flow-row--3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); }
.flow-group { min-width: 64px; }
@media (max-width: 800px) {
	.flow-row, .flow-row--3, .flow-fields { grid-template-columns: minmax(0, 1fr); }
	.flow-in { margin-left: var(--s4); }
}

.plain-list { margin: 0; padding-left: 1.1em; display: grid; gap: 4px; color: var(--ink-soft); }

/* Matching one list to another: ours on the left, theirs on the right. */
.match { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr); gap: var(--s2) var(--s4); align-items: center; }
.match-head { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.inline-select { width: auto; min-width: 140px; height: 36px; }

/* The week: seven days side by side, an hour every 48px, events placed by when they are. */
.week-wrap { overflow-x: auto; }
.week { display: grid; grid-template-columns: 52px repeat(7, minmax(110px, 1fr)); min-width: 840px; }
.week-corner, .week-day { border-bottom: 1px solid var(--line); padding: var(--s2); }
.week-day { font-size: 14px; color: var(--ink-soft); border-left: 1px solid var(--line); min-width: 0; }
.week-day strong { color: var(--ink); font-size: 16px; }
.week-day.is-today strong { background: var(--accent); color: var(--on-accent); border-radius: 99px; padding: 1px 8px; }
.week-allday { display: grid; gap: 2px; margin-top: 4px; }
.wk-chip { display: block; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--ink); font-size: 12px; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-chip--free { background: var(--fill); color: var(--ink-soft); }
.week-gutter { display: grid; grid-auto-rows: 48px; font-size: 12px; color: var(--ink-faint); text-align: right; padding-right: 8px; }
.week-gutter span { transform: translateY(-7px); }
.week-col { position: relative; height: calc(var(--hours) * 48px); border-left: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--line) 47px, var(--line) 48px); }
.week-col.is-today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.wk-slot { position: absolute; left: 0; right: 0; height: 48px; }
.wk-slot:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.wk-ev { position: absolute; display: flex; flex-direction: column; gap: 1px; padding: 3px 6px; border-radius: 6px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: var(--ink); font-size: 12px; line-height: 1.25; text-decoration: none; overflow: hidden; z-index: 1; }
.wk-ev strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.wk-ev span { color: var(--ink-soft); }
.wk-ev:hover { z-index: 2; box-shadow: 0 2px 10px rgb(0 0 0 / 0.2); }
.wk-ev--booked { border-left-color: var(--ok); background: var(--ok-soft); }
.wk-ev--free { opacity: 0.6; border-left-style: dashed; }
.event-when { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); align-items: end; }
.allow { gap: var(--s1); padding-top: var(--s3); border-top: 1px solid var(--line); }
.allow .check { min-height: 32px; }
.check { display: flex; align-items: center; gap: var(--s2); min-height: 44px; }

/* Mail: a list of threads, and one open. */
.mail-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) auto; gap: var(--s3); align-items: baseline; padding: 10px var(--s2); border-top: 1px solid var(--line); text-decoration: none; color: var(--ink-soft); }
.mail-row:first-child { border-top: 0; }
.mail-row:hover { background: var(--paper); }
.mail-row .who, .mail-row .what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-row .what strong { color: var(--ink); font-weight: 500; }
.mail-row.is-unread .who, .mail-row.is-unread .what strong { color: var(--ink); font-weight: 700; }
.mail-row time, .mail-row .when { font-size: 13px; color: var(--ink-faint); white-space: nowrap; }
.mail-msg { border-top: 1px solid var(--line); padding: var(--s4) 0; display: grid; gap: var(--s2); }
.mail-msg:first-child { border-top: 0; padding-top: 0; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.55; }
.mail-search { display: flex; gap: var(--s2); flex: 1; max-width: 420px; }
@media (max-width: 800px) {
	.mail-row { grid-template-columns: minmax(0, 1fr) auto; }
	.mail-row .who { grid-column: 1 / -1; }
	.event-when { grid-template-columns: minmax(0, 1fr); }
}

/* Pages with no sidebar: sign-in, an invitation, the platform's pages when signed out. */
.solo { max-width: 720px; margin: 0 auto; padding: 32px 16px 56px; }
.solo-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s6); }
.solo-head .side-foot { margin: 0; background: none; padding: 0; }
.solo-head .side-foot .who { flex: none; }

/* The page's heading. */
.hero { margin-bottom: 28px; }
.hero h1 em { font-style: normal; font-weight: 500; color: var(--ink-faint); font-size: 0.6em; margin-left: var(--s2); }
.hero p { margin-top: var(--s1); color: var(--ink-faint); font-size: 16px; }
.hero .eyebrow { color: var(--ink-faint); font-size: 14px; margin-bottom: var(--s1); }

/* The view-as banner: always visible while an administrator is in a client's workspace. */
.viewas { background: var(--wait-soft); color: var(--wait); padding: 10px 16px; display: flex; gap: var(--s4); align-items: center; justify-content: center; font-weight: 600; flex-wrap: wrap; }
.viewas form { margin: 0; }
.viewas button { background: var(--ink); color: var(--sheet); border: 0; border-radius: var(--r-control); min-height: 36px; padding: 0 14px; font: inherit; cursor: pointer; }

main { display: grid; gap: var(--s5); }
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s5); }
.panel > * + * { margin-top: var(--s4); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
@media (max-width: 600px) { .panel { padding: var(--s4); } }

.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card { display: block; background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: var(--s4) var(--s5); text-decoration: none; color: inherit; position: relative; transition: border-color var(--dur); }
a.card:hover { border-color: var(--line-strong); }
.card h3 { margin-bottom: var(--s1); }
.card .c-go + h3 { padding-right: var(--s5); }
.card .c-go { position: absolute; right: var(--s4); top: var(--s4); color: var(--ink-faint); }
.card.needs { border-color: color-mix(in srgb, var(--wait) 35%, var(--line)); background: var(--wait-soft); }
.stat { font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-sm { font-family: var(--display); font-weight: 600; font-size: 20px; font-variant-numeric: tabular-nums; min-width: 2ch; text-align: right; }
.gold-text { color: var(--wait); font-weight: 600; }

.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.rows { display: grid; }
.rows > .item { display: flex; gap: var(--s4); align-items: center; justify-content: space-between; padding: var(--s3) 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rows > .item:first-child { border-top: 0; }
.item .grow { flex: 1; min-width: 180px; }

.tag { display: inline-block; font-size: 13px; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: var(--fill); color: var(--ink-soft); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.gold { background: var(--wait-soft); color: var(--wait); }
.tag.crit { background: var(--crit-soft); color: var(--crit); }

/* How many of a workspace's included users are taken. */
.seats { display: grid; gap: var(--s2); max-width: 420px; }
.meter { height: 8px; border-radius: 99px; background: var(--fill); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* Controls. One height for every one-line field; labels above. */
form { margin: 0; }
.fields { display: grid; gap: var(--s4); max-width: 560px; }
label.field-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.hint { color: var(--ink-faint); font-size: 14px; margin-top: 6px; }
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], input[type="tel"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
	width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--sheet); color: var(--ink); font: inherit;
}
textarea { height: auto; min-height: 96px; padding: var(--s3) 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.problem { color: var(--crit); font-size: 14px; margin-top: 6px; }
input[type="color"] { width: 56px; height: 44px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--r-control); background: var(--sheet); }
input[type="file"] { font: inherit; }

.btn { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--r-control); border: 1px solid var(--line-strong); background: var(--sheet); color: var(--ink); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink-faint); }
.btn--primary { background: var(--accent); color: var(--on-accent); border-color: transparent; font-weight: 600; }
.btn--primary:hover { border-color: transparent; filter: brightness(1.06); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--accent-text); }
.btn--danger { color: var(--crit); }
.btn--sm { min-height: 36px; padding: 0 var(--s3); font-size: 14px; }
.btn.is-busy { opacity: 0.75; pointer-events: none; }
.btn.is-busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Choices: anything that toggles is a choice with a title and a line under it. */
.choices { display: grid; gap: var(--s3); }
.choice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s4); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); }
.choice strong { display: block; }
.choice.disabled { opacity: 0.6; cursor: default; }

.notice { padding: var(--s3) var(--s4); border-radius: var(--r-control); border: 1px solid var(--line); background: var(--paper); }
.notice--ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.notice--crit { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.notice--gold { background: var(--wait-soft); color: var(--wait); border-color: transparent; }

.tabset { display: flex; gap: var(--s1); padding: var(--s2); overflow-x: auto; }
.panel.tabset > * + * { margin-top: 0; }
.tabset a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 var(--s4); border-radius: 99px; text-decoration: none; color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
.tabset a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); font-weight: 600; }

/* Setup's steps: where you are, what's done, what was skipped. */
.steps-panel { padding: var(--s3) var(--s4); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s2); }
.steps a { display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); border-radius: var(--r-control); text-decoration: none; color: var(--ink-soft); }
.steps a:hover { background: var(--paper); }
.steps .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-strong); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.steps a[aria-current="step"] { color: var(--ink); background: var(--accent-soft); font-weight: 600; }
.steps a[aria-current="step"] .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps .is-done .n { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.steps .is-skipped .n { border-style: dashed; }

.copy { display: flex; gap: var(--s2); align-items: center; }
.copy input { font-family: var(--mono); font-size: 13px; }
table.dns { border-collapse: collapse; width: 100%; font-size: 14px; }
table.dns th, table.dns td { text-align: left; padding: var(--s2) var(--s3); border-top: 1px solid var(--line); vertical-align: top; }
table.dns td.mono { word-break: break-all; }

.preview { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); max-width: 360px; }
.preview .p-band { padding: var(--s4); display: flex; gap: var(--s3); align-items: center; font-family: var(--display); font-weight: 600; border-bottom: 1px solid var(--line); }
.preview .p-body { padding: var(--s4); background: var(--paper); }

.signin { max-width: 440px; margin: 0 auto; }
.signin .btn { width: 100%; justify-content: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
@media print { .side, .viewas { display: none; } .content { padding: 0; } }

/* A client's first visit: three short things to know, side by side. */
.welcome { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.welcome p { margin: var(--s1) 0 0; }

/* The clients list: each card says what's on, who's in and who's been asked. */
.client-card p.faint { margin: 0 0 var(--s2); }
.signin-note { text-align: center; font-size: 13px; }

/* Sign-in: the emailed code, big enough to read back; the development sign-in tucked away. */
.code-input { font-size: 26px !important; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; height: 56px !important; }
/* One-click sign-in: the button in the provider's own plain style, then "or" before the emailed code. */
.btn--provider { min-height: 48px; }
.btn--notion { background: var(--ink); color: var(--sheet); border-color: transparent; }
.btn--notion:hover { border-color: transparent; filter: brightness(1.15); }
.signin-or { display: flex; align-items: center; gap: var(--s3); margin: var(--s4) 0 var(--s3); color: var(--ink-faint); font-size: 14px; max-width: none; }
.signin-or::before, .signin-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.signin-dev { margin-top: var(--s5); border-top: 1px solid var(--line); padding-top: var(--s3); color: var(--ink-faint); font-size: 14px; }
.signin-dev summary { cursor: pointer; text-align: center; }
.signin-dev form { margin-top: var(--s3); }

/* Pinned pages: cards that open the page itself, in a new tab. */
.page-card h3 { margin-bottom: var(--s2); padding-right: var(--s5); }

/* The CRM: lists, a record's three columns, and the deal board. */
.list-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.search { flex: 1 1 240px; max-width: 360px; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; min-width: 620px; border-collapse: collapse; }
table.list th { text-align: left; padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--ink-faint); border-bottom: 1px solid var(--line); }
table.list td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list td a { font-weight: 600; color: var(--ink); }

.record { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s5); }
.record > .panel { min-width: 0; }
.record > .panel:nth-child(1) { flex: 1 1 260px; }
.record > .panel:nth-child(2) { flex: 2 1 340px; }
.record > .panel:nth-child(3) { flex: 1 1 220px; display: grid; gap: var(--s5); }
.record > .panel:nth-child(3) > * + * { margin-top: 0; }
.linked { display: grid; gap: var(--s2); }
.linked-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.linked-head h2 { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.linked-item { display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-control); text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.linked-item:hover { border-color: var(--line-strong); }

.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--s4); align-items: start; }
.col { background: var(--fill); border-radius: var(--r-card); padding: 14px; display: flex; flex-direction: column; gap: var(--s3); min-height: 120px; }
.col--closed { background: color-mix(in srgb, var(--fill) 55%, var(--paper)); }
.col.is-over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); padding: 2px 6px; }
.col-head h2 { font-family: var(--sans); font-size: 15px; }
.deal { background: var(--sheet); border: 1px solid var(--line); border-radius: 12px; padding: var(--s4); display: flex; flex-direction: column; gap: 4px; cursor: grab; }
.deal.is-dragging { opacity: 0.5; }
.deal a { font-weight: 600; color: var(--ink); }

/* Tasks, and logging what happened on a record. */
.task-name { font-weight: 600; color: var(--ink); }
.task-done { color: var(--ink-faint); text-decoration: line-through; }
.tick { display: flex; align-items: center; gap: var(--s2); min-height: 44px; font-weight: 500; }
.tick input { width: 20px; height: 20px; accent-color: var(--accent); }
.log-form { display: grid; grid-template-columns: 140px 1fr auto; gap: var(--s2); align-items: start; }
.log-form textarea { min-height: 44px; height: 44px; }
.log-body { white-space: pre-wrap; color: var(--ink-soft); margin-top: 2px; }
@media (max-width: 600px) { .log-form { grid-template-columns: 1fr; } }

/* A list's filters and saved views, and cells edited in place. */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); }
.filters > div { flex: 1 1 180px; max-width: 280px; }
.save-view { display: flex; gap: var(--s2); align-items: center; max-width: 420px; }
.list-bar .tabset { padding: 0; flex-wrap: wrap; overflow: visible; }
td[data-edit] { cursor: text; border-radius: 6px; min-width: 120px; }
td[data-edit]:hover, td[data-edit]:focus-visible { background: var(--paper); }
td[data-edit]:empty::after { content: "Add"; color: var(--ink-faint); opacity: 0; }
td[data-edit]:empty:hover::after, td[data-edit]:empty:focus-visible::after { opacity: 1; }
td[data-edit] input, td[data-edit] select { height: 36px; }

/* Reports: figures line up on the right, and a bar says how each stage compares. */
table.report th.num, table.report td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.report { min-width: 480px; }
.bar-cell { width: 40%; }
.bar { display: block; height: 10px; min-width: 2px; border-radius: 99px; background: var(--accent); }

/* Developers: commands to copy, addresses that wrap, and the reference's entries. */
pre.code { font-family: var(--mono); font-size: 13px; background: var(--fill); border-radius: 8px; padding: var(--s3); overflow-x: auto; white-space: pre; margin: 0; }
code { font-family: var(--mono); font-size: 0.92em; }
.break { overflow-wrap: anywhere; }
.ref + .ref { border-top: 1px solid var(--line); margin-top: var(--s4); padding-top: var(--s4); }
.ref h3 { display: flex; gap: var(--s2); align-items: center; margin: 0 0 var(--s1); font-size: 15px; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s2); }

/* Conversations: the list, and a thread's emails, theirs on the left and ours on the right. */
a.conv { color: inherit; text-decoration: none; align-items: flex-start; }
a.conv:hover strong { text-decoration: underline; }
.conv-top { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.conv--unread .conv-top strong { font-weight: 700; }
.mails { display: grid; gap: var(--s4); }
.mail { max-width: 720px; border: 1px solid var(--line); border-radius: 12px; padding: var(--s3) var(--s4); }
.mail--out { margin-left: auto; background: var(--accent-soft); border-color: transparent; }
.mail-head { display: flex; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); flex-wrap: wrap; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-quoted { margin-top: var(--s2); }
.mail-quoted summary { cursor: pointer; color: var(--ink-soft); font-size: 14px; }

/* Calendar: meetings by day, and a booking page's days and times. */
section.day + section.day { margin-top: var(--s5); }
section.day h2 { font-size: 15px; margin: 0 0 var(--s1); }
.slot-time { font-variant-numeric: tabular-nums; min-width: 150px; color: var(--ink-soft); }
.tabset.days { flex-wrap: wrap; margin: var(--s3) 0; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--s2); }
.slots .slot { justify-content: center; text-align: center; }

/* Documents: the words of a document, as the signer reads them. */
.doc-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; max-width: 720px; }
details.decline { margin-top: var(--s5); }
details.decline summary { cursor: pointer; color: var(--ink-soft); font-size: 14px; margin-bottom: var(--s3); }

/* AI: the one-line ask above a reply. */
.ai-ask { margin-bottom: var(--s3); }
.ai-ask input { flex: 1; min-width: 200px; }

/* Outreach: each email waiting for approval, a sequence's emails, and the list of people to add. */
.outreach-item { border-top: 1px solid var(--line); padding-top: var(--s4); margin-top: var(--s4); }
fieldset.step { border: 1px solid var(--line); border-radius: 12px; padding: var(--s4); }
.pick { display: grid; gap: var(--s2); max-height: 320px; overflow: auto; }

/* The line across the top when a payment needs attention. */
.viewas--crit { background: var(--crit-soft); color: var(--crit); }

/* Find clients: a business's score, the criteria behind it, and the conversation that builds the ideal client. */
.score { flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; border: 1px solid var(--line-strong); }
.score--high { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.score--mid { background: var(--wait-soft); color: var(--wait); border-color: transparent; }
.score--low { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.marks { margin-top: var(--s2); font-size: 14px; }
.marks summary { cursor: pointer; color: var(--ink-soft); }
.marks ul { list-style: none; padding: 0; margin: var(--s2) 0 0; display: grid; gap: var(--s2); }
.mark-sign { display: inline-block; min-width: 62px; font-weight: 600; }
.mark--yes .mark-sign { color: var(--ok); }
.mark--no .mark-sign { color: var(--crit); }
.mark--unknown .mark-sign { color: var(--ink-faint); }
.talk { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s4); align-items: start; }
@media (max-width: 900px) { .talk { grid-template-columns: 1fr; } }
.turns { display: grid; gap: var(--s3); margin-bottom: var(--s4); }
.turn { max-width: 85%; padding: var(--s3) var(--s4); border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.turn--assistant { background: var(--fill); justify-self: start; }
.turn--user { background: var(--accent); color: #fff; justify-self: end; }
.draft { margin: 0 0 var(--s4); }
.draft dt { color: var(--ink-faint); font-size: 14px; margin-top: var(--s3); }
.draft dd { margin: 2px 0 0; }
.draft ul { margin: 0; padding-left: 18px; }
