/* Blackton CRM base styles. Pair with tokens.css. Source of truth: docs/design.md.
   Fonts: add to <head>
   <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap">
*/

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--ground); }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

h1, .title {
  margin: 0;
  font-family: var(--font-title);
  font-size: var(--size-title);
  font-weight: 500;
  line-height: 1.05;
  color: var(--ink);
}
h1.lg { font-size: var(--size-title-lg); }
h2 { margin: 0; font-size: var(--size-body); font-weight: 600; color: var(--ink); }

.muted { color: var(--muted); }
.secondary { font-size: var(--size-secondary); }
.caption { font-size: var(--size-caption); color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.positive { color: var(--positive); }
.attention { color: var(--attention); font-weight: 500; }
.overdue { color: var(--overdue); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- shell ---------- */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; background: var(--ground); }

.nav {
  width: var(--nav-width);
  flex: 0 1 var(--nav-width);
  padding: 20px 12px;
  border-right: 1px solid var(--hairline);
  background: var(--tint);
  display: flex; flex-direction: column; gap: 2px;
}
.nav .wordmark {
  font-family: var(--font-title);
  font-size: var(--size-wordmark);
  font-weight: 600;
  color: var(--green);
  padding: 4px 12px 18px;
  line-height: 1.1;
}
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  min-height: var(--touch-h);
  border-radius: var(--radius);
  color: var(--text);
}
.nav a:hover { background: var(--tint-hover); text-decoration: none; }
.nav a[aria-current] { background: var(--tint-selected); font-weight: 600; }
.nav .spacer { flex: 1 1 auto; }
/* On a computer the sidebar is the screen's height and stays put, so Settings,
   Sign out and who is signed in are always at the bottom, however long the page. */
@media (min-width: 768px) {
  .nav { position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh; overflow-y: auto; }
}
.nav .foot {
  padding: 12px 12px 0; margin-top: 8px;
  border-top: 1px solid var(--hairline);
  font-size: var(--size-caption); color: var(--muted);
}

.main {
  flex: 999 1 560px;
  min-width: 0;
  max-width: 1440px;
  padding: var(--page-pad-y) var(--page-pad-x) 28px;
  display: flex; flex-direction: column; gap: var(--gap-section);
}

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 12px 24px;
}
.page-head .sub { color: var(--muted); font-size: var(--size-secondary); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.page-foot {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: var(--size-caption); color: var(--muted);
  display: flex; gap: 18px; flex-wrap: wrap;
}

/* ---------- controls ---------- */
.btn {
  height: var(--control-h);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { border-color: var(--line-strong); }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.quiet { color: var(--muted); }
.btn.sm { height: 32px; }
.btn.tall { height: 40px; }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented button { height: 34px; padding: 0 12px; border: 0; background: var(--paper); color: var(--text); }
.segmented button[aria-pressed="true"] { background: var(--green); color: #fff; font-weight: 500; }

input[type="search"], input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="time"], input[type="number"], input[type="password"], select, textarea {
  height: var(--control-h);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
}
textarea { height: auto; min-height: 72px; padding: 12px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--green); outline-offset: 1px;
}

.tag {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: var(--radius-tag);
  padding: 1px 6px;
  font-size: var(--size-tag);
  letter-spacing: .02em;
  line-height: 16px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- cards, tiles, columns ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.card:hover { border-color: var(--line-strong); }
.card.needs-you { border-color: var(--attention-line); }
.card .name { font-weight: 600; }
.card .facts { font-size: var(--size-caption); color: var(--muted); }
.card .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: var(--size-caption); color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--gap); }
.tile { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 14px; }
.tile .label { font-size: var(--size-caption); color: var(--muted); }
.tile .value { font-family: var(--font-title); font-size: var(--size-stat); font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.tile .foot { font-size: var(--size-caption); color: var(--muted); }

.board-scroll { overflow-x: auto; padding-bottom: 6px; }
.board { display: grid; grid-template-columns: repeat(7, minmax(148px, 1fr)); gap: var(--gap); min-width: 1120px; align-items: start; }
.column { display: flex; flex-direction: column; gap: 8px; }
.column-head {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 6px;
  min-height: calc(2.5em + 8px); /* room for a two-line name, so every underline stays level */
  padding: 0 2px 6px; line-height: 1.25;
  border-bottom: 2px solid var(--green);
}
.column-head .count { color: var(--muted); font-size: var(--size-caption); font-variant-numeric: tabular-nums; }
.column .more { font-size: var(--size-caption); padding: 4px 2px; }

.panel { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 14px; }
.panel h2 { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 10px; font-size: var(--size-secondary); margin: 0; }
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- timeline and messages ---------- */
.ev { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hairline); align-items: start; }
/* The kind of thing each row is, at its end. Press one to see only that kind. */
.ev .kind { background: transparent; cursor: pointer; margin-top: 1px; }
.ev .kind:hover { border-color: var(--line-strong); color: var(--text); }
.ev .kind[aria-pressed="true"], .subtabs #kind-tab { color: var(--green); border-color: var(--green); }
.subtabs #kind-tab { border: 1px solid var(--green); border-radius: var(--radius-tag); padding: 1px 6px; font-size: var(--size-tag); line-height: 16px; align-self: center; font-weight: 400; }
.ev .when { font-size: var(--size-caption); color: var(--muted); padding-top: 2px; }
.ev.needs-you { background: var(--attention-bg); border-top-color: var(--attention-bg-line); padding: 12px; border-radius: var(--radius); }
.bubble { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 10px 12px; max-width: 560px; }
.bubble.out { background: var(--green-soft); border-color: var(--green-soft-line); }
.bubble .via { font-size: var(--size-caption); color: var(--muted); margin-bottom: 4px; }
.bubble .text { white-space: pre-line; overflow-wrap: anywhere; }
.bubble .text.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.bubble .more { display: inline-block; margin-top: 6px; margin-right: 10px; font-size: var(--size-caption); }
.bubble .quoted { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); color: var(--muted); font-size: var(--size-caption); }
.ev .text .open { display: inline-block; margin-left: 8px; padding: 0 8px; line-height: 20px; border: 1px solid var(--line); border-radius: var(--radius-tag); font-size: var(--size-caption); color: var(--green); white-space: nowrap; vertical-align: 1px; }
.ev .text .open:hover { border-color: var(--green); text-decoration: none; background: var(--green-soft); }
/* A stage move the system made, under the event that caused it. */
.ev .tail { font-size: var(--size-caption); color: var(--muted); margin-top: -4px; }
.ev.needs-you + .ev.needs-you { margin-top: 8px; }

