/* The Edge Home and Garden: quotes and invoices. Mobile first; the colours
   are the website's (theedgehomeandgarden.co.uk). */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --bg: #f6f4e7;
  --paper: #fffdf6;
  --tint: #eeeadb;
  --ink: #1b3326;
  --ink-hover: #284a38;
  --text: #2a3a2f;
  --muted: #56645a;
  --leaf: #4e7032;
  --leaf-soft: #e3ead6;
  --bark: #8a5b2e;
  --bark-soft: #f3e6d6;
  --line: #d9d2bd;
  --danger: #a33a2a;
  --danger-soft: #f6e1dc;
  --radius: 14px;
  --tabbar: 68px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; }
a { color: var(--leaf); }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 0.75rem; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; }

/* ------------------------------------------------------------ app frame */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: rgba(255, 253, 246, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar img { height: 40px; width: auto; display: block; }
.topbar-title { font-weight: 700; color: var(--ink); font-size: 0.95rem; line-height: 1.2; }
.topbar-title span { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--tabbar) + 32px + env(safe-area-inset-bottom));
}
.page-head { margin-bottom: 16px; }
.page-head p { color: var(--muted); margin: 0; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--ink); text-decoration: none; font-weight: 600; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.tabbar a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 0.75rem; font-weight: 600;
}
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar .tab-new span.tab-plus {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink); color: #fff; margin-top: -6px;
}

/* ------------------------------------------------------------ building blocks */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px;
  border-radius: 12px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: background-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-hover); }
