:root {
  /* CraftRF brand: same palette as the CraftPi dashboard (navy, cyan, amber, cherry) */
  --paper: #0E2233;
  --card: #16314A;
  --inset: #0A1824;
  --ink: #EAF2F5;
  --ink-2: #B9CBD4;
  --ink-3: #8FA9B8;
  --line: #25506F;
  --brand: #4FD1E8;
  --brand-ink: #0A1824;
  --brand-soft: rgba(79, 209, 232, 0.13);
  --ok: #5ED8A0;
  --ok-soft: rgba(94, 216, 160, 0.15);
  --on-ok: #062014;
  --warn: #F5A623;
  --warn-soft: rgba(245, 166, 35, 0.15);
  --on-warn: #1a1204;
  --bad: #FF6B80;
  --bad-soft: rgba(232, 67, 90, 0.18);
  --bar-off: #2B4A63;
  --glow: 0 0 10px rgba(79, 209, 232, 0.55);
  --hero-wash: radial-gradient(120% 140% at 100% 100%, rgba(79, 209, 232, 0.14), rgba(79, 209, 232, 0) 55%);
  --shadow: 0 0 0 1px rgba(79, 209, 232, 0.04), 0 12px 32px rgba(0, 0, 0, 0.35);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --paper: #EEF4F8;
  --card: #ffffff;
  --inset: #F6FAFC;
  --ink: #0E2233;
  --ink-2: #3F5A6E;
  --ink-3: #5F7A8C;
  --line: #D3E0E8;
  --brand: #0A7C96;
  --brand-ink: #ffffff;
  --brand-soft: #E0F3F8;
  --ok: #1B8A5A;
  --ok-soft: #E0F3EA;
  --on-ok: #ffffff;
  --warn: #9A5B00;
  --warn-soft: #FCEFD6;
  --on-warn: #ffffff;
  --bad: #C0213A;
  --bad-soft: #FDE7EA;
  --bar-off: #C7D8E2;
  --glow: none;
  --hero-wash: radial-gradient(120% 140% at 100% 100%, rgba(10, 124, 150, 0.10), rgba(10, 124, 150, 0) 55%);
  --shadow: 0 1px 2px rgba(14, 34, 51, 0.06), 0 6px 20px rgba(14, 34, 51, 0.05);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
h1, h2, h3, p { margin: 0; }
/* Author styles like display:grid would otherwise beat the hidden attribute. */
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
.boot { padding: 48px 16px; text-align: center; color: var(--ink-3); }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px 64px; }

