/* Wisp admin: dark enamel signage. A deep enamel ground, panels one step lighter with a fine edge, warm off-white
   lettering, enamel blue for actions and selection, pillar-box red only for what needs attention. */

/* Overpass: an open-licence grotesk drawn from road-sign lettering (fonts/OFL.txt), served from this install */
@font-face {
  font-family: "Overpass";
  src: url("/fonts/overpass.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #0a1120;
  --side: #0d1627;
  --panel: #111b2e;
  --panel-2: #15213a;
  --field: #0c1526;
  --edge: #1f2c45;
  --edge-strong: #2c3c5c;
  --ink: #efece4;
  --ink-2: #c8cdd8;
  --muted: #8e9ab1;
  --blue: #2f6fe8;
  --blue-hover: #3b7cf2;
  --blue-ink: #8db6ff;
  --blue-soft: rgba(77, 141, 255, .14);
  --red: #f0614c;
  --red-soft: rgba(240, 97, 76, .13);
  --green: #43c08a;
  --green-soft: rgba(67, 192, 138, .13);
  --amber: #e9b44c;
  --focus: #8db6ff;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -12px rgba(0, 0, 0, .55);
  --sans: "Overpass", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* Hidden means hidden, whatever display a control's own rule gives it */
[hidden] { display: none !important; }
html { background: var(--ground); }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
::selection { background: rgba(77, 141, 255, .35); color: #fff; }
a { color: var(--blue-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #b3ceff; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; font-weight: 750; margin: 0; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 650; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 6px 0 24px; max-width: 70ch; }
.head .lead { margin-bottom: 0; }
code, pre { font: 12.5px/1.55 var(--mono); }
code { color: var(--ink-2); background: rgba(255, 255, 255, .05); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
* { scrollbar-color: var(--edge-strong) transparent; scrollbar-width: thin; }

/* ---- the frame: a sidebar and the page ---------------------------------------------------------------------- */
body.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; background: var(--side); border-right: 1px solid var(--edge); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: .01em; }
.brand img { width: 24px; height: 24px; }

/* The client's assistant: theirs, up front */
.me { display: flex; align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--edge); border-radius: var(--radius); background: var(--panel); color: inherit; text-decoration: none; }
.me:hover { border-color: var(--edge-strong); color: inherit; }
.me .face { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--edge-strong); }
.me .face img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.me .face svg { width: 22px; height: 22px; color: var(--ink-2); }
.me .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); border: 2px solid var(--panel); }
.me .dot.live { background: var(--green); }
.me .who-name { font-weight: 650; font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.me .who-state { font-size: 12px; color: var(--muted); }

.nav { display: grid; gap: 14px; }
.nav .group { display: grid; gap: 1px; }
.nav .label { font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 0 10px 5px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav a:hover { background: rgba(255, 255, 255, .04); color: var(--ink); }
.nav a.active { background: var(--blue-soft); color: #fff; }
.nav a.active svg { color: var(--blue-ink); }
.nav .count { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.side .foot { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid var(--edge); }
.side .foot a, .side .foot button { justify-content: flex-start; width: 100%; }

.top { display: none; }
.page { padding: 28px 36px 72px; max-width: 1180px; width: 100%; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.head .text { min-width: 0; }

/* Phones: a top bar, and the sidebar slides in over the page */
@media (max-width: 900px) {
  body.app { display: block; }
  .top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--side); border-bottom: 1px solid var(--edge); }
  .top .where { font-weight: 650; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side { position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .28s cubic-bezier(.2, .9, .3, 1); box-shadow: 0 0 0 100vmax rgba(3, 7, 15, 0); }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(3, 7, 15, .6); }
  .page { padding: 20px 16px 64px; }
  .head { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
}

/* ---- sign in, setup, password ------------------------------------------------------------------------------ */
body.plain { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.center { width: 100%; display: grid; place-items: center; }
.auth { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--edge); border-radius: 14px; padding: 28px 26px 22px; box-shadow: var(--shadow); }
.auth-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.auth .brand { margin-top: 4px; }
.stamp.small { width: 66px; height: 66px; box-shadow: 0 0 0 3px var(--panel), 0 0 0 4px rgba(141, 182, 255, .4); }
.stamp.small .t { font-size: 7.5px; }
.stamp.small .d { font-size: 15px; margin: 2px 0 1px; }
.stamp.small .y { font-size: 8px; }
.auth h1 { font-size: 20px; }
.auth .lead { margin: 6px 0 20px; }
.auth form > button.primary { width: 100%; padding: 10px 14px; margin-top: 6px; }

/* ---- panels and forms -------------------------------------------------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); padding: 20px 20px 6px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card > h2 + p.help { margin-top: -6px; }
.good { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--amber); }

label.field { display: block; margin-bottom: 15px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
label.field > small, .help { display: block; font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.help { margin: 0 0 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); border: 1px solid var(--edge-strong); background: var(--field); border-radius: 8px; padding: 8px 11px; min-height: 38px; outline: none; transition: border-color .15s, box-shadow .15s; caret-color: var(--blue-ink); }
input::placeholder, textarea::placeholder { color: #75819a; }
textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
textarea.tall { min-height: 260px; }
textarea.code { font: 12.5px/1.6 var(--mono); }
input:hover, select:hover, textarea:hover { border-color: #3a4c70; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(141, 182, 255, .18); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; min-height: 0; accent-color: var(--blue); margin: 0; flex: none; }
input[type=color] { padding: 3px; height: 38px; cursor: pointer; }
input[type=file] { padding: 6px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--panel-2); border: 1px solid var(--edge-strong); border-radius: 6px; padding: 4px 10px; margin-right: 10px; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 0 18px 14px 0; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }

button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--edge-strong); background: var(--panel-2); color: var(--ink); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
button svg, .button svg { width: 17px; height: 17px; flex: none; }
button:hover, .button:hover { background: #1b2944; border-color: #3a4c70; color: var(--ink); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
button.ghost, .button.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
button.ghost:hover, .button.ghost:hover { background: rgba(255, 255, 255, .05); color: var(--ink); }
button.danger { color: var(--red); }
button.danger:hover { background: var(--red-soft); border-color: rgba(240, 97, 76, .45); color: #ff8b79; }
button.small { padding: 5px 10px; font-size: 12.5px; }
button.icon { padding: 7px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 16px; }

/* The save bar keeps to the foot of the page while a long form scrolls */
.sticky-actions { position: sticky; bottom: 0; z-index: 4; display: flex; gap: 8px; flex-wrap: wrap; margin: 8px -36px 0; padding: 12px 36px 14px; background: var(--ground); border-top: 1px solid var(--edge); }
@media (max-width: 900px) {
  .sticky-actions { margin: 8px -16px 0; padding: 12px 16px 14px; }
}

.flash { background: var(--green-soft); color: #9fe3c3; border: 1px solid rgba(67, 192, 138, .35); padding: 10px 14px; border-radius: 9px; margin: 0 0 18px; }
.flash.error { background: var(--red-soft); color: #ffb3a7; border-color: rgba(240, 97, 76, .4); }

/* Repeating items: topics and knowledge sections */
.item { border: 1px solid var(--edge); border-radius: 10px; padding: 14px 14px 2px; margin-bottom: 12px; background: var(--panel); }
.item-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.item-head .num { width: 26px; height: 26px; border-radius: 7px; background: var(--panel-2); border: 1px solid var(--edge); color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: none; }
.item-head .grow { flex: 1; min-width: 0; }
.item-head .key { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.item.fresh { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(141, 182, 255, .15); }
/* On a phone a section's title gets a line of its own under its number and buttons, or it's cut to a word */
@media (max-width: 520px) {
  .item-head:has(input.grow) { flex-wrap: wrap; }
  .item-head input.grow { order: 1; flex-basis: 100%; }
  .item-head:has(input.grow) [data-up] { margin-left: auto; }
}
.links { display: flex; flex-wrap: wrap; gap: 4px 0; margin-bottom: 12px; }

/* Look */
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.slot { border: 1px dashed var(--edge-strong); border-radius: 10px; padding: 12px; background: var(--field); }
.slot b { display: block; font-size: 13px; }
.slot small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.slot .thumb { height: 96px; display: grid; place-items: center; background: repeating-conic-gradient(#18233a 0 25%, #121c2f 0 50%) 0 0 / 14px 14px; border-radius: 8px; margin-bottom: 8px; }
.slot .thumb img { max-height: 90px; max-width: 100%; }
.slot .none { color: var(--muted); font-size: 12px; }
/* Each image is saved the moment it's chosen, so the picker needs no file name beside its button */
.slot input[type=file] { color: transparent; width: auto; max-width: 100%; border: 0; background: none; padding: 0; min-height: 0; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 14px; }

pre.snippet { background: #060b16; color: #d9e3f5; border: 1px solid var(--edge); padding: 13px 15px; border-radius: 9px; overflow-x: auto; margin: 0 0 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
table.list { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--edge); font-size: 13.5px; vertical-align: middle; }
table.list th { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
table.list tr:last-child td { border-bottom: 0; }
.spaced { margin-top: 16px; }
.default-submit { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
details summary { cursor: pointer; color: var(--blue-ink); font-weight: 600; font-size: 13px; margin-bottom: 10px; }
.loading { color: var(--muted); }

/* ---- Overview: numbers first -------------------------------------------------------------------------------- */

/* The signature: today's round date-stamp, as a counter clerk would strike it */
.stamp { flex: none; width: 92px; height: 92px; border-radius: 50%; border: 2px solid rgba(141, 182, 255, .75); box-shadow: 0 0 0 4px var(--ground), 0 0 0 5px rgba(141, 182, 255, .4); display: grid; place-content: center; text-align: center; color: var(--blue-ink); transform: rotate(-8deg); font-weight: 800; line-height: 1.05; }
.stamp .t { font-size: 9.5px; letter-spacing: .2em; }
.stamp .d { font-size: 21px; letter-spacing: .02em; margin: 3px 0 2px; }
.stamp .y { font-size: 10px; letter-spacing: .16em; opacity: .85; }

.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.figure { padding: 16px 18px 14px; border-left: 1px solid var(--edge); min-width: 0; color: inherit; text-decoration: none; display: block; }
.figure:first-child { border-left: 0; }
a.figure:hover { background: rgba(255, 255, 255, .02); color: inherit; }
.figure .k { font-size: 11px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.figure .v { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin: 6px 0 2px; line-height: 1.1; }
.figure .s { font-size: 12.5px; color: var(--muted); }
.figure .s b { font-weight: 650; }
.figure .up { color: var(--green); }
.figure .down { color: var(--red); }
.figure.alert .v { color: var(--red); }
.figure svg.spark { display: block; width: 100%; height: 30px; margin-top: 10px; overflow: visible; }
.spark polyline { fill: none; stroke: var(--blue-ink); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark.red polyline { stroke: var(--red); }
.meter { height: 6px; border-radius: 99px; background: var(--panel-2); margin-top: 12px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--blue-ink); }
.meter i.high { background: var(--amber); }
.meter i.full { background: var(--red); }

.split { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.split > .card { margin-bottom: 0; display: flex; flex-direction: column; }
.split .chart-wrap { flex: 1; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-head h2 { margin: 0; }
.keys { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.keys span { display: inline-flex; align-items: center; gap: 6px; }
.keys i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.keys i.answered { background: #4d8dff; }
.keys i.topics { background: #2a4a83; }
.keys i.unanswered { background: var(--red); }
.chart .answered { fill: #4d8dff; }
.chart .topics { fill: #2a4a83; }
.chart .unanswered { fill: var(--red); }
.chart-wrap { position: relative; min-height: 190px; display: flex; margin: 6px 0 4px; padding-left: 34px; }
svg.chart { display: block; width: 100%; height: auto; min-height: 190px; flex: 1; }
.ylab { position: absolute; left: 0; font-size: 11px; color: var(--muted); line-height: 1; translate: 0 -50%; }
/* Where the full-height and half-height grid lines fall in the 160-unit-tall drawing */
.ylab.at-max { top: 6.25%; }
.ylab.at-half { top: 53.1%; }
.chart g.day:focus { outline: none; }
.chart g.day:focus rect.hit { fill: rgba(141, 182, 255, .12); }
.readout { font-size: 12.5px; color: var(--ink-2); margin: 0 0 14px; min-height: 1.55em; }
.chart .grid line { stroke: var(--edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart g.day:hover rect { opacity: .82; }
.chart .hit { fill: transparent; }
.axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); padding-bottom: 12px; }
.empty-chart { height: 190px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--edge-strong); border-radius: 8px; margin: 6px 0 16px; padding: 16px; }

.todo { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 2px; }
.todo li { display: flex; gap: 11px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--edge); }
.todo li:first-child { border-top: 0; padding-top: 2px; }
.todo .mark { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-top: 0; }
.todo .mark svg { width: 15px; height: 15px; stroke-width: 2.4; }
.todo .mark.ok { background: var(--green-soft); color: var(--green); }
.todo .mark.warn { background: var(--red); color: #fff; }
.todo .mark.no { background: var(--red); color: #fff; }
.todo b { display: block; font-size: 13.5px; font-weight: 600; }
.todo span { font-size: 12.5px; color: var(--muted); }

/* ---- Questions: received, then answered --------------------------------------------------------------------- */
.questions { display: grid; }
.question { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 15px 0; border-top: 1px solid var(--edge); }
.question:first-child { border-top: 0; padding-top: 4px; }
.question .count { flex: none; min-width: 46px; padding: 5px 8px; border-radius: 8px; background: var(--red-soft); color: #ff9888; font-weight: 700; font-size: 13px; text-align: center; }
.question .grow { flex: 1; min-width: 0; }
.question .q { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.question .said, .question .meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.question .acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; flex: none; max-width: 360px; }
/* The postmark it came in with: the day it was last asked */
.question .post { flex: none; width: 66px; height: 66px; border-radius: 50%; border: 1.5px solid rgba(141, 182, 255, .55); color: var(--blue-ink); display: grid; place-content: center; text-align: center; rotate: -6deg; line-height: 1.1; margin-top: -4px; }
.question .post span { font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.question .post b { font-size: 12.5px; font-weight: 800; letter-spacing: .02em; }
/* Marked done: the counter's "answered" cancellation strikes across it, then it leaves the list */
.question .cancel { position: absolute; left: 50%; top: 50%; translate: -50% -50%; rotate: -7deg; padding: 4px 14px; border: 2px solid var(--green); border-radius: 6px; color: var(--green); font-weight: 800; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; background: rgba(10, 17, 32, .85); opacity: 0; scale: 1.5; pointer-events: none; }
.question.done .cancel { opacity: 1; scale: 1; transition: opacity .16s ease-out, scale .28s cubic-bezier(.16, 1, .3, 1); }
.question.done > :not(.cancel) { opacity: .35; transition: opacity .2s; }
.question.gone { opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }
@media (prefers-reduced-motion: reduce) {
  .question.done .cancel, .question.gone { transition: none; }
}

@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figure:nth-child(3) { border-left: 0; }
  .figure:nth-child(n + 3) { border-top: 1px solid var(--edge); }
  .stamp { width: 74px; height: 74px; }
  .stamp .d { font-size: 17px; }
  .question { flex-wrap: wrap; }
  .question .acts { max-width: none; width: 100%; justify-content: flex-start; padding-left: 60px; }
}
@media (max-width: 420px) {
  .figure { padding: 14px 14px 12px; }
  .figure .v { font-size: 24px; }
  .question .acts { padding-left: 0; }
}
.you { font-size: 12.5px; color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
  .question .post { display: none; }
}

.sep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; margin: 0 .55em; vertical-align: middle; opacity: .7; }