.btn-leaf { background: var(--leaf); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--tint); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { background: var(--tint); }
.btn-danger { background: transparent; color: var(--danger); border-color: #e3b9b0; }
.btn-whatsapp { background: #1f7a4a; color: #fff; }
.btn-block { width: 100%; }
.btn-small { min-height: 40px; padding: 6px 14px; font-size: 0.9rem; border-radius: 10px; }
.btn[disabled] { opacity: 0.6; cursor: default; }
.btn.is-busy::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-stack { display: grid; gap: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row .btn { flex: 1 1 140px; }
.link-btn { background: none; border: 0; padding: 8px 0; min-height: 44px; font: inherit; color: var(--leaf); font-weight: 600; cursor: pointer; text-decoration: underline; }

.field { margin-bottom: 14px; }
.field label, .label { display: block; font-weight: 700; color: var(--ink); margin-bottom: 6px; font-size: 0.95rem; }
.field .hint { font-size: 0.85rem; color: var(--muted); margin: -2px 0 6px; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="date"],
input[type="search"], input[type="number"], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 13px;
  font: inherit; font-size: 16px; color: var(--text);
  background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px var(--leaf-soft); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 12px; cursor: pointer; }
.check input { width: 24px; height: 24px; flex: none; margin: 1px 0 0; accent-color: var(--leaf); }
.grid-2 { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  background: var(--tint); color: var(--muted);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-quote_sent { background: var(--bark-soft); color: #7a4f24; }
.pill-accepted { background: var(--leaf-soft); color: #3d5a26; }
.pill-invoiced { background: #e2e9ef; color: #2f4a5e; }
.pill-paid { background: var(--leaf); color: #fff; }
.pill-paid::before { background: #fff; }
.pill-declined { background: var(--tint); color: var(--muted); text-decoration: line-through; }
.pill-overdue { background: var(--danger-soft); color: var(--danger); }

.notice { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid; }
.notice-warn { background: var(--bark-soft); border-color: #e2c8a6; color: #5e3d1c; }
.notice-ok { background: var(--leaf-soft); border-color: #c5d3b0; color: #2f4a1d; }
.notice-danger { background: var(--danger-soft); border-color: #e3b9b0; color: #6f2418; }
.notice a { color: inherit; font-weight: 700; }
.notice p:last-child { margin: 0; }

.toast {
  position: fixed; left: 16px; right: 16px; z-index: 50;
  bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom));
  max-width: 520px; margin: 0 auto;
  padding: 14px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 600;
  box-shadow: 0 10px 30px rgba(27, 51, 38, 0.25);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--danger); }
.public .toast { bottom: 24px; }

.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.loading { text-align: center; color: var(--muted); padding: 48px 0; }

/* ------------------------------------------------------------ sign in */

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 0; }
.login-box { width: 100%; max-width: 380px; text-align: center; }
.login-box img { width: 220px; height: auto; margin: 0 auto 12px; display: block; }
.login-box form { text-align: left; margin-top: 20px; }
.turnstile { min-height: 65px; margin: 4px 0 14px; }

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

.hero-stat { background: var(--ink); color: #fff; border-color: var(--ink); }
.hero-stat .label, .hero-stat .sub { color: #c9d6c5; }
.hero-stat .label { font-size: 0.9rem; font-weight: 600; margin: 0; }
.hero-stat .value { font-size: 2.6rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; margin: 4px 0; }
.hero-stat .sub { font-size: 0.9rem; margin: 0; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat {
  display: block; text-decoration: none; color: inherit;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
a.stat:hover { border-color: var(--leaf); }
.stat .label { font-size: 0.82rem; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.stat .value { font-size: 1.35rem; font-weight: 800; color: var(--ink); line-height: 1.15; margin: 0; }
.stat .sub { font-size: 0.8rem; color: var(--muted); margin: 4px 0 0; }
.stat .sub.alert { color: var(--danger); font-weight: 700; }

.chart-wrap { position: relative; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #e7e2d1; stroke-width: 1; }
.chart .axis { stroke: #cfc8b2; stroke-width: 1; }
.chart text { font: 11px "Schibsted Grotesk", system-ui, sans-serif; fill: var(--muted); }
.chart text.now { fill: var(--ink); font-weight: 800; }
.chart .bar { fill: var(--leaf); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .col.active .bar, .chart .col:hover .bar { fill: var(--ink); }
.chart .col { outline: none; }
.chart .col:focus-visible .hit { stroke: var(--leaf); stroke-width: 2; }
.chart-tip {
  position: absolute; top: 0; z-index: 2; pointer-events: none;
  background: var(--ink); color: #fff; border-radius: 8px; padding: 6px 10px;
  font-size: 0.85rem; white-space: nowrap; transform: translateX(-50%);
}
.chart-tip strong { display: block; font-size: 1rem; }
.chart-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin-top: 8px; }
.chart-table th, .chart-table td { padding: 6px 4px; border-bottom: 1px solid var(--tint); text-align: left; }
.chart-table td:last-child, .chart-table th:last-child { text-align: right; }
.year-select { width: auto; min-height: 40px; padding: 6px 30px 6px 10px; }

.pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pipeline a {
  position: relative; text-decoration: none; color: var(--ink);
  background: var(--tint); border-radius: 10px; padding: 10px 6px; text-align: center;
}
.pipeline a:hover { background: var(--leaf-soft); }
.pipeline .n { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.pipeline .t { display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted); line-height: 1.2; margin-top: 2px; }

/* ------------------------------------------------------------ job lists */

.search { margin-bottom: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -16px 6px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 40px; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink);
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
}
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

.job-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.job-item a {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  grid-template-areas: "who amount" "what what" "meta meta";
  padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: inherit;
}
.job-item a:hover { border-color: var(--leaf); }
.job-item .who { grid-area: who; }
.job-item .amount { grid-area: amount; }
.job-item .what { grid-area: what; }
.job-item .meta { grid-area: meta; }
.job-item .who { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-item .amount { font-weight: 800; color: var(--ink); text-align: right; }
.job-item .what { font-size: 0.88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* ------------------------------------------------------------ job page */

.job-title { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 4px; }
.job-title h1 { margin: 0; }
.job-sub { color: var(--muted); margin-bottom: 16px; }

.stages { list-style: none; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0 0 16px; padding: 0; counter-reset: step; }
.stages li { position: relative; text-align: center; font-size: 0.75rem; color: var(--muted); padding-top: 34px; line-height: 1.25; }
.stages li::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 1;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--line); color: var(--muted); font-weight: 800; font-size: 0.8rem;
}
.stages li::after { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.stages li:first-child::after { display: none; }
.stages li.done::before { content: "✓"; background: var(--leaf); border-color: var(--leaf); color: #fff; }
.stages li.done::after, .stages li.current::after { background: var(--leaf); }
.stages li.current::before { border-color: var(--ink); color: var(--ink); background: #fff; }
.stages li.current { color: var(--ink); font-weight: 700; }


.action-card { border: 2px solid var(--ink); }
.action-card .lead { font-size: 1.05rem; }

.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-grid .btn { min-height: 52px; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { flex: 1; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.details dt { color: var(--muted); font-size: 0.9rem; }
.details dd { margin: 0; word-break: break-word; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--leaf); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--tint); }
.timeline li:last-child::after { display: none; }
.timeline .when { display: block; font-size: 0.8rem; color: var(--muted); }

.record { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; font-size: 0.92rem; }
.record dt { color: var(--muted); font-size: 0.82rem; margin-top: 8px; }
.record dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.record-hash { font-family: ui-monospace, Consolas, monospace; font-size: 0.78rem; word-break: break-all; }
@media (min-width: 560px) {
  .record { grid-template-columns: 170px 1fr; gap: 8px 14px; }
  .record dt { margin: 0; }
}

/* ------------------------------------------------------------ forms: steps and items */

.steps { display: flex; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.steps li { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps li.on { background: var(--leaf); }
.step-label { font-size: 0.85rem; font-weight: 700; color: var(--leaf); margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.04em; }

.item-card { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.item-card textarea { min-height: 52px; }
.item-row { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: end; margin-top: 10px; }
.item-row label { font-size: 0.8rem; font-weight: 700; color: var(--muted); display: block; margin-bottom: 4px; }
.item-row .line-total { min-height: 48px; display: flex; align-items: center; justify-content: flex-end; font-weight: 800; color: var(--ink); min-width: 80px; }
.money { position: relative; }
.money::before { content: "£"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money input { padding-left: 28px; }
.item-top { display: flex; gap: 8px; align-items: flex-start; }
.item-top textarea { flex: 1; }
.remove { flex: none; width: 44px; height: 48px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.remove:hover { color: var(--danger); border-color: #e3b9b0; }
.remove svg { width: 18px; height: 18px; }
.suggest { margin: 4px 0 14px; }
.suggest .chips { margin-bottom: 0; }

.total-bar {
  position: sticky; bottom: calc(var(--tabbar) + 8px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 16px; margin: 16px 0;
  box-shadow: 0 8px 24px rgba(27, 51, 38, 0.2);
}
.total-bar strong { font-size: 1.4rem; }

.form-actions { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 560px) { .form-actions.two { grid-template-columns: 1fr 1fr; } }

/* ------------------------------------------------------------ the document */

.doc-frame { background: var(--tint); border-radius: var(--radius); padding: 10px; margin-bottom: 12px; }
.doc {
  background: #fff; color: #2c3a30; border-radius: 6px;
  padding: 22px 18px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-family: Helvetica, Arial, sans-serif; font-size: 13px; line-height: 1.45;
}
.doc p { margin: 0; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #e2ddcc; }
.doc-logo { width: 120px; height: auto; display: block; }
.doc-kind { text-align: right; }
.doc-label { display: block; color: var(--leaf); font-size: 15px; letter-spacing: 0.02em; }
.doc-ref { display: block; color: #6b746c; font-size: 12px; margin-top: 6px; word-break: break-all; }
.doc-parties { display: grid; grid-template-columns: 1fr; gap: 18px; margin: 20px 0; }
.doc-parties h4 { font-weight: 400; color: #6b746c; font-size: 12px; margin: 0 0 6px; }
.doc-parties p { color: #2c3a30; margin-bottom: 3px; }
.doc-name { text-transform: uppercase; color: var(--ink) !important; font-size: 14px; margin-bottom: 6px !important; }
.doc-link { color: var(--leaf) !important; }
.doc-dates { margin-top: 12px; }
.doc-dates p { color: var(--ink); }
.doc-title { font-size: 14px; color: var(--ink); margin: 0 0 10px !important; }
.doc-items { width: 100%; border-collapse: separate; border-spacing: 0; }
.doc-items th { background: #f4f2e8; color: #6b746c; font-weight: 400; font-size: 12px; text-align: left; padding: 9px 12px; }
.doc-items th:first-child { border-radius: 7px 0 0 7px; }
.doc-items th:last-child { border-radius: 0 7px 7px 0; }
.doc-items td { padding: 12px; vertical-align: top; color: var(--ink); font-size: 14px; border-bottom: 1px solid #f4f2e8; }
.doc-items tr:last-child td { border-bottom: 0; }
.doc-amount { text-align: right !important; white-space: nowrap; }
.doc-qty { display: block; color: #6b746c; font-size: 12px; margin-top: 3px; }
.doc-empty { color: #6b746c !important; text-align: center; }
.doc-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-top: 1px solid #e2ddcc; padding: 18px 0; margin-top: 6px; }
.doc-total span { color: var(--ink); font-size: 15px; }
.doc-total strong { color: var(--leaf); font-size: 30px; font-weight: 400; }
.doc-subtotal { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; color: #2c3a30; font-size: 13px; }
.doc-subtotal:first-of-type { border-top: 1px solid #e2ddcc; padding-top: 14px; margin-top: 6px; }
.doc-payment { color: var(--leaf); }
.doc-subtotal + .doc-total { border-top: 0; padding-top: 6px; margin-top: 0; }
.doc-total + .doc-subtotal { border-top: 0; margin: -10px 0 12px; padding-top: 0; }
.doc-notes { margin-bottom: 16px; }
.doc-notes h4 { font-weight: 400; color: #6b746c; font-size: 12px; margin: 0 0 4px; }
.doc-box { background: #faf9f3; border: 1px solid #e2ddcc; border-radius: 9px; padding: 14px 16px; margin-bottom: 14px; }
.doc-box h3 { font-weight: 400; font-size: 15px; color: var(--ink); margin: 0 0 10px; }
.doc-box dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.doc-box dt { color: #6b746c; font-size: 12px; padding-top: 1px; }
.doc-box dd { margin: 0; color: var(--ink); word-break: break-word; }
.doc-box em { color: var(--danger); font-style: normal; }
.doc-signature { display: block; width: 200px; max-width: 100%; height: auto; margin-top: 10px; border: 1px solid #e2ddcc; border-radius: 6px; background: #fff; }
.doc-paid { color: var(--leaf); font-size: 15px; margin-bottom: 12px !important; }
.doc-thanks { margin-bottom: 18px !important; }
.doc-foot { border-top: 1px solid #e2ddcc; padding-top: 10px; color: #6b746c; font-size: 11px; }

/* The receipt: a narrow slip like the Hillarys receipts. */
.slip { max-width: 460px; margin: 0 auto; font-size: 14px; }
.slip-logo { display: block; width: 150px; height: auto; margin: 0 auto 6px; }
.slip-kind { text-align: center; color: var(--leaf); font-size: 15px; letter-spacing: 0.08em; margin-bottom: 16px !important; }
.slip-rows { display: grid; gap: 4px; }
.slip-row { display: flex; justify-content: space-between; gap: 16px; color: var(--ink); }
.slip-row > :last-child { text-align: right; overflow-wrap: anywhere; }
.slip-rule { border: 0; border-top: 1.5px dashed #b9b4a4; margin: 12px 0; }
.slip-title { font-weight: 700; color: var(--ink); margin-bottom: 6px !important; }
.slip-items { list-style: none; margin: 0; padding: 0; counter-reset: item; display: grid; gap: 6px; }
.slip-items li { counter-increment: item; display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto auto; gap: 10px; color: var(--ink); }
.slip-items li::before { content: counter(item) "."; color: #6b746c; }
.slip-items .slip-qty { color: #6b746c; }
.slip-statement { color: var(--ink); }
.slip-thanks { color: #6b746c; margin-bottom: 14px !important; }
@media (min-width: 560px) {
  .doc { padding: 36px 34px; }
  .doc-logo { width: 150px; }
  .doc-parties { grid-template-columns: 1fr 1fr; gap: 24px; }
}

.terms h3 { font-size: 0.98rem; margin: 18px 0 6px; }
.terms h3:first-child { margin-top: 0; }
.terms p { font-size: 0.9rem; margin-bottom: 8px; }
.terms-box { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }

/* ------------------------------------------------------------ signing */

.public main { padding-bottom: 40px; }
.public .topbar { justify-content: center; }
.sigpad-canvas {
  display: block; width: 100%; aspect-ratio: 5 / 2; max-height: 260px;
  background: #fff; border: 2px dashed var(--leaf); border-radius: 12px;
  touch-action: none; cursor: crosshair;
}
.sigpad-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.owner-banner { background: var(--bark-soft); border: 1px solid #e2c8a6; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; color: #5e3d1c; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.done-mark svg { width: 34px; height: 34px; }

@media print {
  .topbar, .tabbar, .no-print { display: none !important; }
  body, main { background: #fff; padding: 0; }
  .doc-frame { padding: 0; background: none; }
  .doc { box-shadow: none; }
}


/* ------------------------------------------------------------ phone or desktop */

.tabbar .nav-brand { display: none; }
.job-list-head { display: none; }
.preview-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 0 0 8px; }

@media (max-width: 1023.98px) {
  .desktop-only { display: none !important; }
}

/* A desktop gets a sidebar instead of the tab bar, and the screens that
   stack on a phone sit side by side. */
@media (min-width: 1024px) {
  .mobile-only { display: none !important; }

  body:not(.signed-out):not(.public) { padding-left: 248px; }
  body:not(.public) .topbar { display: none; }
  body.public main { max-width: 1160px; padding: 32px 32px 56px; }

  .tabbar {
    top: 0; right: auto; width: 248px; height: auto;
    display: flex; flex-direction: column; gap: 4px;
    padding: 20px 14px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  .tabbar a {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    min-height: 46px; padding: 0 14px; border-radius: 10px;
    font-size: 0.98rem; color: var(--text);
  }
  .tabbar a:hover { background: var(--tint); }
  .tabbar a[aria-current="page"] { background: var(--tint); color: var(--ink); }
  .tabbar .nav-brand {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
    min-height: 0; padding: 4px 14px 20px; margin-bottom: 8px;
    border-bottom: 1px solid var(--line); border-radius: 0;
  }
  .tabbar .nav-brand:hover { background: none; }
  .nav-brand img { width: 150px; height: auto; }
  .nav-brand span { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
  /* New quote is the main action, so it reads as a button. */
  .tabbar .tab-new { order: -1; background: var(--ink); color: #fff; margin: 4px 0 10px; justify-content: center; font-weight: 700; }
  .tabbar .tab-new:hover, .tabbar .tab-new[aria-current="page"] { background: var(--ink-hover); color: #fff; }
  .tabbar .tab-new span.tab-plus { width: auto; height: auto; margin: 0; background: none; }
  .tabbar .tab-new span.tab-plus svg { width: 20px; height: 20px; }
  .tabbar .nav-brand { order: -2; }

  main { max-width: 1200px; padding: 32px 40px 56px; }
  h1 { font-size: 1.85rem; }
  .page-head { margin-bottom: 20px; }

  .toast { left: auto; right: 24px; bottom: 24px; margin: 0; max-width: 420px; }
  .total-bar { bottom: 16px; }

  /* Dashboard: the month and four figures in one row, then the chart beside
     the pipeline and anything to chase, then the latest jobs as a table. */
  .dash-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
  .dash-top .hero-stat { grid-column: 1 / -1; }
  .dash-top .stats { display: contents; }
  .dash-top .card, .dash-top .stat { margin: 0; }
  .hero-stat .value { font-size: 2.3rem; }
  .stat { padding: 16px; display: flex; flex-direction: column; }
  .stat .value { font-size: 1.5rem; }
  .stat .sub { margin-top: auto; padding-top: 4px; }
  .dash-grid {
    display: grid; gap: 16px; align-items: start;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-areas: "chart pipe" "chart chase" "latest coming" "latest .";
  }
  .dash-grid > .card { margin: 0; }
  .dash-chart { grid-area: chart; }
  .dash-pipeline { grid-area: pipe; }
  .dash-chase { grid-area: chase; }
  .dash-latest { grid-area: latest; }
  .dash-coming { grid-area: coming; }
  .tabbar .nav-badge { position: static; margin-left: auto; }
  .client-stats { grid-template-columns: repeat(3, 1fr); max-width: 720px; }
  .client-table .job-list-head, .client-table .client-item a { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) minmax(0, 1.2fr) 130px; }
  .enquiry-table .job-list-head, .job-table.enquiry-table .enquiry-item a { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 2.2fr) 110px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
  .dash-pipeline .pipeline { grid-template-columns: 1fr 1fr; }

  /* Job lists read as a table: client, job, stage, amount. */
  .job-table { gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
  .card .job-table { border-radius: 10px; }
  .job-list-head {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 1.5fr) 120px; gap: 16px;
    padding: 10px 16px; background: var(--tint); font-size: 0.8rem; font-weight: 700; color: var(--muted);
  }
  .job-list-head span:last-child { text-align: right; }
  .job-table .job-item + .job-item { border-top: 1px solid var(--tint); }
  .job-table .job-item a {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) minmax(0, 1.5fr) 120px;
    grid-template-areas: "who what meta amount";
    gap: 16px; padding: 12px 16px; border: 0; border-radius: 0; background: none;
  }
  .job-table .job-item a:hover { background: var(--bg); }
  .job-table .job-item .meta { margin: 0; }
  .job-table .job-item .what { font-size: 0.95rem; }
  /* The column heading names the amount, so the row label is not needed. */
  .job-table .job-item .amount small { display: none; }

  .list-tools { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
  .list-tools .search { flex: 0 0 340px; margin: 0; }
  .list-tools .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 4px 0 0; }
  .suggest .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }

  /* Quote and invoice forms: the form, with the document beside it. */
  .form-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: start; }
  .form-preview { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; }
  .form-preview .doc-frame { margin: 0; }
  .form-actions.two { grid-template-columns: 1fr 1fr; }

  /* A job: what to do next and the details on the right, the documents on the left. */
  .job-layout {
    display: grid; gap: 0 24px; align-items: start;
    grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr);
  }
  .job-head { grid-column: 1 / -1; }
  .job-head .stages { max-width: 820px; }
  /* The "what next" card runs across the top; the documents sit on the left
     and the job's details stack on the right. */
  .job-side { grid-column: 2; }
  .job-layout > .action-card { grid-column: 1 / -1; grid-row: 2; }
  .job-docs { grid-column: 1; grid-row: 3 / span 12; }
  .action-card .share-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .action-card > .action-aside { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
  .action-aside .pay-form { margin-top: 0; }
  .action-aside .btn-stack { margin: 0; }
  /* In the narrow details column, each label sits above its value. */
  .job-side .record { grid-template-columns: 1fr; gap: 2px; }
  .job-side .record dt { margin-top: 8px; }

  /* Settings: two columns of cards, the terms across both. */
  .settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
  .settings-grid > .card:nth-child(1) { grid-row: span 2; }
  .settings-wide { grid-column: 1 / -1; }
  .settings-save { max-width: 320px; }

  /* The customer's page: the quote and terms, with the form to sign beside them. */
  .sign-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); gap: 32px; align-items: start; }
  /* Pinned while the quote scrolls, but never taller than the window, so the
     sign button can always be reached. */
  .sign-side { position: sticky; top: 24px; margin: 0; max-height: calc(100vh - 48px); overflow-y: auto; }
  .sign-main .terms-box { max-height: 520px; }
}

/* Wide screens fit the month and the four figures in one row, and the "what
   next" card puts its buttons or payment form beside the main part. */
@media (min-width: 1280px) {
  .action-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 4px 32px; align-items: start; }
  .action-card > .action-main:only-child { grid-column: 1 / -1; }
  .action-card > .action-aside { margin-top: 0; padding-top: 0; border-top: 0; padding-left: 32px; border-left: 1px solid var(--line); align-self: stretch; }
  .dash-top { grid-template-columns: minmax(0, 1.25fr) repeat(4, minmax(0, 1fr)); }
  .dash-top .hero-stat { grid-column: auto; }
}


/* ------------------------------------------------------------ updates, payments, booking, photos, clients */

.nav-badge {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 800; line-height: 18px; text-align: center;
}

.updates-card { border-color: var(--leaf); }
.updates { list-style: none; margin: 0; padding: 0; }
.updates li + li { border-top: 1px solid var(--tint); }
.updates a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; text-decoration: none; color: var(--text); }
.update-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--bark); margin-top: 6px; }
.update-signed { background: var(--leaf); }
.update-text { display: flex; flex-direction: column; font-weight: 600; color: var(--ink); }
.update-text .when { font-weight: 400; font-size: 0.82rem; color: var(--muted); }

.chart-head { flex-wrap: wrap; }
.chart-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.segmented { display: inline-flex; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.segmented a { padding: 7px 12px; min-height: 40px; display: inline-flex; align-items: center; font-size: 0.85rem; font-weight: 600; color: var(--ink); text-decoration: none; background: var(--paper); }
.segmented a + a { border-left: 1.5px solid var(--line); }
.segmented a[aria-current="true"] { background: var(--ink); color: #fff; }
.chart-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; justify-content: space-between; margin-top: 10px; }
.chart-foot details { flex: 1 1 220px; }

.coming { list-style: none; margin: 0; padding: 0; }
.coming li + li { border-top: 1px solid var(--tint); }
.coming a { display: flex; gap: 12px; align-items: center; padding: 10px 0; text-decoration: none; color: var(--text); }
.coming .day { flex: none; min-width: 84px; padding: 4px 8px; border-radius: 8px; background: var(--leaf-soft); color: #3d5a26; font-weight: 700; font-size: 0.85rem; text-align: center; }
.coming-text { display: flex; flex-direction: column; min-width: 0; }
.coming-text strong { color: var(--ink); }
.coming-text span { font-size: 0.88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.viewed { color: var(--leaf); font-weight: 600; margin: -4px 0 10px; }
.viewed::before { content: "●"; margin-right: 6px; font-size: 0.7rem; vertical-align: 1px; }
.pay-form { margin: 14px 0 0; background: var(--bg); }

.payments { list-style: none; margin: 0; padding: 0; }
.payments li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--tint); }
.payments li span { display: flex; flex-direction: column; }
.payments small { color: var(--muted); font-size: 0.8rem; }
.payments strong { color: var(--ink); }
.payments .remove { width: 36px; height: 36px; }
.payments-total { display: flex; justify-content: space-between; padding-top: 10px; font-weight: 700; color: var(--ink); }

.book-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.book-row input { flex: 1 1 160px; width: auto; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.photo { position: relative; margin: 0; border-radius: 10px; overflow: hidden; background: var(--tint); aspect-ratio: 1; }
.photo a, .photo img { display: block; width: 100%; height: 100%; }
.photo img { object-fit: cover; }
.photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center;
  padding: 4px 4px 4px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); color: #fff; font-size: 0.75rem; font-weight: 700;
}
.photo-del { width: 30px; height: 30px; border: 0; border-radius: 8px; background: rgba(0, 0, 0, 0.35); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-del svg { width: 14px; height: 14px; }
.photo-add { display: flex; gap: 10px; align-items: center; }
.photo-add select { width: auto; flex: 0 0 auto; }
.photo-pick { flex: 1; cursor: pointer; }

.client-stats { grid-template-columns: repeat(3, 1fr); }
.client-stats .value { font-size: 1.15rem; }
.client-actions { margin-bottom: 16px; }

/* ------------------------------------------------------------ client records and the quote's client picker */

.page-head-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-head-row > div { min-width: 0; }
.narrow { max-width: 620px; }

.client-picker { border-color: var(--leaf); }
.client-results { list-style: none; margin: 8px 0 0; padding: 0; }
.client-results:empty { display: none; }
.client-results li + li { border-top: 1px solid var(--tint); }
.client-results button {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  min-height: 52px; padding: 8px 10px; border: 0; border-radius: 8px; background: none;
  font: inherit; text-align: left; color: var(--text); cursor: pointer;
}
.client-results button:hover, .client-results button:focus-visible { background: var(--tint); }
.client-results strong { color: var(--ink); }
.client-results span { font-size: 0.85rem; color: var(--muted); }
.client-results .no-match { padding: 10px; font-size: 0.9rem; color: var(--muted); }
.picked { display: flex; align-items: center; gap: 12px; }
.picked > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.picked small { color: var(--muted); font-size: 0.85rem; }
.picked-tick { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--leaf); color: #fff; display: grid; place-items: center; font-weight: 800; }

/* Loading: shown only when the next page takes over 2 seconds. */
.busy {
  position: fixed; z-index: 60; top: calc(64px + env(safe-area-inset-top)); right: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--tint); border-top-color: var(--leaf);
  background: var(--paper); box-shadow: 0 2px 8px rgba(27, 51, 38, 0.15);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
  animation: spin 0.8s linear infinite;
}
.busy.show { opacity: 1; }
@media (min-width: 1024px) { .busy { top: 24px; right: 28px; } }

.grid-2.align-end { align-items: end; }
/* Date boxes draw a little taller than text boxes; side by side they match. */
.grid-2.align-end input { height: 50px; }

/* On a phone the parts of the "what next" card follow each other. */
.action-aside { margin-top: 14px; }
.action-aside > .link-btn { margin-top: 6px; }

/* An amount on a list row says what it is: quote, to pay, paid in total. */
.job-item .amount { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.job-item .amount small { font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.list-sort { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 0 10px; font-size: 0.9rem; color: var(--muted); }
.list-sort select { width: auto; min-height: 40px; padding: 6px 30px 6px 10px; }

/* Website reporting shares the app's existing signed-in navigation. */
.analytics-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.analytics-kpis .card { display: flex; flex-direction: column; min-width: 0; }
.analytics-kpis strong { font-size: 1.8rem; color: var(--ink); }
.analytics-kpis span, .analytics-kpis small { font-size: .85rem; }
.analytics-list { padding: 0; margin: 12px 0 0; list-style: none; }
.analytics-list li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--tint); }
.analytics-list span { min-width: 0; overflow-wrap: anywhere; }
.analytics-list strong { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.analytics-chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; margin-top: 20px; border-bottom: 1px solid var(--line); }
.analytics-chart span { flex: 1; background: var(--leaf); min-width: 0; border-radius: 3px 3px 0 0; }
.analytics-chart-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin: 5px 0 14px; }
.analytics-events { list-style: none; padding: 0; }
.analytics-events li { display: flex; flex-direction: column; padding: 12px 0; border-bottom: 1px solid var(--tint); overflow-wrap: anywhere; }
.analytics-events span, .analytics-events time { font-size: .85rem; color: var(--muted); }
@media (min-width: 720px) { .analytics-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 380px) { .tabbar a { font-size: .65rem; } .tabbar a svg { width: 21px; height: 21px; } }
@media (max-width: 450px) { .tabbar a { font-size: .62rem; } .tabbar a svg { width: 21px; height: 21px; } .tabbar .tab-new span.tab-plus { width: 36px; height: 36px; } }

/* ------------------------------------------------------------ enquiries */

.pill-new { background: var(--leaf); color: #fff; }
.pill-new::before { background: #fff; }
.enquiry-item.unread .who { color: var(--ink); }
.enquiry-item:not(.unread) .who { font-weight: 600; }
.enquiry-item .amount { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.enquiry-item .what { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.enquiry-item .meta { flex-wrap: nowrap; min-width: 0; }
.enquiry-item .meta .snippet { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (min-width: 1024px) { .enquiry-item .meta .snippet { display: block; white-space: nowrap; } }
.enquiry-message { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; font-size: 1.02rem; }

/* ------------------------------------------------------------ how a job works */

.edit-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 14px; }
.flow-mini { margin: -4px 0 14px; }
.flow-mini > summary { cursor: pointer; font-weight: 600; color: var(--leaf); font-size: 0.92rem; }
.flow-mini .flow { margin-top: 12px; }
.flow-card > summary { cursor: pointer; list-style: none; display: grid; gap: 2px; }
.flow-card > summary::-webkit-details-marker { display: none; }
.flow-card > summary h2 { margin: 0; }
.flow-card > summary h2::after { content: " ▾"; color: var(--muted); font-size: 0.9em; }
.flow-card[open] > summary h2::after { content: " ▴"; }
.flow-card .flow { margin-top: 16px; }

.flow { display: grid; justify-items: center; gap: 0; max-width: 760px; margin: 0 auto; }
.flow-step { position: relative; width: 100%; max-width: 520px; display: flex; gap: 12px; align-items: flex-start;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.flow-step strong { color: var(--ink); }
.flow-step p { margin: 2px 0 0; font-size: 0.9rem; color: var(--text); }
.flow-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 0.85rem; }
.flow-coming { color: var(--muted) !important; font-size: 0.8rem !important; font-style: italic; }
.flow-down { width: 2px; height: 22px; background: var(--line); position: relative; }
.flow-down::after { content: ""; position: absolute; left: -5px; bottom: -2px; border: 6px solid transparent; border-top-color: var(--line); border-bottom: 0; }
.flow-split { width: 100%; display: grid; gap: 10px; justify-items: center; }
.flow-question { margin: 0; padding: 6px 14px; border-radius: 999px; background: var(--bark-soft); color: #5e3d1c; font-weight: 700; font-size: 0.9rem; }
.flow-lanes { width: 100%; display: grid; grid-template-columns: 1fr; gap: 10px; }
.flow-lane { position: relative; background: var(--paper); border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px 14px; }
.flow-lane h4 { margin: 0 0 4px; color: var(--ink); font-size: 0.95rem; }
.flow-lane ul { margin: 0; padding-left: 18px; font-size: 0.88rem; display: grid; gap: 4px; }
.flow-note { margin: 0; font-size: 0.85rem; color: var(--muted); text-align: center; max-width: 520px; }
.flow .done { border-color: #c5d3b0; background: var(--leaf-soft); }
.flow .done .flow-num { background: var(--leaf); }
.flow .now { border: 2px solid var(--ink); box-shadow: 0 0 0 4px var(--leaf-soft); }
.flow-here { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 0.72rem; font-weight: 700; vertical-align: 2px; }
@media (min-width: 640px) { .flow-lanes { grid-template-columns: 1fr 1fr; } }

/* Each part of a long form saves right where it was changed. */
.section-save { display: flex; justify-content: flex-end; margin-top: 12px; }
.section-save .btn { min-width: 140px; }
.share-one .btn { min-height: 52px; white-space: normal; }

/* The customer's sign-off on the receipt, and the words they sign. */
.slip-sign-label { color: #6b746c; margin-top: 10px !important; }
.slip-signature { display: block; width: 220px; max-width: 80%; height: auto; margin: 4px auto; }
.slip-signer { text-align: center; color: var(--ink); }
.signoff-statement { background: var(--tint); border-radius: 10px; padding: 10px 12px; color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------ diary */

/* Analytics stays in the sidebar; the phone tab bar keeps to seven. */
@media (max-width: 1023.98px) { .tabbar .nav-wide { display: none; } }

.diary-nav { display: flex; gap: 6px; }
.diary-nav .btn { min-width: 44px; font-size: 1.05rem; }
.diary-add { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.diary-sync { margin: 0 0 12px; color: var(--muted); }
.diary-sync.on { color: var(--leaf); }
.diary-form { max-width: 720px; }
.diary-kinds { margin-bottom: 12px; flex-wrap: wrap; }
.diary-client { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 4px; margin: 0 0 12px; }
.diary-client legend { font-weight: 700; color: var(--ink); padding: 0 6px; }

.book-card.book-now { border: 2px solid var(--leaf); }
.book-booked { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
.book-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.book-form .book-until, .book-form .btn { grid-column: 1 / -1; }
.book-until { margin: -4px 0 10px; }

/* ------------------------------------------------------------ the iPad, landscape (Richard's main screen) */

@media (min-width: 1024px) {
  /* The next step's buttons sit beside its words, so they are on screen
     without scrolling. */
  .action-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 4px 24px; align-items: start; }
  .action-card > .action-main:only-child { grid-column: 1 / -1; }
  .action-card > .action-aside { margin-top: 0; padding-top: 0; border-top: 0; padding-left: 24px; border-left: 1px solid var(--line); align-self: stretch; }
  .btn { min-height: 48px; }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
  /* A narrower sidebar leaves the work more room. */
  body:not(.signed-out):not(.public) { padding-left: 212px; }
  .tabbar { width: 212px; padding: 16px 10px; }
  .nav-brand img { width: 128px; }
  main { padding: 24px 24px 48px; }
}
.link-btn svg, .card-head a svg { width: 18px; height: 18px; vertical-align: -4px; margin-right: 4px; }
.card-head a.link-btn { display: inline-flex; align-items: center; text-decoration: none; font-weight: 600; }

/* ------------------------------------------------------------ the diary as a calendar */

/* One colour per kind, everywhere: visits blue, work green, personal yellow,
   blocked grey and hatched, Google events outlined, reminders amber. */
.k-appointment { --k: #3f6fa0; --k-soft: #e3ecf6; }
.k-work { --k: #4e7032; --k-soft: #e3ead6; }
.k-personal { --k: #b88c14; --k-soft: #f7efd6; }
.k-blocked { --k: #5d6660; --k-soft: #e6e4dd; }
.k-google { --k: #8a8577; --k-soft: #ffffff; }
.k-deadline { --k: #b5762f; --k-soft: #f6e7d5; }
.t-chase { --k: #5c7a96; --k-soft: #e8eef4; }

.cal-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.cal-title h1 { margin: 0; }
.cal-title .diary-sync { margin: 2px 0 0; }
.cal-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cal-views a[aria-current="true"] { background: var(--ink); color: #fff; }
.cal-nav { display: flex; gap: 6px; align-items: center; }
.cal-nav .btn { min-width: 44px; }
.cal-jump { width: auto; min-height: 40px; padding: 6px 8px; }
.cal-bar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.cal-bar-row .diary-add { margin: 0; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.cal-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 10px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.cal-filter .key { width: 11px; height: 11px; border-radius: 3px; background: var(--k); margin: 0; }
.cal-filter.k-google .key { background: #fff; border: 1.5px dashed var(--k); }
.cal-filter.k-blocked .key { background: repeating-linear-gradient(135deg, var(--k), var(--k) 2px, #fff 2px, #fff 4px); }
.cal-filter[aria-pressed="false"] { opacity: 0.45; text-decoration: line-through; }

/* Chips and bars: the colour of the kind down the left, its soft colour behind. */
.cal-chip { display: flex; gap: 5px; align-items: baseline; min-width: 0; padding: 3px 7px; border-radius: 7px; text-decoration: none;
  background: var(--k-soft); color: var(--ink); border-left: 4px solid var(--k); font-size: 0.78rem; line-height: 1.3; }
.cal-chip .cal-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.cal-chip .cal-time { color: var(--muted); font-weight: 700; flex: none; }
.cal-chip.k-google, .cal-event.k-google { border: 1px dashed #b9b4a4; border-left: 4px solid var(--k); color: var(--muted); }
.cal-chip.k-blocked, .cal-event.k-blocked { background: repeating-linear-gradient(135deg, #ebe9e2, #ebe9e2 6px, #e0ddd4 6px, #e0ddd4 12px); }

/* Day and Week: an all-day band, then the hours with entries as bars. */
.cal-grid { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-heads, .cal-band { display: grid; grid-template-columns: 54px repeat(var(--cols), minmax(0, 1fr)); }
.cal-heads { border-bottom: 1px solid var(--line); }
.cal-dayhead { padding: 8px 6px; text-align: center; font-weight: 700; font-size: 0.85rem; color: var(--ink); text-decoration: none; border-left: 1px solid var(--tint); }
.cal-dayhead.today { background: var(--ink); color: #fff; }
.cal-band { grid-auto-flow: row dense; gap: 3px 0; padding: 4px 0; border-bottom: 1px solid var(--line); min-height: 34px; background: var(--bg); }
.cal-band-label { grid-column: 1; grid-row: 1 / span 30; font-size: 0.7rem; color: var(--muted); padding: 4px 6px; }
.cal-band .cal-chip { margin: 0 3px; }
.cal-body { display: grid; grid-template-columns: 54px minmax(0, 1fr); max-height: calc(100vh - 290px); min-height: 360px; overflow-y: auto; }
.cal-hours { display: grid; align-content: start; }
.cal-hours span { font-size: 0.7rem; color: var(--muted); text-align: right; padding: 0 6px; transform: translateY(-7px); }
.cal-hours span:first-child { transform: none; }
.cal-cols { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); align-items: start; }
.cal-col { position: relative; border-left: 1px solid var(--tint); cursor: copy;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hour) - 1px), var(--tint) calc(var(--hour) - 1px), var(--tint) var(--hour)); }
.cal-col.today { background-color: #fbfaf2; }
.cal-event { position: absolute; display: flex; flex-direction: column; gap: 1px; overflow: hidden; padding: 3px 6px; border-radius: 7px;
  background: var(--k-soft); border-left: 4px solid var(--k); color: var(--ink); text-decoration: none; font-size: 0.78rem; line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.cal-event:hover { filter: brightness(0.97); }
.cal-preview { position: fixed; z-index: 1000; width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); overflow-y: auto; padding: 16px 20px;
  border: 1px solid var(--line); border-left: 5px solid var(--leaf); border-radius: 12px;
  background: var(--paper); color: var(--ink); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  font-size: 1rem; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere;
  cursor: auto; }
.cal-preview[hidden] { display: none; }
.cal-event .cal-time { font-weight: 700; color: var(--muted); font-size: 0.72rem; }
.cal-event .cal-name { font-weight: 700; overflow-wrap: anywhere; }
.cal-event .cal-where { color: var(--muted); font-size: 0.72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.cal-hint { margin: 8px 0 0; }

/* Month: six weeks of days with their entries as chips. */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-month-head { padding: 6px; text-align: center; font-size: 0.78rem; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.cal-cell { position: relative; display: grid; align-content: start; gap: 3px; min-height: 104px; padding: 4px; border-left: 1px solid var(--tint); border-top: 1px solid var(--tint); min-width: 0; }
.cal-cell:nth-child(7n + 8) { border-left: 0; }
.cal-cell.other { background: var(--bg); }
.cal-cell.other .cal-date { color: var(--muted); }
.cal-cell.today .cal-date { background: var(--ink); color: #fff; }
.cal-date { justify-self: start; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; color: var(--ink); text-decoration: none; }
.cal-more { font-size: 0.75rem; font-weight: 600; color: var(--leaf); }
.cal-add { position: absolute; top: 3px; right: 5px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  color: var(--muted); font-weight: 700; opacity: 0; }
.cal-cell:hover .cal-add, .cal-add:focus { opacity: 1; background: var(--tint); }
@media (pointer: coarse) { .cal-add { opacity: 0.6; } }

/* List: the next thirty days. */
.cal-list-day { margin-bottom: 14px; }
.cal-list-day h3 { margin: 0 0 6px; font-size: 0.95rem; }
.cal-list-day.today h3 { color: var(--leaf); }
.cal-list-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cal-list-day li > a, .cal-list-day li > div { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--k); text-decoration: none; color: var(--ink); }
.cal-list-time { font-weight: 700; font-size: 0.85rem; }
.cal-list-text { display: grid; min-width: 0; }
.cal-list-text span { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-list-kind { font-size: 0.75rem; font-weight: 700; color: var(--k); }

/* The entry form. */
.diary-form { border-top: 5px solid var(--k); }
.diary-when-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
.diary-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: -4px 0 12px; }
.diary-quick .chips { margin: 0; padding: 0; overflow: visible; flex-wrap: wrap; }

@media (max-width: 699.98px) {
  .cal-month .cal-chip .cal-time { display: none; }
  .cal-cell { min-height: 76px; padding: 2px; }
  .cal-chip { font-size: 0.7rem; padding: 2px 4px; }
  .cal-list-day li > a, .cal-list-day li > div { grid-template-columns: 90px minmax(0, 1fr); }
  .cal-list-kind { display: none; }
  .cal-filters { display: none; }
}
.flow-page { padding-top: 20px; padding-bottom: 20px; }

/* How an enquiry came in, as one row of choices. */
.enquiry-sources { flex-wrap: wrap; margin-bottom: 14px; }
.enquiry-sources label { display: inline-flex; }
.enquiry-sources input { position: absolute; opacity: 0; pointer-events: none; }
.enquiry-sources span { padding: 8px 14px; min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; font-size: 0.88rem; color: var(--ink); background: var(--paper); cursor: pointer; }
.enquiry-sources label + label span { border-left: 1.5px solid var(--line); }
.enquiry-sources input:checked + span { background: var(--ink); color: #fff; }
.enquiry-sources input:focus-visible + span { outline: 3px solid var(--leaf-soft); }
.enquiry-form { max-width: 760px; }

/* The stages of a job in the diary, each its own colour (matching Google). */
.k-valuation { --k: #23807d; --k-soft: #dff0ee; }
.k-instructed { --k: #7a4fa0; --k-soft: #eee6f5; }
.k-invoice { --k: #c4652a; --k-soft: #f8e6da; }
.k-payment { --k: #3d8a5a; --k-soft: #e0f0e5; }
.stage-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.stage-pick { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer; }
.stage-pick .key { width: 14px; height: 14px; border-radius: 4px; background: var(--k); margin: 0; }
.stage-pick[aria-pressed="true"] { background: var(--k-soft); border-color: var(--k); box-shadow: inset 0 0 0 1px var(--k); }
.diary-kinds a[aria-current="true"] { background: var(--ink); color: #fff; }

/* The amount to take on the final invoice: big, with the sum under it. */
.to-pay { background: var(--leaf-soft); border: 2px solid var(--leaf); border-radius: 14px; padding: 14px 18px; margin: 4px 0 14px; }
.to-pay-label { margin: 0; font-weight: 700; color: #2f4a1d; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }
.to-pay-amount { margin: 2px 0 8px; font-size: 2.6rem; line-height: 1.1; font-weight: 800; color: var(--ink); }
.to-pay-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 16px; margin: 0; font-size: 0.95rem; max-width: 420px; }
.to-pay-sum dt { color: var(--text); }
.to-pay-sum dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.to-pay-sum .to-pay-eq { border-top: 1.5px solid var(--leaf); padding-top: 4px; margin-top: 2px; font-weight: 800; }

/* Work analytics. */
.work-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.work-kpis .stat { margin: 0; }
.work-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.work-grid .card { margin: 0; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr) auto; gap: 10px; align-items: center; font-size: 0.9rem; }
.bar-label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.bar-label .key { width: 11px; height: 11px; border-radius: 3px; background: var(--k); margin: 0; }
.bar-track { height: 14px; border-radius: 7px; background: var(--tint); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 7px; background: var(--k, var(--leaf)); min-width: 2px; }
.bar-value { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chips .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
a.chip { text-decoration: none; display: inline-flex; align-items: center; }
@media (min-width: 900px) {
  .work-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .work-grid { grid-template-columns: 1fr 1fr; }
}

/* Diary entries shown on a job, a client and the dashboard. */
.diary-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.diary-mini a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 8px 10px; border-radius: 10px; text-decoration: none;
  background: var(--k-soft, var(--tint)); border-left: 4px solid var(--k, var(--muted)); color: var(--ink); }
.diary-mini-when { grid-column: 1 / -1; font-size: 0.78rem; font-weight: 700; color: var(--muted); }
.diary-mini-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diary-mini-kind { font-size: 0.75rem; font-weight: 700; color: var(--k, var(--muted)); align-self: center; }
.coming li[class*="k-"] a { border-left: 4px solid var(--k); padding-left: 10px; }
.flow-link { display: inline-block; margin-top: 6px; font-weight: 700; font-size: 0.85rem; color: var(--leaf); }
.eta-booking-action { margin: 0 0 18px; }
.eta-choices { border: 0; padding: 0; margin: 22px 0; display: grid; gap: 8px; }
.eta-choices legend { font-weight: 700; margin-bottom: 10px; }
.eta-preview { white-space: pre-wrap; padding: 18px; border-radius: 12px; background: var(--tint); line-height: 1.6; }
.eta-link { margin: 4px 8px 10px; }
.client-item { position: relative; padding-right: 56px; }
.client-table .job-list-head { padding-right: 72px; }
.client-bin { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 42px; height: 42px; padding: 10px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, background .15s; }
.client-bin svg { width: 22px; height: 22px; }
.client-bin:hover, .client-bin:focus-visible { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.client-bin:disabled { opacity: .35; cursor: default; background: transparent; border-color: transparent; color: var(--muted); }
.confirm-dialog { position: fixed; inset: 0; margin: auto; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 40px);
  overflow-y: auto; padding: 28px; border: 1px solid var(--line); border-radius: 18px; color: var(--text); background: var(--paper);
  box-shadow: 0 24px 80px #10251a40; font: inherit; }
.confirm-dialog::backdrop { background: #10251a88; backdrop-filter: blur(3px); }
.confirm-dialog h2 { overflow-wrap: anywhere; }
.confirm-dialog p { margin: 14px 0 24px; }
.confirm-dialog .btn-danger { background: var(--danger); border-color: var(--danger); color: white; }
.confirm-dialog .btn-danger:hover { background: #822c20; }
.appointment-header { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 24px;
  background: var(--ink); border-radius: var(--radius); margin-bottom: 20px; color: var(--paper); }
.appointment-header h1 { color: var(--paper); margin-bottom: 8px; }
.appointment-header > div { min-width: 0; }
.appointment-header h1 { overflow-wrap: anywhere; }
.appointment-header p { margin: 0; }
.appointment-eyebrow { font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; opacity: .8; margin-bottom: 8px !important; }
.appointment-header-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.appointment-header .appointment-send { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.appointment-header .btn-secondary { background: transparent; color: var(--paper); border-color: #fff8; }
.appointment-send svg, .appointment-contacts svg { width: 22px; height: 22px; flex-shrink: 0; }
.appointment-overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.appointment-overview .card { margin: 0; min-width: 0; }
.appointment-address { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0 22px; font-size: 1.05rem; }
.appointment-address svg { width: 26px; height: 26px; flex-shrink: 0; color: var(--leaf); }
.appointment-contacts { border-top: 1px solid var(--line); margin-bottom: 18px; }
.appointment-contacts a { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); text-decoration: none; overflow-wrap: anywhere; }
.appointment-contacts a span:first-of-type { flex: 1; min-width: 0; }
.appointment-map-panel { min-height: 260px; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; background: var(--tint); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.appointment-map-panel > svg { width: 44px; height: 44px; color: var(--leaf); margin: 18px 0 0; }
.appointment-map-panel > p { padding: 0 16px; }
.appointment-map-panel iframe { width: 100%; height: 300px; border: 0; display: block; }
.appointment-map-links { align-items: center; margin-top: 12px; }
.appointment-details, .appointment-history, .appointment-notes { grid-column: 1 / -1; }
.appointment-details .card-head { flex-wrap: wrap; gap: 12px; }
.appointment-details .record { margin-top: 20px; }
.appointment-events { list-style: none; padding: 0; margin: 0; }
.appointment-events li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.appointment-events p { margin: 3px 0 0; }
.appointment-history h3 { margin-top: 24px; font-size: 1rem; }
@media (max-width: 799.98px) {
  .appointment-header { padding: 20px; flex-direction: column; align-items: stretch; }
  .appointment-header-actions { display: grid; grid-template-columns: 1fr; }
  .appointment-overview { grid-template-columns: minmax(0, 1fr); }
  .appointment-details .appointment-send { width: 100%; }
}
.coming li a.eta-link, .diary-mini a.eta-link { display: inline-flex; justify-content: center; padding: 8px 14px;
  border: 1px solid var(--line); background: var(--paper); min-height: 40px; }

/* Keep week appointments readable on phones; scroll the calendar sideways. */
.cal-week { overflow-x: auto; }
.cal-week > .cal-heads, .cal-week > .cal-band, .cal-week > .cal-body { min-width: 1000px; }
@media (max-width: 699.98px) {
  .cal-filters { display: flex; }
  .cal-filters .cal-filter { min-height: 40px; }
}

.diary-reserved { border: 2px solid var(--bark); margin: 0 0 16px; }
.diary-reserved h2 { font-size: 1.05rem; }
.diary-reserved ul { list-style: none; margin: 0; padding: 0; }
.diary-reserved li a { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 10px 0; color: var(--ink); text-decoration: none; }
.diary-reserved li a > span:first-of-type { flex: 1; min-width: 160px; }
.cal-filter:disabled { cursor: default; opacity: 1; }