/* A note: who and when under the text, with Edit and a cross to delete. */
.ev .byline, .thread .msg .byline { font-size: var(--size-caption); color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.byline-actions { display: inline-flex; align-items: center; gap: 10px; }
.link-btn { border: 0; background: transparent; padding: 0; font: inherit; font-size: var(--size-caption); color: var(--green); cursor: pointer; }
.link-btn:hover { color: var(--green-dark); text-decoration: underline; }
.link-btn.quiet { color: var(--muted); }
.link-btn.x { color: var(--muted); font-size: 17px; line-height: 1; padding: 0 3px; }
.link-btn.x:hover { color: var(--overdue); text-decoration: none; }
.note-edit { display: flex; flex-direction: column; gap: 8px; }
.note-edit textarea { min-height: 56px; }

.composer { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); display: flex; flex-direction: column; }
.composer .tabs { display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--hairline); align-items: center; }
.composer .tabs button { height: 36px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); }
.composer .tabs button[aria-pressed="true"] { border-bottom-color: var(--green); color: var(--ink); font-weight: 600; }
.composer .window { margin-left: auto; font-size: var(--size-caption); color: var(--positive); padding-right: 6px; }
.composer .window.shut { color: var(--attention); }
.composer textarea { border: 0; border-radius: 0; background: transparent; }
.composer .actions { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-top: 1px solid var(--hairline); gap: 8px; flex-wrap: wrap; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; background: var(--paper); }
th { font-weight: 600; text-align: left; font-size: var(--size-caption); color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
th.r, td.r { text-align: right; }
tr.group td { background: var(--tint); font-weight: 600; padding: 8px 12px; font-size: var(--size-secondary); }

/* ---------- phone-first screens ---------- */
.choice {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: var(--phone-choice-h);
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-phone);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px; font-weight: 500; text-align: left;
}
.choice .why { font-weight: 400; font-size: var(--size-secondary); color: var(--muted); }
.choice.primary { background: var(--green); border-color: var(--green); color: #fff; }
.choice.primary .why { color: #fff; opacity: .85; }

/* ---------- phone width ---------- */
@media (max-width: 767px) {
  .nav { width: 100%; flex-basis: 100%; border-right: 0; border-bottom: 1px solid var(--hairline); flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .nav .wordmark { width: 100%; padding-bottom: 8px; }
  .nav .spacer, .nav .foot { display: none; }
  .main { padding: 16px; }
  .btn, .segmented button { min-height: var(--touch-h); }
}

/* ---------- page furniture (release 1 pages) ---------- */
.hint { font-size: var(--size-caption); color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }
.crumbs { font-size: var(--size-caption); color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--size-secondary); color: var(--muted); align-items: center; }
.stack { display: flex; flex-direction: column; gap: 2px; }
.stack.loose { gap: 6px; }
.search { width: 240px; max-width: 100%; }
.nav a.quiet { color: var(--muted); }
.hidden { display: none !important; }
.note { font-size: var(--size-caption); color: var(--muted); }
.panel .note { margin-top: 10px; }
.panel .link { font-size: var(--size-caption); display: inline-block; margin-top: 10px; }
.came-from p { margin: 0; font-size: var(--size-secondary); overflow-wrap: anywhere; }
.came-from p + p { margin-top: 4px; color: var(--muted); }
.btn.needs-you { border-color: var(--attention-line); background: var(--attention-bg); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-row.loose { gap: 8px; }
a.btn:hover { text-decoration: none; color: var(--text); }
a.btn.primary:hover { color: #fff; }

.empty { font-size: var(--size-secondary); color: var(--muted); padding: 14px 0; margin: 0; }
.column .empty { font-size: var(--size-caption); padding: 6px 2px; }
td .sub { font-size: var(--size-caption); color: var(--muted); }
td.secondary { font-size: var(--size-secondary); color: var(--muted); }
td.attention { font-size: var(--size-secondary); }

/* two columns on a couple's record: timeline and details */
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split .timeline { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; }
.split .aside { flex: 1 1 280px; max-width: 320px; display: flex; flex-direction: column; gap: var(--gap-section); }
.ev .body { display: flex; flex-direction: column; gap: 8px; }
.ev .text { font-size: var(--size-secondary); }

/* small in-page filters: Everything, Messages, Viewings, Notes */
.subtabs { display: flex; gap: 14px; font-size: var(--size-secondary); padding-bottom: 8px; flex-wrap: wrap; }
.subtabs button { border: 0; background: transparent; padding: 0 0 4px; color: var(--muted); border-bottom: 2px solid transparent; }
.subtabs button[aria-pressed="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--green); }

/* rich text (the email, the signature): a words-only toolbar and the text. Only
   the Formatting toolbars, so the page heads' toolbars keep their buttons. */
.toolbar[aria-label="Formatting"] { gap: 2px; padding: 8px 8px 0; }
.toolbar[aria-label="Formatting"] button { height: 28px; padding: 0 10px; border: 1px solid transparent; border-radius: var(--radius-tag); background: transparent; color: var(--muted); font-size: var(--size-caption); }
.toolbar[aria-label="Formatting"] button:hover { color: var(--text); border-color: var(--line); }
.toolbar[aria-label="Formatting"] button[aria-pressed="true"] { background: var(--tint-selected); color: var(--ink); border-color: var(--tint-selected); }
.rich { min-height: 110px; padding: 12px; outline: none; font-size: var(--size-body); line-height: 1.5; cursor: text; }
.composer .rich:empty::before { content: 'Write the email'; color: var(--muted); }
.rich p { margin: 0 0 10px; }
.rich ul, .rich ol { margin: 0 0 10px; padding-left: 22px; }
.rich a { color: var(--green); text-decoration: underline; }
.rich img { max-width: 100%; height: auto; display: block; }
.rich-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.rich-box .rich { min-height: 80px; }
.preview { width: 100%; height: 420px; border: 1px solid var(--hairline); border-radius: var(--radius); background: #F6F2ED; }
.composer .attach { display: flex; gap: 14px 18px; flex-wrap: wrap; padding: 8px 12px 10px; border-top: 1px solid var(--hairline); font-size: var(--size-secondary); }
.composer .attach label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.composer .attach input { margin: 0; width: 16px; height: 16px; }

/* composer when the WhatsApp window is shut: pick a template instead of typing */
.composer .pick { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.composer .pick label { font-size: var(--size-caption); color: var(--muted); }
.composer .pick .btn { align-self: flex-start; }
/* A saved WhatsApp message as the couple will read it, before it is sent. */
.wa-preview { white-space: pre-wrap; margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--tint); color: var(--muted); font-size: var(--size-secondary); line-height: 1.5; }
.composer .subject { border: 0; border-bottom: 1px solid var(--hairline); border-radius: 0; background: transparent; }
.composer .links { display: flex; gap: 8px; font-size: var(--size-caption); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--size-secondary); font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; }
.field.check { flex-direction: row; align-items: center; gap: 8px; min-height: var(--control-h); }
.field.check input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--green); }
.field.check label { font-weight: 400; }
.form-error { font-size: var(--size-secondary); color: var(--attention); font-weight: 500; margin: 0; }
.form-ok { font-size: var(--size-secondary); color: var(--positive); margin: 0; }

/* ---------- login ---------- */
.login { max-width: 360px; margin: 0 auto; padding: 12vh 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.login .wordmark { font-family: var(--font-title); font-size: var(--size-wordmark); font-weight: 600; color: var(--green); }

/* ---------- phone-first screen ---------- */
.phone { max-width: 390px; min-height: 100vh; margin: 0 auto; padding: 48px 20px 28px; display: flex; flex-direction: column; gap: 18px; font-size: 15px; }
.phone-top { display: flex; justify-content: space-between; align-items: center; font-size: var(--size-secondary); color: var(--muted); }
.phone h1 { font-size: 32px; }
.phone textarea { border-radius: var(--radius-phone); resize: none; }
.phone .choices { display: flex; flex-direction: column; gap: 10px; }
.phone .next { font-size: var(--size-body); color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.phone .spacer { flex: 1 1 auto; }
.choice.center { justify-content: center; }
.choice[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.choice[aria-pressed="true"] .why { color: #fff; opacity: .85; }
.page-head.top { align-items: flex-start; }
/* Move to: a stage picker beside the record's actions, for phone and computer alike. */
.move { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.move label { font-size: var(--size-caption); color: var(--muted); }
.move select { height: var(--control-h); min-width: 0; }
.ev .when { white-space: pre-line; }
.composer .tabs { flex-wrap: wrap; }
.composer .tabs button { white-space: nowrap; }
@media (max-width: 767px) {
  .composer .window { flex-basis: 100%; margin-left: 0; padding: 0 4px 8px; }
}

/* ---------- settings: panels of rules and editable tables ---------- */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; align-items: start; }
.panels .wide { grid-column: 1 / -1; }
.panel.stacked { display: flex; flex-direction: column; gap: 12px; }
.panel.stacked h2 { margin-bottom: 0; }
.panel.stacked .why { font-size: var(--size-caption); color: var(--muted); margin-top: -6px; }
.panel.stacked h3 { margin: 6px 0 0; font-size: var(--size-secondary); font-weight: 600; color: var(--ink); }
.panel.stacked .note, .panel.stacked .form-ok, .panel.stacked .form-error, .panel.stacked .empty { margin: 0; }
.panel.stacked .empty { padding: 4px 0; }
.rules { display: flex; flex-direction: column; gap: 10px; }
.rules .btn-row { margin-top: 4px; }
.rule { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 10px; align-items: center; font-size: var(--size-secondary); }
.rule.wide { grid-template-columns: minmax(0, 1fr) minmax(140px, 55%); }
.rule input, .rule select { width: 100%; min-width: 0; }
.rule input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
.rule input:disabled { color: var(--muted); background: var(--tint); }
table.edit th { padding: 10px 8px; }
table.edit td { padding: 6px 8px; vertical-align: middle; }
table.edit input, table.edit select { width: 100%; min-width: 120px; }
table.edit input[type="number"] { min-width: 88px; text-align: right; font-variant-numeric: tabular-nums; }
table.edit textarea { width: 100%; min-width: 240px; min-height: 64px; }
table.edit input[type="checkbox"] { width: 18px; height: 18px; min-width: 0; margin: 0; vertical-align: middle; }
th.narrow { width: 96px; }
th.mid { width: 150px; }
th.check, td.check { width: 64px; text-align: center; }

/* ---------- auctions ---------- */
/* Each date is a row that opens in place to show its bids and actions: the row
   above it tints, the detail grows from 0fr to 1fr (no fixed heights), and its
   content fades up a touch behind the growth. */
.tile .tile-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tile .tile-top .caption { font-variant-numeric: tabular-nums; }

/* Short columns take only what they need; "Where it stands" takes the rest. */
table.dates .c-date, table.dates .c-season, table.dates .c-min, table.dates .c-bids, table.dates .c-top, table.dates .c-act { width: 1%; white-space: nowrap; }
table.dates .c-act { text-align: right; }
table.bids th:not(:first-child), table.bids td:not(:first-child) { width: 1%; white-space: nowrap; }
table.dates tbody tr.date { cursor: pointer; }
table.dates tbody tr.date td { transition: background .15s ease; }
table.dates tbody tr.date:hover td, table.dates tbody tr.date[aria-expanded="true"] td { background: var(--tint); }
table.dates tbody tr.date[aria-expanded="true"] td { border-bottom-color: transparent; }
table.dates tr.date td.c-date { white-space: nowrap; }
table.dates tr.date td.c-date a { font-weight: 600; color: var(--ink); }
table.dates tr.date td.c-date a:hover { color: var(--green-dark); }
table.dates tr.date td.c-date .count { font-size: var(--size-caption); color: var(--muted); font-weight: 400; margin-left: 6px; }
table.dates tr.detail > td { padding: 0; border-bottom: 0; background: var(--tint); }
table.dates tr.detail.open > td { border-bottom: 1px solid var(--hairline); }

.expand { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s cubic-bezier(.16, 1, .3, 1); }
.expand > div { overflow: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .22s ease, transform .35s cubic-bezier(.16, 1, .3, 1); }
.expand.open { grid-template-rows: 1fr; }
.expand.open > div { opacity: 1; transform: none; }
.detail-in { padding: 2px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.detail-in .table-scroll { background: var(--paper); }
.detail-in .between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 32px; }
table.bids { min-width: 600px; }
.pager { display: inline-flex; align-items: center; gap: 10px; }
.segmented.sm button { height: 26px; min-width: 26px; padding: 0 8px; font-size: var(--size-caption); font-variant-numeric: tabular-nums; }
/* One line per bid, every row the same height: the name, its tags and Inform beside it. */
table.bids td { padding: 0 12px; height: 44px; white-space: nowrap; vertical-align: middle; }
table.bids .btn.inline { height: 26px; padding: 0 9px; margin-left: 8px; font-size: var(--size-caption); vertical-align: 1px; }
table.bids td.nowrap { white-space: nowrap; }
table.bids td.nowrap .btn.inline:first-child { margin-left: 0; }
table.bids .tag { margin-left: 6px; vertical-align: 1px; }

/* Rows settle into place on the first load, a few at a time. */
@keyframes row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
table.dates.fresh tbody tr.date { animation: row-in .28s ease both; }

/* Bids placed, by day: one column per day of the round, one dot per bid. Dots
   pop in on a diagonal stagger; hovering a day dims the others. */
.dots-wrap { width: min(100%, 560px); }
.dots { display: flex; align-items: flex-end; justify-content: space-between; gap: 3px; min-height: 52px; padding-top: 10px; position: relative; }
.dots .col { flex: 1 1 0; max-width: 8px; min-width: 3px; display: flex; flex-direction: column-reverse; align-items: stretch; gap: 3px; cursor: default; transition: opacity .2s ease; padding-top: 10px; }
.dots:hover .col { opacity: .3; }
.dots .col:hover { opacity: 1; }
.dots .col > i { display: block; height: 1px; background: var(--line); }
.dots .col.today > i { height: 2px; background: var(--green); }
.dots .col.future > i { background: var(--hairline); }
.dots .col > b { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--green); animation: dot-in .35s cubic-bezier(.34, 1.56, .64, 1) both; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.dots .col > b.gone { background: var(--line-strong); }
.dots .col:hover > b { transform: scale(1.35); }
@keyframes dot-in { from { opacity: 0; transform: translateY(6px) scale(0); } to { opacity: 1; transform: none; } }
.dots-foot { display: flex; justify-content: space-between; font-size: var(--size-caption); color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .expand, .expand > div, table.dates tbody tr.date td, .dots .col, .dots .col > b { transition: none; }
  table.dates.fresh tbody tr.date, .dots .col > b { animation: none; }
}

/* On a phone each date is a block (its season, minimum and bid count on one
   line), so the detail opens under it without a sideways scroll. The bids table
   inside the detail stays a table and scrolls in its own box. */
table.dates .c-phone { display: none; }
@media (max-width: 767px) {
  table.dates > thead { display: none; }
  table.dates, table.dates > tbody, table.dates > tbody > tr, table.dates > tbody > tr > td { display: block; }
  table.dates > tbody > tr.date { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date top" "facts facts" "state act"; gap: 2px 12px; padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
  table.dates > tbody > tr.date > td { padding: 0; border-bottom: 0; }
  table.dates > tbody > tr.date > td.c-date { grid-area: date; }
  table.dates > tbody > tr.date > td.c-top { grid-area: top; text-align: right; font-weight: 600; }
  table.dates > tbody > tr.date > td.c-season, table.dates > tbody > tr.date > td.c-min, table.dates > tbody > tr.date > td.c-bids { display: none; }
  table.dates > tbody > tr.date > td.c-phone { display: block; grid-area: facts; font-size: var(--size-caption); color: var(--muted); }
  table.dates > tbody > tr.date > td.c-state { grid-area: state; align-self: center; }
  table.dates > tbody > tr.date > td.c-act { grid-area: act; text-align: right; }
  table.dates > tbody > tr.detail > td { width: 100%; }
}
td .btn-row .secondary { white-space: normal; }
.nav a.quiet[aria-current] { color: var(--text); }

/* ---------- today ---------- */
.today .tiles, .today .today-panels { max-width: 1120px; }
.today .tile { display: flex; flex-direction: column; gap: 2px; }
.today .tile .value { margin-top: 2px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 30px; margin: 8px 0 6px; }
.spark b { flex: 1 1 0; min-height: 2px; background: var(--green); border-radius: 1px; transition: height .5s cubic-bezier(.34, 1.56, .64, 1); }
.spark b.last { background: var(--line-strong); }
.spark b.future { background: var(--hairline); height: 2px !important; }
.spark b.today { outline: 1px solid var(--green); outline-offset: 1px; }
.today-panels { grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); margin-top: var(--gap); }
.today .panel h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.today .panel h2 .count { font-family: var(--font-body); font-size: var(--size-caption); color: var(--muted); font-weight: 400; }
/* Every row has the same padding, highlighted or not, so the times, names and
   buttons line up down a panel. */
.today .row { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 9px 10px; border-top: 1px solid var(--hairline); }
.today .row.needs-you { background: var(--attention-bg); border-top-color: transparent; border-radius: var(--radius); margin-top: 4px; }
.today .row .when { font-size: var(--size-caption); color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.3; }
.today .row .who { font-weight: 500; }
.today .row .what { font-size: var(--size-secondary); color: var(--muted); margin-top: 1px; }
.today .row .actions { display: flex; gap: 8px; justify-content: flex-end; }
.today .quiet { color: var(--muted); font-size: var(--size-secondary); padding: 6px 10px 2px; border-top: 1px solid var(--hairline); }
/* "Show 4 more" and "5 waiting over a week" under Waiting on you. */
.today .more { display: block; width: 100%; text-align: left; font-size: var(--size-secondary); padding: 9px 10px 3px; border-top: 1px solid var(--hairline); margin-top: 4px; }
@media (max-width: 600px) {
  .today .row { grid-template-columns: 1fr auto; }
  .today .row .when { grid-column: 1 / -1; }
}

/* ---------- the record's thread, read like a messenger ---------- */
.thread { display: flex; flex-direction: column; gap: 8px; max-height: min(68vh, 760px); overflow-y: auto; padding: 8px 6px 14px; scroll-behavior: smooth; }
.thread .sys { align-self: center; max-width: 92%; text-align: center; font-size: var(--size-caption); color: var(--muted); padding: 2px 8px; line-height: 1.5; }
.thread .sys .text { display: inline; font-size: inherit; }
.thread .sys strong { font-weight: 500; color: var(--text); }
.thread .sys .tail { color: var(--muted); }
.thread .sys.day { background: var(--paper); border: 1px solid var(--hairline); border-radius: 999px; padding: 2px 12px; margin: 8px 0 2px; }
.thread .msg { max-width: min(76%, 640px); border-radius: 14px; padding: 10px 14px; background: var(--paper); border: 1px solid var(--hairline); font-size: var(--size-secondary); }
.thread .msg.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.thread .msg.out { align-self: flex-end; background: var(--green-soft); border-color: var(--green-soft-line); border-bottom-right-radius: 4px; }
/* A note sits in the middle, like the lines the CRM writes, on plain stone with a dashed edge: the team's own, never the couple's, never a warning. */
.thread .msg.note { align-self: center; width: min(76%, 560px); max-width: none; background: var(--note-bg); border: 1px dashed var(--note-line); border-radius: var(--radius); }
.thread .msg .subject { font-weight: 600; margin-bottom: 2px; }
.thread .msg .text { white-space: pre-line; overflow-wrap: anywhere; }
.thread .msg .text.clamped { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.thread .msg .more { display: inline-block; margin-top: 6px; margin-right: 10px; font-size: var(--size-caption); }
.thread .msg .quoted { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--line); color: var(--muted); font-size: var(--size-caption); }
.thread .msg .meta { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; font-size: var(--size-caption); color: var(--muted); }
.thread .msg.in .meta { justify-content: flex-start; }
.thread .msg .meta .kind { background: transparent; cursor: pointer; }
.thread .msg .meta .kind:hover { border-color: var(--line-strong); color: var(--text); }
.thread .msg .meta .kind[aria-pressed="true"] { color: var(--green); border-color: var(--green); }
.thread .msg .meta .attention { color: var(--attention); }
.thread .msg.auto { background: var(--paper); border-color: var(--line); }
.thread .msg.auto .head { display: flex; justify-content: space-between; gap: 14px; align-items: baseline; width: 100%; border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.thread .msg.auto .head .subject { margin: 0; font-weight: 500; }
.thread .msg.auto .head .chev { font-size: var(--size-caption); color: var(--green); white-space: nowrap; }
.thread .msg.auto .inner { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hairline); }
.thread .msg .byline { margin-top: 6px; }
@media (max-width: 600px) { .thread .msg { max-width: 90%; } .thread { max-height: 60vh; } }

/* ---------- email many ---------- */
.mailout-panels { grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); }
.mailout .checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.mailout .checks label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--size-secondary); }
.mailout .checks input[type="checkbox"], .mailout .checks input[type="radio"] { width: 16px; height: 16px; }
.mailout .checks input[type="datetime-local"] { height: 36px; }
.mailout tr.dim td { color: var(--muted); }
.mailout .field > .label { display: block; font-size: var(--size-caption); color: var(--muted); margin-bottom: 6px; }
.mailout .count { margin: 8px 0 4px; font-size: var(--size-secondary); }
.mailout details summary { cursor: pointer; font-size: var(--size-caption); color: var(--muted); }
.mailout .names { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--size-caption); color: var(--muted); padding-top: 6px; }
.mailout .preview { width: 100%; height: 520px; border: 1px solid var(--line); background: #fff; margin-top: 10px; }
.mailout #result.attention { color: var(--attention); }

/* ---------- money: sub tabs, the book, the house, costs ---------- */
/* Sub tabs with a sliding thumb (the pill tab in Cue Foundations, MIT, rebuilt as
   the CRM's segmented control): one green thumb moves under the picked tab. */
.segmented.slide { position: relative; background: var(--paper); align-self: flex-start; max-width: 100%; overflow-x: auto; }
.segmented.slide button { position: relative; z-index: 1; background: transparent; white-space: nowrap; transition: color .2s ease; }
.segmented.slide button[aria-selected="true"] { color: #fff; font-weight: 500; }
.segmented.slide button:focus-visible { outline: 2px solid var(--green-dark); outline-offset: -4px; }
.segmented.slide .thumb { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--green); transition: transform .4s cubic-bezier(.34, 1.3, .64, 1), width .4s cubic-bezier(.34, 1.3, .64, 1); }
.money .pane { display: flex; flex-direction: column; gap: 14px; }
.money .pane.pane-in { animation: row-in .28s ease both; }
.book .note, .book .form-ok, .book .form-error { margin: 0; }
.book-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 32px; }
.book-head select { height: 32px; }
tr.total td { background: var(--tint); font-weight: 600; }

/* Month by month: one column a month, one dot per step of money. Dots pop in on a
   stagger; hovering a month dims the others; the picked month is underlined. */
.tile.chart { display: flex; flex-direction: column; gap: 6px; }
.mchart { display: flex; align-items: flex-end; gap: 4px; min-height: 120px; padding-top: 8px; }
.mchart .m { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: transparent; padding: 4px 0 0; color: var(--muted); font-size: var(--size-caption); cursor: pointer; transition: opacity .2s ease; }
.mchart .m.future { cursor: default; opacity: .5; }
.mchart:hover .m:not(.future) { opacity: .35; }
.mchart .m:hover, .mchart:hover .m:hover { opacity: 1; }
.mchart .pile { display: flex; flex-wrap: wrap-reverse; align-content: flex-start; justify-content: center; gap: 3px; width: 21px; min-height: 2px; padding-bottom: 5px; border-bottom: 1px solid var(--line); box-sizing: content-box; }
.mchart .m[aria-pressed="true"] .pile { border-bottom: 2px solid var(--green); padding-bottom: 4px; }
.mchart .m[aria-pressed="true"] .mn { color: var(--ink); font-weight: 600; }
.mchart .pile b { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); animation: dot-in .35s cubic-bezier(.34, 1.56, .64, 1) both; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.mchart .pile b.c { background: var(--line-strong); }
.mchart .pile b.o { background: transparent; border: 1px solid var(--line-strong); box-sizing: border-box; }
.mchart .m:hover b { transform: scale(1.25); }
.mchart .m:focus-visible { outline: 2px solid var(--green-dark); outline-offset: 2px; border-radius: var(--radius); }
.mkey { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--size-caption); color: var(--muted); }
.mkey i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; background: var(--green); }
.mkey i.c { background: var(--line-strong); }
.mkey i.o { background: transparent; border: 1px solid var(--line-strong); box-sizing: border-box; }
.mkey span:last-child { margin-left: auto; }

/* The two sides for the picked month and the year. */
.sides { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: var(--gap); }
.tile.side { display: flex; flex-direction: column; gap: 8px; }
.tile .label.strong { color: var(--ink); font-weight: 600; font-size: var(--size-secondary); }
table.four { background: transparent; }
table.four th { padding: 4px 0 6px; }
table.four td { padding: 7px 0; font-size: var(--size-secondary); }
table.four th.r, table.four td.r { width: 28%; }
table.four tr.total td { background: transparent; border-bottom: 0; border-top: 1px solid var(--line); }
.btn.fold { align-self: flex-start; }
.btn.fold::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .25s ease; }
.btn.fold[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }
table.months tbody tr[data-month] { cursor: pointer; }
table.months tbody tr[data-month]:hover td, table.months tr.picked td { background: var(--tint); }

