@font-face { font-family: 'Onest'; src: url('/fonts/onest-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Familjen Grotesk'; src: url('/fonts/familjen-grotesk-latin-wght-normal.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
:root {
  --night: #1d1426; --ink: #241a2e; --plum: #3a2747; --dusk: #5b3a5e; --mauve: #8c6a86;
  --ember: #d9692a; --lamp: #f2b35b; --rose: #c4675a; --sage: #5f7350; --red: #a8281f;
  --paper: #f6efe4; --card: #fffaf2; --line: #e4d8c6; --muted: #6a5f6e; --text: #241a2e;
  --radius: 14px; --shadow: 0 1px 2px rgba(36,26,46,.06), 0 8px 24px rgba(36,26,46,.07);
  --head: 'Familjen Grotesk', 'Onest', system-ui, sans-serif; --body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); font-size: 17px; line-height: 1.6; color: var(--text); background: var(--paper); font-feature-settings: 'ss01'; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 650; }
h3 { font-size: 1.12rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: #8a4b12; text-underline-offset: 3px; }
a:hover { color: var(--ember); }
code { font-size: .88em; background: rgba(58,39,71,.08); padding: .1em .35em; border-radius: 6px; word-break: break-word; }
img, svg { max-width: 100%; }
.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.narrow { max-width: 720px; }
.narrow-wide { max-width: 980px; }
.pad { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.muted { color: var(--muted); } .small { font-size: .9rem; } .center { text-align: center; }
.sr, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--lamp); color: var(--ink); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 2px; border-radius: 4px; }
.staging-bar { background: var(--lamp); color: var(--ink); font-size: .85rem; text-align: center; padding: .35rem 1rem; font-weight: 500; }

/* header */
.site-header, .admin-header { background: var(--night); color: #f8ecdc; position: sticky; top: 0; z-index: 5; }
.admin-header { background: var(--plum); }
.head-row { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.brand em { font-style: normal; font-weight: 500; opacity: .7; }
.site-footer .brand { color: var(--ink); }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: none; width: 44px; height: 44px; border-radius: 10px; padding: 12px 10px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary span { display: block; height: 2px; background: #f8ecdc; margin: 4px 0; border-radius: 2px; }
.nav-desk, .menu nav { display: flex; align-items: center; gap: 1.3rem; }
.nav-desk a, .menu nav a, .linklike { color: #f8ecdc; text-decoration: none; font-size: .98rem; }
.nav-desk a[aria-current="page"], .menu nav a[aria-current="page"] { color: var(--lamp); }
.nav-desk a:hover, .menu nav a:hover, .linklike:hover { color: var(--lamp); }
.nav-desk form, .menu nav form { margin: 0; }
.nav-desk .btn-small { color: var(--ink); }
.menu { display: none; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
@media (max-width: 960px) {
  .nav-desk { display: none; }
  .menu { display: block; }
  .menu > summary { display: block; }
  .menu:not([open]) nav { display: none; }
  .menu[open] nav { position: absolute; right: 0; top: 52px; flex-direction: column; align-items: stretch; background: var(--night); padding: 1rem; border-radius: 12px; min-width: 230px; box-shadow: 0 12px 30px rgba(0,0,0,.35); gap: .2rem; }
  .is-admin .menu[open] nav { background: var(--plum); }
  .menu[open] nav a, .menu[open] nav .linklike { padding: .6rem .5rem; display: block; text-align: left; width: 100%; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .6rem 1.15rem; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff6e6; font: 600 .98rem var(--body); text-decoration: none; cursor: pointer; transition: transform .08s, background .15s; }
.btn:hover { background: var(--plum); color: #fff6e6; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-lamp { background: var(--lamp); border-color: var(--lamp); color: var(--ink); }
.btn-lamp:hover { background: #f5c27a; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(58,39,71,.08); color: var(--ink); }
.btn-ghost-light { background: transparent; border-color: rgba(248,236,220,.6); color: #f8ecdc; }
.btn-ghost-light:hover { background: rgba(248,236,220,.1); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); }
.btn-danger:hover { background: #8a1f18; }
.btn-small { min-height: 36px; padding: .35rem .85rem; font-size: .88rem; }
.menu nav .btn-small { color: var(--ink); }

/* hero */
.hero { background: radial-gradient(120% 90% at 85% 110%, #c4675a 0%, #5b3a5e 38%, #241a2e 72%, #1d1426 100%); color: #f8ecdc; padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: #9a430e; margin-bottom: .8rem; }
.hero .eyebrow { color: var(--lamp); }
.lede { font-size: clamp(1.08rem, 1.8vw, 1.25rem); color: #efdfcd; max-width: 38em; }
.lede-dark { font-size: 1.1rem; color: #4a3f4f; max-width: 46em; }
.cta-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.6rem 0 1rem; }
.hero-note { font-size: .9rem; color: #d9c5b2; }
.docket-preview { margin: 0; background: #fffaf2; color: var(--ink); border-radius: 18px; padding: 1.1rem; box-shadow: 0 30px 60px rgba(0,0,0,.35); transform: rotate(-1.2deg); }
.docket-preview figcaption { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: #8a4b12; margin: 0 0 .7rem .2rem; font-weight: 600; }
.dk { border: 1px solid var(--line); border-left: 5px solid var(--mauve); border-radius: 10px; padding: .65rem .8rem; margin-bottom: .55rem; background: #fff; display: grid; gap: .1rem; font-size: .93rem; }
.dk b { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.dk-wake { border-left-color: var(--ember); } .dk-wake b { color: #a54a14; }
.dk-911 { border-left-color: var(--red); } .dk-911 b { color: var(--red); }
.dk-intake { border-left-color: #8a6a1e; } .dk-intake b { color: #6b4e16; }
.dk-spam { border-left-color: #8d8692; } .dk-spam b { color: #5f5866; }

/* sections */
.three { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; counter-reset: s; }
.three li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; counter-increment: s; position: relative; }
.three li::before { content: counter(s); font-family: var(--head); font-weight: 700; color: var(--ember); font-size: 1.6rem; display: block; margin-bottom: .4rem; }
.band { background: #efe3d2; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.rule-card { margin: 0; background: var(--night); color: #f3e2cc; border-radius: var(--radius); padding: 1.3rem 1.4rem; font: 500 .92rem/1.65 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; white-space: pre-wrap; overflow-x: auto; }
.faq details { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.faq summary { cursor: pointer; font-weight: 600; font-family: var(--head); font-size: 1.08rem; min-height: 32px; }
.faq details p { margin: .6rem 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 2.5vw, 1.6rem); box-shadow: var(--shadow); margin-bottom: 1.4rem; }
.stack { display: grid; gap: .9rem; }
label { display: grid; gap: .3rem; font-weight: 500; font-size: .95rem; }
input, select, textarea { font: inherit; font-size: 1rem; color: var(--text); background: #fff; border: 1.5px solid #d5c6b0; border-radius: 10px; padding: .6rem .75rem; min-height: 44px; width: 100%; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--ember); outline: 2px solid rgba(217,105,42,.25); outline-offset: 0; }
input[disabled], select[disabled], textarea[disabled] { background: #f3ece2; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--ember); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem 1rem; margin: 0; display: grid; gap: .5rem; }
legend { font-weight: 600; padding: 0 .3rem; }
.flash { border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1.2rem; border: 1px solid; }
.flash-ok { background: #eef1e4; border-color: #b9c6a0; color: #2f3d22; }
.flash-err { background: #fbe9e5; border-color: #e2a99d; color: #7a1d14; }
.flash-warn { background: #fdf1db; border-color: #e9c787; color: #5a3d07; }
.price-card .price { font-size: 1.2rem; } .price-card .price strong { font-family: var(--head); font-size: 2.6rem; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 999px; background: #eadfce; color: #5a4a3a; vertical-align: middle; }
.tag-on { background: #dfe7cf; color: #33461f; } .tag-warn { background: #f7d9b4; color: #6d3a08; }
.ticks { padding-left: 1.2rem; } .ticks li { margin-bottom: .35rem; }
.prose { font-size: 1.02rem; } .prose h2 { margin-top: 1.8rem; } .prose blockquote { margin: 1rem 0; padding: .8rem 1.1rem; border-left: 4px solid var(--lamp); background: var(--card); border-radius: 0 10px 10px 0; }
.timeline { padding-left: 1.2rem; } .timeline li { margin-bottom: 1.2rem; } .timeline li::marker { color: var(--ember); font-weight: 700; font-family: var(--head); }
.site-footer { background: #efe3d2; padding: 2.5rem 0; margin-top: 2rem; border-top: 1px solid var(--line); }
.foot-grid { display: grid; grid-template-columns: 1.2fr 2fr; gap: 1.5rem 3rem; align-items: start; }
.foot-grid nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.foot-grid nav a { color: var(--ink); min-height: 32px; display: inline-flex; align-items: center; }
.foot-grid > p { grid-column: 1 / -1; margin: 0; }

/* simulator */
.sim { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.4rem; margin: 1.5rem 0; }
.sim-phone { background: var(--night); color: #f8ecdc; border-radius: 22px; padding: 1rem; display: grid; gap: .8rem; box-shadow: 0 20px 50px rgba(29,20,38,.3); min-width: 0; }
.sim-top { display: flex; align-items: center; gap: .6rem; font-size: .92rem; }
.sim-top .timer { margin-left: auto; font-variant-numeric: tabular-nums; opacity: .8; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #8d8692; flex: none; }
.dot.live { background: #7fd16b; box-shadow: 0 0 0 4px rgba(127,209,107,.2); }
.dot.ended { background: var(--rose); }
.sim-log .muted { color: #d9c5d4; }
.sim-log { background: #2b2035; border-radius: 14px; padding: .9rem; height: min(52vh, 430px); overflow-y: auto; display: flex; flex-direction: column; gap: .55rem; scroll-behavior: smooth; }
.bubble { max-width: 88%; padding: .55rem .8rem; border-radius: 14px; font-size: .96rem; line-height: 1.45; overflow-wrap: anywhere; }
.bubble.clerk { background: #f3e2cc; color: var(--ink); align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.caller { background: var(--ember); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.system { align-self: center; background: transparent; color: #d4b8cf; font-size: .82rem; text-align: center; border: 1px dashed #5b3a5e; }
.sim-input { display: flex; gap: .5rem; }
.sim-input input { background: #fffaf2; flex: 1; min-width: 0; }
.sim-input .btn-ghost { color: #f8ecdc; border-color: rgba(248,236,220,.5); }
.sim-input .btn-ghost[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); }
.sim-quick { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { background: transparent; color: #f3e2cc; border: 1px solid #6b4c6c; border-radius: 999px; padding: .35rem .75rem; font: 500 .85rem var(--body); cursor: pointer; min-height: 36px; }
.chip:hover:not([disabled]) { background: #3a2747; }
.chip[disabled] { opacity: .4; cursor: not-allowed; }
.sim-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.sim-side { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.sim-settings { background: var(--card); }
.sim-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.sim-card h3 { margin-bottom: .4rem; }
.sim-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; font-size: .93rem; }
.sim-card dt { color: var(--muted); } .sim-card dd { margin: 0; overflow-wrap: anywhere; }
.sim-card ul { padding-left: 1.1rem; margin: .4rem 0 0; font-size: .92rem; }

/* admin */
.is-admin main { min-height: 70vh; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.title-row h1, .title-row h2 { margin: 0; }
.crumbs { margin: 0 0 .3rem; font-size: .92rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 1.4rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .94rem; }
.tbl th, .tbl td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #f3eadc; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.sum { min-width: 220px; }
.tbl td input[type=time] { min-width: 120px; }
.tabs { display: flex; gap: .3rem; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 1rem 0 1.4rem; padding-bottom: 0; scrollbar-width: thin; }
.tabs a { white-space: nowrap; padding: .6rem .85rem; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ember); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; align-items: end; }
.row-form { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; display: grid; gap: .75rem; background: #fff; }
.row-form.new { background: #fbf3e6; border-style: dashed; }
.row-form.off { opacity: .65; }
.row-form h3 { margin: 0; }
.row-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.rows { list-style: none; padding: 0; margin: 0 0 1rem; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rows li form { margin: 0; }
.rows .btns { display: flex; gap: .4rem; flex-wrap: wrap; }
.inline-form { display: flex; gap: .8rem; align-items: end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 180px; }
.status-line { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pill { padding: .25rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.pill-open { background: #dfe7cf; color: #33461f; } .pill-closed { background: var(--plum); color: var(--lamp); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: .35rem 0 .35rem 1.8rem; position: relative; }
.checklist li::before { content: ''; position: absolute; left: 0; top: .6rem; width: 16px; height: 16px; border: 2px solid #c6b49a; border-radius: 5px; }
.checklist li.done::before { background: var(--sage); border-color: var(--sage); }
.checklist li.done::after { content: ''; position: absolute; left: 5px; top: .78rem; width: 6px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.danger-zone { margin-top: 1rem; }
.badge { display: inline-block; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .2rem .55rem; border-radius: 6px; background: #eadfce; color: #5a4a3a; white-space: nowrap; }
.b-emergency_911 { background: #f6d6d1; color: var(--red); } .b-wake { background: #f8dcc6; color: #96400f; } .b-intake, .b-message { background: #efe2c2; color: #5d4511; } .b-faq { background: #dde5d2; color: #3d4f2c; } .b-spam { background: #e4e0e7; color: #4f4856; }
h1 .badge { font-size: .5em; vertical-align: middle; }
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: .35rem 1rem; margin: 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.transcript { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.transcript li { display: grid; grid-template-columns: 3.2rem 4.2rem 1fr; gap: .6rem; font-size: .95rem; }
.transcript .t { color: var(--muted); font-variant-numeric: tabular-nums; } .transcript .w { font-weight: 600; }
.transcript .who-system { color: var(--muted); font-size: .86rem; } .transcript .who-caller .w { color: var(--ember); }
.mail-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
pre.msg { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; overflow-x: auto; }
.days { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.days legend { width: 100%; }

@media (max-width: 960px) {
  .hero-grid, .two, .sim { grid-template-columns: 1fr; }
  .three { grid-template-columns: 1fr; }
  .docket-preview { transform: none; }
}
@media (max-width: 700px) {
  body { font-size: 16px; }
  .grid2, .grid3, .foot-grid { grid-template-columns: 1fr; }
  .transcript li { grid-template-columns: 2.8rem 1fr; }
  .transcript .x { grid-column: 1 / -1; }
  .sim-log { height: 50vh; }
  .wrap { width: min(1160px, 100% - 1.6rem); }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media (min-width: 961px) and (max-width: 1180px) {
  .is-admin .nav-desk { display: none; }
  .is-admin .menu, .is-admin .menu > summary { display: block; }
  .is-admin .menu:not([open]) nav { display: none; }
  .is-admin .menu[open] nav { position: absolute; right: 0; top: 52px; flex-direction: column; align-items: stretch; background: var(--plum); padding: 1rem; border-radius: 12px; min-width: 230px; box-shadow: 0 12px 30px rgba(0,0,0,.35); gap: .2rem; }
  .is-admin .menu[open] nav a, .is-admin .menu[open] nav .linklike { padding: .6rem .5rem; display: block; text-align: left; width: 100%; }
}

h2.h3 { font-size: 1.12rem; font-weight: 650; }