/* ---------- top bar ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 820px; margin: 0 auto; padding: 18px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { display: block; width: 30px; height: 30px; border-radius: 8px; }
.brand-name { font-weight: 800; letter-spacing: -0.01em; }
.brand-sub { color: var(--ink-3); font-weight: 500; margin-left: -4px; }
.top-tag { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--hero-wash), var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 22px 22px 20px;
}
.hero::after {
  content: ""; position: absolute; right: -70px; bottom: -70px; width: 340px; height: 340px; z-index: -1;
  background: url(/hero.svg) no-repeat center / contain; opacity: 0.9;
}
.eyebrow { font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brand); }
.hero h1 { font-size: clamp(24px, 5vw, 32px); line-height: 1.15; letter-spacing: -0.02em; margin-top: 6px; }
.hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 18px; }
.phase { display: flex; align-items: flex-end; gap: 12px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 26px; }
.bars span { display: block; width: 7px; border-radius: 2px; background: var(--bar-off); }
.bars span:nth-child(1) { height: 8px; }
.bars span:nth-child(2) { height: 13px; }
.bars span:nth-child(3) { height: 19px; }
.bars span:nth-child(4) { height: 26px; }
.bars span.on { background: var(--brand); box-shadow: var(--glow); }
.phase-label { font-weight: 700; line-height: 1; padding-bottom: 2px; }
.phase-sub { font-size: 12px; color: var(--ink-3); display: block; font-weight: 500; margin-top: 4px; }
.updated { font-size: 13px; color: var(--ink-3); margin-left: auto; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* ---------- tabs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 18px 0 14px; }
.tab {
  background: none; border: 0; padding: 9px 14px; border-radius: 999px; cursor: pointer;
  color: var(--ink-2); font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { background: var(--brand-soft); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--warn); color: var(--on-warn); font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ---------- cards & sections ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 12px; }
.card h2 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2::before { content: ""; width: 6px; height: 6px; background: var(--brand); border-radius: 1px; box-shadow: var(--glow); flex: none; }
.card h3 { font-size: 17px; line-height: 1.3; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--mono); font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-3); }
.stat.owed b { color: var(--warn); }
.stat.clear b { color: var(--ok); }

/* ---------- tasks ---------- */
.row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; padding-top: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; overflow-wrap: anywhere; }
.row-sub { font-size: 13px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--bar-off); flex: none; margin-top: 1px; display: grid; place-items: center; }
.check.done { background: var(--ok); border-color: var(--ok); }
.check.done::after { content: ""; width: 5px; height: 10px; border: solid var(--on-ok); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.check.progress { border-color: var(--brand); border-style: dashed; }

.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.quiet { background: var(--bar-off); color: var(--ink-2); }

/* ---------- costs ---------- */
.cost-row { display: flex; gap: 12px; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); }
.cost-row:first-of-type { border-top: 0; padding-top: 0; }
.cost-row .row-main { flex: 1; }
.amount { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* ---------- approvals ---------- */
.approval { border-left: 4px solid var(--warn); }
.approval.done { border-left-color: var(--ok); }
.approval.changes { border-left-color: var(--bad); }
.status-line { margin: 10px 0 0; font-size: 14px; }

/* ---------- forms ---------- */
.form { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label.f { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type="text"], input[type="email"], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--inset); font-weight: 400; color: var(--ink);
}
textarea { min-height: 84px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; font-weight: 700; cursor: pointer;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.err { color: var(--bad); font-size: 14px; }

/* ---------- messages ---------- */
.msg { margin: 0 0 12px; max-width: 88%; }
.msg.team { margin-left: auto; }
.bubble { padding: 10px 14px; border-radius: 14px; background: var(--inset); border: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.team .bubble { background: var(--brand-soft); border-color: transparent; }
.msg-meta { font-size: 12px; color: var(--ink-3); margin: 0 4px 3px; }
.msg.team .msg-meta { text-align: right; }

/* ---------- floor plans ---------- */
.floor-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 7px 14px; border-radius: 999px; font-weight: 600; cursor: pointer; }
.chip-btn[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.plan-frame { margin: 10px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; overflow: auto; max-height: 75vh; }
.plan-img { display: block; width: 100%; height: auto; }
.plan-frame.zoomed .plan-img, .plan-img.zoomed { width: 220%; max-width: none; }
.plan-actions { margin-bottom: 10px; }

/* ---------- equipment ---------- */
.eq-unit { padding: 12px 0; border-top: 1px solid var(--line); }
.eq-unit:first-of-type { border-top: 0; padding-top: 0; }
.eq-step { display: flex; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.eq-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--bar-off); flex: none; }
.eq-step.done .eq-dot { background: var(--ok); border-color: var(--ok); }
.eq-text { flex: 1; min-width: 160px; }
.eq-name { margin-top: 10px; max-width: 320px; }

/* ---------- closeout ---------- */
.closeout { border-color: var(--brand); }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--ink); font-size: 14px; }
.notice.warn { background: var(--warn-soft); }

.empty { color: var(--ink-3); padding: 8px 0; }
.center { max-width: 520px; margin: 12vh auto 0; padding: 0 16px; text-align: center; }
.center h1 { font-size: 24px; letter-spacing: -0.01em; margin-bottom: 8px; }
.center p { color: var(--ink-2); }