/* The house, one row a month. */
.house-table { max-width: 640px; }
.house-table td.act { width: 1%; white-space: nowrap; font-size: var(--size-secondary); }
.house-table .state.positive { color: var(--positive); }
@media (max-width: 767px) { .money .tiles { grid-template-columns: 1fr 1fr; } }
table.cost-lines td:last-child { width: 1%; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .segmented.slide .thumb, .mchart .m, .mchart .pile b, .btn.fold::after { transition: none; }
  .mchart .pile b, .money .pane.pane-in { animation: none; }
}

/* ---------- events ---------- */
/* The editor: the name and the place take a wider column; the photo is picked
   from eight venue photos, the picked one ringed in green. */
.event-form .form .cols .wide { grid-column: span 2; }
@media (max-width: 767px) { .event-form .form .cols .wide { grid-column: auto; } }
.photo-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; max-width: 820px; }
.event-form .segmented { align-self: flex-start; }
.photo-pick button { padding: 0; border: 1px solid var(--hairline); border-radius: var(--radius); background: var(--paper); aspect-ratio: 4 / 3; overflow: hidden; cursor: pointer; position: relative; transition: border-color .15s ease, box-shadow .15s ease; }
.photo-pick button img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .82; transition: opacity .15s ease; }
.photo-pick button:hover img, .photo-pick button[aria-checked="true"] img { opacity: 1; }
.photo-pick button[aria-checked="true"] { border-color: var(--green); box-shadow: 0 0 0 2px var(--green); }
table.events td.c-season { white-space: nowrap; }
table.events td.c-season .tag { margin-left: 8px; vertical-align: 1px; }
table.events td.c-min { width: 1%; white-space: nowrap; }
.event-facts { padding-top: 4px; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.add-row select { max-width: 320px; }
@media (max-width: 767px) {
  table.events > tbody > tr.date > td.c-season, table.events > tbody > tr.date > td.c-min { display: none; }
}

/* ---------- gone quiet ---------- */
.quiet-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.quiet-bar select { width: auto; }
.quiet-bar .spacer { flex: 1; }
table.quiet th.c-pick, table.quiet td.c-pick { width: 1%; padding-right: 0; }
table.quiet td.c-pick input, table.quiet th.c-pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); vertical-align: middle; }
table.quiet tr.picked td { background: var(--tint); }
.archived-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--note-bg); border: 1px solid var(--note-line); border-radius: var(--radius); padding: 10px 14px; }
.quiet-line { margin: 10px 0 0; }

