/*
 * CloserDesk console and portal.
 *
 * This is a control panel for someone who is worried about their inbox, not a
 * marketing page. It is deliberately quiet: one accent colour, one border
 * weight, no gradients, no shadows that imply depth, no animation. Nothing
 * moves unless the person moved it.
 *
 * Colour is never the only signal. Every state that is shown with a colour is
 * also shown with a word, because a red dot means nothing to someone who
 * cannot see red and very little to someone seeing the page for the first time.
 *
 * Written mobile-first. The layout is a single column until 48rem, at which
 * point the tables stop scrolling and the sidebar appears.
 */

:root {
  --ink: #1c2024;
  --ink-soft: #5b6570;
  --ink-faint: #858e99;
  --ground: #fafafa;
  --surface: #ffffff;
  --line: #e2e5e9;
  --line-strong: #c9ced5;
  --accent: #3b4f6b;
  --accent-strong: #32435c;
  --accent-soft: #eef1f6;
  --on-accent: #ffffff;
  --good: #1f6b45;
  --good-soft: #eaf4ee;
  --warn: #8a5a12;
  --warn-soft: #fbf3e6;
  --bad: #97362c;
  --bad-soft: #fbeeec;
  --radius: 6px;
  --gap: 2rem;
  --brass: #8a6d3b;
  /* The nameplate. Defined here so every surface resolves it; the console
   * brightens it for a dark ground. */
  --gold: #8a6d3b;
  --gold-soft: #b8944f;
  /* Gold leaf: the portal's buttons and figures, as on closerdesk.me. */
  --leaf: linear-gradient(100deg, #F6E2B0 0%, #D9B77A 38%, #A9823F 68%, #E9CD8E 100%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  /* Lets the browser theme scrollbars, form controls and spinners to match. */
  color-scheme: light dark;
}

/*
 * Dark theme.
 *
 * Tokens only. Every colour in this stylesheet resolves through a custom
 * property, so nothing below this block needs to know a theme exists â€” and a
 * new component gets dark mode for free as long as it keeps using the tokens.
 *
 * It follows the operating system rather than offering a switch. A switch needs
 * JavaScript and somewhere to persist a preference, and nothing on any page
 * currently depends on JavaScript running. That is a rule worth more than a
 * toggle.
 *
 * Three deliberate choices:
 *
 * The accent gets *lighter*, not darker. A navy that reads as authoritative on
 * white disappears on near-black, so the relationship inverts â€” which is also
 * why `--on-accent` becomes dark: a filled button is now light-on-dark-text.
 *
 * The foreground is #e7e9ec rather than white. Pure white on near-black
 * shimmers on an LCD, and reading a page of it is tiring.
 *
 * The ground is #131518 rather than #000. Black gives shadowless surfaces
 * nothing to sit on, and every card would need a border to exist.
 */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e7e9ec;
    --ink-soft: #a6b0bb;
    --ink-faint: #7c8792;
    --ground: #131518;
    --surface: #1b1e22;
    --line: #2a2f35;
    --line-strong: #3d444c;
    --accent: #9db4d4;
    --accent-strong: #b6c8e0;
    --accent-soft: #232c38;
    --on-accent: #141a22;
    --good: #6cc79a;
    --good-soft: #16261e;
    --warn: #dcae62;
    --warn-soft: #2a2115;
    --bad: #e08a7e;
    --bad-soft: #2b1a18;
    /* Brass has to lift off a dark ground rather than sink into it. */
    --brass: #c9a961;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.55 var(--font);
}

/*
 * Text nobody chose the shape of must break rather than push the page sideways.
 *
 * A company name, a customer's address and a subject line all arrive from
 * outside and none of them are guaranteed to contain a space. `scripts/ux-audit.ts`
 * found a 67-character address on the conversation page and a 46-character run
 * inside a client name, both of which overflowed at 375px. Table cells are
 * excluded: they already wrap through `.clip` and sit inside `.table-scroll`.
 */
h1,
h2,
h3,
p,
li,
dt,
dd,
label,
caption,
.crumb,
.brand,
.who {
  overflow-wrap: anywhere;
}

