/* The builder and the portal. Boxes on a quiet page: every section is a
   bordered panel with a head bar, rows inside it run edge to edge, and
   corners are tight. Body text is Inter, heads Inter Tight. Ink is the only
   emphasis colour; red, amber and green mean a state, never decoration.
   Sizes, gaps, radii and shadows come from the tokens below. */
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("fonts/inter-normal-400-vietnamese.woff2") format("woff2");
	unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
	font-family: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("fonts/inter-normal-400-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, 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: "Inter";
	font-style: normal;
	font-weight: 100 900;
	font-display: swap;
	src: url("fonts/inter-normal-400-latin.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: "Inter Tight";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("fonts/inter-tight-normal-500-vietnamese.woff2") format("woff2");
	unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
	font-family: "Inter Tight";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("fonts/inter-tight-normal-500-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, 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: "Inter Tight";
	font-style: normal;
	font-weight: 500;
	font-display: swap;
	src: url("fonts/inter-tight-normal-500-latin.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;
}

:root {
	/* Native controls - date pickers, file inputs - draw themselves in the
	   light palette unless told the page has both. */
	color-scheme: light dark;
	--bg: #f4f4f5;
	--surface: #ffffff;
	--surface-head: #fafafa;
	--surface-2: #f0f0f2;
	--hover: rgb(24 24 27 / .045);
	--line: #e4e4e7;
	--line-strong: #d1d1d6;
	--ink: #18181b;
	--ink-soft: #63636e;
	--accent: #18181b;
	--accent-ink: #ffffff;
	--accent-hover: #3f3f46;
	--danger: #b42318;
	--danger-bg: #fdecea;
	--warn-bg: #fdf3e1;
	--warn-ink: #8a4b0a;
	--ok-bg: #e7f4ea;
	--ok-ink: #1d6b3a;
	--shadow: none;
	--shadow-pop: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px rgb(0 0 0 / .10);
	--shadow-modal: 0 24px 64px rgb(0 0 0 / .22);
	--shadow-lift: 0 1px 4px rgb(0 0 0 / .25);
	--scrim: rgb(9 9 11 / .45);

	--radius: 4px;
	--radius-sm: 2px;

	--sp-1: 4px;
	--sp-2: 8px;
	--sp-3: 12px;
	--sp-4: 16px;
	--sp-5: 20px;
	--sp-6: 24px;
	--sp-8: 32px;
	--sp-10: 40px;
	--pad: var(--sp-4);

	--fs-2xs: .6875rem;
	--fs-xs: .75rem;
	--fs-sm: .8125rem;
	--fs-md: .875rem;
	--fs-lg: 1rem;
	--fs-xl: 1.25rem;
	--fs-2xl: 1.625rem;
	--fs-3xl: 2.125rem;
	--fs-4xl: 3.25rem;

	--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--head: "Inter Tight", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* Dark: when the device is dark and the person did not choose light, or
   when they chose dark (the profile menu sets data-theme). The two blocks
   must stay the same. */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0c0c0e; --surface: #141417; --surface-head: #18181b; --surface-2: #1f1f23;
		--hover: rgb(255 255 255 / .05); --line: #27272b; --line-strong: #3a3a41;
		--ink: #ededf0; --ink-soft: #9d9da8; --accent: #ededf0; --accent-ink: #0c0c0e; --accent-hover: #c4c4cc;
		--danger: #f28b82; --danger-bg: #3a1d1b; --warn-bg: #33270f; --warn-ink: #f3cf8a; --ok-bg: #14281b; --ok-ink: #8fd4a4;
		--shadow-pop: 0 0 0 1px rgb(0 0 0 / .4), 0 12px 32px rgb(0 0 0 / .55);
		--shadow-modal: 0 24px 64px rgb(0 0 0 / .6);
		--shadow-lift: 0 1px 4px rgb(0 0 0 / .6);
		--scrim: rgb(0 0 0 / .6);
	}
}
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0c0c0e; --surface: #141417; --surface-head: #18181b; --surface-2: #1f1f23;
	--hover: rgb(255 255 255 / .05); --line: #27272b; --line-strong: #3a3a41;
	--ink: #ededf0; --ink-soft: #9d9da8; --accent: #ededf0; --accent-ink: #0c0c0e; --accent-hover: #c4c4cc;
	--danger: #f28b82; --danger-bg: #3a1d1b; --warn-bg: #33270f; --warn-ink: #f3cf8a; --ok-bg: #14281b; --ok-ink: #8fd4a4;
	--shadow-pop: 0 0 0 1px rgb(0 0 0 / .4), 0 12px 32px rgb(0 0 0 / .55);
	--shadow-modal: 0 24px 64px rgb(0 0 0 / .6);
	--shadow-lift: 0 1px 4px rgb(0 0 0 / .6);
	--scrim: rgb(0 0 0 / .6);
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: var(--fs-md)/1.5 var(--font);
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
	/* A column the full viewport tall, so a short page's footer still sits
	   at the bottom instead of floating mid-screen. */
	min-height: 100vh; display: flex; flex-direction: column;
}

main { width: 100%; max-width: 980px; margin: 0 auto; padding: 28px 20px 64px; flex: 1 0 auto; }

h1, h2, h3 { font-family: var(--head); font-weight: 500; }
h1 { font-size: var(--fs-2xl); margin: 0 0 var(--sp-1); letter-spacing: -.025em; line-height: 1.2; }
h2 { font-size: var(--fs-lg); margin: 0; letter-spacing: -.01em; line-height: 1.3; }
h3 { font-size: var(--fs-md); margin: 0 0 2px; letter-spacing: -.005em; }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--ink) 18%, transparent); }

/* ---------- chrome ---------- */

.topbar {
	display: flex; align-items: center; justify-content: space-between;
	gap: var(--sp-4); padding: var(--sp-3) var(--sp-5);
	background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--head); font-weight: 500; font-size: var(--fs-lg); color: var(--ink); text-decoration: none; letter-spacing: -.02em; }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--fs-md); }
/* Outranks the nav link color above, which would grey the button label. */
.topbar nav a.btn--primary, .topbar nav a.btn--primary:hover { color: var(--accent-ink); }
.topbar nav a:hover { color: var(--ink); }
.btn--nav { padding-inline: var(--sp-4); }

.foot {
	max-width: 980px; margin: 0 auto; padding: 0 20px 40px;
	color: var(--ink-soft); font-size: var(--fs-sm);
}

.messages { list-style: none; max-width: 980px; margin: var(--sp-4) auto 0; padding: 0 20px; }
.msg {
	padding: 9px var(--sp-3); border-radius: var(--radius); margin-bottom: var(--sp-2);
	font-size: var(--fs-md); border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
}
.msg--success { background: var(--ok-bg); color: var(--ok-ink); }
.msg--warning { background: var(--warn-bg); color: var(--warn-ink); }
.msg--error   { background: var(--danger-bg); color: var(--danger); }

/* An operator looking at the portal as one of their clients. Loud on purpose:
   every page says whose eyes these are, and how to stop. */
.viewing {
	display: flex; gap: var(--sp-3); align-items: center; justify-content: center; flex-wrap: wrap;
	padding: 7px 14px; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-md);
}
.viewing .linkish { color: inherit; text-decoration: underline; }

/* Sign-out has to be a form (POST), so the button is dressed as a nav link. */
.topbar .logout { display: inline; margin: 0; }
.linkish {
	background: none; border: 0; padding: 0; cursor: pointer;
	color: var(--ink-soft); font: inherit; font-size: var(--fs-md);
}
.linkish:hover { color: var(--ink); }
.whoami { color: var(--ink-soft); font-size: var(--fs-md); opacity: .75; }

/* A label for a control that shows only an icon. */
.visually-hidden {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

.lede { color: var(--ink-soft); margin: 0 0 var(--sp-4); max-width: 62ch; }
.hint { color: var(--ink-soft); font-size: var(--fs-sm); margin: 10px 0 0; }
.err { color: var(--danger); font-size: var(--fs-sm); margin: 5px 0 0; }
.meta { color: var(--ink-soft); font-size: var(--fs-sm); margin: 0; }
.meta__count { opacity: .75; }
.section-head { margin-bottom: var(--sp-3); }

/* Anchored panels land clear of the viewport edge; a field reached from the
   settings search shows itself for a moment. */
[id] { scroll-margin-top: var(--sp-4); }
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

/* Korean wraps between words, not inside them. Latin stays in Inter; a
   Korean font the machine already has comes next (Windows, Mac, Linux with
   Noto CJK), then the web font the page loads for a machine with none.
   Form controls are named too, since they do not inherit. */
html[lang="ko"] body { word-break: keep-all; }
html[lang="ko"] body, html[lang="ko"] input, html[lang="ko"] select, html[lang="ko"] textarea, html[lang="ko"] button,
[lang="ko"] {
	font-family: "Inter", "Noto Sans CJK KR", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- builder shell: the rail beside the page ---------- */

.shell { display: flex; flex: 1; min-height: 0; align-items: stretch; }
.shell__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell__main main { flex: 1 0 auto; max-width: none; padding: var(--sp-6) var(--sp-8) 64px; }
.shell__main .messages { max-width: none; margin: 0; padding: var(--sp-4) var(--sp-8) 0; }
.shell__main .foot { max-width: none; margin: 0; padding: 0 var(--sp-8) var(--sp-10); }

.side {
	position: sticky; top: 0; align-self: flex-start;
	display: flex; flex-direction: column; gap: var(--sp-4);
	width: 232px; flex: 0 0 232px; height: 100vh; overflow-y: auto; overflow-x: hidden;
	padding: var(--sp-3) var(--sp-3) var(--sp-3); background: var(--bg);
	border-right: 1px solid var(--line);
}
/* On a wide screen this is the brand and nothing else - the close button
   beside it belongs to the drawer, and only appears at that width. */
.side__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; padding: 0 var(--sp-2); }
.side__nav { display: flex; flex-direction: column; gap: 1px; }
.side__nav a {
	display: flex; align-items: center; gap: var(--sp-2); min-height: 30px; padding: 0 10px;
	border-radius: var(--radius-sm); color: var(--ink-soft); text-decoration: none; font-size: var(--fs-md);
}
.side__nav a:hover { color: var(--ink); background: var(--hover); }
/* The page you are on: a box of its own with an ink bar down its left. */
.side__nav a[aria-current] {
	background: var(--surface); color: var(--ink); font-weight: 500; border-radius: 0;
	box-shadow: inset 2px 0 0 var(--ink), 0 0 0 1px var(--line);
}
.side__store { border-top: 1px solid var(--line); padding-top: var(--sp-4); }
.side__group { display: flex; flex-direction: column; gap: 1px; }
.side__group-head {
	display: block; padding: 10px 10px 4px; font-size: var(--fs-2xs); font-weight: 600;
	text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft);
}
.side__foot {
	margin-top: auto; padding: var(--sp-3) var(--sp-1) 0; border-top: 1px solid var(--line);
	display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2);
}
/* A waiting count beside a rail link. */
.side__count {
	margin-left: auto; min-width: 20px; padding: 0 5px; border-radius: var(--radius-sm); text-align: center;
	background: var(--ink); color: var(--bg); font-size: var(--fs-2xs); font-weight: 600; line-height: 18px;
	font-variant-numeric: tabular-nums;
}
/* A store's small square in the rail: its logo, or its first letter. */
.side__logo {
	flex: none; width: 26px; height: 26px; border-radius: var(--radius-sm); object-fit: contain;
	background: var(--surface-2); border: 1px solid var(--line);
}
.side__logo--empty { display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-soft); }

/* The store switcher at the top of a store's pages in the rail. */
.switcher { position: relative; margin: 0 0 var(--sp-2); }
.switcher > summary { list-style: none; }
.switcher > summary::-webkit-details-marker { display: none; }
.switcher__current {
	display: flex; align-items: center; gap: 10px; padding: 6px var(--sp-2); border-radius: var(--radius);
	border: 1px solid var(--line); background: var(--surface); cursor: pointer; min-width: 0;
}
.switcher__current:hover, .switcher[open] > .switcher__current { border-color: var(--line-strong); background: var(--surface-head); }
.switcher__current--only { cursor: default; }
.switcher__current--only:hover { border-color: var(--line); background: var(--surface); }
.switcher__name {
	flex: 1; min-width: 0; font-family: var(--head); font-weight: 500; font-size: var(--fs-md); letter-spacing: -.01em;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.switcher__chev { flex: none; width: 16px; height: 16px; color: var(--ink-soft); transition: transform .12s; }
.switcher[open] .switcher__chev { transform: rotate(180deg); }
.switcher__panel {
	position: absolute; left: 0; right: 0; top: calc(100% + var(--sp-1)); z-index: 40;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow-pop); padding: var(--sp-1);
}
.switcher__find { margin: 0 0 var(--sp-1); }
.switcher__find input { padding: 5px var(--sp-2); font-size: var(--fs-sm); }
.switcher__list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.switcher__list a {
	display: flex; align-items: center; gap: var(--sp-2); padding: 5px 6px; border-radius: var(--radius-sm);
	color: var(--ink); text-decoration: none; font-size: var(--fs-sm);
}
.switcher__list a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.switcher__list a:hover, .switcher__list a:focus-visible { background: var(--hover); outline: 0; }
.switcher__list a[aria-current] { font-weight: 500; }
.switcher__list a[aria-current]::after { content: "\2713"; margin-left: auto; color: var(--ink-soft); font-size: var(--fs-xs); }
.switcher__list .side__logo { width: 22px; height: 22px; font-size: var(--fs-2xs); }
.switcher__all {
	display: block; margin-top: var(--sp-1); padding: 6px 6px 3px; border-top: 1px solid var(--line);
	color: var(--ink-soft); font-size: var(--fs-sm); text-decoration: none;
}
.switcher__all:hover { color: var(--ink); }