/* Deleting a couple on request (couple.html) */
.btn.danger { background: var(--overdue); border-color: var(--overdue); color: #fff; font-weight: 500; }
.btn.danger:hover { filter: brightness(0.92); border-color: var(--overdue); }
.erase-link { display: block; margin-top: 14px; }
.erase-link:hover { color: var(--overdue); }
.panel.erase p { margin: 0 0 8px; max-width: 64ch; }
.panel.erase .btn-row { margin-top: 12px; }

/* The Add a couple pop-up (js/add-couple.js) and the note after saving */
.dialog { width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--text); box-shadow: 0 18px 50px rgba(20, 30, 25, .18); }
.dialog::backdrop { background: rgba(28, 36, 32, .38); }
.dialog .form { gap: 0; max-height: inherit; display: flex; flex-direction: column; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 6px; }
.dialog-head h2 { margin: 0; }
.dialog-x { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: var(--radius); }
.dialog-x:hover { color: var(--ink); background: var(--tint); }
.dialog-body { display: flex; flex-direction: column; gap: 14px; padding: 10px 18px 16px; overflow-y: auto; }
.dialog .cols.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dialog .cols.three { grid-template-columns: 1.2fr 1.2fr .8fr; }
.dialog .checks-row { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: -4px 0; }
.dialog-match { margin: -4px 0 0; padding: 8px 12px; background: var(--note-bg); border: 1px solid var(--note-line); border-radius: var(--radius); font-size: var(--size-secondary); }
.dialog-more summary { cursor: pointer; font-size: var(--size-secondary); color: var(--muted); width: max-content; }
.dialog-more[open] summary { margin-bottom: 12px; }
.dialog-foot { display: flex; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--hairline); background: var(--paper); }
@media (max-width: 560px) {
  .dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .dialog .cols.two, .dialog .cols.three { grid-template-columns: 1fr; }
  .dialog .form { height: 100%; }
  .dialog-body { flex: 1; }
}
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius); font-size: var(--size-secondary); box-shadow: 0 10px 30px rgba(20, 30, 25, .2); z-index: 50; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: inherit; text-decoration: underline; }