/* Visible focus everywhere. Keyboard navigation is not a fallback. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a {
  color: var(--accent);
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

/* --- Skip link ---------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 0.75rem 1rem;
  border: 1px solid var(--line-strong);
  z-index: 10;
}

.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --- Shell -------------------------------------------------------------- */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.masthead-inner,
.wrap {
  max-width: 74rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.masthead-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: baseline;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

/*
 * The wordmark.
 *
 * A serif at a generous size, with the two halves separated by weight rather
 * than by a colour, a slash or a logo. Expensive brands are legible at a glance
 * and say one thing; the restraint is the signal.
 *
 * The face is a system serif stack â€” Georgia and its Apple/Windows siblings are
 * on essentially every machine, so this costs no network request and cannot
 * flash unstyled. There is no build step here and a downloaded font would need
 * one, or a third-party request on every page of a product whose whole promise
 * is that it is careful with other people's data.
 */
.brand {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.3rem;
  line-height: 1;
}

.brand b {
  font-weight: 600;
}

/*
 * "console" / "portal" is a label on the wordmark, not part of it. Small caps
 * at a wide tracking reads as a mark of which door you came through rather than
 * a second word in the brand.
 */
.brand span {
  font-family: var(--font);
  color: var(--ink-faint);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  vertical-align: 0.35em;
  margin-left: 0.15rem;
}

/* The venue's own name (and logo) on its portal: their system, run by us. */
.brand.venue {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.brand.venue img {
  height: 32px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}

.contact-line {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.masthead nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.masthead nav a {
  color: var(--ink-soft);
  text-decoration: none;
}

.masthead nav a:hover,
.masthead nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
}

.masthead .who {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
}

/* On a phone the controls wrap as whole words, never letter by letter. */
.masthead .who > *,
.masthead .who button {
  white-space: nowrap;
}

/*
 * The demo banner.
 *
 * Full bleed and above the content, because the thing it says â€” that no reply
 * approved on this page will reach anybody â€” is the single most important fact
 * about the screen, and a reader who misses it draws exactly the wrong
 * conclusion about what they just did. LIVE shows no banner at all: the
 * absence is the signal, and a permanent "everything is normal" strip trains
 * people to stop reading the strip.
 */
.env-banner {
  background: var(--warn-soft);
  border-bottom: 1px solid var(--warn);
  color: var(--warn);
  font-size: 0.9rem;
  padding: 0.7rem 0;
}

.env-banner b {
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

@media print {
  /* A printed digest must still say whether it describes real sends. */
  .env-banner {
    border: 1px solid #000;
  }
}

/*
 * Guided mode.
 *
 * Set apart from the page's own cards by the accent rule down the left, so a
 * reader can tell at a glance that this is CloserDesk explaining itself rather
 * than the client's own data. It reads before the content because someone
 * seeing the product for the first time needs the frame before the detail.
 */
.guide {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.4rem;
  margin-bottom: var(--gap);
  max-width: 60ch;
}

.guide h2 {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.guide p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

@media print {
  /* An explanation of the product is not part of the client's record. */
  .guide {
    display: none;
  }
}

main {
  padding: var(--gap) 0 4rem;
}

.page-head {
  margin-bottom: var(--gap);
}

.page-head h1 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 0.35rem;
  letter-spacing: -0.015em;
}

.page-head p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 46rem;
}

.crumb {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0 0 0.5rem;
}

.crumb a {
  color: var(--ink-soft);
}

h2 {
  font-size: 1.1rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 0.95rem;
  margin: 1.25rem 0 0.5rem;
}

/* --- Tabs --------------------------------------------------------------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--gap);
  font-size: 0.9rem;
}

.tabs a {
  padding: 0.55rem 0;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tabs a:hover {
  color: var(--ink);
}

.tabs a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 500;
}

.tabs-more {
  margin-bottom: var(--gap);
}

.tabs-more > summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.4rem 0;
}

.tabs-more > summary:hover {
  color: var(--ink);
}

.tabs-more .tabs {
  border-bottom: none;
  margin-bottom: 0;
  padding-top: 0.25rem;
}

/* --- Cards and panels --------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 48rem) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}

.stat .value {
  font-size: 1.75rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat .label {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.25rem;
}

/* --- Status ------------------------------------------------------------- */

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  white-space: nowrap;
}

.pill.good {
  background: var(--good-soft);
  border-color: transparent;
  color: var(--good);
}

.pill.warn {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

.pill.bad {
  background: var(--bad-soft);
  border-color: transparent;
  color: var(--bad);
}

.pill.accent {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

/* --- Notices ------------------------------------------------------------ */

.notice {
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.notice p {
  margin: 0;
}

.notice p + p {
  margin-top: 0.4rem;
}

.notice.good {
  border-left-color: var(--good);
  background: var(--good-soft);
}

.notice.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

.notice.bad {
  border-left-color: var(--bad);
  background: var(--bad-soft);
}

/* --- Tables ------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}

caption {
  text-align: left;
  padding: 0.85rem 1rem 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

th,
td {
  text-align: left;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

/* A row where only one cell is a link should still read as one clickable
 * unit â€” a colour change, not a transform, so it needs no motion budget and
 * no prefers-reduced-motion guard. :focus-within too, so tabbing through a
 * table of clients gets the same row highlight a pointer does. */
tbody tr:hover,
tbody tr:focus-within {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

td.num {
  font-variant-numeric: tabular-nums;
}

/* Long values must wrap rather than widen the table indefinitely. */
td .clip {
  display: block;
  max-width: 26rem;
  overflow-wrap: anywhere;
}

/* --- Definition lists --------------------------------------------------- */

dl.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1.25rem;
  margin: 0;
  font-size: 0.9rem;
}

dl.facts dt {
  color: var(--ink-faint);
}

dl.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* --- Forms -------------------------------------------------------------- */

form.stack {
  display: grid;
  gap: 1rem;
  max-width: 30rem;
}

form.wide {
  max-width: none;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin: 0.3rem 0 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="time"],
input[type="tel"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.check {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  font-size: 0.9rem;
  font-weight: 400;
}

.code-input {
  font-family: var(--mono);
  font-size: 1.35rem;
  letter-spacing: 0.35em;
  text-align: center;
}

button,
.button {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.55rem 1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
}

button.secondary,
.button.secondary {
  background: var(--surface);
  color: var(--accent);
}

button.secondary:hover,
.button.secondary:hover {
  background: var(--accent-soft);
}

button.quiet,
.button.quiet {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

button.quiet:hover,
.button.quiet:hover {
  background: var(--ground);
  color: var(--ink);
}

button.quiet.demo-active {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: var(--warn);
}

button.danger {
  background: var(--surface);
  border-color: var(--bad);
  color: var(--bad);
}

button.danger:hover {
  background: var(--bad-soft);
}

/* The button rules set display, which beats the browser's own hidden. */
button[hidden] { display: none; }

button[disabled],
button[disabled]:hover {
  cursor: not-allowed;
  background: var(--ground);
  border-color: var(--line);
  color: var(--ink-faint);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inline-form {
  display: inline;
}

/* --- Message bodies ----------------------------------------------------- */

.message {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
}

.message header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}

/* Inline style attributes are blocked by the CSP, so draft bodies keep their
   line breaks through this class rather than style="white-space:pre-wrap". */
.body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message .body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.message.inbound {
  border-left: 3px solid var(--line-strong);
}

.message.outbound {
  border-left: 3px solid var(--accent);
}

/* --- Empty states ------------------------------------------------------- */

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--ink-soft);
  background: var(--surface);
}

.empty p {
  margin: 0 auto;
  max-width: 28rem;
}

.empty p + p {
  margin-top: 0.5rem;
  color: var(--ink-faint);
  font-size: 0.9rem;
}

/* --- Small print -------------------------------------------------------- */

.meta {
  font-size: 0.82rem;
  color: var(--ink-faint);
}

.mono {
  font-family: var(--mono);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

pre.mono {
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem;
  overflow-x: auto;
  white-space: pre-wrap;
}

/* --- Centred single-purpose pages (login, MFA, exchange) ---------------- */

.narrow {
  max-width: 26rem;
  margin: 3rem auto;
  padding: 0 1.25rem;
}

.narrow .card {
  padding: 1.75rem;
}

.qr {
  display: block;
  margin: 1rem auto;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

footer.foot {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
  color: var(--ink-faint);
  font-size: 0.82rem;
}

footer.foot p {
  margin: 0;
}

/* --- Print -------------------------------------------------------------- */

@media print {
  .masthead nav,
  .tabs,
  .tabs-more,
  .actions {
    display: none;
  }
  /*
   * Paper is white whatever the screen was. Without forcing the light tokens
   * back, a reader on a dark-themed machine prints pale grey text onto white
   * and gets a blank-looking page â€” the digest and the audit trail are exactly
   * the pages someone prints.
   */
  :root {
    --ink: #1c2024;
    --ink-soft: #5b6570;
    --ink-faint: #858e99;
    --ground: #ffffff;
    --surface: #ffffff;
    --line: #e2e5e9;
    --line-strong: #c9ced5;
    --accent: #3b4f6b;
    --accent-soft: #eef1f6;
    --on-accent: #ffffff;
    --good: #1f6b45;
    --good-soft: #eaf4ee;
    --warn: #8a5a12;
    --warn-soft: #fbf3e6;
    --bad: #97362c;
    --bad-soft: #fbeeec;
  }
  body {
    background: #fff;
    color: var(--ink);
  }
}

/*
 * Charts.
 *
 * Server-rendered SVG. The bars scale with the viewport because the viewBox
 * has no fixed aspect ratio, so the chart works at 375px without a second
 * layout. The accessible table beside it is hidden visually and not from
 * assistive technology â€” `display: none` would take it from both.
 */
.chart {
  margin: 0.75rem 0 0.25rem;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 120px;
}

.chart .bar-primary {
  fill: var(--accent);
}

.chart .bar-muted {
  fill: var(--line-strong);
}

.chart figcaption {
  margin-top: 0.5rem;
  color: var(--ink-faint);
  font-size: 0.8125rem;
}

.legend {
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.key {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.25rem;
  vertical-align: baseline;
}

.key-primary {
  background: var(--accent);
}

.key-muted {
  background: var(--line-strong);
}

.legend .key + .key {
  margin-left: 1rem;
}

.empty-inline {
  color: var(--ink-faint);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- Presence -----------------------------------------------------------
 *
 * What makes an interface read as expensive is restraint, not decoration.
 * Space, a real type scale, and one accent used rarely. Everything below is
 * either more room or more hierarchy; nothing here adds an ornament.
 *
 * Brass appears in exactly two places â€” the wordmark and a hairline under the
 * page title. It is deliberately not used for anything interactive: a warm
 * mid-tone cannot carry the contrast a button or a link needs, and a colour
 * that means "luxury" in one place and "click me" in another means nothing.
 * Every functional colour stays as it was.
 */
/* Headings share the wordmark's serif, so the product sounds like one voice. */
h1,
h2,
h3,
.stat .value {
  font-family: var(--serif);
  font-weight: 500;
}

.page-head {
  margin-bottom: calc(var(--gap) * 1.25);
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
  position: relative;
}

/* A 3rem hairline of brass. The whole ornament budget, spent in one place. */
.page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 3rem;
  height: 1px;
  background: var(--brass);
}

.page-head h1 {
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 0 0 0.5rem;
}

.page-head p {
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 38rem;
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.008em;
  margin: calc(var(--gap) * 1.25) 0 0.9rem;
}

h3 {
  font-size: 1.08rem;
  margin: 1.6rem 0 0.6rem;
}

/* Cards separate by space and a quieter line, not by weight of border. */
.card {
  padding: 1.6rem;
  margin-bottom: 1.1rem;
}

.stat {
  padding: 1.4rem 1.25rem;
}

.stat .value {
  font-size: 2.3rem;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat .label {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.brand {
  color: var(--brass);
}

.brand b {
  color: var(--ink);
}

/* Buttons stop shouting: quieter corners, more room, a considered transition. */
button,
.button {
  padding: 0.7rem 1.35rem;
  letter-spacing: 0.01em;
  transition: background 180ms ease, border-color 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
  button,
  .button {
    transition: none;
  }
}


/* ===========================================================================
 * Two surfaces, two characters.
 *
 * Everything above this line is shared machinery. Everything below gives the
 * portal and the console deliberately different personalities, scoped by the
 * `data-surface` attribute the layout puts on <body>.
 *
 * The portal is quiet and expensive: warm paper, a serif that carries the
 * headings, hairline rules instead of boxes, and one figure on the page that is
 * allowed to be large. The reader is a business owner in their fifties who is
 * nervous about a machine emailing their customers, so nothing shouts.
 *
 * The console is a cockpit: dark in both operating-system themes, denser, and
 * carrying the name of whoever's desk it is.
 *
 * The header comment at the top of this file says nothing moves unless the
 * person moved it, and that holds: only buttons respond to the pointer.
 * ======================================================================== */

/* --- The greeting -------------------------------------------------------- */

.greeting {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 400;
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* --- The portal: the house at night -------------------------------------- */

/*
 * The venue's own room, in the same ink and candle-gold as closerdesk.me, so
 * the step from the site to the desk feels like walking further into one
 * house. Dark in both operating-system themes, like the console: it is a
 * single deliberate world, not a light page with a night mode bolted on.
 * Print still resets to paper (see @media print above).
 */
[data-surface="portal"] {
  --ground: #0F121B;
  --surface: #161A25;
  --line: rgba(238, 231, 217, 0.12);
  --line-strong: rgba(238, 231, 217, 0.24);
  --ink: #EEE7D9;
  --ink-soft: rgba(238, 231, 217, 0.72);
  --ink-faint: rgba(238, 231, 217, 0.5);
  --accent: #CFAB6E;
  --accent-strong: #E2C48E;
  --accent-soft: rgba(207, 171, 110, 0.1);
  --on-accent: #0F121B;
  --brass: #CFAB6E;
  --gold: #CFAB6E;
  --gold-soft: #F2C77A;
  --good: #8FCBA8;
  --good-soft: rgba(143, 203, 168, 0.1);
  --warn: #E2B867;
  --warn-soft: rgba(226, 184, 103, 0.1);
  --bad: #E39A8E;
  --bad-soft: rgba(227, 154, 142, 0.1);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 2px;
  color-scheme: dark;
  /* Cormorant's old-style figures make a 1 read as an I in "1 reply". A
   * feature setting, not font-variant-numeric, so the many tabular-nums rules
   * below add to it instead of replacing it. */
  font-feature-settings: "lnum" 1;
}

[data-surface="portal"] ::selection { background: var(--gold); color: var(--ground); }

/* Their house's name, set like the site's: light serif in ivory, a gold word after. */
[data-surface="portal"] .brand { font-family: var(--serif); font-size: 1.6rem; }
[data-surface="portal"] .brand b { font-weight: 500; letter-spacing: 0.01em; }
[data-surface="portal"] .brand span { color: var(--gold); opacity: 0.85; }

[data-surface="portal"] h1,
[data-surface="portal"] h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

[data-surface="portal"] h1 {
  font-size: 2.6rem;
  font-weight: 300;
  line-height: 1.1;
}

[data-surface="portal"] h2 {
  font-size: 1.6rem;
  line-height: 1.2;
}

/* A hairline above a section reads as considered where a full box reads as
 * generic. The card keeps its border only where it holds an action. */
[data-surface="portal"] .page-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.25rem;
}

[data-surface="portal"] .card {
  border-color: var(--line);
  box-shadow: 0 1px 2px rgb(35 32 28 / 4%);
}

[data-surface="portal"] p {
  max-width: 68ch;
}

/* --- The one figure allowed to be large ---------------------------------- */

.value {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2.5rem;
  align-items: end;
  margin: 0 0 var(--gap);
  padding: 1.75rem 0 1.5rem;
  border-top: 2px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.value-figure {
  font-family: var(--serif);
  font-size: clamp(2.75rem, 9vw, 4rem);
  line-height: 0.95;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin: 0;
}

.value-label {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.value-basis {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-faint);
  max-width: 60ch;
}

/* --- The console: a cockpit ---------------------------------------------- */

[data-surface="console"] {
  --ground: #101319;
  --surface: #171b23;
  --line: #262c37;
  --line-strong: #3a4250;
  --ink: #e9ecf1;
  --ink-soft: #a3adbd;
  --ink-faint: #788294;
  --accent: #7fa8d4;
  --accent-strong: #9dc0e4;
  --accent-soft: #1c2836;
  --on-accent: #101319;
  --good: #6fce9f;
  --good-soft: #16281f;
  --warn: #e3b567;
  --warn-soft: #2a2113;
  --bad: #f0917f;
  --bad-soft: #2c1a17;
  --gold: #d6a944;
  --gold-soft: #f0d18a;
  color-scheme: dark;
}

[data-surface="console"] .masthead {
  border-bottom-color: var(--line-strong);
}

/* Denser than the portal on purpose: this is a working surface, and a person
 * triaging ten clients wants more on screen, not more air. */
[data-surface="console"] .card {
  padding: 1rem 1.15rem;
}

[data-surface="console"] .greeting {
  font-family: var(--font);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  display: flex;
  align-items: baseline;
  gap: 0.5ch;
  flex-wrap: wrap;
}

/* The nameplate. Whose desk this is. */
.nameplate {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--gold, var(--brass));
  background: linear-gradient(96deg, var(--gold, #d6a944), var(--gold-soft, #f0d18a) 45%, var(--gold, #d6a944));
  -webkit-background-clip: text;
  background-clip: text;
  /* The gradient is the flourish; the colour above is what actually has to be
   * legible if background-clip is unsupported or overridden. */
  -webkit-text-fill-color: transparent;
  padding-right: 0.1em;
}

@supports not (background-clip: text) {
  .nameplate {
    -webkit-text-fill-color: currentcolor;
  }
}

/* The last line of every page. It is there to be read on the way out. */
.goal {
  margin: 0.6rem 0 0;
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold, var(--brass));
  opacity: 0.75;
}

/* --- Arrival ------------------------------------------------------------- */

/*
 * No arrival animation: content that fades in reads as a page still loading,
 * and a screenshot or a slow phone caught it half-invisible. Moving between
 * pages is different: the browser holds the old page until the new one is
 * painted, then dissolves one into the other, so nothing is ever blank. The
 * masthead is named so it stays still while the page under it changes.
 * Browsers without view transitions just navigate as before.
 */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  .masthead {
    view-transition-name: masthead;
  }

  ::view-transition-old(root) {
    animation: 160ms ease-out both page-out;
  }

  ::view-transition-new(root) {
    animation: 280ms cubic-bezier(0.2, 0.7, 0.2, 1) 60ms both page-in;
  }

  @keyframes page-out {
    to { opacity: 0; }
  }

  @keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
  }

  /* Interactive things acknowledge the pointer. Transform only, so nothing
   * reflows and no layout depends on the hover happening. */
  .button,
  button {
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease,
      background-color 0.14s ease;
  }

  .button:hover,
  button:hover {
    transform: translateY(-1px);
  }

  .button:active,
  button:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.05s;
  }

  form[aria-busy="true"] .is-pressed {
    animation: 1.2s ease-in-out infinite pressed;
  }

  @keyframes pressed {
    50% { opacity: 0.55; }
  }
}

/* A pressed button says so at once and can't be pressed twice; the server's
 * answer replaces the whole page anyway. */
form[aria-busy="true"] {
  cursor: progress;
}

form[aria-busy="true"] :is(button, .button) {
  pointer-events: none;
}

form[aria-busy="true"] .is-pressed {
  opacity: 0.75;
}

/* --- Focus ---------------------------------------------------------------
 *
 * Restated after the surface overrides, because a focus ring that inherits a
 * token which has just been redefined is the classic way keyboard navigation
 * quietly disappears on one surface only.
 */
:is([data-surface="portal"], [data-surface="console"]) :focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* The greeting is the first thing under the masthead and needs room to be it. */
main > .greeting:first-child {
  margin-top: 0.75rem;
}

/* --------------------------------------------------------------------------
   The draft. This is the one thing on the conversation page that asks the
   owner for a decision, so it is the one thing that gets weight: a warm ground
   and a left edge in the accent, against cards that are otherwise flat.
   -------------------------------------------------------------------------- */
.card.draft {
  border-left: 3px solid var(--gold);
  background: color-mix(in srgb, var(--gold) 5%, var(--surface, transparent));
}

.draft-subject {
  font-size: 1.05rem;
  font-weight: 600;
  margin: .5rem 0 .75rem;
}

.draft-body {
  white-space: pre-wrap;
  line-height: 1.65;
  padding: .9rem 1rem;
  border-radius: .35rem;
  background: color-mix(in srgb, currentColor 4%, transparent);
}

/* The gate trace. All 18 gates in evaluation order; the one that actually
   refused is the only one that gets weight, everything after it recedes
   because it was never reached â€” that gap is itself the information. */
.gate-trace {
  display: grid;
  gap: 0.3rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  font-family: var(--mono);
}

.gate-trace li {
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  color: var(--ink-soft);
}

.gate-trace li.refused {
  color: var(--bad);
  background: var(--bad-soft);
  border-left-color: var(--bad);
  font-weight: 600;
}

.gate-trace li.not-reached {
  color: var(--ink-faint);
  opacity: 0.55;
}

/* Editing is the rarer path. Keep it one click away so the common case â€”
   read it, send it â€” is two words and a button. */
details.edit {
  margin-top: 1rem;
}

details.edit > summary {
  cursor: pointer;
  font-size: .9rem;
  opacity: .75;
  padding: .3rem 0;
}

details.edit > summary:hover {
  opacity: 1;
}

/* Who said what, at a glance, without reading the address. */
.message > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .75rem;
}

.message > header > span {
  font-size: .85rem;
  opacity: .7;
}

.message.outbound {
  border-left: 2px solid color-mix(in srgb, var(--gold) 60%, transparent);
}

/* --------------------------------------------------------------------------
   The set-up list. A numbered sequence, so it is drawn as one: a single rail
   down the left with a mark per step, rather than ten separate cards, which
   would say these steps are unrelated when the whole point is their order.
   -------------------------------------------------------------------------- */
.setup-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.setup-step {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.setup-step:first-child {
  border-top: 0;
}

.setup-mark {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  font-size: .85rem;
  line-height: 1;
  opacity: .5;
}

.setup-step.is-done > .setup-mark {
  opacity: 1;
  border-color: var(--gold);
  color: var(--gold);
}

/* Today checklist: urgency reads as fill color, not just position in the list. */
.setup-mark.tone-now {
  opacity: 1;
  border-color: var(--bad);
  color: var(--bad);
}

.setup-mark.tone-today {
  opacity: 1;
  border-color: var(--warn);
  color: var(--warn);
}

.setup-mark.tone-soon {
  opacity: 1;
  border-color: var(--gold);
  color: var(--gold);
}

.setup-body > h3 {
  margin: 0 0 .35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.setup-body > p {
  margin: 0 0 .4rem;
}

.setup-body > p:last-child {
  margin-bottom: 0;
}

/* A finished step should recede. It is there to be counted, not read again. */
.setup-step.is-done > .setup-body {
  opacity: .62;
}

.setup-step.is-done > .setup-body:hover,
.setup-step.is-done > .setup-body:focus-within {
  opacity: 1;
}

/* Corner bubble from app.js: what changed since the last check. */
.pulse-bubble {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 20px rgb(0 0 0 / 0.18);
}
.pulse-bubble:hover,
.pulse-bubble:focus-visible { background: var(--accent-strong); color: var(--on-accent); }
.pulse-bubble[hidden] { display: none; }

/* --------------------------------------------------------------------------
   A conversation reads like one: the couple on the left, the venue on the
   right, a reply that hasn't gone yet drawn dashed at the bottom. The box
   above it says in words what has to happen next, with the buttons to do it.
   -------------------------------------------------------------------------- */
.avatar {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  font-size: .85rem;
  letter-spacing: .02em;
}
.convo-head { display: flex; gap: .9rem; align-items: center; margin: .25rem 0 1.25rem; }
.convo-head .avatar { width: 3rem; height: 3rem; font-size: 1rem; }
.convo-head h1 { margin: 0; overflow-wrap: anywhere; }
.convo-head p { margin: .3rem 0 0; display: flex; flex-wrap: wrap; gap: .35rem; }

.thread { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.bubble { display: flex; gap: .7rem; align-items: flex-start; max-width: 46rem; }
.bubble.outbound { flex-direction: row-reverse; margin-left: auto; }
.bubble-body {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  border-top-left-radius: 4px;
  padding: .8rem 1rem;
}
.bubble.outbound .bubble-body {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 14px;
  border-top-right-radius: 4px;
}
.bubble.draft .bubble-body { background: var(--surface); border: 1.5px dashed var(--gold); }
.bubble.draft .avatar { background: var(--warn-soft); color: var(--warn); }
.bubble header { display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; font-size: .8rem; color: var(--ink-faint); margin-bottom: .4rem; }
.bubble header strong { color: var(--ink); font-size: .85rem; }
.bubble-subject { margin: 0 0 .35rem; font-weight: 600; font-size: .92rem; }
.bubble .body { font-size: .95rem; line-height: 1.55; }
.bubble-note { margin: .6rem 0 0; font-size: .8rem; color: var(--ink-soft); }
.bubble .actions { margin-top: .9rem; }
.thread-foot { margin-bottom: 1rem; }

.next-step {
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line));
  border-left: 4px solid var(--warn);
  background: var(--warn-soft);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1.75rem;
}
.next-step h2 { margin: 0 0 .4rem; font-size: 1.1rem; }
.next-step p { margin: .3rem 0; }
.next-line { margin: .25rem 0 1rem; font-weight: 600; }
.next-step-lead { font-weight: 600; margin-top: .8rem !important; }
.next-step-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; margin-top: .5rem; }
.next-step-option {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .85rem;
}
.next-step-option textarea { width: 100%; }
.next-step-option p, .next-step-option label { margin: 0; font-weight: 400; }

/* The conversation list, drawn as an inbox rather than a spreadsheet. */
.inbox { list-style: none; margin: 0 0 1.5rem; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.inbox li + li { border-top: 1px solid var(--line); }
.inbox a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: center;
  padding: .75rem 1rem;
  color: inherit;
  text-decoration: none;
}
.inbox a:hover, .inbox a:focus-visible { background: var(--accent-soft); }
.inbox-main { display: flex; flex-direction: column; min-width: 0; }
.inbox-who, .inbox-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-who { font-weight: 600; }
.inbox-subject { color: var(--ink-soft); font-size: .88rem; }
.inbox-side { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .35rem; }
.inbox-time { color: var(--ink-faint); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 40rem) {
  .inbox a { grid-template-columns: auto minmax(0, 1fr); }
  .inbox-side { grid-column: 2; justify-content: flex-start; }
  /* The header was a quarter of a phone screen: one row of controls, no name (the page greets them by it). */
  .masthead .who { margin-left: 0; gap: .5rem; align-items: center; }
  .masthead .who > span { display: none; }
  .masthead .who .button, .masthead .who button { padding: .35rem .8rem; }
}

/* How many things are waiting, always on the Today / Clients link. */
.nav-badge {
  display: inline-block;
  min-width: 1.9rem;
  margin-left: .45rem;
  padding: 0 .5rem;
  border-radius: 999px;
  /* A count, not an alarm: a red bubble on every page made a normal morning look like an emergency. */
  background: var(--accent-soft);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.5rem;
  text-align: center;
  vertical-align: 1px;
}
.nav-badge[hidden] { display: none; }

.inline-fields { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.inline-fields .grow { flex: 1 1 14rem; }
.side-details h3 { margin: 1.25rem 0 .4rem; }

/* Today: what it did, what needs you, one card per enquiry */
.day-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  padding: 1rem 1.25rem;
  margin: 1rem 0 2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.day-strip div { display: flex; flex-direction: column; }
.day-strip b { font-family: var(--serif); font-size: 1.9rem; font-weight: 400; line-height: 1.1; font-variant-numeric: tabular-nums; }
.day-strip span { font-size: .8rem; color: var(--ink-soft); }
.day-strip .needs b { color: var(--warn); }
.day-strip .clear b { color: var(--good); }
.todo-cards { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .9rem; }
.todo-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: 10px;
  background: var(--surface);
  padding: 1rem 1.25rem;
}
.todo-card.tone-accent { border-left-color: var(--accent); }
.todo-card.tone-bad { border-left-color: var(--bad); }
.todo-card.tone- { border-left-color: var(--line-strong); }
.todo-card-head { display: flex; gap: .8rem; align-items: center; }
.todo-card-who { flex: 1; min-width: 0; }
.todo-card-who strong { display: block; overflow-wrap: anywhere; }
.todo-card-who small { color: var(--ink-soft); font-size: .78rem; }
.todo-card-quote {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: .75rem 0 .35rem;
  padding-left: .8rem;
  border-left: 2px solid var(--line-strong);
}
.todo-card-reason { font-size: .9rem; color: var(--ink-soft); margin: .25rem 0 .75rem; }
.todo-card-question { display: block; margin: 0 0 .4rem; font-size: .95rem; }
.todo-card-form textarea { width: 100%; margin-bottom: .5rem; }
.todo-card-draft {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: .75rem .9rem;
  font-size: .92rem;
  margin: .5rem 0 .75rem;
  white-space: pre-line;
}
.row-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row-actions form { margin: 0; }
.row-actions > a:not(.button) { margin-left: auto; font-size: .85rem; }
.done-list { list-style: none; padding: 0; margin: .5rem 0 1.5rem; }
.done-list li { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.done-list li a { color: inherit; text-decoration: none; }
.done-list li a:hover { text-decoration: underline; }
.done-time { margin-left: auto; color: var(--ink-soft); font-size: .8rem; font-variant-numeric: tabular-nums; }
.foot-contact { margin-top: 2.5rem; font-size: .82rem; color: var(--ink-soft); }


/* Needs you: urgency groups, filter chips, and the folded older section */
.urgent-why { color: var(--bad); font-weight: 600; }
.group-label { margin: 1.5rem 0 .6rem; font-size: 1rem; }
.group-label span { color: var(--ink-soft); font-weight: 400; }
.card-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.card-chips a { padding: .3rem .8rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .85rem; text-decoration: none; }
.card-chips a[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent); }
.older-group { margin: 1.5rem 0; }
.older-group > summary { cursor: pointer; color: var(--ink-soft); }
.older-group[open] > summary { margin-bottom: .75rem; }
[data-surface="portal"] .done-preview { flex: 1 1 100%; max-width: none; margin: 0; color: var(--ink-soft); font-size: .85rem; line-height: 1.45; }
.plain-list { list-style: none; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .4rem; }
.answer-list { list-style: none; padding: 0; margin: .5rem 0 1.5rem; }
.answer-list > li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.answer-head { display: flex; gap: .6rem; align-items: center; justify-content: space-between; }
.answer-value { margin: .3rem 0 .4rem; white-space: pre-wrap; }
.ready-list { list-style: none; padding: 0; margin: .5rem 0 1.5rem; }
.ready-list li { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.ready-list li a { color: inherit; }
.search { display: flex; gap: .5rem; margin: 0 0 1rem; }
.search input { flex: 1; min-width: 0; }
.date-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
/* A couple's viewing page: each day, then its times underneath, the same on every row. */
.slot-days > li { display: grid; gap: .4rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }

/* The one number that answers "is it working?", then what to do about it. */
.headline { margin: 1.25rem 0 .75rem; }
.headline-figure { font-family: var(--serif); font-size: 3.6rem; line-height: 1; margin: 0; font-variant-numeric: tabular-nums; }
.headline-figure small { font-size: .45em; color: var(--ink-soft); }
.headline-label { margin: .35rem 0 0; color: var(--ink-soft); font-size: .95rem; }
.headline-status { margin: .6rem 0 0; font-weight: 600; max-width: 60ch; }
.headline-status.tone-good { color: var(--good); }
.headline-status.tone-warn { color: var(--warn); }
.todo-card-reason { color: var(--ink); }
.coverage-line { margin-top: .6rem; }
.answer-warning { margin: 0 0 .4rem; color: var(--ink); border-left: 3px solid var(--warn); padding-left: .6rem; }
.found-list > li { display: grid; gap: .4rem; }
.found-keep { display: flex; gap: .4rem; align-items: center; font-weight: 600; }
.founder-unlock input[type="password"] { width: 9rem; padding: .25rem .5rem; font-size: .8rem; }

/* --- Results: the page an owner shows a partner -------------------------- */

.results-head { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: start; }
.results-head h1, .results-head p { grid-column: 1; }
.results-head [data-print] { grid-column: 2; grid-row: 1 / span 2; }
.proof-hero { padding: 1.5rem 0 1.25rem; border-top: 2px solid var(--line-strong); border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; }
.proof-kicker { margin: 0 0 .75rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.proof-figure { font-family: var(--serif); font-size: clamp(2.4rem, 8vw, 3.4rem); line-height: 1; margin: 0; color: var(--accent); font-variant-numeric: tabular-nums; }
.proof-figure small { font-size: .45em; color: var(--ink-soft); }
.proof-claim { font-family: var(--serif); font-size: 1.35rem; margin: 1rem 0 .25rem; text-wrap: balance; }
.proof-claim b { color: var(--good); font-weight: 600; }
.proof-basis { margin: .5rem 0 0; font-size: .85rem; line-height: 1.5; color: var(--ink-faint); max-width: 62ch; }
.speed { display: grid; grid-template-columns: minmax(15rem, auto) 1fr; gap: 1.25rem; align-items: center; }
/* Each label sits level with its bar: 28px rows, 16px apart, as drawn in the SVG. */
.speed-labels { display: grid; gap: 16px; }
.speed-labels p { margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; height: 28px; }
.speed-labels b { line-height: 1; }
.speed-labels span { font-size: .8rem; color: var(--ink-faint); }
.speed-labels b { font-family: var(--serif); font-size: 1.35rem; font-weight: 400; font-variant-numeric: tabular-nums; }
.speed-labels .speed-now-figure { color: var(--accent); }
.speed-chart { display: block; width: 100%; height: 76px; }
.speed-before { fill: var(--line-strong); }
.speed-now { fill: var(--accent); }
.proof-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; margin-bottom: var(--gap); }
.proof-tile { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.proof-tile .proof-figure { font-size: 2.4rem; }
.proof-label { margin: .45rem 0 0; font-size: .88rem; line-height: 1.45; color: var(--ink-soft); }
.proof-section { margin-bottom: var(--gap); }
.ledger th:not(:first-child), .ledger td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.proof-line { font-size: 1rem; margin: .35rem 0; }
.proof-line.good b { color: var(--good); }
.proof-line.warn b { color: var(--warn); }
.clock svg { display: block; width: 100%; height: 120px; }
.clock-open { fill: var(--line-strong); }
.clock-closed { fill: var(--gold); }
.clock-missed { fill: var(--bad); }
.clock-none { fill: var(--line); }
.clock-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--ink-faint); margin-top: .35rem; }
.key-open { background: var(--line-strong); }
.key-closed { background: var(--gold); }
.key-missed { background: var(--bad); }
.legend .key-closed, .legend .key-missed { margin-left: 1rem; }
.funnel-list { list-style: none; padding: 0; margin: .75rem 0; display: grid; gap: .6rem; }
.funnel-list li { display: grid; grid-template-columns: 9.5rem 1fr 4.5rem; gap: .75rem; align-items: center; }
.funnel-label { font-size: .9rem; color: var(--ink-soft); }
.funnel-bar svg { display: block; width: 100%; height: 20px; }
.funnel-value { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.funnel-value small { font-weight: 400; color: var(--ink-faint); }
.funnel-0 { fill: var(--line-strong); }
.funnel-1 { fill: var(--accent); opacity: .55; }
.funnel-2 { fill: var(--accent); }
.funnel-3 { fill: var(--gold); }
@media (max-width: 40rem) {
  .speed { grid-template-columns: 1fr; }
  .speed-labels { grid-template-columns: 1fr 1fr; }
  .speed-labels p { flex-direction: column; align-items: flex-start; height: auto; gap: .25rem; }
  .funnel-list li { grid-template-columns: 7rem 1fr 3.5rem; }
}
@media print {
  .no-print, .masthead nav, .pulse-bubble { display: none !important; }
  .proof-tile { break-inside: avoid; }
}

/* Picking who a held form enquiry's reply goes to. */
.choices { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.choice { display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice span { display: grid; gap: .1rem; min-width: 0; overflow-wrap: anywhere; }
.choice small { color: var(--ink-soft); }

.outcome-form { display: grid; gap: .75rem; margin-bottom: 1rem; }
.outcome-date { display: grid; gap: .3rem; max-width: 22rem; }
.outcome-date small { color: var(--ink-faint); font-weight: 400; }
.outcome-date .hint { margin: 0; }

/* One enquiry's record: every step, oldest first. */
.timeline { list-style: none; margin: .75rem 0 0; padding: 0 0 0 1rem; border-left: 2px solid var(--line); display: grid; gap: .7rem; }
.timeline li { position: relative; display: grid; gap: .1rem; }
.timeline li::before { content: ""; position: absolute; left: calc(-1rem - 5px); top: .4rem; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.timeline li.tone-good::before { background: var(--good); }
.timeline li.tone-warn::before { background: var(--warn); }
.timeline li.tone-bad::before { background: var(--bad); }
.timeline time { font-size: .78rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.timeline span { overflow-wrap: anywhere; }

/* A table ignores the 1px width of .visually-hidden and pushed every chart's page sideways on a phone. */
.chart { position: relative; overflow: hidden; }
.legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; align-items: center; }
.legend > span.key-item { white-space: nowrap; }
.legend .key + .key, .legend .key-closed, .legend .key-missed { margin-left: 0; }

/* Opening hours */
.hours { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.hours-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hours-row .check { min-width: 8.5rem; margin: 0; }
.hours-times { display: flex; align-items: center; gap: 8px; }
.hours-row input[type="time"] { width: auto; min-width: 0; }

/* Undo a send */
.undo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }

/* Saved answers in a hand-written reply */
.answers-pick ul { display: grid; gap: 6px; margin: 8px 0 0; }
.answers-pick li { display: grid; gap: 2px; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent, inherit); text-align: left; cursor: pointer; text-decoration: underline; font: inherit; min-height: 0; }

/* Phones: every link visible in a tidy grid. A swipe row with no scrollbar hid Settings off the edge. */
@media (max-width: 640px) {
  .masthead nav {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    gap: 0 1.25rem;
    white-space: nowrap;
  }
  /* A thumb-sized target, 44px tall, for an owner tapping one-handed mid-wedding. */
  .masthead nav a { display: inline-block; padding: .7rem 0; }
}

/* Today, calm: one sentence, then sections by what the owner has to do. */
.today-summary { font-family: var(--serif); font-size: 1.35rem; line-height: 1.35; margin: 1.75rem 0 1.25rem; max-width: 40ch; text-wrap: balance; }
main h2 .count { color: var(--ink-soft); font-weight: 400; font-size: .85em; margin-left: .25rem; }
.answer-rows { list-style: none; padding: 0; margin: .5rem 0 1.5rem; }
.answer-rows > li { padding: .8rem 0; border-bottom: 1px solid var(--line); }
.answer-rows label { display: block; margin-bottom: .4rem; overflow-wrap: anywhere; }
.answer-rows textarea { width: 100%; min-height: 2.6rem; margin-bottom: .4rem; }
[data-surface="portal"] .urgent-why { color: var(--warn); }

/* Console Needs attention: subject, date, reason, then Mark done at the far right. */
.attention-list .inline-form { margin-left: auto; }
.attention-when { color: var(--ink-soft); font-size: .8rem; font-variant-numeric: tabular-nums; }
.attention-detail { order: 1; flex-basis: 100%; color: var(--ink-soft); font-size: .85rem; }


/* --- The portal, finished -------------------------------------------------
 *
 * Last in the file so it settles the layers above. The idea is the website's:
 * a dark house, and the reply drawn as the one sheet of paper on it. Cards
 * lose their coloured rails (the pill already says the state), corners match
 * the site's near-square ones, and the page gets room under the masthead.
 */
[data-surface="portal"] main {
  padding-top: clamp(1.75rem, 4vw, 3rem);
}

/* Today opens on the greeting, set as the page's heading. */
[data-surface="portal"] main > .greeting:first-child {
  font-size: clamp(2rem, 4.2vw, 2.75rem);
  font-weight: 300;
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

/* The two figures the constitution puts first: a quiet ruled line, not a box. */
[data-surface="portal"] .day-strip {
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  padding: 1.1rem 0;
  margin: 0 0 1rem;
  gap: 1rem 3.5rem;
}
[data-surface="portal"] .day-strip b { color: var(--gold); font-weight: 300; font-size: 2.2rem; }
[data-surface="portal"] .day-strip span { letter-spacing: 0.01em; }
[data-surface="portal"] .headline-status { font-weight: 500; color: var(--ink-soft); }
[data-surface="portal"] .today-summary { font-size: 1.6rem; font-weight: 300; max-width: 44ch; margin: 2.25rem 0 1.5rem; text-wrap: pretty; }

[data-surface="portal"] :is(.todo-card, .card, .bubble-body, .search input, .ready-list li) {
  border-radius: 4px;
}
[data-surface="portal"] .todo-card {
  border-left-width: 1px;
  border-left-color: var(--line);
  padding: 1.35rem 1.5rem;
}
[data-surface="portal"] .todo-card-quote {
  font-size: 1.2rem;
  font-style: italic;
  border-left: 0;
  padding-left: 0;
  color: var(--ink);
}

/*
 * The reply, on paper. The same sheet as the website's letter, so what a venue
 * was shown on closerdesk.me is what lands on their desk. It is the only light
 * surface in the portal, which is the point: it is the thing to read.
 */
[data-surface="portal"] :is(.todo-card-draft, .bubble.draft .draft-body) {
  position: relative;
  max-width: 40rem;
  margin: 1rem 0 1.25rem;
  padding: 1.6rem 1.75rem 1.5rem;
  border-radius: 0;
  background: linear-gradient(170deg, #F7F2E8, #EEE6D6);
  color: #211C16;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.55;
  white-space: pre-line;
  box-shadow: 0 30px 60px -32px rgb(0 0 0 / 80%);
}
[data-surface="portal"] :is(.todo-card-draft, .bubble.draft .draft-body)::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--gold);
}
[data-surface="portal"] .bubble .bubble-body,
[data-surface="portal"] .bubble.outbound .bubble-body {
  border-radius: 4px;
}
[data-surface="portal"] .bubble.draft .bubble-body {
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
}
[data-surface="portal"] .bubble.draft .avatar { background: var(--surface); color: var(--gold); }

/* Writing your own reply, or changing CloserDesk's, happens on the same paper. */
[data-surface="portal"] :is(#compose-body, details.edit textarea[name="body"]) {
  max-width: 40rem;
  padding: 1.4rem 1.6rem;
  border: 0;
  border-top: 2px solid var(--gold);
  border-radius: 0;
  background: linear-gradient(170deg, #F7F2E8, #EEE6D6);
  color: #211C16;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.55;
  caret-color: #8A6A35;
}
[data-surface="portal"] :is(#compose-body, details.edit textarea[name="body"]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
[data-surface="portal"] input[name="subject"] { max-width: 40rem; }

/* The front door (the link from an email, and asking for a new one): no box,
 * just the name, a line of gold and one button, like the top of the website. */
[data-surface="portal"] main.narrow { padding-top: clamp(3.5rem, 14vh, 8rem); }
[data-surface="portal"] .front-door {
  max-width: 27rem;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
[data-surface="portal"] .front-door h1 { font-size: clamp(2.2rem, 6vw, 2.9rem); margin: 0 0 1rem; }
[data-surface="portal"] .front-door > p:not(.hint, .wordmark) { font-size: 1.05rem; color: var(--ink-soft); line-height: 1.6; }
[data-surface="portal"] .front-door button[type="submit"] { width: 100%; padding: 0.95rem 1.35rem; }
[data-surface="portal"] .wordmark {
  display: flex;
  align-items: center;
  margin: 0 0 2.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink);
}
[data-surface="portal"] .wordmark span { color: var(--gold); }
[data-surface="portal"] .wordmark::after { content: ""; flex: 0 0 2.5rem; height: 1px; margin-left: 0.9rem; background: var(--gold); }

/* Setting up: the ten steps as one line down the page. Done steps carry a
 * gold tick, the current one is lit, the ones ahead wait in grey. */
.steps { list-style: none; margin: 0 0 2rem; padding: 0; counter-reset: step; }
.steps li {
  position: relative;
  padding: 0 0 1.6rem 3rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--ground);
  color: var(--ink-faint);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}
.steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(0.875rem - 0.5px);
  top: 1.75rem;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.steps li.is-done::before { content: "\2713"; border-color: var(--gold); color: var(--gold); }
.steps li.is-done::after { background: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.steps li.is-current::before { background: var(--gold); border-color: var(--gold); color: var(--on-accent); font-weight: 600; }
.steps strong { display: inline-block; margin: 0.15rem 0.5rem 0.2rem 0; font-weight: 500; }
.steps li:not(.is-done, .is-current) strong { color: var(--ink-soft); }
.steps .meta { display: block; color: var(--ink-faint); font-size: 0.88rem; }
.steps-note { max-width: 40rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-soft); }

/* Sign out is the rarest thing on the bar: a word, not a box. */
[data-surface="portal"] .masthead .who button.quiet {
  border: 0;
  background: none;
  padding: 0.4rem 0;
  color: var(--ink-faint);
}
[data-surface="portal"] .masthead .who button.quiet:hover { color: var(--ink); transform: none; }

/* Folds: one small chevron that turns, instead of the browser's triangle. */
[data-surface="portal"] summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  color: var(--ink-soft);
}
[data-surface="portal"] summary::-webkit-details-marker { display: none; }
[data-surface="portal"] summary::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}
[data-surface="portal"] details[open] > summary::before { transform: rotate(45deg); }
[data-surface="portal"] summary:hover { color: var(--ink); }

/* The way back sits above the name, small and spaced like the site's labels. */
[data-surface="portal"] .crumb {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
[data-surface="portal"] .crumb a { color: var(--ink-faint); text-decoration: none; }
[data-surface="portal"] .crumb a::before { content: "\2190\00a0\00a0"; }
[data-surface="portal"] .crumb a:hover { color: var(--gold); }

/* An occasional errand, so a quiet link rather than a button. */
[data-surface="portal"] a.download {
  font-size: 0.85rem;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
}
[data-surface="portal"] a.download:hover { border-bottom-color: var(--gold); }
[data-surface="portal"] .page-head .no-print { margin-top: 0.85rem; }

[data-surface="portal"] .empty {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2.5rem 1.5rem;
}
[data-surface="portal"] .empty strong { font-family: var(--serif); font-size: 1.5rem; font-weight: 300; color: var(--ink); }

@media (max-width: 40rem) {
  [data-surface="portal"] :is(.todo-card-draft, .bubble.draft .draft-body) {
    padding: 1.25rem 1.2rem;
    font-size: 1.1rem;
  }
  [data-surface="portal"] .todo-card { padding: 1.1rem; }
  [data-surface="portal"] .day-strip { gap: 1rem 2rem; }
}

/* --- The venue's brain (Your answers) ---------------------------------------
 *
 * What CloserDesk knows, as a night sky: gold points are answers, brighter the
 * more replies they've gone into; dashed rings are questions with no answer;
 * a red ring is one a couple asked that it had to hand back. brain.ts draws it.
 */
.brain { margin: 0 0 2.5rem; }
.brain svg { display: block; width: 100%; height: auto; overflow: visible; }
.brain-spoke { stroke: var(--line); stroke-width: 1; }
.brain-spoke.lit { stroke: color-mix(in srgb, var(--gold) 45%, transparent); }
.brain-twig { stroke-width: 1; }
.brain-twig.known { stroke: color-mix(in srgb, var(--gold) 40%, transparent); }
.brain-twig.missing { stroke: var(--line); stroke-dasharray: 2 4; }
.brain-dot.known { fill: var(--gold); }
.brain-dot.used { fill: var(--gold-soft); filter: url(#brain-glow); }
.brain-dot.missing { fill: var(--ground); stroke: var(--ink-faint); stroke-width: 1.25; stroke-dasharray: 2 2.5; }
.brain-asked {
  fill: none;
  stroke: var(--bad);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: brain-pulse 2.4s ease-out infinite;
}
@keyframes brain-pulse { from { transform: scale(0.85); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.brain-label { font: 400 13px var(--font); fill: var(--ink-soft); }
.brain-label.missing { fill: var(--ink-faint); }
.brain-cluster { font: 500 10.5px var(--font); letter-spacing: 0.16em; text-transform: uppercase; fill: var(--gold); }
.brain-hub { fill: var(--surface); stroke: var(--gold); stroke-width: 1; }
.brain-hub-core { fill: var(--gold); filter: url(#brain-glow); }
.brain-venue { font: 300 22px var(--serif); fill: var(--ink); }
/* A halo in the page's own colour, so a line passing behind a word never runs through it. */
.brain :is(.brain-label, .brain-cluster, .brain-venue) { paint-order: stroke; stroke: var(--ground); stroke-width: 6px; stroke-linejoin: round; }
.brain-point { cursor: pointer; }
.brain-point:is(:hover, :focus-visible) .brain-dot { stroke: var(--ink); stroke-width: 2; }
.brain-point:is(:hover, :focus-visible) .brain-label { fill: var(--ink); }
.brain-point:focus { outline: none; }
.brain figcaption { display: grid; gap: 0.5rem; margin-top: 0.75rem; color: var(--ink-soft); font-size: 0.95rem; }
.brain-key { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; font-size: 0.8rem; color: var(--ink-faint); }
.brain-key i { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.4rem; vertical-align: -0.05rem; }
.brain-key i.known { background: var(--gold-soft); box-shadow: 0 0 6px var(--gold); }
.brain-key i.missing { border: 1px dashed var(--ink-faint); }
.brain-key i.asked { border: 1.5px solid var(--bad); }
@media (max-width: 40rem) {
  /* Too small to read at phone width; the list below says the same thing. */
  .brain-label { display: none; }
  .brain-cluster { font-size: 19px; }
  .brain-venue { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .brain-asked { animation: none; }
}

/* --- Couples board: five stages side by side, each a column of couples. */
.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(11rem, 1fr));
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.board-col h2 { font-size: 1rem; display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 0.5rem; }
.board-count { font-variant-numeric: tabular-nums; opacity: 0.7; }
.board-cards { display: grid; gap: 0.6rem; }
.couple {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 0.9rem;
}
.couple-name { font-weight: 600; }
.couple-date, .couple-source, .couple-why { color: var(--ink-soft); font-size: 0.85rem; }
.couple-next { font-size: 0.85rem; }
.couple-next.tone-warn { color: var(--warn); }
.couple-next.tone-good { color: var(--good); }
.couple-also { font-size: 0.8rem; }
.warmth { justify-self: start; font-size: 0.75rem; letter-spacing: 0.02em; padding: 0.1rem 0.5rem; border-radius: 999px; border: 1px solid currentColor; }
.warmth-hot { color: var(--bad); }
.warmth-warm { color: var(--warn); }
.warmth-cooling, .warmth-cold { color: var(--ink-soft); }
.code-block { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; }
@media (max-width: 720px) {
  .board { grid-template-columns: 1fr; overflow-x: visible; }
}

/* Holding a date: the date held, then the hold's last day, side by side. */
.hold-days { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Where couples are slipping away: one quiet line under the board summary. */
.leak-line { color: var(--ink-soft); margin-top: 0.25rem; }
.leak-line strong { color: var(--warn); }

/* --- A couple's own page: paper, not the desk --------------------------------
 *
 * The one surface a couple sees. It belongs to the venue, not to CloserDesk,
 * so it reads like the reply they were sent: warm paper, dark ink, a light
 * serif for what matters (their date, their price), and one quiet gold. Light
 * in every theme on purpose: it's the thing they hold, like the letter.
 */
[data-surface="couple"] {
  --ground: #F6F0E4;
  --surface: #FBF7EF;
  --line: rgba(33, 28, 22, 0.14);
  --line-strong: rgba(33, 28, 22, 0.28);
  --ink: #211C16;
  --ink-soft: rgba(33, 28, 22, 0.74);
  --ink-faint: rgba(33, 28, 22, 0.6);
  --accent: #211C16;
  --accent-strong: #000;
  --accent-soft: rgba(33, 28, 22, 0.06);
  --on-accent: #F6F0E4;
  --gold: #86662F;
  --good: #2F6B45;
  --good-soft: rgba(47, 107, 69, 0.08);
  --warn: #8A5A12;
  --warn-soft: rgba(138, 90, 18, 0.08);
  --bad: #97362C;
  --bad-soft: rgba(151, 54, 44, 0.07);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 2px;
  color-scheme: light;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-feature-settings: "lnum" 1;
}
[data-surface="couple"] main.narrow { max-width: 34rem; margin: 0 auto; padding: clamp(2rem, 8vh, 4.5rem) 1rem 4rem; }
[data-surface="couple"] ::selection { background: var(--gold); color: var(--ground); }
.couple { display: grid; gap: 0; }
.c-head { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 2rem; }
.c-logo { width: 40px; height: 40px; object-fit: contain; }
.c-venue { margin: 0; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); }
.couple h1 { margin: 0 0 1.25rem; font: 300 clamp(2.4rem, 8vw, 3.2rem)/1.05 var(--serif); letter-spacing: -0.015em; text-wrap: balance; }
.couple h2 { margin: 0 0 0.75rem; font: 400 1.65rem/1.2 var(--serif); text-wrap: balance; }
.couple h3 { margin: 1.25rem 0 0.5rem; font: 400 1.25rem/1.2 var(--serif); }
.couple p { margin: 0 0 0.75rem; line-height: 1.6; }
.c-yes h1, .c-yes .c-pre, .c-yes .plain-list { overflow-wrap: anywhere; }
.c-lede { font: 400 1.25rem/1.55 var(--serif); color: var(--ink-soft); }
.c-section { padding: 1.75rem 0; border-top: 1px solid var(--line); }
.c-label { margin: 0 0 0.5rem; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-faint); }
.c-big { margin: 0 0 0.4rem; font: 300 clamp(2rem, 7vw, 2.6rem)/1.1 var(--serif); text-wrap: balance; }
.c-quiet { color: var(--ink-faint); font-size: 0.95rem; }
.c-status { display: inline-block; margin: 0 0 1rem; font-size: 0.85rem; font-weight: 500; letter-spacing: 0.04em; }
.c-status.good { color: var(--good); }
.c-status.bad { color: var(--bad); }
.c-status.accent { color: var(--gold); }
.c-note { padding: 0.85rem 1rem; border-left: 2px solid var(--gold); background: var(--accent-soft); }
.c-note.good { border-color: var(--good); background: var(--good-soft); }
.c-note.warn { border-color: var(--warn); background: var(--warn-soft); }
.c-banner { margin: 0 0 1.5rem; padding: 0.85rem 1rem; border: 2px solid var(--warn); background: var(--warn-soft); color: var(--ink); }
.c-score { margin: 0 0 1rem; color: var(--ink-faint); }
.c-score strong { display: block; font: 400 2rem/1.1 var(--serif); color: var(--ink); }
.c-replay { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.c-replay li { display: grid; grid-template-columns: 4.5rem 1fr; gap: 0.75rem; line-height: 1.5; }
.c-at { font-variant-numeric: tabular-nums; color: var(--ink-faint); }
.c-reply .body { margin-bottom: 1rem; }
.c-from { display: block; margin-top: 0.25rem; font-size: 0.8rem; color: var(--ink-faint); }
.c-gap { padding: 0.6rem 0.8rem; border: 1px dashed var(--warn); background: var(--warn-soft); }
.c-gap .c-label { display: block; color: var(--warn); }
.c-estimate { margin: 1rem 0 0; padding: 1rem 0 0; border-top: 1px dashed var(--line); font: 400 1.2rem/1.5 var(--serif); }
.c-estimate p:first-child { font-size: 1.35rem; }
.c-dates { margin: 0 0 1rem; padding-left: 1.1rem; }
.c-dates a, .couple a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--gold); }
.c-check { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) auto; gap: 0.75rem; align-items: end; margin-top: 1.25rem; }
@media (max-width: 30rem) { .c-check { grid-template-columns: 1fr 1fr; } .c-check button { grid-column: 1 / -1; } }
.c-field { display: grid; gap: 0.35rem; }
.c-field span { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.06em; color: var(--ink-soft); }
.c-field small { color: var(--ink-faint); font-size: 0.82rem; }
.couple input:not([type="checkbox"]), .couple textarea {
  width: 100%; min-height: 44px; padding: 0.6rem 0.7rem; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem;
}
.couple textarea { min-height: 5.5rem; resize: vertical; }
.couple input:focus-visible, .couple textarea:focus-visible, .couple button:focus-visible, .couple a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.couple button, .c-button { min-height: 44px; padding: 0.7rem 1.2rem; font-size: 0.95rem; }
.c-button { display: inline-block; background: var(--accent); color: var(--on-accent) !important; text-decoration: none; border-radius: var(--radius); }
.c-form { display: grid; gap: 1rem; }
.c-tick { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; line-height: 1.5; }
.c-tick input { margin-top: 0.3rem; width: 1.1rem; height: 1.1rem; }
.c-pre { white-space: pre-wrap; }
.c-agreement { max-height: 60vh; overflow: auto; padding: 1rem; border: 1px solid var(--line); background: var(--surface); font: 400 1.05rem/1.6 var(--serif); }
.c-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.c-table th { text-align: left; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); padding: 0 0.5rem 0.5rem 0; }
.c-table td { padding: 0.6rem 0.5rem 0.6rem 0; border-top: 1px solid var(--line); vertical-align: top; }
.c-num { white-space: nowrap; }
.c-chip { font-size: 0.78rem; font-weight: 500; }
.c-chip.good { color: var(--good); }
.c-chip.bad { color: var(--bad); }
.c-sum { margin-top: 0.9rem; }
.c-howto { margin-top: 1rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); }
.c-link { word-break: break-all; font-size: 0.92rem; }
.c-opendays li { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.c-opendays li:first-child { border-top: 0; }
.c-trap { position: absolute; left: -9999px; }
.c-foot { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 0.9rem; }
/* Whatever a venue or a couple types, however long a word, wraps on a phone. */
.couple, textarea, .wedding-file, .wedding-list, .guest-list, .sheet-row dd, .quote { overflow-wrap: anywhere; }
[data-surface="couple"] .table-scroll { margin: 0 0 0.5rem; border-color: var(--line); background: var(--surface); }
.wedding-file .table-scroll { margin: 0 0 1rem; }

/* --- Prices and booking, weddings, open days (the owner's side of the desk) --- */
.price-row, .extra-row { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.9rem 1rem 1rem; margin: 0 0 0.75rem; display: grid; gap: 0.75rem; }
.price-row legend, .extra-row legend { padding: 0 0.35rem; font-size: 0.8rem; color: var(--ink-soft); }
.daypicks { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
.daypicks .check { margin: 0; min-height: 32px; }
.price-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 0.6rem 0.8rem; }
.price-grid label, .extra-row label { display: grid; gap: 0.3rem; font-size: 0.85rem; color: var(--ink-soft); }
.extra-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.extra-row .full { grid-column: 1 / -1; }
.plan-rows { display: grid; gap: 0.5rem; }
.plan-row { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.plan-head { font-size: 0.75rem; color: var(--ink-faint); }
@media (max-width: 34rem) { .plan-row { grid-template-columns: 1fr 1fr; } .plan-head { display: none; } .extra-row { grid-template-columns: 1fr; } }
.quote { margin: 0.5rem 0 1rem; padding: 0.75rem 1rem; border-left: 2px solid var(--gold); font-family: var(--serif); font-size: 1.1rem; font-style: italic; color: var(--ink-soft); }
.link-text { word-break: break-all; font-family: var(--mono); font-size: 0.82rem; }
.wedding-file { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.wedding-ask { padding: 0.9rem 1rem; margin: 0 0 1rem; border-left: 2px solid var(--gold); background: var(--accent-soft); }
.wedding-ask p { margin: 0 0 0.6rem; }
.wedding-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin: 0 0 1rem; }
.wedding-sum div { border-top: 1px solid var(--line); padding-top: 0.5rem; }
.wedding-sum dt { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.wedding-sum dd { margin: 0.2rem 0 0; font-family: var(--serif); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.wedding-payments { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.wedding-payments th { text-align: left; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); padding: 0 0.6rem 0.4rem 0; font-weight: 500; }
.wedding-payments td { padding: 0.5rem 0.6rem 0.5rem 0; border-top: 1px solid var(--line); vertical-align: middle; }
.wedding-payments form { margin: 0; }
.wedding-list > li, .guest-list > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.wedding-when { display: grid; gap: 0.15rem; }
.wedding-when span { color: var(--ink-soft); font-size: 0.92rem; }
.wedding-facts { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.guest-list form { margin: 0; }
.qr { max-width: 260px; margin: 0.5rem 0 1rem; background: #fff; padding: 12px; border-radius: var(--radius); }
.qr svg { display: block; width: 100%; height: auto; }
.sheet { display: grid; gap: 0; margin: 1.5rem 0; }
.sheet-row { display: grid; grid-template-columns: minmax(9rem, 0.6fr) minmax(0, 1.4fr); gap: 1rem; padding: 0.75rem 0; border-top: 1px solid var(--line); }
.sheet-row dt { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.sheet-row dd { margin: 0; white-space: pre-wrap; }
.sheet-row.missing dd { color: var(--warn); }
.sheet-day { font-family: var(--serif); font-size: 1.6rem; margin: 0.25rem 0; }
@media (max-width: 34rem) { .sheet-row { grid-template-columns: 1fr; gap: 0.25rem; } .wedding-sum { grid-template-columns: 1fr; } }
@media print {
  .print-hide, .masthead, .foot, .crumb { display: none !important; }
  .sheet-row { break-inside: avoid; }
}
.wedding-payments caption { caption-side: top; text-align: left; padding: 0 0 0.4rem; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }

/* --- The date desk: every weekend, two years ahead --------------------------- */
.demand-month { padding: 0.75rem 0; border-top: 1px solid var(--line); }
.demand-month h3 { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 500; }
.demand-days { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: 0.35rem; }
.demand-day a { display: grid; gap: 0.1rem; min-height: 44px; padding: 0.35rem 0.45rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-size: 0.8rem; line-height: 1.25; }
.demand-day b { font-weight: 500; }
.demand-state { color: var(--ink-faint); font-size: 0.72rem; }
.demand-asks { color: var(--ink-soft); font-size: 0.72rem; }
.demand-day.free a { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.demand-day.free .demand-state { color: var(--good); }
.demand-day.held a { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.demand-day.held .demand-state { color: var(--gold); }
.demand-day.booked a { opacity: 0.6; }
.demand-day.hot a { background: var(--good-soft); border-width: 2px; }
.demand-day.hot .demand-asks { color: var(--good); font-weight: 600; }

/* --- The season on one screen ------------------------------------------------------ */
.season-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.season-figure { border-top: 1px solid var(--line-strong); padding-top: 0.75rem; }
.season-label { margin: 0; font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.season-number { margin: 0.25rem 0; font-family: var(--serif); font-size: 2.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.season-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.season-grid .card { margin: 0; }
.season-lines { margin: 1.5rem 0 0.5rem; font-family: var(--serif); font-size: 1.15rem; color: var(--ink-soft); }
@media (max-width: 44rem) { .season-figures, .season-grid { grid-template-columns: 1fr; } }

/* --- The five steps to a full desk ------------------------------------------------ */
.setup-steps ol { display: grid; gap: 0.5rem; }
.setup-steps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.6rem; }

/* Day One: a venue's first hour (portal/day-one) */
.day-one-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--gap, 1rem); }
.day-one-step h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.day-one-step.is-done > .hint { margin-top: 0; }
.day-one-quote, .day-one-url { margin: .25rem 0; overflow-wrap: anywhere; }
.day-one-name { overflow-wrap: anywhere; }
.day-one-quote { white-space: pre-line; }
.day-one-rehearsal { list-style: none; padding: 0; display: grid; gap: var(--gap, 1rem); }
.side-by-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.side-by-side > div { min-width: 0; }

/* Your website: the venue's own words can be long and unbroken. */
.website-findings { padding: 0; list-style: none; }
.website-findings li, details.edit .plain-list li { overflow-wrap: anywhere; }

/* "Write a new reply": the words as they're written, while the next page loads (app.js). */
.writing-live { margin: .75rem 0 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.writing-label { margin: 0 0 .5rem; color: var(--ink-soft); font-size: .9rem; }
.writing-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow-y: auto; }
.writing-text:empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .writing-text:not(:empty)::after { content: "▍"; animation: 1s steps(2) infinite pressed; color: var(--ink-faint); }
}

/* The Statement: a month on one page, set like a private bank's letter. */
/* Paper in every theme: its own ink, never the page's. */
main.narrow:has(.statement) { max-width: 46rem; padding-top: 2rem; }
.statement { --ink: #211c16; --ink-soft: #5e554a; --ink-faint: #8a8174; --gold: #86662f; --line-strong: #cdbfa6; max-width: 44rem; margin: 0 auto; padding: 3rem clamp(1.25rem, 5vw, 3.5rem) 3.5rem; background: #fbf8f1; color: var(--ink); border: 1px solid #e4dccb; border-top: 3px solid var(--gold); }
.statement a:not(.button) { color: var(--gold); }
.statement-tools { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: 0 0 2rem; }
.statement-head { text-align: center; padding-bottom: 1.75rem; border-bottom: 1px solid #e4dccb; }
.statement-mark { margin: 0; font-size: .72rem; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); }
.statement-head h1 { margin: .6rem 0 .4rem; font-family: var(--serif); font-weight: 400; font-size: clamp(2.2rem, 6vw, 3rem); line-height: 1.05; }
.statement-for { margin: 0; color: var(--ink-soft); }
.statement-example { margin: 1.5rem 0 0; padding: .75rem 1rem; border: 1px dashed var(--line-strong); font-size: .9rem; color: var(--ink-soft); }
.statement-open { margin: 1.75rem 0; font-family: var(--serif); font-size: 1.3rem; line-height: 1.5; text-wrap: pretty; }
.statement-sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1.5rem 0; border-top: 1px solid #e4dccb; border-bottom: 1px solid #e4dccb; }
.statement-sums div { display: grid; gap: .35rem; align-content: start; }
.statement-sums span { font-size: .72rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-faint); }
.statement-sums b { font-family: var(--serif); font-weight: 400; font-size: clamp(1.6rem, 4vw, 2.3rem); line-height: 1; color: var(--gold); font-variant-numeric: lining-nums tabular-nums; }
.statement-sums small { font-size: .82rem; line-height: 1.4; color: var(--ink-soft); }
.statement-lines { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.statement-lines th, .statement-lines td { padding: .6rem 0; border-bottom: 1px solid #ece6d8; font-weight: 400; text-align: left; }
.statement-lines td { text-align: right; font-variant-numeric: tabular-nums; }
.statement-lines small { color: var(--ink-faint); }
.statement-basis { margin: 0; font-size: .85rem; color: var(--ink-faint); }
.statement-guarantee { margin: 0 0 1.5rem; padding: .75rem 1rem; border-left: 2px solid var(--line-strong); font-size: .95rem; }
.statement-sign { margin: 2.25rem 0 0; font-family: var(--serif); font-style: italic; font-size: 1.35rem; }
.statement-sign span { display: block; font-family: inherit; font-style: normal; font-size: .8rem; letter-spacing: .08em; color: var(--ink-faint); }
@media (max-width: 560px) { .statement-sums { grid-template-columns: 1fr; } }
@media print { .statement { border: 0; padding: 0; background: none; } }

/* ===========================================================================
 * The portal and the console, in closerdesk.me's colours.
 *
 * Last in the file so it settles every layer above. The same cream, navy and
 * muted gold as the homepage, the same grotesque with a mono for times, and its
 * four gold details: a line that draws under links, a marker that moves to the
 * picked page, and a gold focus ring. Light in every theme, like the site.
 * Screen only: print keeps its paper. The couple's page keeps its own look.
 * ======================================================================== */
@media screen {
  :is([data-surface="portal"], [data-surface="console"]) {
    --ground: #FDFBF7;
    --surface: #FFFFFF;
    --line: rgba(27, 38, 59, 0.10);
    --line-strong: rgba(27, 38, 59, 0.22);
    --ink: #1B263B;
    --ink-soft: rgba(27, 38, 59, 0.78);
    --ink-faint: rgba(27, 38, 59, 0.62);
    --accent: #1B263B;
    --accent-strong: #0F1726;
    --accent-soft: rgba(27, 38, 59, 0.06);
    --on-accent: #FDFBF7;
    --brass: #8C6A2E;
    --gold: #8C6A2E;
    --gold-soft: #B08D57;
    --good: #2F7A55;
    --good-soft: rgba(47, 122, 85, 0.08);
    --warn: #8A5A12;
    --warn-soft: rgba(138, 90, 18, 0.08);
    --bad: #97362C;
    --bad-soft: rgba(151, 54, 44, 0.07);
    --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --serif: var(--font);
    --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
    --radius: 10px;
    color-scheme: light dark;
    font-feature-settings: normal;
    background: var(--ground);
    -webkit-font-smoothing: antialiased;
  }
  :is([data-surface="portal"], [data-surface="console"]) ::selection { background: var(--gold); color: var(--ground); }

  /* Headings set like the site's: bold, tight, no serif. */
  :is([data-surface="portal"], [data-surface="console"]) :is(h1, h2, h3, .stat .value, .value-figure, .greeting, .brand) {
    font-family: var(--font);
    letter-spacing: -0.03em;
  }
  :is([data-surface="portal"], [data-surface="console"]) :is(h1, h2, h3) { font-weight: 700; }
  :is([data-surface="portal"], [data-surface="console"]) main > .greeting:first-child { font-weight: 700; color: var(--ink); }
  :is([data-surface="portal"], [data-surface="console"]) :is(.stat .value, .value-figure, .day-strip b) { font-weight: 700; color: var(--ink); }

  /* The wordmark: "Closer" in navy, "Desk" in gold, the door in plain small type. */
  :is([data-surface="portal"], [data-surface="console"]) .brand { font-weight: 800; font-size: 1.35rem; color: var(--gold); }
  :is([data-surface="portal"], [data-surface="console"]) .brand b { font-weight: 800; color: var(--ink); }
  :is([data-surface="portal"], [data-surface="console"]) .brand span {
    font-family: var(--mono); font-weight: 500; font-size: 0.75rem; letter-spacing: 0; text-transform: none;
    color: var(--ink-faint); vertical-align: 0.15em; margin-left: 0.35rem;
  }
  :is([data-surface="portal"], [data-surface="console"]) .nameplate {
    font-family: var(--font); font-weight: 700; letter-spacing: -0.02em;
    background: none; -webkit-text-fill-color: currentcolor; color: var(--gold);
  }

  [data-surface="portal"] .wordmark { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.03em; }
  [data-surface="portal"] .wordmark::after { display: none; }

  /* Sentence case, no wide tracking, anywhere on the desk. */
  :is([data-surface="portal"], [data-surface="console"]) * { text-transform: none; }
  :is([data-surface="portal"], [data-surface="console"]) :is(th, .stat .label, .goal, .proof-kicker, .season-label,
    .sheet-row dt, .wedding-sum dt, .wedding-payments th, .wedding-payments caption, .statement-mark, .statement-sums span) {
    letter-spacing: 0;
  }
  :is([data-surface="portal"], [data-surface="console"]) th { font-size: 0.85rem; }

  /* Header and foot: solid, one hairline. */
  :is([data-surface="portal"], [data-surface="console"]) .masthead { background: var(--ground); border-bottom: 1px solid var(--line); }
  :is([data-surface="portal"], [data-surface="console"]) .masthead-inner { align-items: center; }
  :is([data-surface="portal"], [data-surface="console"]) footer.foot { border-top: 1px solid var(--line); background: none; }
  :is([data-surface="portal"], [data-surface="console"]) .page-head::after { background: var(--gold); }

  /* Cards: white on cream, a soft line, the site's rounder corners. */
  :is([data-surface="portal"], [data-surface="console"]) :is(.card:not(.front-door), .todo-card, .stat) {
    background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: none;
  }

  /* Buttons: navy pills, like "Arrange a call". Quiet ones are outlined. */
  :is([data-surface="portal"], [data-surface="console"]) :is(button, .button) {
    border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
    font-weight: 600; letter-spacing: 0; box-shadow: none;
  }
  :is([data-surface="portal"], [data-surface="console"]) :is(button, .button):hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
  :is([data-surface="portal"], [data-surface="console"]) :is(button, .button):is(.secondary, .quiet) {
    background: transparent; color: var(--ink); border-color: var(--line-strong);
  }
  :is([data-surface="portal"], [data-surface="console"]) :is(button, .button):is(.secondary, .quiet):hover { background: var(--accent-soft); color: var(--ink); border-color: var(--ink); }
  :is([data-surface="portal"], [data-surface="console"]) button.quiet.demo-active { color: var(--warn); border-color: var(--warn); }
  /* A link-button stays a plain link, not a pill. */
  :is([data-surface="portal"], [data-surface="console"]) .link-button,
  :is([data-surface="portal"], [data-surface="console"]) .link-button:hover { background: none; border: 0; border-radius: 0; color: var(--ink); font-weight: inherit; }
  :is([data-surface="portal"], [data-surface="console"]) :is(input, select, textarea) { border-radius: 8px; background: var(--surface); color: var(--ink); }
  :is([data-surface="portal"], [data-surface="console"]) :is(input, select, textarea):focus { border-color: var(--gold); }

  /* The reply stays the one sheet of paper, now white with a gold top edge. */
  [data-surface="portal"] :is(.todo-card-draft, .bubble.draft .draft-body, #compose-body, details.edit textarea[name="body"]) {
    background: var(--surface); color: var(--ink); font-family: var(--font); font-size: 1.05rem;
    border: 1px solid var(--line); border-top: 2px solid var(--gold); border-radius: 4px;
    box-shadow: 0 18px 40px -30px rgba(27, 38, 59, 0.35); caret-color: var(--gold);
  }
  [data-surface="portal"] :is(.todo-card-draft, .bubble.draft .draft-body)::before { display: none; }

  /* 1. A thin gold line draws from the left under links on hover and focus.
   * Plain text links keep a faint resting line so they still read as links. */
  :is([data-surface="portal"], [data-surface="console"]) :is(main a:not([class]), .crumb a, .masthead nav a, .tabs a) {
    text-decoration: none;
    background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 1px;
    transition: background-size 0.28s ease-out, color 0.28s ease-out;
  }
  :is([data-surface="portal"], [data-surface="console"]) :is(main a:not([class]), .crumb a) {
    color: var(--ink); font-weight: 550;
    background: linear-gradient(var(--gold), var(--gold)) no-repeat 0 100% / 0 1px,
      linear-gradient(var(--line-strong), var(--line-strong)) no-repeat 0 100% / 100% 1px;
  }
  :is([data-surface="portal"], [data-surface="console"]) :is(main a:not([class]), .crumb a):is(:hover, :focus-visible) {
    color: var(--gold); background-size: 100% 1px, 100% 1px;
  }
  :is([data-surface="portal"], [data-surface="console"]) :is(.masthead nav a, .tabs a):is(:hover, :focus-visible) {
    color: var(--ink); background-size: 100% 1px;
  }

  /* 2. A gold marker under the picked page. Between pages the browser slides it
   * from the old link to the new one (the page dissolve above already runs). */
  :is([data-surface="portal"], [data-surface="console"]) .masthead nav a { color: var(--ink-soft); padding: 0.35rem 0; position: relative; }
  :is([data-surface="portal"], [data-surface="console"]) .tabs a { border-bottom: 0; margin-bottom: 0; position: relative; }
  :is([data-surface="portal"], [data-surface="console"]) :is(.masthead nav a, .tabs a)[aria-current="page"] { color: var(--ink); font-weight: 600; }
  :is([data-surface="portal"], [data-surface="console"]) :is(.masthead nav a, .tabs a)[aria-current="page"]::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--gold);
    transform: none; width: auto;
  }
  :is([data-surface="portal"], [data-surface="console"]) .masthead nav a[aria-current="page"]::after { bottom: -2px; view-transition-name: nav-mark; }
  :is([data-surface="portal"], [data-surface="console"]) .tabs a[aria-current="page"]::after { view-transition-name: tab-mark; }
  ::view-transition-group(nav-mark),
  ::view-transition-group(tab-mark) { animation-duration: 0.3s; animation-timing-function: ease-out; }

  /* 4. The keyboard focus ring is gold everywhere. */
  :is([data-surface="portal"], [data-surface="console"]) :focus-visible { outline: 2px solid #8C6A2E; outline-offset: 3px; }
}

@media screen and (prefers-reduced-motion: reduce) {
  :is([data-surface="portal"], [data-surface="console"]) a { transition: none; }
}

/* Night: the same desk with the lamp on, when the phone or laptop is set to dark.
 * Navy ground, cream text, and the gold lifted so it reads on navy. Buttons turn
 * cream with navy words, the way the navy ones read on cream by day. */
@media screen and (prefers-color-scheme: dark) {
  :is([data-surface="portal"], [data-surface="console"]) {
    --ground: #0F1726;
    --surface: #16213A;
    --line: rgba(253, 251, 247, 0.10);
    --line-strong: rgba(253, 251, 247, 0.22);
    --ink: #FDFBF7;
    --ink-soft: rgba(253, 251, 247, 0.78);
    --ink-faint: rgba(253, 251, 247, 0.62);
    --accent: #FDFBF7;
    --accent-strong: #FFFFFF;
    --accent-soft: rgba(253, 251, 247, 0.08);
    --on-accent: #0F1726;
    --brass: #CFAB6E;
    --gold: #CFAB6E;
    --gold-soft: #B08D57;
    --good: #6CC59A;
    --good-soft: rgba(108, 197, 154, 0.10);
    --warn: #DCAE62;
    --warn-soft: rgba(220, 174, 98, 0.10);
    --bad: #E08A7E;
    --bad-soft: rgba(224, 138, 126, 0.10);
    color-scheme: dark;
  }
  [data-surface="portal"] :is(.todo-card-draft, .bubble.draft .draft-body, #compose-body, details.edit textarea[name="body"]) {
    box-shadow: 0 18px 40px -30px rgba(0, 0, 0, 0.6);
  }
  :is([data-surface="portal"], [data-surface="console"]) :focus-visible { outline-color: #CFAB6E; }
}