/* ---------- the profile square ---------- */
/* Your initials at the foot of the rail, and everything the tool knows
   about you behind them. The menu opens up, as wide as the rail. */
.profile { position: relative; width: 100%; }
.avatar-btn {
	display: flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; border-radius: var(--radius);
	border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
	font: inherit; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em; cursor: pointer;
}
.avatar-btn:hover { border-color: var(--ink-soft); }
.profile-menu {
	position: absolute; left: 0; right: 0; bottom: calc(100% + var(--sp-2)); z-index: 40;
	padding: var(--sp-1); background: var(--surface);
	border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow-pop);
}
.profile-menu .logout { margin: 0; }
.profile-head {
	display: flex; flex-direction: column; align-items: center; gap: 3px;
	padding: var(--sp-3) var(--sp-3) 10px; margin: calc(-1 * var(--sp-1)) calc(-1 * var(--sp-1)) var(--sp-1);
	background: var(--surface-head); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.avatar-circle {
	display: flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border-radius: var(--radius); margin-bottom: 6px;
	background: var(--ink); color: var(--bg);
	font-size: var(--fs-lg); font-weight: 600;
}
/* A long address wraps rather than losing its tail: this is the one place
   it is written down. */
.profile-detail {
	max-width: 100%; font-size: var(--fs-sm); color: var(--ink-soft);
	text-align: center; overflow-wrap: anywhere;
}
.profile-detail span { display: inline-block; }
.menu-item {
	display: block; width: 100%; padding: 7px 10px; text-align: left;
	background: none; border: 0; border-radius: var(--radius-sm);
	font: inherit; font-size: var(--fs-md); font-weight: 500; color: var(--ink); text-decoration: none;
	cursor: pointer;
}
.menu-item:hover { background: var(--hover); }
.menu-item[aria-current="page"] { background: var(--surface-2); }
.menu-signout { color: var(--danger); }
.menu-signout:hover { background: var(--danger-bg); color: var(--danger); }

/* The theme switch in the profile menu: three choices in a row. */
.theme-switch { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-2) 10px; margin: var(--sp-1) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.theme-switch__label { font-size: var(--fs-xs); color: var(--ink-soft); }
.theme-switch__opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.theme-switch__opts button {
	display: flex; align-items: center; justify-content: center;
	min-width: 0; padding: 5px 0; border: 0; border-left: 1px solid var(--line); background: var(--surface);
	color: var(--ink-soft); cursor: pointer;
}
.theme-switch__opts button:first-child { border-left: 0; }
.theme-switch__opts svg { width: 16px; height: 16px; }
.theme-switch__opts button:hover { color: var(--ink); background: var(--hover); }
.theme-switch__opts button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* The language switcher: a row of names in the top bar, a menu section in
   the profile menu. The current language is shown, not offered. */
.lang-switch { display: flex; gap: var(--sp-3); margin: 0; }
.lang-switch button[disabled] { color: var(--ink); cursor: default; opacity: .6; }

/* data-rail says the script ran. With it the menu hides behind the square;
   without it there is no square to press, so the way out is simply there. */
html[data-rail] .profile-menu { display: none; }
html[data-rail] .profile[data-open] .profile-menu { display: block; }
html:not([data-rail]) .avatar-btn { display: none; }
html:not([data-rail]) .profile-menu {
	position: static; padding: 0; border: 0; box-shadow: none; background: none;
}
html:not([data-rail]) .profile-head { display: none; }
html:not([data-rail]) .menu-item { padding: 0; font-weight: inherit; }

.railbar, .railbar__scrim, .railbar__open, .railbar__shut, .railbar__find { display: none; }

/* ---------- the rail on a phone: a drawer ---------- */
/* Below the breakpoint the rail leaves the page. A bar holds the store you
   are in and a button, and the rail slides over the page whole when that
   button is pressed.

   nav.js marks <html> before the first paint. With no script there is no
   attribute, nothing below matches, and the rail lies down as a row of
   links. */

@media (max-width: 760px) {
	.shell { flex-direction: column; }
	.shell__main main { padding: var(--sp-4) var(--sp-4) 48px; }
	.shell__main .messages { padding: var(--sp-3) var(--sp-4) 0; }
	.shell__main .foot { padding: 0 var(--sp-4) var(--sp-8); }

	.railbar {
		display: flex; align-items: center; gap: var(--sp-3);
		position: sticky; top: 0; z-index: 30;
		min-height: 48px; padding: 0 var(--sp-4);
		background: var(--surface); border-bottom: 1px solid var(--line);
	}
	.railbar__where {
		flex: 1; min-width: 0; color: var(--ink-soft); font-size: var(--fs-md);
		white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	}
	/* The only way to the rail, so it is sized for a thumb rather than a
	   pointer. The negative margin keeps the bar as short as its text. */
	.railbar__open, .railbar__shut {
		flex: none; align-items: center; justify-content: center;
		width: 44px; height: 44px; margin: -4px -10px -4px auto;
		padding: 0; border: 0; border-radius: var(--radius);
		background: none; color: var(--ink); cursor: pointer;
	}
	/* Only where it does something: with no script there is no drawer to
	   open, and a button that answers nothing is worse than no button. */
	html[data-rail] .railbar__open, html[data-rail] .railbar__find { display: inline-flex; }
	.railbar__find {
		flex: none; align-items: center; justify-content: center;
		width: 44px; height: 44px; margin: -4px 0 -4px auto;
		padding: 0; border: 0; border-radius: var(--radius);
		background: none; color: var(--ink); cursor: pointer;
	}
	.railbar__find + .railbar__open { margin-left: 0; }
	.railbar__open:hover, .railbar__shut:hover, .railbar__find:hover { background: var(--hover); }
	.railbar__open svg, .railbar__shut svg, .railbar__find svg { width: 22px; height: 22px; fill: none; }

	/* No script: the row of links, under the bar that now carries the brand. */
	html:not([data-rail]) .side {
		position: static; width: auto; flex: 0 0 auto; height: auto;
		flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
		border-right: 0; border-bottom: 1px solid var(--line);
	}
	html:not([data-rail]) .side__top { display: none; }
	html:not([data-rail]) .side__nav { flex-direction: row; flex-wrap: wrap; }
	html:not([data-rail]) .side__store { border-top: 0; padding-top: 0; }
	html:not([data-rail]) .side__group { display: contents; }
	html:not([data-rail]) .side__group-head { display: none; }
	html:not([data-rail]) .side__foot { margin-top: 0; margin-left: auto; border-top: 0; padding: 0; }

	/* With it: the rail keeps the shape it has on a wide screen and slides in
	   over the page. Shut, it is out of reach of the tab key as well as of the
	   eye - visibility waits for the slide out, and leads it on the way in. */
	html[data-rail] .side {
		position: fixed; inset: 0 auto 0 0; z-index: 40;
		width: min(288px, 86vw); height: 100%;
		border-right: 1px solid var(--line);
		box-shadow: var(--shadow-modal);
		transform: translateX(-100%); visibility: hidden;
		transition: transform .18s ease-out, visibility 0s linear .18s;
	}
	html[data-rail="open"] .side {
		transform: none; visibility: visible;
		transition: transform .18s ease-out, visibility 0s;
	}
	html[data-rail] .side:focus { outline: 0; }
	html[data-rail] .side__nav a { min-height: 40px; }
	html[data-rail] .railbar__shut { display: inline-flex; margin: -6px -8px -6px auto; }

	html[data-rail] .railbar__scrim {
		display: block; position: fixed; inset: 0; z-index: 35;
		background: var(--scrim);
		opacity: 0; pointer-events: none; transition: opacity .18s ease-out;
	}
	html[data-rail="open"] .railbar__scrim { opacity: 1; pointer-events: auto; }
	/* A drag on the scrim is aimed at the drawer, not at the page under it. */
	html[data-rail="open"] body { overflow: hidden; }
}

/* Same weight as the rules above, and after them, or the drawer slides
   anyway. */
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
	html[data-rail] .side, html[data-rail="open"] .side { transition: none; }
	html[data-rail] .railbar__scrim { transition: none; }
}

/* ---------- page structure ---------- */

/* Every page opens with the thing you came to do there, on the right. Its
   title is for screen readers only: the rail already says where you are. */
