@font-face { font-family: "Figtree"; src: url(/fonts/figtree-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(/fonts/figtree-600.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }

:root {
  --bg: #f3f1ee; --surface: #ffffff; --ink: #1f2427; --muted: #5a5f62; --line: #e0dad3;
  --brand: #8a3b1c; --brand-ink: #ffffff; --soft: #f1e3d8; --top: #1f2427; --top-ink: #f3f1ee;
  --ok: #2f6b3f; --ok-bg: #e3efe6; --warn: #7a5300; --warn-bg: #fbf0d7; --err: #b3261e; --err-bg: #fbe4e2;
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #15191b; --surface: #1e2427; --ink: #ece7e2; --muted: #a8a29c; --line: #343b3f;
  --brand: #e08a5a; --brand-ink: #1a0e07; --soft: #33261f; --top: #0e1112; --top-ink: #ece7e2;
  --ok: #7cc48f; --ok-bg: #1d2d22; --warn: #e8c46a; --warn-bg: #2f2716; --err: #ff8a80; --err-bg: #3a1f1d;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #15191b; --surface: #1e2427; --ink: #ece7e2; --muted: #a8a29c; --line: #343b3f;
  --brand: #e08a5a; --brand-ink: #1a0e07; --soft: #33261f; --top: #0e1112; --top-ink: #ece7e2;
  --ok: #7cc48f; --ok-bg: #1d2d22; --warn: #e8c46a; --warn-bg: #2f2716; --err: #ff8a80; --err-bg: #3a1f1d;
  color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; padding-top: 20px; padding-bottom: 40px; }
.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
a { color: var(--brand); }
h1 { font-size: 1.75rem; line-height: 1.2; margin: .2em 0 .4em; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 1.2em 0 .5em; }
.card > h2:first-child, .card > input + h2 { margin-top: 0; }
p { margin: .5em 0 1em; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.pre { white-space: pre-wrap; }

/* top bar */
.top { background: var(--top); color: var(--top-ink); }
.topin { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { color: var(--top-ink); font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.appnav { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; }
.appnav a, .linkbtn { color: var(--top-ink); text-decoration: none; font-size: .95rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.appnav a[aria-current="page"] { border-bottom-color: var(--brand); }
.appnav .btn { color: var(--brand-ink); border-bottom: 0; padding: 6px 12px; }
.linkbtn { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font: inherit; font-size: .95rem; }
.inline { display: inline; margin: 0; }

.foot { border-top: 1px solid var(--line); padding: 16px 0; font-size: .9rem; }
.foot a { margin-right: 16px; color: var(--muted); }

/* buttons: square-ish, never pills */
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 1px solid var(--brand); border-radius: 4px; padding: 10px 18px; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* cards and layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px; margin: 16px 0; }
.narrow { max-width: 520px; margin: 0 auto; }
.grid3 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid3 .card { margin: 0; }
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); max-width: 18ch; }
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row2, .row3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .row2 { grid-template-columns: 1fr 1fr; } .row3 { grid-template-columns: 1fr 1fr 1fr; } }

/* forms */
.stack { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
label .muted { font-weight: 400; }
input, select, textarea { font: 400 1rem var(--font); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; width: 100%; }
textarea { resize: vertical; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
.stack .btn { align-self: flex-start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.flash { padding: 10px 14px; border-radius: 4px; background: var(--ok-bg); color: var(--ok); border: 1px solid currentColor; }
.flash.err { background: var(--err-bg); color: var(--err); }
.flash.warn { background: var(--warn-bg); color: var(--warn); }

/* inbox */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 8px 0 0; -webkit-overflow-scrolling: touch; }
.tabs a { white-space: nowrap; padding: 8px 10px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.count { font-size: .8rem; color: var(--muted); }
.enqlist { list-style: none; margin: 0; padding: 0; }
.enqlist li { border-bottom: 1px solid var(--line); }
.enqlist .empty { padding: 24px 4px; color: var(--muted); }
.enq { display: flex; flex-direction: column; gap: 2px; padding: 12px 4px; color: var(--ink); text-decoration: none; }
.enq:hover { background: var(--surface); }
.enq-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.enq-bot { font-size: .88rem; }
.tag { font-size: .78rem; font-weight: 600; padding: 2px 8px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); white-space: nowrap; }
.t-new { background: var(--soft); color: var(--brand); border-color: transparent; }
.t-quote-sent { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.t-won, .s-sent { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.s-failed { background: var(--err-bg); color: var(--err); border-color: transparent; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; }

/* detail */
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.msg { border-bottom: 1px solid var(--line); padding: 8px 0; }
.msg summary { cursor: pointer; }
.msg pre { white-space: pre-wrap; font: .92rem/1.5 var(--font); background: var(--bg); padding: 12px; border-radius: 4px; overflow-wrap: anywhere; }
.ticks { padding-left: 1.2em; }
.ticks li { margin: .4em 0; }
.powered { text-align: center; margin-top: 24px; }

/* admin */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; }
.stat-n { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; padding: 0; }
table.admin { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .92rem; }
table.admin th, table.admin td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.admin th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
table.admin tr:last-child td { border-bottom: 0; }
table.admin .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
table.admin .wrapcell { overflow-wrap: anywhere; }

/* coming soon */
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--brand); margin: 0; }
.narrow-left { max-width: 560px; }