/* Settings: the owners' switches for lines in the welcome emails. */
fieldset.switches { border: 0; padding: 0; margin: 4px 0 8px; min-width: 0; }
fieldset.switches legend { font-weight: 600; padding: 0; margin-bottom: 2px; }
label.tick { display: flex; align-items: flex-start; gap: 10px; min-height: var(--control-h); padding: 6px 0; font-weight: 400; line-height: 1.45; cursor: pointer; }
label.tick input { width: 18px; height: 18px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--green); }

/* a table read as cards on a phone: each cell with its column's name (data-label) */
@media (max-width: 600px) {
  table.cards-on-phone thead { display: none; }
  table.cards-on-phone, table.cards-on-phone tbody, table.cards-on-phone tr, table.cards-on-phone td { display: block; width: 100%; }
  table.cards-on-phone tr { border-bottom: 1px solid var(--hairline); padding: 10px 12px; }
  table.cards-on-phone tr.group { background: var(--paper); padding: 8px 12px; font-weight: 500; }
  table.cards-on-phone td { border: 0; padding: 3px 0; text-align: left; }
  table.cards-on-phone td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 96px; color: var(--muted); font-size: var(--size-caption); }
}

/* the board on a phone: the columns one under another, empty ones folded away */
@media (max-width: 767px) {
  .board { grid-template-columns: 1fr; min-width: 0; }
  .board .column:has(> .empty) { display: none; }
  .board-scroll { overflow-x: visible; }
}

/* Today on a phone: who needs you first, the week's numbers after */
@media (max-width: 767px) {
  body[data-page="today"] .main { display: flex; flex-direction: column; }
  body[data-page="today"] .main > .tiles { order: 10; }
}

/* a couple's messages on a phone: one page scroll, not a box inside it */
@media (max-width: 600px) { .thread { max-height: none; } }

/* Settings: a template as a couple reads it, the wording to change folded under it */
.tpl-preview { white-space: pre-wrap; font-size: var(--size-secondary); background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 10px 12px; max-height: 240px; overflow: auto; }
.tpl-edit summary, details.help summary { cursor: pointer; color: var(--green); font-size: var(--size-caption); margin-top: 6px; }
.tpl-edit textarea { margin-top: 6px; }
details.help ul { margin: 6px 0 0; padding-left: 18px; }
details.help li { margin: 2px 0; }
.signoff-show { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 50%; margin-top: 8px; }