.page-head {
	display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap;
	gap: var(--sp-3) var(--sp-5); margin: 0 0 var(--sp-4);
}
.page-head:not(:has(.page-head__actions)) { margin: 0; }
.page-head h1 {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.page-head__actions { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.page-head__actions form { margin: 0; }
.page-head--split { justify-content: space-between; }
.page-head.stage-filter, .page-head__actions.stage-filter { margin: 0; }
.page-head + .block__note { margin: calc(-1 * var(--sp-2)) 0 var(--sp-4); }

/* The store bar: which store, where it is live, and the store-wide actions.
   A strip across the top of the page, edge to edge. */
.store-bar {
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
	gap: var(--sp-2) var(--sp-4); min-height: 56px;
	margin: calc(-1 * var(--sp-6)) calc(-1 * var(--sp-8)) var(--sp-6); padding: 10px var(--sp-8);
	background: var(--surface); border-bottom: 1px solid var(--line);
}
.store-bar__id { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.store-bar__name { font-family: var(--head); font-weight: 500; font-size: var(--fs-lg); letter-spacing: -.015em; }
.store-bar__host { color: var(--ink-soft); font-size: var(--fs-sm); text-decoration: none; }
.store-bar__host:hover { color: var(--ink); text-decoration: underline; }
.store-bar__actions { display: flex; align-items: center; gap: var(--sp-2); }
.store-bar__actions form { margin: 0; }
@media (max-width: 760px) {
	.store-bar { margin: calc(-1 * var(--sp-4)) calc(-1 * var(--sp-4)) var(--sp-4); padding: 10px var(--sp-4); }
}

/* A menu of rarer actions behind a button: a details element, so it opens
   with script off. */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { border-color: var(--ink-soft); }
.menu__list {
	position: absolute; right: 0; top: calc(100% + var(--sp-1)); z-index: 30; min-width: 13rem;
	display: flex; flex-direction: column; padding: var(--sp-1);
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow-pop);
}
.menu__list form { margin: 0; }
.menu__item {
	display: block; width: 100%; text-align: left; padding: 6px 10px; border: 0; border-radius: var(--radius-sm);
	background: none; color: var(--ink); font: inherit; font-size: var(--fs-md); text-decoration: none; cursor: pointer;
}
.menu__item:hover { background: var(--hover); }

/* ---------- boxes ---------- */
/* A section is a box: a hairline border on the surface colour, a head bar
   across its top, and its content inside a padding of --pad. A list in a
   box runs edge to edge, its rows divided by hairlines. */

.block, .product-section, .dash-card {
	margin: 0 0 var(--sp-6); padding: var(--pad); min-width: 0;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.block > :last-child, .dash-card > :last-child { margin-bottom: 0; }

/* The head bar. The first one sits on the box's top edge; one further down
   divides the box. */
.block__head, .product-section__head, .dash-card > h2:first-child,
.block > .page-head:has(.page-head__actions) {
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
	gap: var(--sp-1) var(--sp-3); min-height: 44px;
	margin: var(--pad) calc(-1 * var(--pad)) var(--pad); padding: 7px var(--pad);
	background: var(--surface-head); border-block: 1px solid var(--line);
}
.block > .block__head:first-child, .product-section__head, .dash-card > h2:first-child,
.block > .page-head:first-child:has(.page-head__actions) {
	margin-top: calc(-1 * var(--pad)); border-top: 0; border-radius: var(--radius) var(--radius) 0 0;
}
.block > .page-head:has(.page-head__actions) { justify-content: flex-end; }
.block__head { justify-content: flex-start; }
.block__head > :last-child:not(:first-child) { margin-left: auto; }
h2.block__head, .block__head h2, .product-section__head h2, .dash-card > h2:first-child {
	font-size: var(--fs-md); font-weight: 500; letter-spacing: -.005em;
}
.block__head > a:not(.btn), .block__head > .linkbtn { font-size: var(--fs-sm); color: var(--ink-soft); }
.block__head > a:not(.btn):hover { color: var(--ink); }
.block__head > .block__note { flex: 1 0 100%; max-width: none; margin: 0 0 2px; }
.block__note { color: var(--ink-soft); font-size: var(--fs-sm); margin: 6px 0 0; max-width: 68ch; }
.block__danger { margin: var(--sp-4) 0 0; }

/* A form box: the fields flow across the full width under its head. */
.block--form .config-form, .block--form .grid-form { margin-top: var(--sp-1); }

/* Rows that run to the box's edges. In a box the list draws a hairline
   across its whole width above and below, and each row the one over it, so
   a list of two columns with one record in it still closes. A list straight
   under a bar, or at the top or foot of the box, lays its hairline over the
   edge already there. */
.block > :is(.items, .owner-list, .review-list, .domain-list, .setup-list, .look-list, .import-list, .away-list),
.product-section > .items, .dash-card > .look-list {
	margin-inline: calc(-1 * var(--pad)); column-gap: 0; border-block: 1px solid var(--line);
}
.block > :is(.items, .owner-list, .review-list, .domain-list, .setup-list, .look-list, .import-list, .away-list) > li,
.product-section > .items > li, .dash-card > .look-list > li {
	padding-inline: var(--pad); margin-top: -1px; border-top: 1px solid var(--line);
}
:is(.block, .product-section, .dash-card) > :is(.items, .owner-list, .review-list, .domain-list, .look-list, .import-list) > li > :is(.item-row, .import-row, a, div) { border-top: 0; }
.block > :is(.block__head, .page-head):has(+ :is(.items, .owner-list, .review-list, .domain-list, .setup-list, .look-list, .import-list, .table)),
.product-section__head { margin-bottom: 0; }
.block > :is(.block__head, .page-head) + :is(.items, .owner-list, .review-list, .domain-list, .setup-list, .look-list, .import-list),
.product-section > .product-section__head + .items, .dash-card > h2:first-child + .look-list { margin-top: -1px; }
.block > :is(.items, .owner-list, .review-list, .domain-list, .setup-list, .look-list, .import-list):first-child,
.block > .page-head:first-child:not(:has(.page-head__actions)) + :is(.items, .owner-list, .review-list, .domain-list, .setup-list, .look-list, .import-list) { margin-top: calc(-1 * var(--pad) - 1px); }
.block > .page-head:first-child:not(:has(.page-head__actions)) + .block__head { margin-top: calc(-1 * var(--pad)); border-top: 0; border-radius: var(--radius) var(--radius) 0 0; }
.block > :is(.items, .owner-list, .review-list, .domain-list, .setup-list, .look-list, .import-list, .away-list):last-child,
.dash-card > .look-list:last-child { margin-bottom: calc(-1 * var(--pad) - 1px); }
.product-section > .items:last-child { margin-bottom: -1px; }

/* A sub-head inside a box is a thinner bar across it. */
.block > .day-head {
	margin: var(--pad) calc(-1 * var(--pad)) 0; padding: 6px var(--pad);
	font-family: var(--font); font-size: var(--fs-2xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
	color: var(--ink-soft); background: var(--surface-head); border-block: 1px solid var(--line);
}
.block > :is(.block__head, .page-head) + .day-head { margin-top: calc(-1 * var(--pad) - 1px); }
.block > .day-head + * { margin-top: -1px; }
.block > .day-head + .empty, .block > .empty + .day-head { margin-top: 0; }
.block > :is(.items, .owner-list, .review-list, .domain-list, .setup-list, .look-list, .import-list, .away-list) + .day-head { margin-top: -1px; }
.block > .page-head--split { justify-content: space-between; }
/* The calendar's frame fills the rest of its box. */
.block > .cal-frame { margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad)); border-width: 1px 0 0; border-radius: 0 0 var(--radius) var(--radius); }
.block > :is(.block__head, .page-head) + .cal-frame { margin-top: calc(-1 * var(--pad) - 1px); }

/* A table in a box runs edge to edge as well. */
.block > .table { width: calc(100% + 2 * var(--pad)); margin-inline: calc(-1 * var(--pad)); }
.block > .table:last-child { margin-bottom: calc(-1 * var(--pad)); }
.block > .table :is(th, td):first-child { padding-left: var(--pad); }
.block > .table :is(th, td):last-child { padding-right: var(--pad); }
.block > :is(.block__head, .page-head) + .table { margin-top: 0; }

/* Two boxes side by side, stacking on a narrow screen. */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 var(--sp-6); align-items: start; }

/* An empty list says so in the place the list would be: a dashed box on
   the page, a quiet line inside a box. */
.empty {
	color: var(--ink-soft); font-size: var(--fs-md); text-align: center;
	padding: var(--sp-6) var(--sp-4); margin: 0 0 var(--sp-4);
	border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
li.empty { list-style: none; }
:is(.block, .product-section, .dash-card) .empty { border: 0; padding: var(--sp-5) var(--sp-4); margin: 0; }
.product-section > .items > li.empty { grid-column: 1 / -1; }

/* ---------- rows ---------- */
/* A record in a list is a preview row linking to ?edit=<id>. */

.item-row {
	display: flex; align-items: center; gap: var(--sp-3);
	min-height: 52px; padding: var(--sp-2) 0; border-top: 1px solid var(--line);
	color: inherit; text-decoration: none;
}
.item-row--hidden { opacity: .55; }
.item-row:hover .item-row__name { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.item-row__thumb {
	flex: 0 0 44px; width: 44px; height: 44px;
	object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2);
}
.item-row__thumb--empty { display: block; border: 1px solid var(--line); }
.item-row__text { flex: 1; min-width: 0; }
.item-row__name { display: block; font-weight: 500; }
.item-row__desc {
	color: var(--ink-soft); font-size: var(--fs-sm);
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
	overflow: hidden;
}
.item-row__price {
	color: var(--ink-soft); font-variant-numeric: tabular-nums;
	white-space: nowrap; font-size: var(--fs-sm);
}
.item-row .btn--small { margin-left: var(--sp-3); }
.was { opacity: .6; }

/* Drag-to-reorder: the grips are the handles (product-sort.js), so clicking a
   row still opens its editor. On-screen order is the saved order. */
.item-li { display: flex; align-items: center; border-top: 1px solid var(--line); }
.item-li .item-row { border-top: 0; flex: 1; min-width: 0; }
.item-li:has(> a.item-row):hover { background: var(--hover); }
/* An action beside a row rather than inside the row's link: an anchor cannot
   hold a form, and the row itself still opens the record. The li is a flex
   container, so an action is a flex child: taken out of the flow, two of
   them stack on the same corner and the first disappears under the second. */
.item-li__action { flex: none; margin-left: 10px; }
.item-li:has(.item-li__action) .item-row { padding: var(--sp-3) 0; }
.grip {
	background: none; border: 0; margin: 0; padding: 4px 10px 4px 0;
	color: var(--ink-soft); opacity: .45; line-height: 0;
	cursor: grab; touch-action: none;
}
.grip:hover { opacity: 1; }
.grip:active { cursor: grabbing; }
.sortable-ghost { opacity: .35; }
.sortable-drag { opacity: .9; background: var(--surface); box-shadow: var(--shadow-pop); }

.items { list-style: none; padding: 0; margin: 0; display: grid; gap: 0 var(--sp-8); min-height: 14px; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); align-items: start; }
.review-list, .owner-list { list-style: none; margin: var(--sp-4) 0 0; padding: 0; display: grid; gap: 0 var(--sp-8); align-items: start; }
.owner-list { margin: 0 0 var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(min(30rem, 100%), 1fr)); }
.review-list { grid-template-columns: repeat(auto-fill, minmax(min(26rem, 100%), 1fr)); }
.review__row, .owner__row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.review__row .field { flex: 1 1 10rem; min-width: 0; }
.owner__row .field { flex: 1 1 12rem; min-width: 0; }

/* The menu's sections: a box each, its name and actions in the head bar. */
.product-section { padding-bottom: 0; }
.product-section__head { justify-content: flex-start; gap: var(--sp-2); padding-left: var(--sp-2); }
.product-section__head h2 { margin-right: var(--sp-1); }
.product-section__head form { margin: 0 0 0 auto; }
.product-section__head .grip { padding: 4px; }
.count {
	background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
	border-radius: var(--radius-sm); padding: 0 6px; font-size: var(--fs-xs); line-height: 18px; font-variant-numeric: tabular-nums;
}

/* Domains, sources, toppings: a row with its actions on the right. */
.domain-list { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; }
.domain {
	display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
	flex-wrap: wrap; min-height: 48px; padding: var(--sp-2) 0; border-top: 1px solid var(--line);
}
.domain__host { display: inline-flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.domain__actions { display: flex; gap: 6px; }
/* The heading row that opens each group of toppings. */
.domain--group {
	min-height: 0; padding-top: var(--sp-4); padding-bottom: var(--sp-1);
	font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .08em;
	text-transform: uppercase; color: var(--ink-soft); background: var(--surface-head);
}
.domain-add, .owner-add { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; }
/* The add sits above the rows, so it needs air under it as well as over it,
   or the first row reads as part of the button strip. */
.photo-add, .review-list + .form, .owner-add, .domain-add { margin: 2px 0 var(--sp-4); }

/* A topping row carries its photo where one was uploaded. */
.topping-thumb {
	width: 32px; height: 32px; border-radius: var(--radius-sm);
	object-fit: cover; background: var(--surface-2);
}

/* Flags and tags: small square-cornered labels. Flags say a state
   (hidden, sold out) in two words or fewer, lowercase. */
.flag, .tag {
	display: inline-block; font-size: var(--fs-2xs); font-weight: 500; line-height: 16px;
	padding: 0 5px; border-radius: var(--radius-sm); white-space: nowrap; vertical-align: 1px;
	color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line-strong);
}
.flag--warn { color: var(--warn-ink); background: var(--warn-bg); border-color: transparent; }
.flag--ok { color: var(--ok-ink); background: var(--ok-bg); border-color: transparent; }
.tag { background: var(--surface-2); border-color: transparent; }
.tag--primary, .tag--member { background: var(--accent); color: var(--accent-ink); }
.tag--muted { background: transparent; border: 1px dashed var(--line-strong); }
.tag--demo { background: transparent; border: 1px dashed var(--ink-soft); }
.tag--uninterested { background: transparent; color: var(--ink-soft); text-decoration: line-through; }
.tag--trial { background: transparent; border: 1px solid var(--ink); color: var(--ink); }
.badge {
	position: absolute; top: 6px; left: 6px;
	font-size: var(--fs-2xs); padding: 1px 6px; border-radius: var(--radius-sm);
}
.badge--warn { background: var(--warn-bg); color: var(--warn-ink); }