@media (max-width: 520px) {
  .hero { padding: 18px 16px; }
  .card { padding: 16px; }
  .form .two { grid-template-columns: 1fr; }
  .updated { margin-left: 0; width: 100%; }
  .msg { max-width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .hero::after { animation: rings 5s ease-in-out infinite; }
  @keyframes rings { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
  .card { transition: border-color 0.15s ease; }
  .card:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
  .btn, .tab { transition: background-color 0.12s ease, border-color 0.12s ease, filter 0.12s ease; }
}

/* ---------- theme toggle ---------- */
.top-right { display: flex; align-items: center; gap: 14px; }
.theme-btn { background: none; border: 1px solid var(--line); color: var(--ink-2); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; font-size: 16px; line-height: 1; }
.theme-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- visitor landing ---------- */
.landing-hero { padding: 34px 26px 30px; }
.landing-hero h1 { font-size: clamp(28px, 6vw, 42px); max-width: 16em; }
.lead { color: var(--ink-2); font-size: 17px; max-width: 34em; margin-top: 14px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
a.btn { text-decoration: none; display: inline-block; }
.hint { margin-top: 14px; color: var(--ink-3); font-size: 14px; max-width: 36em; }
.section-title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 30px 2px 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.grid3 .card { margin: 0; }
.grid3 h3 { margin-bottom: 8px; }
.grid3 p { color: var(--ink-2); font-size: 15px; }
.tag { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); border-radius: 6px; padding: 2px 8px; margin-bottom: 10px; }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.steps li::before { content: counter(step); font-family: var(--mono); font-weight: 700; color: var(--brand-ink); background: var(--brand); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 13px; }
.steps b { display: block; }
.steps span { color: var(--ink-2); font-size: 15px; }
.facts { margin: 0; padding-left: 18px; color: var(--ink-2); }
.facts li { margin: 6px 0; }
.foot { margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }
.foot a { color: var(--brand); }
@media (max-width: 520px) { .landing-hero { padding: 26px 18px 24px; } .hero::after { width: 240px; height: 240px; right: -60px; bottom: -60px; } }

/* ---------- Wi-Fi self-help wizard ---------- */
.ts-hero { padding: 28px 24px 24px; margin-bottom: 14px; }
.ts-hero h1 { font-size: clamp(24px, 5vw, 34px); max-width: 18em; }
.ts-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 14px; }
.ts-nav .linkbtn[disabled] { color: var(--ink-3); text-decoration: none; cursor: default; }
.card h2.ts-q { display: block; font-family: var(--sans); font-size: 22px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; text-transform: none; color: var(--ink); margin-bottom: 14px; outline: none; }
.card h2.ts-q::before { content: none; }
.ts-why { margin: -6px 0 14px; }
.ts-options { display: grid; gap: 10px; }
.ts-opt { text-align: left; background: var(--inset); }
.ts-opt:hover { border-color: var(--brand); }
.ts-yn { min-width: 110px; background: var(--inset); }
.ts-yn:hover { border-color: var(--brand); }
.ts-ask { margin: 18px 0 10px; font-weight: 700; }
.ts-card .steps { margin-bottom: 4px; }
.ts-card .steps li { background: var(--inset); }
.ts-sum { margin-top: 16px; }
.ts-sum summary { cursor: pointer; color: var(--ink-2); font-size: 14px; }
.ts-sum p { margin-top: 8px; }
a.brand-link { text-decoration: none; color: inherit; }

/* ---------- contact details ---------- */
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.contact-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .k { flex: 0 0 84px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.contact-list a { color: var(--brand); font-weight: 600; overflow-wrap: anywhere; }
.contact-list + p { margin-top: 12px; }

/* ---------- screenshots ---------- */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.shot { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.shot a { display: block; background: var(--inset); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 12px 14px 14px; display: grid; gap: 4px; }
.shot figcaption b { font-size: 15px; }
.shot figcaption span { color: var(--ink-2); font-size: 14px; }

/* yes/no checks that carry steps */
.steps + .actions { margin-top: 16px; }
