@import url("/assets/fonts.css");
/* CraftPM dashboard (SPEC §10B): warm paper by day, workshop charcoal by night, curved corners,
   Fraunces headings. Family blue for actions, orange as the accent mark. Fonts are self-hosted.
   Light: --text on --bg 15:1, --muted on --bg 6.0:1, --accent on --surface 6.4:1, --orange on --bg 6.6:1.
   Dark: --text on --bg 14:1, --muted on --surface 6.7:1, --accent on --surface 6.9:1. */
:root {
  --bg: #f4ede1; --surface: #fffdf8; --text: #1d1b18; --muted: #5c5449; --border: #dcd1bf;
  --accent: #1d4ed8; --accent-text: #fff; --chart: #1d4ed8; --orange: #9a3412; --danger: #b42318; --ok: #067647;
  --orange-bright: #f97316; --on-orange: #fff; /* the logo's orange: decorative, and text on it */
  --radius-sm: 12px; --radius: 20px; /* corners: controls, and cards or panels */
  --warn: #8a3b0a; --warn-bg: #fdf0dc; --danger-bg: #fdeceb; --ok-bg: #e8f5ec; --muted-bg: #ebe1cf;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1816; --surface: #24211d; --text: #f1ebe0; --muted: #b9ae9c; --border: #3d372f;
    --accent: #86a8ff; --accent-text: #0b1020; --chart: #5b84f5; --orange: #fb923c; --danger: #ff8a80; --ok: #6ee7a8;
    --warn: #fdb022; --warn-bg: #2e2412; --danger-bg: #2e1916; --ok-bg: #12291c; --muted-bg: #2e2a24;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1816; --surface: #24211d; --text: #f1ebe0; --muted: #b9ae9c; --border: #3d372f;
  --accent: #86a8ff; --accent-text: #0b1020; --chart: #5b84f5; --orange: #fb923c; --danger: #ff8a80; --ok: #6ee7a8;
  --warn: #fdb022; --warn-bg: #2e2412; --danger-bg: #2e1916; --ok-bg: #12291c; --muted-bg: #2e2a24;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 Archivo, system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 560px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 8px; }
p.lead, .muted { color: var(--muted); }
.mono { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
button, .button {
  display: block; width: 100%; min-height: 48px; padding: 10px 16px; margin-top: 10px;
  font: inherit; font-weight: 600; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; text-align: center; text-decoration: none;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.small { display: inline-block; width: auto; min-height: 44px; padding: 4px 12px; margin: 0 0 0 8px; font-weight: 500; }
button.danger { background: var(--danger); color: var(--accent-text); border-color: var(--danger); } /* white on red in light mode, dark on light red in dark */
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
label { display: block; font-weight: 600; margin-top: 14px; }
input, select { width: 100%; min-height: 44px; margin-top: 4px; padding: 8px 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.divider { text-align: center; color: var(--muted); margin: 18px 0 4px; }
.msg { margin-top: 12px; min-height: 1.5em; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--ok); }
ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
ul.list li:last-child { border-bottom: 0; }
ul.list.card { padding: 4px 16px; }
.badge { font-size: .8rem; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: currentColor; }
.badge.warn { color: var(--warn); border-color: currentColor; }
.badge.danger { color: var(--danger); border-color: currentColor; }
.badge.comp { color: var(--accent); border-color: currentColor; }
[hidden] { display: none !important; }
a { color: var(--accent); }
footer.site { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; font-size: .9rem; color: var(--muted); }
footer.site a { margin-right: 14px; white-space: nowrap; display: inline-block; }
.small-print { font-size: .9rem; }
.tagline { color: var(--muted); font-size: .9rem; margin: -8px 0 16px; }

/* ---------- Branding ---------- */
.brand, .brand-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 900; letter-spacing: -.01em; }
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; border-radius: var(--radius-sm); }
/* The wordmark's "PM" is always the brand orange; logos are exempt from text-contrast rules. */
.brand-word .pm { color: #f97316; }
.brand-divider { width: 1px; height: 24px; background: var(--border); flex-shrink: 0; }
.appbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.shop { display: inline-block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .brand-word { display: none; } }

/* ---------- App shell ---------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 10; }
.skip:focus { left: 8px; }
body.app { padding-bottom: 24px; }
body.app footer.site { max-width: 960px; }
.appbar { background: var(--surface); border-top: 3px solid var(--orange-bright); border-bottom: 1px solid var(--border); } /* not sticky: it holds the status line, and must never cover the focused element (WCAG 2.4.11) */
.appbar-inner { max-width: 960px; margin: 0 auto; padding: 10px 16px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.appbar-actions { display: flex; gap: 6px; flex-shrink: 0; }
.appbar-actions button.small { margin: 0; }
nav.tabs { max-width: 960px; margin: 0 auto; padding: 0 8px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
nav.tabs a { padding: 10px 12px; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; }
nav.tabs a.active { color: var(--text); border-bottom-color: var(--orange-bright); }
/* Phones: every tab visible, on two rows, instead of a sideways scroll nobody notices. */
@media (max-width: 640px) { nav.tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; } nav.tabs a { padding: 8px 10px; } }
.appmain { max-width: 960px; margin: 0 auto; padding: 16px 16px 8px; outline: none; }
.appmain h1 { font-size: 1.4rem; margin: 8px 0 12px; }
/* A short orange rule under each page title, the brand accent from the logo. */
.appmain h1::after { content: ""; display: block; width: 36px; height: 3px; margin-top: 6px; border-radius: 2px; background: var(--orange-bright); }
.appmsg { max-width: 960px; margin: 0 auto; padding: 0 16px; position: sticky; bottom: 8px; }
.appmsg:not(:empty) { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.banner { background: var(--warn-bg); color: var(--warn); text-align: center; margin: 0; padding: 10px 16px; font-weight: 600; }
.banner a { color: inherit; font-weight: 700; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 14px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.view > :first-child { margin-top: 0; }
.card > h2:first-child, .card > h1:first-child { margin-top: 0; }

/* ---------- Building blocks ---------- */
.field { margin-top: 12px; }
.field label { margin-top: 0; }
.hint { color: var(--muted); font-size: .9rem; margin: 4px 0 0; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row button { margin-top: 0; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; color: var(--muted); }
.row-meta button.small { margin: 0; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-row h1 { margin-right: auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
.stat-n { font-size: 1.8rem; font-weight: 700; }
.stat-l { color: var(--muted); }
.stat.alert { border-color: var(--danger); }
.stat.alert .stat-n { color: var(--danger); }
dialog.ask { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); max-width: min(420px, calc(100vw - 32px)); padding: 20px; }
dialog.ask::backdrop { background: rgb(0 0 0 / .45); }
dialog.ask .row { justify-content: flex-end; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
code.details { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters select, .filters input[type=search] { width: auto; margin: 0; }
.filters input[type=search] { flex: 1 1 220px; }
.address { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; background: var(--muted-bg); padding: 2px 6px; border-radius: 4px; overflow-wrap: anywhere; }

/* Light/dark button (theme.js). Dark is the default; the sun switches to light, the moon back. */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 44px; height: 44px; min-height: 0; min-width: 0; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { display: block; }
.theme-toggle .icon-moon, :root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Pricing rules ---------- */
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 12px; }
label.check input { width: 20px; height: 20px; min-height: 0; margin: 0; }
.try-box .row { align-items: flex-end; }
.try-box .row .field { flex: 1 1 140px; margin-top: 0; }
.try-box .row button { margin: 0 0 1px; min-height: 44px; }
.try-result { margin-top: 12px; }
.try-price { margin: 0; }
.try-price .big { font-size: 1.6rem; font-weight: 700; }
table.data.edit input { min-height: 40px; margin: 0; max-width: 180px; }
table.data.edit td { vertical-align: middle; }
table.data.edit button.small { margin: 0; }
.card .row button[type=submit] { margin-top: 12px; }

/* ---------- Integrations ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.tile { margin-top: 0; }
.tile h3 { margin: 0; }
.tile .row { margin-top: 10px; }
.tile .row button, .tile .row .button-link { margin: 0; }
.button-link { display: inline-block; padding: 10px 16px; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-text); font-weight: 600; text-decoration: none; }
.button-link.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.button-link.small { padding: 8px 12px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
table.data.mapping th { width: 40%; font-weight: 600; }
table.data.mapping select { margin: 0; min-height: 40px; }
.card .row .field { margin-top: 0; flex: 1 1 220px; }

/* ---------- Parts search ---------- */
.search-form { margin: 0 0 16px; }
.search-form input { flex: 1; margin: 0; min-height: 48px; font-size: 1.05rem; }
.search-form button { margin: 0; min-height: 48px; }
.results { display: grid; gap: 12px; }
.result { margin-top: 0; }
.result-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.result-head h2 { margin: 0; font-size: 1.15rem; }
.result-head .desc { margin: 2px 0 8px; }
.price-box { text-align: right; min-width: 200px; }
.price-box .big { font-size: 1.7rem; font-weight: 700; }
.price-box .badge { margin-left: 4px; }
.price-label { font-size: .85rem; }
.qbo-slot { margin-top: 6px; }
table.offers tr.chosen td { background: var(--muted-bg); }
table.offers .badge { margin-left: 6px; }
table.offers button.small { margin: 0; min-height: 36px; }
@media (max-width: 600px) { .price-box { text-align: left; } }

/* ---------- QuickBooks ---------- */
.match-form input { flex: 1 1 160px; margin: 0; min-height: 44px; }
.match-form button { margin: 0; }
.qbo-slot { border-top: 1px dashed var(--border); padding-top: 6px; }
.qbo-slot .mono { font-weight: 600; }
.warn-text { color: var(--warn); }

/* ---------- Sync review and dashboard ---------- */
nav.subtabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 0 0 12px; padding: 0; }
.review-actions { margin-bottom: 12px; }
.review-actions button { margin: 0; }
table.changes td { vertical-align: top; }
table.changes .badge { margin: 0 4px 4px 0; display: inline-block; }
table.changes input[type=checkbox], table.changes th input[type=checkbox] { width: 20px; height: 20px; min-height: 0; margin: 0; }
.title-row button.small { margin: 0; }
.vendor-chip { display: inline-flex; align-items: center; gap: 4px; margin: 0 10px 4px 0; }
a.stat { cursor: pointer; }
a.stat:hover { border-color: var(--accent); }

/* ---------- Price files by email ---------- */
.sender-form { margin-top: 12px; }
.sender-form input { flex: 1 1 220px; margin: 0; min-height: 44px; }
.sender-form select { width: auto; margin: 0; min-height: 44px; }
.sender-form button { margin: 0; }
.row-meta label.check { margin: 0; }

/* ---------- New items ---------- */
.accounts { border-top: 1px dashed var(--border); margin-top: 14px; padding-top: 10px; }
.accounts h4 { margin: 0 0 4px; font-size: 1rem; }
.accounts button.small { margin-top: 8px; }
.qbo-slot button.small { margin-top: 6px; }

/* ---------- Price check before paying ---------- */
.preview { border-color: var(--accent); }
.preview button.primary { width: auto; padding: 10px 22px; }
.preview-steps { margin: 12px 0 4px; padding-left: 22px; display: grid; gap: 4px; }
.preview-steps li.done { color: var(--ok); }
.preview-steps li.done::marker { content: "✓ "; }
.preview-result { margin-top: 14px; }
.preview-result .stats { margin: 10px 0; }
.preview-gap { font-weight: 600; }
.preview-cta { font-weight: 700; color: var(--accent); }
.free-notice { margin-bottom: 4px; }
.price-box.locked .locked-price { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; font-size: 1.7rem; font-weight: 700; color: var(--muted); letter-spacing: 2px; }
/* Sync review: room for the item name; the table scrolls inside its card on narrow screens. */
table.data.changes { min-width: 760px; }
table.data.changes .was { font-size: .82rem; color: var(--muted); }
table.data.changes td:nth-child(2) { min-width: 200px; }
table.data.changes td:nth-child(3) .badge { white-space: nowrap; }
table.data.changes td:last-child { white-space: nowrap; }

/* ---------- Settings: plan and billing ---------- */
.interval-toggle { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.interval-toggle button.small { margin: 0; }
.plan-pick { border: 1px solid var(--border); border-top: 3px solid var(--orange-bright); border-radius: var(--radius); padding: 14px 16px; margin: 4px 0 12px; }
.plan-pick p { margin: 0 0 4px; }
.plan-price { font-size: 1.6rem; font-weight: 700; }
.plan-price .muted { font-size: 1rem; font-weight: 500; font-family: Archivo, system-ui, sans-serif; }
#billing > button.small { margin-left: 0; }
#deletion > button.small { margin-left: 0; }
.card .row input { flex: 1 1 160px; margin-top: 0; }
.card .row input.days { flex: 0 0 90px; }

/* ---- CraftPM additions ---- */
.visually-hidden, .sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.plain { list-style: none; padding: 0; margin: 0; }
.small { font-size: .875rem; }
.h3 { font-size: 1.15rem; margin: 0; }
.h4 { font-size: 1rem; margin: 0 0 6px; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.pin { font-size: 1.25rem; letter-spacing: 2px; }
button.big, .button.big { min-height: 52px; font-size: 1.05rem; padding: 12px 20px; }
button.link { background: none; border: none; color: var(--accent); text-decoration: underline; min-height: 44px; }
main.appmain { max-width: 960px; }
.subtabs { display: flex; gap: 4px; margin: 8px 0 16px; flex-wrap: wrap; }
.subtabs a { padding: 10px 14px; min-height: 44px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text); border: 1px solid var(--border); }
.subtabs a.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.projects { display: grid; gap: 12px; }
.project-card { display: flex; gap: 14px; align-items: flex-start; }
.project-card .cover { width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); flex: none; background: var(--muted-bg); }
.progress .bar { height: 10px; background: var(--muted-bg); border-radius: 5px; overflow: hidden; border: 1px solid var(--border); margin-top: 6px; }
.progress .bar span { display: block; height: 100%; background: var(--orange-bright); }
.steps { list-style: none; padding: 0; margin: 0; }
.steps li { display: flex; align-items: center; gap: 10px; min-height: 44px; border-bottom: 1px solid var(--border); }
.steps .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.steps .done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps .current .dot { border-color: var(--orange); color: var(--orange); }
.steps .current { font-weight: 600; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); margin: 16px 0; align-items: start; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { width: 120px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.update.draft { border-left: 4px solid var(--warn); }
.update.unpublished { opacity: .85; border-left: 4px solid var(--muted); }
.caption { white-space: pre-wrap; }
.photo-list { display: grid; gap: 8px; }
.photo-item { display: flex; gap: 12px; align-items: flex-start; }
.photo-item img { width: 96px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.photo-item input { width: 100%; }
.small-buttons { margin-top: 6px; flex-wrap: wrap; }
.composer { border: 2px solid var(--accent); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.presets { border: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.presets legend { margin-bottom: 8px; font-weight: 600; }
.preset { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.preset input { margin-top: 4px; width: 20px; height: 20px; }
.preset > span { display: flex; flex-direction: column; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 3px; border: 1px solid var(--border); vertical-align: middle; margin-right: 4px; }
.swatch-row { white-space: nowrap; margin-right: 12px; }
.accent-preview { margin-top: 8px; }
.logo-preview { border-radius: var(--radius-sm); border: 1px solid var(--border); object-fit: contain; background: #fff; }
button.block { width: 100%; text-align: left; }
:focus-visible { outline: 3px solid var(--orange-bright); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.row > button, .row > .button, .row > span > button { width: auto; margin-top: 0; }
.row > button.small, .row > span > button.small { margin-left: 0; }
a.button { display: inline-flex; align-items: center; justify-content: center; width: auto; }
.button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
textarea { width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical; }
textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
p > button.primary.big, #post-update { width: auto; }
.hint { color: var(--muted); font-size: .875rem; margin: 2px 0 4px; }
[aria-invalid="true"] { border-color: var(--danger); border-width: 2px; }
.photo-item { flex-wrap: wrap; }
.photo-item .grow { flex: 1 1 220px; }
.small-buttons button.small { margin: 0; }

/* ---- CraftPM look (SPEC §10B) ---- */
body { background-image: linear-gradient(rgba(127, 110, 85, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(127, 110, 85, .07) 1px, transparent 1px); background-size: 28px 28px; }
h1, h2, .h3, .h4, dialog.ask p { font-family: var(--display); letter-spacing: -.01em; }
h1 { font-weight: 700; font-size: 1.9rem; }
h2 { font-weight: 650; }
button, .button, a.button, .subtabs a, .button-link { border-radius: 999px; }
.theme-toggle { border-radius: 50%; }
.card { box-shadow: 0 16px 30px -26px rgba(29, 27, 24, .55); border-color: transparent; }
:root[data-theme="dark"] .card { border-color: var(--border); box-shadow: none; }
.appbar { border-top-width: 4px; }
.appmain h1::after { width: 44px; height: 4px; }
input, select, textarea { border-radius: var(--radius-sm); }
.project-card .cover, .thumbs img, .photo-item img { border-radius: 12px; }
.project-card .cover { width: 112px; height: 84px; }
/* the progress bar as a tape measure */
.progress .bar { height: 16px; border-radius: 6px; background: var(--muted-bg); border: 0; position: relative; }
.progress .bar::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(29, 27, 24, .35) 0 1px, transparent 1px 8px) bottom left / 100% 40% no-repeat; pointer-events: none; }
.progress .bar span { border-radius: 0 5px 5px 0; }
.steps .done .dot { background: var(--orange-bright); border-color: var(--orange-bright); color: #1d1b18; }
.steps .current .dot { border-color: var(--orange); color: var(--orange); }
.badge { border-radius: 999px; }
.update.draft { border-left: 0; box-shadow: inset 5px 0 0 var(--warn), 0 16px 30px -26px rgba(29, 27, 24, .55); }
.update.unpublished { border-left: 0; box-shadow: inset 5px 0 0 var(--muted); }
.composer { border-width: 2px; border-radius: 24px; }
.banner { border-radius: 0; }
/* Contrast fixes found by axe (Nov 14): the wordmark's "PM" uses the text-safe orange, and the active
   project tab keeps its light-on-accent text against later link rules. */
.brand-word .pm { color: var(--orange); }
.subtabs a.active, .subtabs a.active:visited, .subtabs a.active:hover { color: var(--accent-text); }

/* comments in the dashboard (SPEC §4.10) */
.tabs a .count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--orange-bright); color: #1d1b18; font-size: .78rem; font-weight: 700; }
.thread-box { margin-top: 14px; border-top: 2px dashed var(--border); padding-top: 10px; }
.thread-box .thread > li + li { border-top: 1px solid var(--border); }
.comment { padding: 8px 0; }
.comment .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 2px 0 6px; }
.comment.hidden { opacity: .75; }
.replies { margin: 6px 0 0 14px; padding-left: 12px; border-left: 3px solid var(--orange-bright); }
details.reply > summary { min-height: 44px; display: inline-flex; align-items: center; color: var(--accent); font-weight: 600; cursor: pointer; }
details.reply form { margin-top: 6px; }

/* billing (SPEC §9) */
.term-toggle { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.term-toggle legend { font-weight: 600; margin-bottom: 6px; }
.term { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 16px; border: 2px solid var(--border); border-radius: 999px; min-height: 44px; cursor: pointer; font-weight: 600; }
.term:has(input:checked) { border-color: var(--accent); }
.term input { width: 18px; height: 18px; margin: 0; min-height: 0; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan-card { margin: 0; display: grid; gap: 6px; align-content: start; }
.plan-card.featured { outline: 3px solid var(--orange-bright); outline-offset: -3px; }
.plan-card .price strong { font-family: var(--display); font-size: 2rem; }

a.button.small-link { width: auto; display: inline-flex; min-height: 44px; padding: 8px 18px; }

/* shop page editor (SPEC §4.9) */
.profile-editor { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.profile-editor .preview { position: sticky; top: 12px; margin-top: 0; }
.preview-frame { display: block; border: 1px solid var(--border); border-radius: 18px; background: #fff; margin-top: 10px; height: 720px; }
.preview-frame.phone { width: 390px; max-width: 100%; }
.preview-frame.desktop { width: 100%; }
@media (max-width: 1000px) { .profile-editor { grid-template-columns: 1fr; } .profile-editor .preview { position: static; } }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 44px; margin-top: 6px; }
label.check input { width: 20px; height: 20px; min-height: 0; margin: 0; }
.day-row { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 110px auto auto 1fr auto 1fr; gap: 8px; align-items: center; }
.day-row legend { float: left; font-weight: 600; padding: 0; }
.day-row label { margin: 0; font-weight: 500; }
.day-row input[type=time] { margin: 0; }
@media (max-width: 640px) { .day-row { grid-template-columns: 1fr 1fr; } }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.checklist .done { color: var(--muted); text-decoration: line-through; }

/* custom domain: the DNS record to add (SPEC §7A) */
dl.dns-record { margin: 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.dns-row { display: grid; grid-template-columns: minmax(150px, 34%) 1fr; gap: 4px 14px; align-items: center; padding: 12px 14px; }
.dns-row + .dns-row { border-top: 1px solid var(--border); }
.dns-row dt { font-weight: 600; }
.dns-row dd { margin: 0; min-width: 0; }
.dns-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dns-plain { font-weight: 600; }
@media (max-width: 560px) { .dns-row { grid-template-columns: 1fr; } .dns-row dt { font-size: 14px; color: var(--muted); } }
code.dns-value { font: 600 16px/1.3 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; background: var(--bg); padding: 5px 10px; border-radius: 8px; overflow-wrap: anywhere; }
.dns-note { display: block; margin-top: 4px; }
#domain:focus { outline: none; }

/* help: topic tiles, one card per topic */
.help-head .lead { max-width: 40em; }
.help-toc ul { list-style: none; padding: 0; margin: 18px 0 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.help-toc li { display: flex; }
@media (max-width: 760px) { .help-toc ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.help-toc a { flex: 1; display: grid; align-content: center; gap: 2px; min-height: 64px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: 0 10px 22px -20px rgba(29, 27, 24, .6), inset 0 0 0 1px var(--border); transition: transform .15s ease, box-shadow .15s ease; }
.help-toc a:hover { transform: translateY(-2px); box-shadow: 0 14px 26px -20px rgba(29, 27, 24, .7), inset 0 0 0 2px var(--orange-bright); }
.help-toc strong { font: 650 1.02rem/1.25 var(--display); }
.help-toc span { color: var(--muted); font-size: .9rem; }
.help-topic { scroll-margin-top: 12px; }
.help-topic:focus { outline: none; }
.help-topic > h2 { font-family: var(--display); font-size: 1.4rem; margin: 0; padding-left: 14px; border-left: 5px solid var(--orange-bright); }
.help-hint { margin: 2px 0 14px 19px; color: var(--muted); font-size: .92rem; }
.help-sub { font: 650 1.08rem/1.3 var(--display); margin: 22px 0 8px; scroll-margin-top: 12px; }
.help-sub:focus { outline: none; }
.help-steps { list-style: none; counter-reset: step; padding: 0; margin: 8px 0; display: grid; gap: 10px; }
.help-steps li { counter-increment: step; position: relative; padding-left: 40px; min-height: 28px; }
.help-steps li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--muted-bg); color: var(--text); font: 700 .9rem/1 var(--display); }
.help-list { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.help-providers { display: grid; gap: 8px; margin-top: 4px; }
.help-providers details, .help-more { border-radius: var(--radius-sm); background: var(--bg); padding: 4px 14px; }
.help-more { margin-top: 12px; }
.help-providers summary, .help-more summary { font-weight: 650; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.help-providers details[open], .help-more[open] { padding-bottom: 12px; }
.help-topic .notice { margin: 12px 0; }
.help-topic .notice p + p { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .help-toc a, .help-toc a:hover { transition: none; transform: none; } }

/* featured build: photo picker (SPEC §4.6) */
.feature h3 { font: 650 1.08rem/1.3 var(--display); margin: 10px 0 0; }
fieldset.plain { border: 0; padding: 0; margin: 0; }
fieldset.plain legend { font-weight: 600; padding: 0; }
.pick-grid { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.pick-grid li { border-radius: var(--radius-sm); background: var(--bg); padding: 6px; box-shadow: inset 0 0 0 2px transparent; }
.pick-grid li.on { box-shadow: inset 0 0 0 3px var(--accent); }
.pick { position: relative; display: block; cursor: pointer; }
.pick img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.pick input[type=checkbox] { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; margin: 0; min-height: 0; accent-color: var(--accent); }
.pick-label { display: block; font-size: .85rem; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-pick { display: flex; align-items: center; gap: 6px; font-size: .9rem; min-height: 32px; cursor: pointer; }
.cover-pick input { width: 18px; height: 18px; margin: 0; min-height: 0; }

/* messages: the latest contact-form messages, read-only */
.messages { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.message { background: var(--surface); border-radius: var(--radius); box-shadow: 0 16px 30px -26px rgba(29, 27, 24, .55); }
.message summary { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 14px 18px; cursor: pointer; list-style: none; min-height: 44px; }
.message summary::-webkit-details-marker { display: none; }
.message summary::after { content: "▸"; grid-column: 2; grid-row: 1; justify-self: end; color: var(--muted); transition: transform .15s ease; }
.message[open] summary::after { transform: rotate(90deg); }
.m-subject { font: 650 1.05rem/1.3 var(--display); grid-column: 1; }
.m-from { grid-column: 1; color: var(--muted); overflow-wrap: anywhere; }
.m-from strong { color: var(--text); font-weight: 600; }
.m-when { grid-column: 2; grid-row: 2; color: var(--muted); font-size: .9rem; white-space: nowrap; align-self: end; }
.m-body { padding: 0 18px 16px; border-top: 1px solid var(--border); }
.m-text { white-space: pre-wrap; margin: 14px 0 0; overflow-wrap: anywhere; }
.m-body .facts { margin-top: 12px; }
@media (max-width: 560px) { .message summary { grid-template-columns: 1fr; } .m-when { grid-column: 1; grid-row: auto; } .message summary::after { display: none; } }
@media (prefers-reduced-motion: reduce) { .message summary::after { transition: none; } }

/* upload previews: show exactly how a logo or cover is fitted */
.cover-previews { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: end; }
.cover-previews[hidden] { display: none; }
.cover-previews figure { margin: 0; }
.cover-previews figcaption { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.cover-crop { display: block; width: 100%; object-fit: cover; object-position: center; border-radius: 12px; background: var(--muted-bg); }
.cover-crop.wide { aspect-ratio: 2 / 1; }
.cover-crop.phone { aspect-ratio: 4 / 3; }
.logo-previews { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.logo-in-header { margin: 0; }
.fake-shopbar { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); font: 650 1rem/1 var(--display); }
.fake-shopbar img { width: 44px; height: 44px; border-radius: 12px; object-fit: contain; background: #fff; }

/* featured builds: list and the past-work editor */
.fb-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.fb-card { display: grid; gap: 4px; padding-bottom: 14px; border-radius: var(--radius); overflow: hidden; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: 0 16px 30px -26px rgba(29, 27, 24, .55); height: 100%; align-content: start; }
.fb-card:hover .fb-title { text-decoration: underline; }
.fb-card img, .fb-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: grid; place-items: center; background: var(--muted-bg); color: var(--muted); margin-bottom: 8px; }
.fb-title { font: 650 1.08rem/1.3 var(--display); padding: 0 14px; }
.fb-meta { color: var(--muted); font-size: .9rem; padding: 0 14px; }
.fb-card .badge { justify-self: start; margin: 4px 14px 0; }
.fe-photos { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.fe-photos li { background: var(--bg); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 8px; align-content: start; }
.fe-photos li.cover { box-shadow: inset 0 0 0 3px var(--accent); }
.fe-photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
.fe-photos .field { margin: 0; }

/* emails from your domain: the three records */
.dns-records { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.dns-step { margin: 0 0 6px; font-weight: 650; display: flex; gap: 10px; align-items: center; }
.email-pair { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.email-pair input { flex: 1 1 200px; margin: 0; }
.email-pair input.local-part { flex: 0 1 140px; }
.email-pair span { font-weight: 700; font-size: 1.2rem; }
#email-domain:focus { outline: none; }

/* visitor stats: one series in --chart (validated against both surfaces), recessive axis */
.stat-big { margin: 0; }
.stat-big strong { font: 700 2rem/1 var(--display); margin-right: 4px; }
.seg { display: inline-flex; gap: 4px; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.visits-chart { margin: 4px 0 0; }
.vc-plot { position: relative; padding: 18px 0 0; }
.vc-max { position: absolute; top: 0; left: 0; font-size: .8rem; color: var(--muted); }
.vc-bars { height: 140px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--border); background: linear-gradient(var(--border), var(--border)) 0 0 / 100% 1px no-repeat; }
.vc-bar { position: relative; flex: 1; height: max(var(--h), 2px); background: var(--chart); border-radius: 4px 4px 0 0; min-width: 2px; }
.vc-bar.zero { background: var(--border); }
.vc-bar::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--text); color: var(--surface); font-size: .8rem; padding: 4px 8px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .1s; z-index: 2; }
.vc-bar:hover::after { opacity: 1; }
.vc-bar:hover { filter: brightness(1.15); }
.vc-axis { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 4px; }
.vc-table { margin-top: 8px; font-size: .9rem; }
.vc-table summary { cursor: pointer; min-height: 32px; }
.vc-table table { border-collapse: collapse; margin-top: 6px; }
.vc-table th, .vc-table td { text-align: left; padding: 3px 14px 3px 0; font-weight: 400; }
.vc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .vc-two { grid-template-columns: 1fr; } .vc-bars { height: 110px; } }
.vc-ranked h3 { font: 650 1rem/1.3 var(--display); margin: 0 0 6px; }
.vc-ranked ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.vc-ranked li { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 10px; align-items: center; }
.vr-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vr-bar { height: 6px; border-radius: 3px; background: var(--muted-bg); overflow: hidden; }
.vr-bar span { display: block; height: 100%; width: var(--w); background: var(--chart); border-radius: 3px; }
.vr-n { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 2ch; text-align: right; }
@media (prefers-reduced-motion: reduce) { .vc-bar::after { transition: none; } }

/* where to get a domain */
.get-domain { margin-top: 4px; }
.registrars { list-style: none; padding: 0; margin: 4px 0 8px; display: grid; gap: 10px; }
.registrars li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.registrars li a { font-weight: 650; }
.registrars li p { flex-basis: 100%; margin: 0; }

/* project status: where it stands and what to do next */
.status-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 4px 0 14px; }
.status-now { margin: 0; color: var(--muted); }

/* ---------------------------------------------------------------------------------------------------
   Workshop ledger (Nov 16, 2026): the dashboard in the same hand as craftpm.app and the customer page.
   Paper with a little tooth by day, workshop charcoal by night; book type (Fraunces), hairline rules,
   nearly square corners; ink buttons, rust links and progress; statuses as italic words, not pills.
   These rules override the ones above.
   Light: text 14.9:1, muted 6.9:1 on --bg (7.6:1 on --surface), accent 6.7:1 / 7.4:1, button text 16:1.
   Dark: text 14.9:1, muted 7.4:1 on --surface, accent 7.6:1 on --surface, button text 14.9:1.
   --------------------------------------------------------------------------------------------------- */
:root {
  --bg: #f3ede2; --surface: #fbf8f2; --text: #1c1a17; --muted: #574f44; --border: #d6cab5;
  --accent: #8f3511; --accent-text: #fbf8f2; --orange: #8f3511; --focus: #1d4ed8;
  --ink-btn: #1c1a17; --ink-btn-text: #fbf8f2;
  --radius-sm: 3px; --radius: 2px;
  --display: "Fraunces Full", "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sheet-shadow: 0 1px 0 rgba(28, 26, 23, .06), 0 14px 26px -24px rgba(28, 26, 23, .5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1816; --surface: #23201c; --text: #f1ebe0; --muted: #b9ae9c; --border: #3d372f;
    --accent: #e8a272; --accent-text: #1a1816; --orange: #e8a272; --focus: #86a8ff;
    --ink-btn: #f1ebe0; --ink-btn-text: #1a1816; --sheet-shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1816; --surface: #23201c; --text: #f1ebe0; --muted: #b9ae9c; --border: #3d372f;
  --accent: #e8a272; --accent-text: #1a1816; --orange: #e8a272; --focus: #86a8ff;
  --ink-btn: #f1ebe0; --ink-btn-text: #1a1816; --sheet-shadow: none;
}
body {
  font: 400 17px/1.55 var(--display);
  font-variation-settings: "opsz" 14, "SOFT" 30;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .25 0 0 0 0 .18 0 0 0 .055 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: auto;
}
:root[data-theme="dark"] body { background-image: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { background-image: none; } }

h1, h2, h3, .h3, .h4, dialog.ask p { font-family: var(--display); font-weight: 420; letter-spacing: -.012em; font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1; }
h1, .appmain h1 { font-size: 2.1rem; line-height: 1.05; }
h2 { font-size: 1.35rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* page titles: a short tape measure instead of the orange bar */
.appmain h1::after {
  width: 72px; height: 7px; margin-top: 10px; border-radius: 0;
  background: linear-gradient(var(--accent), var(--accent)) bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--accent) 0 1px, transparent 1px 9px) bottom / 100% 6px no-repeat;
}

/* the bar along the top */
.appbar { border-top: 3px solid var(--accent); background: var(--surface); }
nav.tabs a { font: 400 1.02rem/1.3 var(--display); color: var(--muted); border-bottom-width: 2px; }
nav.tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-style: italic; }
.tabs a .count { border-radius: 2px; background: var(--accent); color: var(--accent-text); font: 600 .75rem/1 var(--sans); font-style: normal; }
.brand-mark { border-radius: 6px; }
.theme-toggle { border-radius: var(--radius-sm); }

/* sheets of paper instead of rounded cards */
.card, .stat, dialog.ask { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--sheet-shadow); }
.card { border-color: transparent; }
:root[data-theme="dark"] .card { border-color: var(--border); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card { border-color: var(--border); } }
.stat-n { font: 400 2.1rem/1.1 var(--display); font-variation-settings: "opsz" 144; font-variant-numeric: lining-nums; }

/* buttons: ink by default, square-cut, set in the sans like craftpm.app */
button, .button, a.button, .subtabs a, .button-link { border-radius: var(--radius-sm); font-family: var(--sans); font-weight: 600; letter-spacing: .01em; }
button.primary, .button.primary, a.button.primary { background: var(--ink-btn); color: var(--ink-btn-text); border-color: var(--ink-btn); }
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button:not(.primary):not(.danger):not(.theme-toggle):hover:not(:disabled) { border-color: var(--text); }
button.danger { background: transparent; color: var(--danger); border-color: currentColor; }
button.danger:hover:not(:disabled) { background: var(--danger); color: var(--surface); border-color: var(--danger); }
.subtabs a.active, .subtabs a.active:visited, .subtabs a.active:hover { background: var(--ink-btn); color: var(--ink-btn-text); border-color: var(--ink-btn); }
.term { border-radius: var(--radius-sm); border-width: 1px; font-family: var(--sans); }
.term:has(input:checked) { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }

/* fields */
input, select, textarea { border-radius: 2px; background: var(--surface); border-color: var(--border); font-family: var(--display); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
label, .term-toggle legend, .day-row legend, details > summary { font-weight: 500; }
.composer { border-width: 1px; border-radius: var(--radius); }

/* statuses are words, not pills */
.badge { border: 0; border-radius: 0; padding: 0; font-style: italic; font-size: .95rem; color: var(--muted); }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.danger { color: var(--danger); }
.badge.comp { color: var(--accent); }
/* "Reached Joinery" on an update: the same rubber stamp the customer sees */
.badge.stamp { display: inline-block; margin-left: 10px; padding: 1px 8px; border: 1.5px solid var(--accent); outline: 1px solid var(--accent); outline-offset: 2px; color: var(--accent); font: 600 .72rem/1.4 var(--sans); font-style: normal; letter-spacing: .06em; transform: rotate(-2deg); }

/* progress: a rust tape measure */
.progress .bar { border-radius: 1px; height: 14px; }
.progress .bar span { border-radius: 0; background: var(--accent); }
.steps .done .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.steps .current .dot { border-color: var(--accent); color: var(--accent); }

/* photos as small prints */
.project-card .cover, .thumbs img, .photo-item img, .pick img, .fe-photos img, .cover-crop { border-radius: 1px; box-shadow: 0 1px 0 rgba(28, 26, 23, .08); }
.preview-frame { border-radius: var(--radius); }
dl.dns-record { border-radius: var(--radius); }
code.dns-value, .address { border-radius: 2px; }
.fake-shopbar { border-radius: var(--radius-sm); }
.fake-shopbar img { border-radius: 6px; }
.notice, .appmsg:not(:empty), .skip { border-radius: var(--radius); }
.help-steps li::before { font-weight: 500; font-style: italic; background: none; border: 1px solid var(--border); }
.replies { border-left: 2px solid var(--accent); }
.thread-box { border-top: 1px solid var(--border); }
.plan-card.featured { outline: 2px solid var(--text); outline-offset: -2px; }
.update.draft { box-shadow: inset 3px 0 0 var(--warn), var(--sheet-shadow); }
.update.unpublished { box-shadow: inset 3px 0 0 var(--muted); }
.vc-bar { border-radius: 2px 2px 0 0; }
.vc-bar::after { border-radius: 2px; }
.vr-bar, .vr-bar span { border-radius: 0; }
.mono, .address, code.dns-value { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; }
table.data th { font-weight: 500; font-style: italic; color: var(--muted); }
/* Settings → Delete this shop: set apart by a red hairline, not a red box */
.danger-zone { border-top: 2px solid var(--danger); margin-top: 32px; }
.danger-zone .hint { font-style: italic; }

/* Hours editor: a fieldset won't shrink below its content by default, which pushed the times under the
   preview; let it shrink and wrap the times onto their own line when the column is narrow. */
.day-row { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.day-row legend { float: left; width: 7em; font-weight: 500; }
.day-row label.check { margin: 0; min-height: 44px; }
.day-row .times { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.day-row input[type=time] { width: 9em; margin: 0; }
@media (max-width: 640px) { .day-row { display: flex; } }
/* Visitors: heading and period buttons on one line, everything else stacked below */
.visitors .seg { display: inline-flex; gap: 6px; }
.visitors .seg button.small { margin: 0; min-width: 72px; }
.day-row:has(input[id^="closed-"]:checked) .times { display: none; }
.day-row .time-pair { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.day-row .time-pair label { min-width: 3.6em; }
/* Hours → Special days */
.special-editor { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.special-editor > .h4 { margin: 0; font-size: 1.15rem; }
.special-day { min-width: 0; border: 0; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.special-day .sd-field { display: inline-flex; align-items: center; gap: 8px; }
.special-day .sd-field label, .special-day .time-pair label { margin: 0; font-weight: 500; }
.special-day input[type=date] { width: 11em; margin: 0; }
.special-day input[type=time] { width: 9em; margin: 0; }
.special-day .sd-note { flex: 1 1 260px; }
.special-day .sd-note input { margin: 0; }
.special-day .times { display: inline-flex; flex-wrap: wrap; gap: 6px 10px; }
.special-day .time-pair { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.special-day label.check { margin: 0; }
.special-day button.small { margin: 0 0 0 auto; }
.special-day:has(input[data-k="closed"]:checked) .times { display: none; }
.special-editor > button.small { margin: 10px 0 0; }