/* A segmented filter: the choices in one box, the current one filled. */
.stage-filter, .range {
	display: inline-flex; flex-wrap: wrap; margin: 0;
	border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.stage-filter a, .range a {
	display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 var(--sp-3);
	border-left: 1px solid var(--line); color: var(--ink-soft); text-decoration: none; font-size: var(--fs-sm);
	font-variant-numeric: tabular-nums;
}
.stage-filter a:first-child, .range a:first-child { border-left: 0; }
.stage-filter a:hover, .range a:hover { color: var(--ink); background: var(--hover); }
.stage-filter a[aria-current="page"], .range a[aria-current] { background: var(--ink); color: var(--bg); }
.stage-filter__n { opacity: .65; }
.stage-filter { margin-bottom: var(--sp-4); }

/* ---------- tiles ---------- */
/* A number is a tile: what it counts and the figure. Tiles share one box,
   divided by hairlines, so a row of them reads as one instrument. The
   stat, the dashboard's kpi, the traffic tally and a settings hub's tile
   are all this one shape. */
.stat-row, .kpi-row, .tally {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	margin: 0 0 var(--sp-6); overflow: hidden;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.stat, .kpi, .tally__tile {
	position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-1);
	min-width: 0; margin: 0 -1px -1px 0; padding: 14px var(--pad);
	border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
	color: var(--ink-soft); text-decoration: none; font-size: var(--fs-sm); line-height: 1.35;
}
.stat b, .kpi__value, .tally__value {
	color: var(--ink); font-family: var(--head); font-weight: 500; font-size: var(--fs-2xl);
	line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.kpi__label, .tally__label { font-size: var(--fs-sm); color: var(--ink-soft); }
.kpi__sub { font-size: var(--fs-xs); color: var(--ink-soft); min-height: 1.1em; }
.stat__go { position: absolute; top: 12px; right: 14px; color: var(--ink-soft); opacity: .5; transition: transform .12s ease; }
a:is(.stat, .kpi):hover { background: var(--hover); }
a.stat:hover .stat__go { color: var(--ink); opacity: 1; transform: translateX(2px); }
.tally__tile--hero { grid-column: span 2; }
.tally__tile--hero .tally__value { font-size: var(--fs-4xl); letter-spacing: -.045em; }
.tally__value small { font-size: .5em; letter-spacing: 0; margin-left: 2px; color: var(--ink-soft); }
.tally__delta { font-size: var(--fs-xs); color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tally__delta--up { color: var(--ok-ink); }
.tally__delta--down { color: var(--danger); }
.tally { margin-bottom: var(--sp-2); }
.tally__note { margin: 0 0 var(--sp-8); font-size: var(--fs-xs); }
.kpi-row { margin-bottom: var(--sp-4); }
/* A row of tiles inside a box runs edge to edge under its head. */
.block > .stat-row { margin-inline: calc(-1 * var(--pad)); border-radius: 0; border-inline: 0; }
.block > :is(.block__head, .page-head) + .stat-row { margin-top: calc(-1 * var(--pad) - 1px); }
.block > .stat-row:last-child { margin-bottom: calc(-1 * var(--pad)); border-bottom: 0; }
.block > .stat-row + .traffic-top { margin: calc(-1 * var(--sp-2)) 0 0; }
.stat-row + .traffic-top { margin: calc(-1 * var(--sp-4)) 0 var(--sp-6); }
@media (max-width: 620px) {
	.stat-row, .kpi-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
	.tally__tile--hero .tally__value { font-size: var(--fs-3xl); }
	.tally__value { font-size: var(--fs-xl); }
}
@media (max-width: 340px) {
	.tally__tile--hero { grid-column: auto; }
}

/* ---------- the overview ---------- */

/* The setup list: done, or what is missing and where to fix it. */
.setup-list { list-style: none; margin: 0; padding: 0; }
.setup-item { display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; padding: 6px 0; border-top: 1px solid var(--line); }
.setup-item__mark {
	flex: none; width: 16px; height: 16px; border-radius: var(--radius-sm); border: 1px dashed var(--ink-soft);
	display: grid; place-items: center; font-size: var(--fs-2xs); line-height: 1;
}
.setup-item--done .setup-item__mark { background: var(--ink); border: 1px solid var(--ink); color: var(--bg); }
.setup-item--done .setup-item__label { color: var(--ink-soft); }
.setup-item__label { flex: 1; }
/* The design hand-off: the foot band of the setup box. */
.handoff { padding: var(--pad); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-head); display: grid; gap: var(--sp-3); justify-items: start; }
.block > .handoff:last-child {
	margin: 0 calc(-1 * var(--pad)) calc(-1 * var(--pad)); border-width: 1px 0 0; border-radius: 0 0 var(--radius) var(--radius);
}
.handoff__state { margin: 0; }
.handoff__state b { display: block; font-weight: 600; }
.handoff form { margin: 0; }
.handoff__note { margin: 0; color: var(--ink-soft); font-size: var(--fs-sm); }
.about__head { margin: var(--sp-4) 0 var(--sp-1); font-size: var(--fs-sm); color: var(--ink-soft); font-family: var(--font); font-weight: 500; }
.about__text { margin: 0; white-space: pre-line; max-width: 65ch; }

/* Facts as a definition list. */
.fact-list { margin: 0 0 var(--sp-4); display: grid; gap: var(--sp-2); }
.fact-list div { display: flex; gap: 14px; align-items: baseline; }
.fact-list dt { flex: 0 0 7rem; color: var(--ink-soft); font-size: var(--fs-sm); }
.fact-list dd { margin: 0; }
.fact-list--wide dt { flex-basis: 8rem; }

/* Print: the files an owner downloads for the counter. */
.print-list { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- the dashboard ---------- */

/* The boxes: two columns, wide on the left. */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--sp-4); }
.dash-grid > .dash-card { margin: 0; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-card .funnel { max-width: none; margin: 0; }
.dash-card__foot { margin: var(--sp-3) 0 0; font-size: var(--fs-xs); color: var(--ink-soft); }
.dash-card__calm { margin: 0; padding: var(--sp-4) 0; color: var(--ink-soft); }
.dash-card__table { margin-top: var(--sp-3); font-size: var(--fs-sm); }
.dash-card__table summary { cursor: pointer; color: var(--ink-soft); }
.dash-card__table .table { margin: 10px 0 0; width: 100%; }

/* The funnel: one bar per stage, its length the share of the cohort that
   got that far. */
.funnel { display: grid; gap: 10px; margin: 0 0 var(--sp-3); max-width: 720px; }
.funnel__row { display: grid; grid-template-columns: 9rem 1fr; align-items: center; gap: 14px; }
.funnel dt { color: var(--ink-soft); font-size: var(--fs-sm); }
.funnel dd { margin: 0; display: flex; align-items: center; gap: 10px; }
.funnel__bar { height: 10px; min-width: 2px; background: var(--ink); }
.funnel__n { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: var(--fs-sm); }

/* What needs a look: a row per store, the reason on the right. */
.look-list { list-style: none; margin: 0; padding: 0; }
.look-list li + li { border-top: 1px solid var(--line); }
.look-list li > * {
	display: flex; justify-content: space-between; gap: var(--sp-3); padding: 10px 0;
	color: inherit; text-decoration: none;
}
.look-list li:has(> a):hover { background: var(--hover); }
.look-list a:hover .look-list__name { text-decoration: underline; text-underline-offset: 3px; }
.look-list__name { font-weight: 500; }
.look-list__why { color: var(--ink-soft); font-size: var(--fs-sm); text-align: right; }
.look-list__why--bad { color: var(--danger); }

/* Six months as paired bars: prospects pale, members solid. */
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; height: 160px; align-items: end; padding-bottom: 22px; position: relative; border-bottom: 1px solid var(--line); }
.bars__col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.bars__pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 3px; }
.bars__bar { width: min(18px, 40%); min-height: 2px; background: var(--ink); }
.bars__bar--soft { background: var(--line-strong); }
.bars__label { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: var(--fs-2xs); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.legend { display: flex; align-items: center; gap: 6px; margin: 30px 0 0; font-size: var(--fs-xs); color: var(--ink-soft); }
.legend__key { width: 10px; height: 10px; background: var(--ink); margin-left: var(--sp-2); }
.legend__key:first-child { margin-left: 0; }
.legend__key--soft { background: var(--line-strong); }
.block__head .legend { margin: 0; }
.block__head .legend__key--soft { background: color-mix(in srgb, var(--ink) 16%, transparent); }
.block__head .legend__key--soft + * { margin-right: var(--sp-2); }

/* Activity: a figure per line, the detail beside it. */
.fig-list { margin: 0; display: grid; }
.fig-list div { display: grid; grid-template-columns: 8rem 1fr; gap: var(--sp-3); align-items: baseline; padding: 10px 0; border-top: 1px solid var(--line); }
.fig-list div:first-child { border-top: 0; }
.dash-card > .fig-list, .block > .fig-list { margin: calc(-1 * var(--pad)); }
.dash-card > .fig-list div, .block > .fig-list div { padding-inline: var(--pad); }
.fig-list dt { font-size: var(--fs-sm); color: var(--ink-soft); }
.fig-list dd { margin: 0; }
.fig-list b { font-family: var(--head); font-weight: 500; font-size: var(--fs-xl); letter-spacing: -.02em; margin-right: var(--sp-1); font-variant-numeric: tabular-nums; }
.fig-list span { font-size: var(--fs-sm); color: var(--ink-soft); }

/* ---------- tables ---------- */

.table { border-collapse: collapse; font-variant-numeric: tabular-nums; margin: 0 0 var(--sp-3); }
.table th, .table td { padding: var(--sp-2) 22px var(--sp-2) 0; text-align: right; border-top: 1px solid var(--line); }
.table th { color: var(--ink-soft); font-weight: 500; font-size: var(--fs-xs); border-top: 0; }
.table th:first-child, .table td:first-child { text-align: left; }
.table--wide { width: 100%; }
.table--wide th, .table--wide td { text-align: left; padding-right: 18px; }
.table--wide td { vertical-align: top; }
.block > .table thead th { background: var(--surface-head); border-bottom: 1px solid var(--line); }
.seller { align-items: center; }
.seller .fld select { min-width: 15rem; }

/* ---------- buttons ---------- */

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 32px; padding: 0 var(--sp-3); border-radius: var(--radius);
	border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
	font: inherit; font-size: var(--fs-sm); font-weight: 500; line-height: 1.2; white-space: nowrap;
	cursor: pointer; text-decoration: none;
	transition: border-color .12s, background-color .12s, color .12s;
}
.btn:hover { border-color: var(--ink-soft); background: var(--surface-head); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { background: color-mix(in srgb, var(--accent) 82%, var(--surface)); border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); background: var(--danger-bg); }
.btn--small { min-height: 26px; padding: 0 var(--sp-2); font-size: var(--fs-xs); }
.btn--icon { padding: 0 10px; letter-spacing: .08em; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
/* The one solid red button in the app: the point of no return. */
.btn--danger-solid { background: var(--danger); color: var(--accent-ink); border-color: var(--danger); }
.btn--danger-solid:hover { background: var(--danger); border-color: var(--danger); filter: brightness(1.08); }

.linkbtn {
	background: none; border: 0; padding: 0; cursor: pointer;
	font: inherit; font-size: var(--fs-sm); color: var(--ink-soft); text-decoration: underline;
	text-decoration-color: var(--line-strong); text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--ink); text-decoration-color: currentColor; }
.linkbtn--danger, .linkbtn--danger:hover { color: var(--danger); }

/* ---------- fields ---------- */

input[type="text"], input[type="url"], input[type="number"], input[type="date"],
input[type="time"], input[type="datetime-local"],
input[type="password"], input[type="email"], input[type="search"], input[type="tel"], textarea, select {
	width: 100%; min-height: 36px; padding: 7px 10px;
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line-strong); border-radius: var(--radius);
	font: inherit;
	transition: border-color .12s, box-shadow .12s;
}
:is(input, textarea, select):hover { border-color: var(--ink-soft); }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
	outline: 0; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink);
}
/* A select's list is drawn by the browser in the page's scheme; its options
   must not inherit a field's text colour, or light text lands on a light list. */
select option { background-color: Canvas; color: CanvasText; }
/* Safari draws its own rounded field and a cancel button for type=search;
   both fight the rest of the forms. */
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
/* Number fields without the browser's spin arrows: a price or a rating is
   typed, and the arrow keys still step it. */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* Sixteen pixels or more on a phone, or it zooms the page into the field. */
@media (max-width: 760px) {
	input[type="text"], input[type="url"], input[type="number"], input[type="date"],
	input[type="time"], input[type="datetime-local"],
	input[type="password"], input[type="email"], input[type="search"], input[type="tel"], textarea, select { font-size: var(--fs-lg); }
}

.field { display: block; }
.field > span {
	display: block; font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: var(--sp-1);
}
.field--grow { flex: 1 1 auto; }
.field--price { flex: 0 0 110px; }
.field--narrow { width: 5.5rem; }

/* A field whose label sits in the box until there is something in it: the
   form reads as a row of boxes rather than a column of headings, and a
   filled field still says what it is. */
.fld { position: relative; display: block; }
/* The sizing classes the old .field markup carried, so a field can still be
   the wide one or the narrow one in a row. */
.fld.field--grow { flex: 1 1 auto; }
.fld.field--narrow { flex: 0 1 11rem; width: auto; }
.fld.field--price { flex: 0 0 110px; }
.fld input, .fld textarea { width: 100%; display: block; min-height: 40px; padding: 9px 11px; }
.fld label {
	/* Never wrapped: a two-line label in a narrow field pushes itself out of
	   the box it belongs to. */
	white-space: nowrap; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis;
	position: absolute; left: 7px; top: 50%; transform: translateY(-50%);
	padding: 0 4px; line-height: 1.2;
	color: var(--ink-soft); font-size: var(--fs-md); pointer-events: none;
	transition: .15s ease all;
}
/* Floated, the label straddles the top border and its own background cuts
   the line behind it, which is what makes it read as a notch rather than a
   caption. Fields sit on the surface colour, in a box or a modal, and so
   does the notch. */
.fld input:focus + label,
.fld input:not(:placeholder-shown) + label,
.fld textarea:focus + label,
.fld textarea:not(:placeholder-shown) + label,
.fld :is(input, textarea):not([placeholder=" "]) + label,
.fld--select label {
	top: 0; transform: translateY(-50%); font-size: var(--fs-2xs); font-weight: 500; letter-spacing: .01em;
	background: linear-gradient(transparent calc(50% - 2px), var(--surface) calc(50% - 2px));
}
/* A textarea's label rests against the first line rather than the middle. */
.fld--area label { top: 20px; }
/* A select always has a value, so its label is always the floated one. */
.fld select { width: 100%; min-height: 40px; padding: 10px 10px 6px; }
.fld:focus-within label { color: var(--ink); }
.fld input:focus::placeholder, .fld textarea:focus::placeholder { color: transparent; }

/* ---------- checkboxes and files ---------- */
/* Native checkboxes and file pickers ignore the palette; redraw them with
   the tokens. Both stay real inputs, so keyboard, forms and no-JS
   behaviour are exactly as before. The checkbox is a square with a tick. */
input[type="checkbox"] {
	appearance: none; -webkit-appearance: none;
	width: 16px; height: 16px; flex: none;
	border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
	background: var(--surface); cursor: pointer;
	position: relative; vertical-align: -3px; margin: 0;
	transition: background .12s ease, border-color .12s ease;
}
input[type="checkbox"]::after {
	content: ""; position: absolute; left: 4px; top: 1px;
	width: 4px; height: 8px; border: solid var(--accent-ink); border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0); transition: transform .12s ease;
}
input[type="checkbox"]:hover { border-color: var(--ink-soft); }
input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

input[type="file"] { font-size: var(--fs-sm); color: var(--ink-soft); max-width: 100%; }
input[type="file"]::file-selector-button {
	min-height: 30px; padding: 0 var(--sp-3); margin-right: 10px;
	border: 1px solid var(--line-strong); border-radius: var(--radius);
	background: var(--surface); color: var(--ink);
	font: inherit; font-size: var(--fs-sm); font-weight: 500; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { border-color: var(--ink-soft); background: var(--surface-head); }

.check { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); white-space: nowrap; cursor: pointer; }
.toggles { display: flex; gap: 14px; padding-bottom: var(--sp-2); }
.check-list { display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-4); }
.check-list .check { white-space: normal; align-items: flex-start; }
.check-list .check input { flex: none; margin-top: 2px; }
.check-list__group { display: grid; gap: var(--sp-2); }
.check-list__head { margin: var(--sp-2) 0 0; color: var(--ink-soft); font-size: var(--fs-2xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- image remove/browse ---------- */
/* Every image field is the picture plus two actions: Remove - a hidden
   checkbox its label toggles, applied on save, with the pending state
   drawn by CSS - and the file input to browse for a replacement. */
input[type="checkbox"].pic__clear {
	position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.pic { display: inline-flex; align-items: center; gap: 10px; margin: 2px 0 var(--sp-2); }
.pic__thumb img {
	width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm);
	display: block; background: var(--surface-2); border: 1px solid var(--line);
}
.pic__name { font-size: var(--fs-xs); color: var(--ink-soft); overflow-wrap: anywhere; }
.pic__remove {
	cursor: pointer; font-size: var(--fs-sm);
	color: var(--danger); text-decoration: underline;
}
.item__photo .pic__remove { display: block; margin-top: 6px; }
.pic__remove span:last-child { display: none; color: var(--warn-ink); }
.pic__clear:checked ~ .pic__thumb,
.pic__clear:checked ~ .pic__name,
.pic__clear:checked ~ img { opacity: .35; }
.pic__clear:checked ~ .pic__name { text-decoration: line-through; }
.pic__clear:checked ~ .pic__remove span:first-child { display: none; }
.pic__clear:checked ~ .pic__remove span:last-child { display: inline; }
.pic__clear:focus-visible ~ .pic__remove { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- form layouts ---------- */

.row { display: flex; gap: var(--sp-3); margin-bottom: 10px; }
.row--split { align-items: flex-end; flex-wrap: wrap; }
.row--split .btn { margin-bottom: 1px; }
.import-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.import-form .field { flex: 1 1 380px; }

/* Fields flow into as many columns as the space gives; anything that needs
   the whole line (uploads, long help) is marked .gf-wide. */
.grid-form {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--sp-4) var(--sp-6); align-items: start;
}
.grid-form p { margin: 0; }
.grid-form label { font-size: var(--fs-sm); color: var(--ink-soft); display: block; }
.grid-form .gf-wide, .grid-form > button { grid-column: 1 / -1; }
.grid-form > button { justify-self: start; margin-top: var(--sp-1); }
.gf-top { display: flex; align-items: center; gap: 5px; margin-bottom: var(--sp-1); }

/* The settings forms: the same flow, a little wider. */
.config-form {
	display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--sp-5) var(--sp-8); align-items: start;
}
.config-form p { margin: 0; }
.config-form .hint { margin-top: 6px; }
.block > form + form { margin-top: var(--sp-3); }
.config-form > button { grid-column: 1 / -1; justify-self: start; }
.config-source { font-style: normal; opacity: .8; }

/* A long form in named groups, one Save at its foot: one box, a band per
   group, the group's name on the left and the Save in the foot bar. */
.form-stack {
	display: grid; margin: 0 0 var(--sp-6);
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.form-group {
	border: 0; margin: 0; padding: var(--sp-5) var(--pad);
	display: grid; grid-template-columns: 12rem 1fr; gap: var(--sp-4) var(--sp-8); min-width: 0;
}
.form-group + .form-group { border-top: 1px solid var(--line); }
.form-group legend {
	float: left; padding: 0; font-family: var(--head); font-weight: 500; font-size: var(--fs-md); letter-spacing: -.005em;
}
.form-foot {
	display: flex; justify-content: flex-end; gap: var(--sp-2); padding: 10px var(--pad);
	background: var(--surface-head); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
}
@media (max-width: 900px) {
	.form-group { grid-template-columns: 1fr; }
}

/* A part of a form that most of the time is not wanted: the tick reveals it,
   and until then the fields are not there to read past. No script - the
   checkbox next to them is the state. */
.reveal { display: grid; gap: 10px; }
.reveal__body { display: none; }
.reveal__tick:checked ~ .reveal__body,
.reveal:has(.reveal__tick:checked) .reveal__body { display: block; }

/* Each charge is one row: what for, the list price, then how much. The foot
   carries the one due date the rows share, beside the way to add another. */
.charges { display: grid; gap: 10px; }
.charges__row { display: flex; gap: var(--sp-3); align-items: center; }
.charges__row .fld:first-child { flex: 1 1 18rem; }
.charges__row .fld:not(:first-child) { flex: 0 0 9rem; }
.charges__remove {
	flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 0;
	border-radius: var(--radius); background: none; color: var(--ink-soft);
	font-size: var(--fs-xl); line-height: 1; cursor: pointer;
}
.charges__remove:hover { color: var(--ink); background: var(--hover); }
.charges__foot { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.charges__foot .fld { flex: 0 0 11rem; }
.charges .hint { margin: 0; }
@media (max-width: 560px) {
	.charges__row { flex-wrap: wrap; }
	.charges__row .fld { flex: 1 1 100%; }
}

.search { display: flex; gap: var(--sp-2); align-items: center; margin: 0 0 var(--sp-4); }
.search .fld { flex: 1 1 18rem; min-width: 0; }

/* picker.js: a search over a long list. */
.picker { display: grid; gap: 6px; }
.picker__list {
	position: relative; list-style: none; margin: 0; padding: var(--sp-1); max-height: 16rem; overflow-y: auto;
	border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
}
.picker__head { padding: var(--sp-2) var(--sp-2) 2px; color: var(--ink-soft); font-size: var(--fs-2xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.picker__opt { padding: 6px var(--sp-2); border-radius: var(--radius-sm); font-size: var(--fs-md); cursor: pointer; }
.picker__opt:hover, .picker__opt.is-active { background: var(--hover); }
.picker__opt[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.picker__none { margin: 0 0 var(--sp-3); padding: 6px var(--sp-2); color: var(--ink-soft); font-size: var(--fs-md); }
.picker__bar { display: flex; align-items: center; gap: var(--sp-3); max-width: 36rem; margin: 0 0 10px; }
.picker__bar input { flex: 1; min-width: 0; }
.picker__count { margin: 0; color: var(--ink-soft); font-size: var(--fs-sm); white-space: nowrap; }

/* ---------- sign in ---------- */
/* The one page an anonymous visitor can reach: a single box, narrower than
   the builder's, with more room inside it. */
.panel {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius); padding: var(--sp-6); margin-bottom: var(--sp-8);
}
.panel--login { max-width: 23rem; margin: clamp(2rem, 9vh, 5rem) auto; padding: var(--sp-8) var(--sp-6) var(--sp-6); }
.panel--login h1 { font-size: var(--fs-2xl); margin-bottom: var(--sp-5); }
.panel--login .lede { margin-bottom: var(--sp-5); }
.panel__art { display: block; width: 100%; height: auto; margin: 0 0 22px; }
.panel--login .err { margin: 0 0 var(--sp-4); }
/* Spacing the form rather than each field keeps the gaps even whether or not
   the apex's staged password half is showing. */
.panel--login form { display: grid; gap: 14px; }
/* That staging wraps the password in a span, which would otherwise sit inline
   between two block fields. [hidden] still outranks this - it is !important. */
.panel--login #password-field { display: block; }
/* Boxes worth aiming at with a thumb, and a submit across the whole measure:
   the panel is the entire page here, and this is the only thing to press on
   it. Scoped to the form so sign-up's mailto button keeps its own width. */
.panel--login .fld input { min-height: 44px; }
.panel--login form .btn { width: 100%; min-height: 44px; font-size: var(--fs-md); margin-top: 2px; }

/* The apex is always light, and sets its own palette on body: the tokens it
   does not set follow it here rather than the device's dark scheme. */
body.apex {
	--surface-head: var(--surface-2); --hover: rgb(0 0 0 / .04); --line-strong: #d6d3cf;
	--danger: #b42318; --danger-bg: #fdecea; --warn-bg: #fdf3e1; --warn-ink: #8a4b0a; --ok-bg: #e7f4ea; --ok-ink: #1d6b3a;
	--shadow-pop: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px rgb(0 0 0 / .10);
	--shadow-modal: 0 24px 64px rgb(0 0 0 / .22); --shadow-lift: 0 1px 4px rgb(0 0 0 / .25); --scrim: rgb(9 9 11 / .45);
}

/* ---------- the edit modal ---------- */
/* A list page with ?edit=<id> re-renders with one form in a modal. Backdrop
   and close are ordinary links back to the clean URL. Editing a record, the
   panel is a sheet at the right edge, full height, and the list stays in
   view beside it; the confirm modal stays in the middle. Head and foot are
   bars, the foot pinned to the bottom. */

.modal { position: fixed; inset: 0; z-index: 50; overflow-y: auto; padding: 0; }
.modal__backdrop { position: fixed; inset: 0; background: var(--scrim); }
.modal__panel {
	--pad: var(--sp-6);
	position: relative; display: flex; flex-direction: column;
	margin: 0 0 0 auto; width: min(640px, 100%); min-height: 100%;
	background: var(--surface); border: 0; border-left: 1px solid var(--line);
	box-shadow: var(--shadow-modal); padding: 0 var(--pad);
}
.modal__head {
	display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
	min-height: 56px; margin: 0 calc(-1 * var(--pad)) var(--sp-5); padding: 10px var(--pad);
	background: var(--surface-head); border-bottom: 1px solid var(--line);
}
.modal__head h2 { font-size: var(--fs-lg); }
.modal__close {
	display: grid; place-items: center; width: 32px; height: 32px; margin-right: -6px;
	border-radius: var(--radius); color: var(--ink-soft); text-decoration: none;
	font-size: var(--fs-xl); line-height: 1;
}
.modal__close:hover { color: var(--ink); background: var(--hover); }
/* An open modal carries the messages itself; the page's copy is behind the backdrop. */
.shell__main:has(.modal) > .messages, body:has(.modal) > .messages { display: none; }
.modal__panel .messages { max-width: none; margin: 0 0 var(--sp-2); padding: 0; }

/* The modal's footer: hairline above, destructive action alone on the left,
   Cancel/Save (or Cancel/Delete in the confirm modal) grouped right. */
.modal__foot {
	flex: 1 1 100%; display: flex; align-items: center;
	justify-content: space-between; gap: var(--sp-3);
	margin: var(--sp-6) calc(-1 * var(--pad)) 0; padding: var(--sp-3) var(--pad);
	background: var(--surface-head); border-top: 1px solid var(--line);
}
.modal__foot-main { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
/* A footer button that posts needs a form around it; the form itself is not
   a layout box, so it hands its button straight to the flex row. */
.modal__foot-main form { display: contents; }
.modal__foot--confirm { justify-content: flex-end; }
.modal__panel:not(.modal__panel--confirm) .modal__foot {
	position: sticky; bottom: 0; z-index: 2; margin-top: auto; flex: none;
}
.modal__panel:not(.modal__panel--confirm) > form { flex: 1; display: flex; flex-direction: column; }
.modal__panel:not(.modal__panel--confirm) > form:not(:last-child) { flex: none; }
.modal__panel:not(.modal__panel--confirm) > form > .modal__foot { margin-top: auto; }

.modal__panel--confirm {
	--pad: var(--sp-5);
	margin: 14vh auto 40px; width: min(440px, calc(100% - 32px)); min-height: 0;
	border: 1px solid var(--line); border-radius: var(--radius);
}
.modal__panel--confirm .modal__head { border-radius: var(--radius) var(--radius) 0 0; }
.modal__panel--confirm > h2 { margin: var(--pad) 0 0; font-size: var(--fs-lg); line-height: 1.35; }
.modal__panel--confirm .modal__foot { border-radius: 0 0 var(--radius) var(--radius); }
.confirm__note { color: var(--ink-soft); font-size: var(--fs-md); margin: var(--sp-2) 0 0; max-width: 44ch; }

@media (prefers-reduced-motion: no-preference) {
	.modal__panel:not(.modal__panel--confirm) { animation: sheet-in .18s ease-out; }
	.modal__backdrop { animation: fade-in .18s ease-out; }
}
@keyframes sheet-in { from { transform: translateX(28px); opacity: .4; } }
@keyframes fade-in { from { opacity: 0; } }

/* The plain modal form: owners, reviews, photos. Fields stack. */
.modal__form { display: flex; flex-direction: column; gap: 14px; }
.modal__form .hint { margin: 0; }
.modal__form .warn { margin: 0; font-size: var(--fs-sm); color: var(--warn-ink); }
.modal__part {
	margin: var(--sp-5) calc(-1 * var(--pad)) var(--sp-3); padding: var(--sp-2) var(--pad);
	font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft);
	font-family: var(--font); background: var(--surface-head); border-block: 1px solid var(--line);
}
.modal__photo {
	width: 100%; max-height: 320px; object-fit: cover; display: block;
	border-radius: var(--radius); background: var(--surface-2);
}

/* The record form: the photo as a row above the fields, and the fields
   spaced so a floated label never meets the box above. */
.item__form { display: flex; flex-direction: column; gap: 22px; padding: 0; }
.item__fields { flex: 1 1 340px; min-width: 0; display: grid; gap: var(--sp-4); align-content: start; }
.item__fields > .row { margin: 0; }
.item__photo {
	position: relative; flex: none; display: grid; grid-template-columns: 112px 1fr; column-gap: var(--sp-4); row-gap: var(--sp-1); align-content: start;
}
.item__photo img, .item__photo--empty {
	width: 112px; height: 112px; grid-row: 1 / span 3; object-fit: cover;
	border-radius: var(--radius); display: block; background: var(--surface-2); border: 1px solid var(--line);
}
.item__photo--empty { color: var(--ink-soft); display: grid; place-items: center; font-size: var(--fs-xs); }
.item__photo > label { grid-column: 2; margin: 0; }
.upload { display: block; margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--ink-soft); }
.upload input { width: auto; max-width: 100%; }
.upload span { display: block; margin-top: 2px; }

/* Billing: the plan's feature checkboxes, and the Payment Element page. */
.feature-set { border: 0; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.feature-set legend { font-size: var(--fs-sm); color: var(--ink-soft); margin-bottom: var(--sp-1); padding: 0; }
.feature-set .hint { margin: 0 0 0 6px; display: inline; }
.pay { max-width: 32rem; }
.pay-form { margin-top: 18px; }
.pay-form__note { margin: 18px 0 0; color: var(--ink-soft); }
.pay-form__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* Hours in a week: a day per row. */
.day-head { margin: 22px 0 6px; font-size: var(--fs-sm); color: var(--ink-soft); }
.week { display: grid; gap: var(--sp-4); margin: var(--sp-2) 0 var(--sp-4); }
.week__row { display: grid; grid-template-columns: 3rem repeat(4, 1fr); gap: 10px; align-items: center; }
.week__row > * { min-width: 0; }
.week__row input[type="time"] { padding-left: 8px; padding-right: 4px; }
@media (max-width: 620px) { .week__row { grid-template-columns: 3rem 1fr 1fr; } .week__row > :nth-child(4) { grid-column-start: 2; } }
.week__day { color: var(--ink-soft); font-size: var(--fs-md); }

/* A booking: pick the service and person, then a free slot. */
.booking-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: center; }
.booking-pick .btn { justify-self: start; }
.booking-pick > .fld:first-of-type { grid-column: 1 / -1; }
@media (max-width: 620px) { .booking-pick { grid-template-columns: 1fr; } }
.slot-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.slot {
	position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 var(--sp-3);
	border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
}
.slot:hover { border-color: var(--ink-soft); background: var(--hover); }
.slot input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.slot:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slot:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.booking-outside { display: grid; grid-template-columns: auto 10rem; gap: var(--sp-3); align-items: center; margin: 0 0 10px; }
@media (max-width: 620px) { .booking-outside { grid-template-columns: 1fr; } .booking-outside .check { white-space: normal; } }
.away-add { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: var(--sp-2) 0 14px; }
.booking-client { display: flex; gap: var(--sp-2); }
.booking-client input { flex: 1; min-width: 0; }
.booking-client__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: var(--fs-md); }
.booking-client__list span { color: var(--ink-soft); }
.away-list { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: grid; }
.away-list li { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: center; min-height: 40px; padding: 6px 0; border-top: 1px solid var(--line); }
.mail-body {
	margin: 0 0 var(--sp-4); padding: var(--sp-3) 14px; max-height: 50vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
	font: inherit; background: var(--surface-head); border: 1px solid var(--line); border-radius: var(--radius);
}

/* The order in its modal. */
.order-line { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-variant-numeric: tabular-nums; }
.order-line td { padding: 7px 0; border-top: 1px solid var(--line); vertical-align: baseline; }
.order-line__n { width: 3.2rem; color: var(--ink-soft); }
.order-line__sum { text-align: right; white-space: nowrap; }
.order-line tfoot td { border-top-color: var(--ink); font-weight: 600; }
.order-note { white-space: pre-line; font-weight: 600; }
/* The forward step comes first in the form, for Enter, and shows on the right. */
.order-panel .modal__foot, .order-panel .modal__foot-main { flex-direction: row-reverse; }
.order-panel .modal__foot-main { margin-left: 0; }

/* The re-import page: a group per kind of change, a row per change, and a
   checkbox on each row. A conflict row shows three values. */
.import-summary { margin: 0 0 22px; }
.import-summary p { margin: 0 0 var(--sp-1); max-width: 68ch; }
.import-summary__at { color: var(--ink-soft); font-size: var(--fs-sm); }
.import-group { margin: 28px 0 0; }
.import-group__head { font-size: var(--fs-lg); margin: 0 0 6px; }
.import-group__head + .block__note { margin: 0 0 var(--sp-2); }
.import-list { list-style: none; margin: 0; padding: 0; }
.import-row {
	display: flex; align-items: flex-start; gap: var(--sp-3);
	padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer;
}
.import-row:hover .import-row__name { text-decoration: underline; text-underline-offset: 3px; }
.import-row input { flex: none; margin-top: 3px; }
.import-row__text { flex: 1; min-width: 0; }
.import-row__name { display: block; font-weight: 500; }
.import-row__values { margin: 6px 0 0; gap: var(--sp-1); font-size: var(--fs-md); }
.import-row__values dd { min-width: 0; overflow-wrap: anywhere; }
.import-hours { margin: 6px 0 0; border-collapse: collapse; font-size: var(--fs-md); }
.import-hours th, .import-hours td { text-align: left; padding: 2px var(--sp-4) 2px 0; font-weight: 400; white-space: nowrap; }
.import-hours thead th { color: var(--ink-soft); font-size: var(--fs-xs); }
.import-hours tbody th { color: var(--ink-soft); }
@media (max-width: 620px) {
	.import-row__values div { flex-direction: column; gap: 0; }
	.import-row__values dt { flex: none; }
	.import-hours { font-size: var(--fs-xs); }
	.import-hours th, .import-hours td { padding-right: var(--sp-2); white-space: normal; }
	.import-hours td { white-space: nowrap; }
}

/* The quote letter's editor (Trix), drawn as one of the builder's fields:
   the same border, background, notched label and focus ring, with the
   toolbar inside the box. Trix's own stylesheet is written for a white page,
   so its colours are replaced here with the theme's, and its dark icons are
   inverted in the dark theme. File attachments are refused, so their
   buttons go. */
.letter {
	position: relative; background: var(--surface); color: var(--ink);
	border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.letter:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.letter__label {
	position: absolute; left: 7px; top: 0; transform: translateY(-50%);
	padding: 0 4px; background: linear-gradient(transparent calc(50% - 2px), var(--surface) calc(50% - 2px));
	color: var(--ink-soft); font-size: var(--fs-2xs); font-weight: 500; pointer-events: none;
}
.letter:focus-within .letter__label { color: var(--ink); }
.letter trix-toolbar { padding: 14px var(--sp-2) 0; border-bottom: 1px solid var(--line); background: var(--surface-head); border-radius: var(--radius) var(--radius) 0 0; }
.letter trix-toolbar .trix-button-group {
	margin-bottom: var(--sp-2); background: var(--surface);
	border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.letter trix-toolbar .trix-button-group--file-tools { display: none; }
.letter trix-toolbar .trix-button {
	color: var(--ink-soft); background: transparent;
	border-bottom: 0; border-left-color: var(--line);
}
.letter trix-toolbar .trix-button:not(:disabled):hover { background: var(--hover); }
.letter trix-toolbar .trix-button.trix-active { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--ink); }
.letter trix-toolbar .trix-button:disabled { color: var(--ink-soft); opacity: .45; }
.letter trix-toolbar .trix-dialog {
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.letter trix-toolbar .trix-dialog .trix-input { background: var(--surface); color: var(--ink); border-color: var(--line-strong); border-radius: var(--radius); }
.letter trix-toolbar .trix-dialog .trix-button { border: 1px solid var(--line-strong); border-radius: var(--radius); margin-left: 6px; }
.letter trix-editor {
	min-height: 12rem; padding: var(--sp-3); border: 0; border-radius: 0 0 var(--radius) var(--radius);
	background: transparent; color: var(--ink); font: inherit;
}
.letter .trix-content a { color: var(--ink); }
.letter .trix-content blockquote { border-left-color: var(--line); color: var(--ink-soft); }
.letter .trix-content pre { background: var(--surface-2); color: var(--ink); border-radius: var(--radius-sm); }
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .letter trix-toolbar .trix-button--icon::before { filter: invert(1); }
}
:root[data-theme="dark"] .letter trix-toolbar .trix-button--icon::before { filter: invert(1); }

/* ---------- store list ---------- */

.store-grid {
	list-style: none; padding: 0; margin: 0;
	display: grid; gap: var(--sp-4);
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.store-card {
	background: var(--surface); border: 1px solid var(--line);
	border-radius: var(--radius); overflow: hidden;
	/* Anchors the live-site mark, which sits outside the card's own link. */
	position: relative; transition: border-color .12s;
}
.store-card:hover { border-color: var(--line-strong); }
/* Opens the client's public site. Small and in the corner - the card's main
   job is still to open the editor. */
.store-card__live {
	position: absolute; top: var(--sp-2); right: var(--sp-2); z-index: 1;
	width: 28px; height: 28px; border-radius: var(--radius);
	display: flex; align-items: center; justify-content: center;
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line);
	text-decoration: none; font-size: var(--fs-md); line-height: 1;
}
.store-card__live:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.store-card__link { text-decoration: none; color: inherit; display: block; }
.store-card__link:hover h2, .store-card__link:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.store-card__media { position: relative; border-bottom: 1px solid var(--line); }
.store-card__img { width: 100%; height: 116px; object-fit: cover; display: block; }
.store-card__img--empty { background: var(--surface-2); }
.store-card__body { padding: var(--sp-3) 14px; }
.store-logo {
	width: 56px; height: 56px; object-fit: contain;
	border-radius: var(--radius-sm); background: var(--surface-2);
	border: 1px solid var(--line); padding: var(--sp-1); flex: 0 0 auto;
}
.store-card__logo {
	position: absolute; left: 10px; bottom: 10px; width: 44px; height: 44px;
	padding: 3px; background: var(--surface); box-shadow: var(--shadow-lift);
}
/* The add-a-site card: an invitation, not a store. */
.store-card--add { border-style: dashed; border-color: var(--line-strong); background: none; }
.store-card__add {
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	gap: var(--sp-1); min-height: 176px; height: 100%;
	color: var(--ink-soft); text-decoration: none; font-size: var(--fs-md);
}
.store-card__plus { font-size: var(--fs-3xl); font-weight: 300; line-height: 1; }
.store-card--add:hover { border-color: var(--ink); }
.store-card--add:hover .store-card__add { color: var(--ink); }

/* ---------- photos ---------- */

.photo-add {
	display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
	padding: var(--sp-3);
	background: var(--surface-head); border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.photo-add input[type="file"] { flex: 1 1 18rem; min-width: 0; }
.photo-grid {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: var(--sp-3);
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.photo {
	border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
	background: var(--surface); display: flex; flex-direction: column;
}
/* Hidden photos stay legible - greying them out entirely makes it hard to
   tell what you're about to un-hide. */
.photo--hidden { opacity: .55; }
.photo__img {
	width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
	background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.photo__cap { padding: var(--sp-2) 10px; font-size: var(--fs-sm); }
.photo__row { display: flex; gap: var(--sp-3); align-items: flex-end; }

/* ---------- the calendar ---------- */
/* The front desk's book. A grid row is five minutes; the template places
   each cell, block and time off by column and row. The frame scrolls both
   ways, so the names and the times stay in view. */
.cal-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-nav__step { padding-left: 10px; padding-right: 10px; }
.cal-nav .btn[aria-current] { background: var(--surface-2); }
.cal-nav__day { margin-left: var(--sp-2); font-family: var(--head); font-size: var(--fs-lg); font-weight: 500; }
.cal-jump { display: inline-flex; gap: 6px; margin: 0 0 0 var(--sp-2); }
.cal-jump input[type="date"] { width: auto; min-height: 32px; padding: 4px var(--sp-2); }
.cal-allday { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 var(--sp-3); }
.cal-allday__label { color: var(--ink-soft); font-size: var(--fs-sm); margin-right: var(--sp-1); }
.cal-frame {
	overflow: auto; max-height: max(26rem, calc(100dvh - 15rem));
	border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.cal { --cal-row: 7px; --cal-gutter: 3.5rem; display: grid; min-width: min-content; }
.cal__corner, .cal__head { position: sticky; top: 0; z-index: 4; background: var(--surface-head); border-bottom: 1px solid var(--line); }
.cal__corner { left: 0; z-index: 5; }
.cal__head { display: grid; gap: 1px; padding: var(--sp-2) 10px; border-left: 1px solid var(--line); min-width: 0; }
.cal__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal__head--mine .cal__name { font-weight: 600; }
.cal__shift { color: var(--ink-soft); font-size: var(--fs-xs); }
.cal__hour {
	position: sticky; left: 0; z-index: 3; background: var(--surface);
	padding: 3px var(--sp-2) 0 0; text-align: right; color: var(--ink-soft); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums;
	border-top: 1px solid var(--line);
}
.cal__slot { border-left: 1px solid var(--line); border-top: 1px dotted var(--line); }
.cal__slot--hour { border-top-style: solid; }
.cal__slot--off { background: var(--surface-2); }
.cal__away {
	z-index: 1; margin: 0 0 0 1px; padding: 3px var(--sp-2); overflow: hidden;
	display: flex; flex-direction: column; color: var(--ink-soft); font-size: var(--fs-xs);
	background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--bg) 6px 12px);
}
.cal__block {
	z-index: 2; margin: 1px 5px 1px var(--sp-1); padding: 3px var(--sp-2); min-height: 0; overflow: hidden;
	display: flex; flex-direction: column; gap: 1px; border-radius: var(--radius-sm);
	font-size: var(--fs-xs); line-height: 1.25; text-decoration: none;
	background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-left: 3px solid var(--ink);
}
.cal__block:hover, .cal__block:focus-visible { background: var(--surface-2); border-color: var(--ink-soft); border-left-color: var(--ink); }
.cal__block--requested, .cal__block--requested:hover, .cal__block--requested:focus-visible { border-style: dashed; border-color: var(--ink); }
.cal__block--no_show { background: var(--surface-2); color: var(--ink-soft); border-left-color: var(--ink-soft); }
.cal__block--no_show:hover, .cal__block--no_show:focus-visible { border-left-color: var(--ink-soft); }
.cal__block--short { flex-direction: row; align-items: baseline; gap: 6px; padding-top: 1px; padding-bottom: 0; }
.cal__block--short .cal__time { flex: none; }
.cal__block .flag { font-size: var(--fs-2xs); }
.cal__time { font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; opacity: .85; }
.cal__who { font-weight: 600; }
.cal__who, .cal__what, .cal__time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-allday .cal__block { margin: 0; display: inline-block; }
.cal__now { z-index: 3; align-self: start; border-top: 2px solid var(--ink); pointer-events: none; position: relative; }
.cal__now::before { content: ""; position: absolute; left: 0; top: -6px; width: 4px; height: 10px; background: var(--ink); }
a.cal__slot:hover, a.cal__slot:focus-visible { box-shadow: inset 0 0 0 1px var(--ink-soft); background: var(--hover); outline: 0; }

/* The calendar's week: a row for each staff member, a cell for each day. */
.cal-week { border-collapse: collapse; width: 100%; min-width: 56rem; table-layout: fixed; }
.cal-week th, .cal-week td { border: 1px solid var(--line); vertical-align: top; text-align: left; padding: 0; }
.cal-week tr > :first-child { border-left: 0; }
.cal-week tr > :last-child { border-right: 0; }
.cal-week thead th { border-top: 0; position: sticky; top: 0; z-index: 2; background: var(--surface-head); font-weight: 500; font-size: var(--fs-sm); }
.cal-week thead a { display: block; padding: var(--sp-2) 10px; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-week thead a:hover { background: var(--hover); }
.cal-week tbody th { padding: 10px; font-weight: 500; width: 8rem; position: sticky; left: 0; z-index: 1; background: var(--surface); }
.cal-week thead .cal-week__corner { width: 8rem; left: 0; z-index: 3; }
.cal-week__today { box-shadow: inset 0 2px 0 var(--ink); }
.cal-week__off { background: var(--surface-2); }
.cal-week__cell { display: flex; flex-direction: column; gap: 3px; min-height: 5.5rem; padding: 7px var(--sp-2); color: var(--ink); text-decoration: none; font-size: var(--fs-xs); }
.cal-week__cell:hover, .cal-week__cell:focus-visible { box-shadow: inset 0 0 0 1px var(--ink-soft); outline: 0; }
.cal-week__shift { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cal-week__away { color: var(--ink-soft); padding: 1px 6px; border-radius: var(--radius-sm); background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--bg) 6px 12px); }
.cal-week__booking {
	padding: 2px 6px; border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
	border: 1px solid var(--line-strong); border-left: 3px solid var(--ink); line-height: 1.3;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere;
}
.cal-week__booking--requested { border-style: dashed; border-color: var(--ink); }
.cal-week__booking--no_show { background: var(--surface-2); color: var(--ink-soft); border-left-color: var(--ink-soft); text-decoration: line-through; }

/* ---------- Today: one column for a phone held in one hand ---------- */
/* A box per part: hours, what is sold, the print files. Each group of
   rows opens with a sub-bar, and the rows run to the box's edges. */
.today { max-width: 34rem; }
.today__part {
	margin: 0 0 var(--sp-6); padding: 0 var(--pad) var(--pad);
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.today__part + .today__part { margin-top: 0; }
.today__part, .today__section { scroll-margin-top: 72px; }
.today__head {
	display: flex; align-items: center; min-height: 44px; margin: 0 calc(-1 * var(--pad)); padding: 7px var(--pad);
	font-size: var(--fs-md); background: var(--surface-head); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.today__section {
	margin: var(--pad) calc(-1 * var(--pad)) 0; padding: 6px var(--pad);
	font-family: var(--font); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft);
	background: var(--surface-head); border-block: 1px solid var(--line);
}
.today__section + * { margin-top: -1px; }
.today__list { list-style: none; margin: 0 calc(-1 * var(--pad)); padding: 0; }
.today__list:last-child { margin-bottom: calc(-1 * var(--pad)); }
.today__list > li { padding-inline: var(--pad); }
.today__row {
	display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--sp-1) var(--sp-2);
	min-height: 60px; padding-block: 6px; border-top: 1px solid var(--line); scroll-margin-top: 96px;
}
.today__name { font-weight: 500; overflow-wrap: anywhere; }
.today__row--off .today__name { color: var(--ink-soft); }
.today__price {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
	color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap;
	text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px;
}
.today__price:hover { text-decoration-color: var(--ink); }
.today__toggle { min-height: 44px; min-width: 7rem; padding: 0 10px; font-size: var(--fs-md); }
.today__row--off .today__toggle { border-color: var(--ink); }
.today__edit { grid-column: 1 / -1; display: grid; gap: var(--sp-3); padding: 6px 0 10px; }
.today__edit .fld input, .today__form .fld input { min-height: 48px; font-size: var(--fs-lg); }
.today .messages { grid-column: 1 / -1; margin: 0; padding: 0; }
.today__act { display: flex; justify-content: flex-end; gap: var(--sp-2); }
.today__act .btn { min-height: 44px; min-width: 6rem; font-size: var(--fs-md); }
/* A row that carries the messages hides the copy at the top of the page. */
.shell__main:has(.today .messages) > .messages { display: none; }
.today__pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
/* Hours: today's state and the one button, then the other days. */
.today__now { display: grid; gap: 10px; padding: var(--pad) 0 0; }
.today__when {
	display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3);
	min-height: 44px; padding: 10px 0; color: var(--ink); text-decoration: none;
}
.today__when strong { font-variant-numeric: tabular-nums; font-family: var(--head); font-weight: 500; font-size: var(--fs-xl); letter-spacing: -.02em; }
a.today__when:hover strong { text-decoration: underline; text-underline-offset: 4px; }
.today__now--off .today__when strong { color: var(--ink-soft); }
.today__big { width: 100%; min-height: 52px; font-size: var(--fs-lg); }
.today__booked {
	display: inline-flex; align-items: center; min-height: 44px; color: var(--ink);
	text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px;
}
.today__booked:hover { text-decoration-color: var(--ink); }
.today__add { display: inline-flex; align-items: center; min-height: 44px; margin: var(--sp-1) 0 10px; }
.today__row--day { grid-template-columns: 1fr; }
.today__day {
	display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3);
	min-height: 48px; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums;
}
a.today__day:hover .today__name { text-decoration: underline; text-underline-offset: 4px; }
.today__list > li:has(> a.today__day):hover { background: var(--hover); }
.today__none { padding: 14px 0; border-top: 1px solid var(--line); color: var(--ink-soft); }
.today__check { min-height: 44px; font-size: var(--fs-lg); }

/* ---------- orders ---------- */
/* The Orders screen, for a tablet by the counter: a column each for New,
   Accepted and Ready, a ticket for each order. A new ticket has an ink bar
   on its left, and a pickup time gone by is red. The columns stack on a
   phone. */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.board__col {
	min-width: 0; padding: 0 var(--sp-2) var(--sp-2); container-type: inline-size;
	background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.board__head {
	display: flex; align-items: center; justify-content: space-between; min-height: 44px;
	margin: 0 calc(-1 * var(--sp-2)) var(--sp-2); padding: 0 var(--sp-3);
	font-family: var(--head); font-weight: 500; font-size: var(--fs-md); letter-spacing: -.005em;
	background: var(--surface-head); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.board__n {
	min-width: 1.6rem; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
	color: var(--ink-soft); font-family: var(--font); font-size: var(--fs-xs); font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.board__n--hot { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.board__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board__empty { margin: 0; padding: var(--sp-5) var(--sp-2); text-align: center; color: var(--ink-soft); font-size: var(--fs-sm); }
.board__done { grid-column: 1 / -1; margin-top: 10px; }

.ticket {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 10px 10px var(--sp-3);
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.ticket--new { box-shadow: inset 3px 0 0 var(--ink); }
.ticket__open {
	flex: 1 1 100%; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3);
	color: inherit; text-decoration: none;
}
.ticket__open:hover .ticket__name { text-decoration: underline; text-underline-offset: 3px; }
.ticket__no {
	min-width: 2ch; text-align: center; font-family: var(--head); font-weight: 500; font-size: var(--fs-2xl); line-height: 1;
	letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.ticket__main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ticket__name, .ticket__note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticket__name { font-weight: 600; }
.ticket__meta { color: var(--ink-soft); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ticket__note { font-size: var(--fs-xs); }
.ticket__time { text-align: right; font-family: var(--head); font-weight: 500; font-size: var(--fs-lg); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ticket__time small { display: block; color: var(--ink-soft); font-size: var(--fs-2xs); }
.ticket__time--late { color: var(--danger); }
.ticket__act { flex: none; margin: 0 0 0 auto; }
/* A wide column has room for the button on the ticket's own line. */
@container (min-width: 440px) {
	.ticket { flex-wrap: nowrap; }
	.ticket__open { flex: 1 1 auto; }
}
@media (max-width: 820px) {
	.board { grid-template-columns: 1fr; }
}

/* ---------- traffic ---------- */
/* One ink, hairlines, and the numbers loud. */
.chart { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2) 10px; margin: 6px 0 14px; }
.chart__y {
	display: flex; flex-direction: column; justify-content: space-between; height: 240px;
	font-size: var(--fs-2xs); color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums;
}
.chart__y span { transform: translateY(-50%); }
.chart__y span:last-child { transform: translateY(50%); }
.chart__plot {
	position: relative; height: 240px; display: flex; align-items: flex-end; gap: 3px;
	border-bottom: 1px solid var(--ink-soft);
	background: linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 50%;
}
.chart__plot--dense { gap: 1px; }
.chart__day { position: relative; flex: 1 1 0; height: 100%; display: flex; justify-content: center; outline: none; cursor: default; }
.chart__v, .chart__t { position: absolute; bottom: 0; transition: background .1s ease; }
.chart__v { width: min(100%, 26px); height: var(--v); background: color-mix(in srgb, var(--ink) 16%, transparent); }
.chart__t { width: min(50%, 12px); height: var(--t); background: var(--ink); }
.chart__day:hover .chart__v, .chart__day:focus-visible .chart__v { background: color-mix(in srgb, var(--ink) 30%, transparent); }
.chart__tip {
	position: absolute; bottom: calc(max(var(--v), var(--t)) + 10px); left: 50%; transform: translate(-50%, 4px);
	display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; white-space: nowrap;
	background: var(--ink); color: var(--bg); border-radius: var(--radius); font-size: var(--fs-xs); line-height: 1.3;
	opacity: 0; pointer-events: none; z-index: 2; transition: opacity .12s ease, transform .12s ease;
}
.chart__tip b { font-weight: 600; }
.chart__day:hover .chart__tip, .chart__day:focus-visible .chart__tip { opacity: 1; transform: translate(-50%, 0); }
.chart__day:nth-child(-n+4) .chart__tip { left: 0; transform: translate(0, 4px); }
.chart__day:nth-child(-n+4):hover .chart__tip, .chart__day:nth-child(-n+4):focus-visible .chart__tip { transform: none; }
.chart__day:nth-last-child(-n+4) .chart__tip { left: auto; right: 0; transform: translate(0, 4px); }
.chart__day:nth-last-child(-n+4):hover .chart__tip, .chart__day:nth-last-child(-n+4):focus-visible .chart__tip { transform: none; }
.chart__x { display: flex; gap: 3px; height: 1.2em; font-size: var(--fs-2xs); color: var(--ink-soft); }
.chart__plot--dense + * + .chart__x { gap: 1px; }
.chart__x span { position: relative; flex: 1 1 0; }
.chart__x i { position: absolute; left: 50%; transform: translateX(-50%); font-style: normal; white-space: nowrap; }
.chart__x span:last-child i { left: auto; right: 0; transform: none; }
.chart__table summary { font-size: var(--fs-sm); color: var(--ink-soft); cursor: pointer; }
.chart__table .table { margin-top: var(--sp-3); }

.page-table { width: 100%; table-layout: fixed; }
.page-table th:first-child { width: 44%; }
.page-table td:first-child { position: relative; }
.page-table code { position: relative; z-index: 1; font-size: var(--fs-sm); }
.page-table__bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--ink); opacity: .7; }
.block > .page-table .page-table__bar { left: 0; }

@media (max-width: 620px) {
	.chart__plot, .chart__y { height: 180px; }
	.chart__plot { gap: 2px; }
	.chart__plot--dense { gap: 0; }
}

/* ---------- the apex's shared pieces ---------- */
/* The apex's footer and its legal pages: marketing.css dresses them, these
   rules lay them out. */
.site-foot { border-top: 1px solid var(--line); background: var(--surface); }
.site-foot__inner {
	max-width: 980px; margin: 0 auto; padding: 26px 20px 6px;
	display: flex; justify-content: space-between; align-items: flex-start;
	gap: var(--sp-6); flex-wrap: wrap;
}
.site-foot__inner .meta { margin-top: var(--sp-1); }
.site-foot__nav { display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap; padding-top: 3px; }
.site-foot__nav a { color: var(--ink-soft); text-decoration: none; font-size: var(--fs-md); }
.site-foot__nav a:hover { color: var(--ink); }
.site-foot__legal {
	max-width: 980px; margin: 0 auto; padding: 0 20px 22px;
	color: var(--ink-soft); font-size: var(--fs-xs);
}
/* Legal pages: a single readable column. */
.legal { max-width: 68ch; }
.legal h1 { margin-bottom: 6px; }
.legal h2 { font-size: var(--fs-lg); margin: 26px 0 6px; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 1.2em; margin: var(--sp-2) 0; }
.legal li { margin: 6px 0; }
.legal a { color: var(--accent); }

/* The site file editor, laid out as a code editor: the explorer beside the
   open file, its path and actions above, problems and a status bar below.
   On a wide screen it fills the content area and only the editor scrolls. */
.ide {
	--row: color-mix(in srgb, var(--ink) 6%, transparent);
	--pick: color-mix(in srgb, #3d8fd6 22%, transparent);
	--syn-tag: #800000; --syn-attr: #e50000; --syn-string: #a31515; --syn-comment: #008000;
	--syn-keyword: #0000ff; --syn-number: #098658; --syn-def: #795e26; --syn-var: #001080;
	--syn-prop: #0451a5; --syn-atom: #0000ff; --syn-builtin: #267f99; --syn-meta: #af00db;
	flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
	border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .ide {
		--syn-tag: #569cd6; --syn-attr: #9cdcfe; --syn-string: #ce9178; --syn-comment: #6a9955;
		--syn-keyword: #c586c0; --syn-number: #b5cea8; --syn-def: #dcdcaa; --syn-var: #9cdcfe;
		--syn-prop: #9cdcfe; --syn-atom: #569cd6; --syn-builtin: #4ec9b0; --syn-meta: #d7ba7d;
	}
}
:root[data-theme="dark"] .ide {
	--syn-tag: #569cd6; --syn-attr: #9cdcfe; --syn-string: #ce9178; --syn-comment: #6a9955;
	--syn-keyword: #c586c0; --syn-number: #b5cea8; --syn-def: #dcdcaa; --syn-var: #9cdcfe;
	--syn-prop: #9cdcfe; --syn-atom: #569cd6; --syn-builtin: #4ec9b0; --syn-meta: #d7ba7d;
}
/* The editor is the box; the section around it is not one. */
.block.ide-page { padding: 0; border: 0; background: none; }
@media (min-width: 761px) {
	body:has(.ide) { height: 100vh; }
	body:has(.ide) .shell__main main { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; padding-bottom: 20px; }
	.ide-page { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; }
}
.ide__side { overflow: auto; overflow-x: hidden; background: var(--bg); border-right: 1px solid var(--line); padding: 4px 0 12px; font-size: var(--fs-sm); }
.ide__head { margin: 0; padding: 8px 12px 4px; font-size: var(--fs-2xs); font-weight: 600; line-height: 1.4; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list .file-list { margin-left: 15px; padding-left: 6px; border-left: 1px solid transparent; }
.ide__side:hover .file-list .file-list { border-left-color: var(--line); }
.file-list summary, .file-list a {
	display: flex; align-items: center; gap: 6px; padding: 2px 10px 2px 12px; line-height: 1.5;
	color: var(--ink); text-decoration: none; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-list summary { list-style: none; }
.file-list summary::-webkit-details-marker { display: none; }
.file-list summary::before {
	content: ""; flex: 0 0 auto; width: 5px; height: 5px; margin: 0 3px 0 1px;
	border: solid var(--ink-soft); border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg);
}
.file-list details[open] > summary::before { transform: rotate(45deg); margin-top: -3px; }
.file-list summary:hover, .file-list a:hover { background: var(--row); box-shadow: -100vw 0 0 var(--row); }
.file-list a[aria-current] { background: var(--pick); box-shadow: -100vw 0 0 var(--pick); }
.file-list a::before {
	content: ""; flex: 0 0 auto; width: 16px; text-align: center;
	font: 700 .62rem/1 var(--mono); color: var(--ink-soft);
}
.file-list a[href$=".gohtml"]::before, .file-list a[href$=".html"]::before { content: "<>"; color: #e2571e; }
.file-list a[href$=".css"]::before { content: "#"; font-size: .8rem; color: #3d8fd6; }
.file-list a[href$=".js"]::before, .file-list a[href$=".mjs"]::before { content: "JS"; color: #c9a400; }
.file-list a[href$=".json"]::before { content: "{}"; color: #c9a400; }
.file-list a[href$=".ftl"]::before, .file-list a[href$=".txt"]::before { content: "T"; font-size: .72rem; }
.file-list a[href$=".png"]::before, .file-list a[href$=".jpg"]::before, .file-list a[href$=".jpeg"]::before,
.file-list a[href$=".webp"]::before, .file-list a[href$=".gif"]::before, .file-list a[href$=".svg"]::before,
.file-list a[href$=".ico"]::before { content: "*"; font-size: .9rem; color: #a074c4; }

.ide__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ide__bar { display: flex; align-items: stretch; justify-content: space-between; gap: 8px; background: var(--surface-head); border-bottom: 1px solid var(--line); }
.ide__tab {
	display: flex; align-items: center; gap: 4px; min-width: 0; padding: 6px 14px; font-size: var(--fs-sm); color: var(--ink-soft);
	background: var(--surface); box-shadow: inset 0 2px 0 var(--accent); margin-bottom: -1px; overflow: hidden; white-space: nowrap;
}
.ide__tab:empty { background: none; box-shadow: none; }
.ide__tab > span:nth-last-child(2) { color: var(--ink); }
.ide__sep { width: 5px; height: 5px; margin: 0 4px; border: solid var(--ink-soft); border-width: 0 1px 1px 0; transform: rotate(-45deg); }
.ide__dirty { width: 8px; height: 8px; margin-left: 6px; background: var(--ink); }
.ide__dirty[hidden] { display: none; }
.ide__action { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px; padding: 4px 6px; }
.ide__action form { margin: 0; }
.ide .btn { min-height: 26px; padding: 0 var(--sp-2); font-size: var(--fs-xs); }
.ide .btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.ide__edit { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.ide__form { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; }
.ide__text, .ide .CodeMirror { flex: 1; min-height: 0; height: 100%; width: 100%; font: 13px/1.55 var(--mono); tab-size: 4; }
.ide__text { border: 0; resize: none; padding: 8px 12px; background: var(--surface); color: var(--ink); }
.ide__empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 16px; color: var(--ink-soft); text-align: center; overflow-wrap: anywhere; }
.ide__empty svg { width: 64px; height: 64px; fill: none; stroke: var(--ink-soft); opacity: .4; stroke-width: .6; stroke-linejoin: round; stroke-linecap: round; }
.ide__empty span { font-family: var(--head); font-size: var(--fs-lg); }

.ide__problem { max-height: 30%; overflow: auto; border-top: 1px solid var(--line); background: var(--bg); flex: 0 0 auto; }
.ide__problem .ide__head { position: sticky; top: 0; background: var(--bg); }
.ide__problem p { margin: 0; padding: 4px 12px 10px 32px; position: relative; font: 12.5px/1.5 var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.ide__problem p::before {
	content: "x"; position: absolute; left: 12px; top: 6px; width: 13px; height: 13px; border-radius: var(--radius-sm);
	background: var(--danger); color: var(--surface); font: 700 9px/12px var(--mono); text-align: center;
}
.ide__line { border: 0; padding: 0; background: none; font: inherit; color: var(--danger); text-decoration: underline; cursor: pointer; }

.ide__status {
	display: flex; align-items: center; gap: 14px; padding: 2px 12px; min-height: 24px; flex-wrap: wrap;
	font-size: var(--fs-2xs); color: var(--ink-soft); background: var(--surface-head); border-top: 1px solid var(--line);
}
.ide__version { margin-left: auto; }
.ide__live, .ide__draft { display: inline-flex; align-items: center; gap: 5px; }
.ide__live::before, .ide__draft::before { content: ""; width: 7px; height: 7px; background: var(--ok-ink); }
.ide__draft::before { background: var(--warn-ink); }

/* CodeMirror's theme, from the builder's tokens. */
.cm-s-builder.CodeMirror { background: var(--surface); color: var(--ink); }
.cm-s-builder .CodeMirror-gutters { background: var(--surface); border-right: 0; }
.cm-s-builder .CodeMirror-linenumber { color: color-mix(in srgb, var(--ink-soft) 70%, transparent); padding: 0 8px 0 12px; }
.cm-s-builder .CodeMirror-activeline-background { background: var(--row); }
.cm-s-builder .CodeMirror-activeline-gutter .CodeMirror-linenumber { color: var(--ink); }
.cm-s-builder .CodeMirror-cursor { border-left: 2px solid var(--ink); }
.cm-s-builder .CodeMirror-selected, .cm-s-builder.CodeMirror-focused .CodeMirror-selected, .cm-s-builder .CodeMirror-line::selection,
.cm-s-builder .CodeMirror-line > span::selection, .cm-s-builder .CodeMirror-line > span > span::selection { background: var(--pick); }
.cm-s-builder .CodeMirror-matchingbracket { color: inherit !important; outline: 1px solid var(--ink-soft); }
.cm-s-builder .CodeMirror-nonmatchingbracket { color: var(--danger); }
.cm-s-builder .CodeMirror-foldgutter { width: 14px; }
.cm-s-builder .CodeMirror-foldgutter-open, .cm-s-builder .CodeMirror-foldgutter-folded { color: var(--ink-soft); }
.cm-s-builder .CodeMirror-foldgutter-open { opacity: 0; transition: opacity .15s; }
.cm-s-builder .CodeMirror-gutters:hover .CodeMirror-foldgutter-open, .cm-s-builder .CodeMirror-gutter-wrapper:hover .CodeMirror-foldgutter-open { opacity: 1; }
.cm-s-builder .CodeMirror-foldmarker { color: var(--ink-soft); text-shadow: none; font-family: var(--mono); background: var(--surface-2); border-radius: var(--radius-sm); padding: 0 3px; }
.cm-s-builder .CodeMirror-dialog { background: var(--surface-2); color: var(--ink); font-size: var(--fs-xs); padding: 6px 12px; }
.cm-s-builder .CodeMirror-dialog-top { border-bottom: 1px solid var(--line); }
.cm-s-builder .CodeMirror-dialog-bottom { border-top: 1px solid var(--line); }
.cm-s-builder .CodeMirror-dialog input { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: 2px 6px; font-family: var(--mono); }
.cm-s-builder .CodeMirror-dialog button { font: inherit; padding: 1px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
.cm-s-builder .CodeMirror-search-label { color: var(--ink-soft); margin-right: 4px; }
.cm-s-builder .cm-searching { background: color-mix(in srgb, #e2a400 35%, transparent); }
.cm-s-builder .cm-tag { color: var(--syn-tag); }
.cm-s-builder .cm-attribute { color: var(--syn-attr); }
.cm-s-builder .cm-string, .cm-s-builder .cm-string-2 { color: var(--syn-string); }
.cm-s-builder .cm-comment { color: var(--syn-comment); font-style: italic; }
.cm-s-builder .cm-keyword { color: var(--syn-keyword); }
.cm-s-builder .cm-number { color: var(--syn-number); }
.cm-s-builder .cm-def { color: var(--syn-def); }
.cm-s-builder .cm-variable, .cm-s-builder .cm-variable-2, .cm-s-builder .cm-variable-3 { color: var(--syn-var); }
.cm-s-builder .cm-property { color: var(--syn-prop); }
.cm-s-builder .cm-atom, .cm-s-builder .cm-bracket { color: var(--syn-atom); }
.cm-s-builder .cm-builtin, .cm-s-builder .cm-type { color: var(--syn-builtin); }
.cm-s-builder .cm-meta, .cm-s-builder .cm-qualifier { color: var(--syn-meta); }
.cm-s-builder .cm-operator { color: var(--ink); }
.cm-s-builder .cm-error { color: var(--danger); }

@media (max-width: 760px) {
	.ide { grid-template-columns: minmax(0, 1fr); }
	.ide__side { max-height: 38vh; border-right: 0; border-bottom: 1px solid var(--line); }
	.ide__edit { height: 70vh; flex: 0 0 auto; }
	.ide__bar { flex-wrap: wrap; }
	.ide__tab { flex: 1 1 100%; }
	.ide__action { justify-content: flex-start; }
}

/* ==== find: search box, results ==== */
/* A field with a magnifier drawn in ink on its left and the / key that
   reaches it on its right; the matches drop down under it in a box, the
   chosen one marked like the rail's current link. */
.find { position: relative; }
.find::before, .find::after { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; }
.find::before {
	content: ""; left: 10px; width: 14px; height: 14px; background: var(--ink-soft);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat;
}
.find::after {
	content: "/"; right: 8px; min-width: 18px; padding: 0 4px; text-align: center;
	font: 500 var(--fs-2xs)/16px var(--mono); color: var(--ink-soft);
	border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-head);
}
.find:focus-within::after { display: none; }
.find .find__q {
	width: 100%; min-height: 34px; padding: 6px 30px 6px 32px; font-size: var(--fs-sm);
	color: var(--ink); background: var(--surface);
	border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.find .find__q:focus { outline: 0; border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.find__list {
	position: absolute; z-index: 45; top: calc(100% + var(--sp-1)); left: 0; right: 0;
	max-height: 60vh; overflow-y: auto; padding: var(--sp-1);
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-pop);
}
.find__hit {
	display: block; padding: 6px var(--sp-2); border-radius: var(--radius-sm);
	color: var(--ink); text-decoration: none; font-size: var(--fs-sm); line-height: 1.35;
}
.find__hit:hover { background: var(--hover); }
.find__hit[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 2px 0 0 var(--ink); border-radius: 0; }
.find__label, .find__where { display: block; overflow-wrap: anywhere; }
.find__label { font-weight: 500; }
.find__where { color: var(--ink-soft); font-size: var(--fs-xs); }
.find__none { margin: 0; padding: var(--sp-2); color: var(--ink-soft); font-size: var(--fs-sm); }
/* The /find/ page: the same hits as rows in one box. */
.find-page { padding: 0; overflow: hidden; }
.find-page .find__hit { padding: 10px var(--pad); border-top: 1px solid var(--line); border-radius: 0; font-size: var(--fs-md); }
.find-page .find__hit:first-child { border-top: 0; }
.find-page .find__where { font-size: var(--fs-sm); }
/* A field reached from a search shows itself for a moment. */
@keyframes find-target { from { outline-color: var(--ink); } to { outline-color: transparent; } }
:target:not(.fld > *), .fld:has(> :target) { outline: 2px solid transparent; outline-offset: 2px; animation: find-target 2.4s ease-out; }

/* ==== nav: hub, view switch, crumb ==== */
/* The view switch is a .range at the left end of the page head; on the
   calendar it leads the day's own controls. */
.page-head > .view-switch { margin-right: auto; }
.page-head--split > .cal-nav { flex: 1; }
.cal-nav > .view-switch { margin-right: auto; }
/* On a phone the switch takes a line of its own, its choices sharing it. */
@media (max-width: 760px) {
	:is(.page-head, .cal-nav) > .view-switch, .page-head--split > .cal-nav { flex: 1 0 100%; margin-right: 0; }
	.view-switch a { flex: 1; justify-content: center; }
}
/* Settings / page, over the page's first box. */
.crumb { display: flex; gap: var(--sp-2); align-items: baseline; margin: 0 0 var(--sp-3); font-size: var(--fs-sm); color: var(--ink-soft); }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--ink); text-decoration: underline; }
.crumb span[aria-hidden] { color: var(--line-strong); }
.crumb span:last-child { color: var(--ink); font-weight: 500; }
/* A hub's tiles: the page's name where a stat has its figure, and under it
   at most a short state. */
.hub .stat { min-height: 76px; justify-content: flex-start; overflow-wrap: anywhere; }
.hub .stat b { font-size: var(--fs-lg); line-height: 1.3; letter-spacing: -.01em; }
.hub .stat::after {
	content: "\2192"; position: absolute; top: 14px; right: var(--pad);
	color: var(--ink-soft); opacity: .45; transition: transform .12s ease, opacity .12s ease;
}
.hub .stat:hover::after { opacity: 1; color: var(--ink); transform: translateX(2px); }
.side > .side__nav:not(:has(a)) { display: none; }
