/* Mímir — local knowledge base UI.
   No build step: plain CSS, system fonts, works offline. */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --border: #e4e0d9;
  --border-strong: #cfc9bf;
  --text: #1d1b18;
  --muted: #6d6862;
  --faint: #99928a;
  --accent: #8a4b2a;
  --accent-soft: #f5ebe4;
  --good: #2f6b46;
  --good-soft: #e8f2eb;
  --warn: #8a6a1f;
  --warn-soft: #f7f0dd;
  --bad: #9a3535;
  --bad-soft: #f8e9e7;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --radius: 7px;
  --shadow: 0 1px 2px rgba(29, 27, 24, 0.05), 0 4px 12px rgba(29, 27, 24, 0.04);
  /* Tells the browser which theme its own controls should use -- date
     pickers, scrollbars, select menus -- or they stay light in dark mode. */
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --surface: #1f1e17;
    --border: #322f25;
    --border-strong: #46422f;
    --text: #efece4;
    --muted: #a7a196;
    --faint: #7d786d;
    --accent: #e0a77f;
    --accent-soft: #33251b;
    --good: #8fd0a6;
    --good-soft: #1c2b21;
    --warn: #e0c274;
    --warn-soft: #2d2718;
    --bad: #e79c95;
    --bad-soft: #2f1f1d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* Links take the accent rather than the browser's blue and purple, which sit
   badly against the warm palette in both themes. Visited looks the same:
   these link to records, not pages someone is working through. The underline
   appears on hover, so a link still announces itself without striping every
   row of the notification log. */
a, a:visited {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 2px;
}
a:hover { text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---------- layout ---------- */

header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
  /* Sized by its own width, not the window's: with Ask Mímir open beside the
     page, a wide window leaves the header narrow. */
  container: header / inline-size;
}

/* Full width, header and content alike. Nine tabs plus the name and the
   signed-in pill did not fit in the old 1180px column, and the menu was cut
   off even on a wide monitor. */
.header-inner {
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 54px;
}

.brand {
  font-weight: 620;
  letter-spacing: -0.01em;
  margin-right: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand span { color: var(--faint); font-weight: 400; margin-left: 8px; font-size: 13px; }

nav { display: flex; gap: 2px; }

nav button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: var(--radius);
  cursor: pointer;
}
nav button:hover { background: var(--bg); color: var(--text); }
nav button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 560; }

/* Content stops at 1600px and centres beyond that; long lines of ticket
   text are hard to read at full width on a wide monitor. The header above
   stays full width, since that is where the menu needs the room. */
main { max-width: 1600px; margin: 0 auto; padding: 24px 24px 80px; }
#whoami { flex-shrink: 0; font-family: inherit; cursor: pointer; }

/* Right of the menu: Admin, the bell, the guide and who is signed in. */
.header-tools { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-shrink: 0; }
.admin-menu { position: relative; }
.admin-toggle, .bell {
  appearance: none; border: 0; background: none; font: inherit; color: var(--muted);
  padding: 6px 10px; border-radius: var(--radius); cursor: pointer;
}
.admin-toggle:hover, .bell:hover { background: var(--bg); color: var(--text); }
.admin-toggle.active, .bell.active { background: var(--accent-soft); color: var(--accent); font-weight: 560; }
.admin-items {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; z-index: 30;
  display: flex; flex-direction: column; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.admin-items[hidden], .admin-items button[hidden] { display: none; }
.admin-items button {
  appearance: none; border: 0; background: none; font: inherit; color: var(--text);
  text-align: left; padding: 7px 12px; border-radius: 5px; cursor: pointer;
}
.admin-items button:hover, .admin-items button:focus-visible { background: var(--bg); }
.admin-items button.active { color: var(--accent); font-weight: 560; }
/* Tab groups in the menu row (Market, Support): a tab-like name that drops
   down its tabs. The menu is fixed and placed by app.js (placeNavMenu), so
   the row's sideways scroll does not cut it off. */
.nav-group { display: flex; flex-shrink: 0; }
.nav-group[hidden] { display: none; }
.nav-group-items { position: fixed; top: 0; left: 0; right: auto; }
nav button.nav-group-toggle[aria-expanded="true"] { background: var(--bg); color: var(--text); }
nav button.nav-group-toggle.active { background: var(--accent-soft); color: var(--accent); font-weight: 560; }
nav button.nav-group-toggle.active .tab-count { background: var(--surface); }
.bell { position: relative; display: inline-flex; align-items: center; padding: 6px 8px; }
.bell svg { display: block; }
.bell-dot {
  position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--bad); box-shadow: 0 0 0 2px var(--surface);
}
.bell-dot[hidden] { display: none; }
/* The tagline is the first thing to give way when the menu needs the room. */
@container header (max-width: 1480px) { .brand span { display: none; } }

.panel { display: none; }
.panel.active { display: block; }

/* ---------- primitives ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.grid { display: grid; gap: 12px; }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.stat .n { font-size: 26px; font-weight: 620; letter-spacing: -0.02em; }
.stat .k { color: var(--muted); font-size: 13px; margin-top: 2px; }

h2 { font-size: 15px; margin: 26px 0 10px; letter-spacing: -0.01em; }
h2:first-child { margin-top: 0; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 8px; }

input[type="text"], input[type="search"], input[type="email"],
input[type="password"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 11px;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}

button.primary {
  font: inherit;
  font-weight: 560;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  padding: 9px 18px;
  cursor: pointer;
}
button.primary:hover { filter: brightness(1.08); }
button.primary:disabled { opacity: 0.5; cursor: default; }

button.ghost {
  font: inherit;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 14px;
  cursor: pointer;
}
button.ghost:hover { color: var(--text); border-color: var(--accent); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}
.pill.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad  { background: var(--bad-soft);  color: var(--bad);  border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.tags { display: flex; gap: 5px; flex-wrap: wrap; }
.tag {
  font-size: 12px;
  font-family: var(--mono);
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- skills: who can help (skills.js) ---------- */

.skill-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 12.5px; padding: 1px 4px 1px 8px; border-radius: 999px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text, inherit);
}
.skill-chip.added { border-color: var(--accent); color: var(--accent); }
.skill-chip.hidden-skill { color: var(--faint); text-decoration: line-through; border-style: dashed; }
.skill-chip:not(:has(.skill-x)) { padding-right: 8px; }
button.skill-x {
  border: 0; background: none; padding: 0 4px; margin: 0; min-height: 0;
  font-size: 14px; line-height: 1; color: var(--faint); cursor: pointer;
}
button.skill-x:hover { color: var(--accent); }
.skill-chip.hidden-skill button.skill-x { text-decoration: none; }
select.skill-picker { width: auto; font-size: 12.5px; padding: 2px 6px; }
.skill-people { margin-top: 8px; display: grid; gap: 4px; }
.skill-person { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.skill-row {
  display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.skill-row:first-of-type { border-top: 0; }
.skill-who { min-width: 180px; }

/* ---------- ticket list ---------- */

.ticket-row {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  margin-bottom: 7px;
  cursor: pointer;
}
.ticket-row:hover { border-color: var(--accent); }
.ticket-row .top { display: flex; gap: 10px; align-items: baseline; }
@media (max-width: 700px) {
  /* A long pill (the qualification verdict) wraps under the name on a phone
     rather than widening the page past the screen. */
  .ticket-row .top { flex-wrap: wrap; row-gap: 4px; }
  .ticket-row .top .pill { white-space: normal; }
  /* View switchers with many choices scroll sideways instead. */
  #prospects-controls { min-width: 0; }
  #prospects-controls .segmented { max-width: 100%; min-width: 0; overflow-x: auto; }
}
.ticket-row .id { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.ticket-row .subject { font-weight: 520; flex: 1; min-width: 0; }
.ticket-row .meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.ticket-row .problem { color: var(--muted); font-size: 13px; margin-top: 5px; }

/* ---------- detail ---------- */

.field { margin-bottom: 14px; }
.field .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--faint); margin-bottom: 3px;
}
.field .value { white-space: pre-wrap; }

.attempt {
  border-left: 2px solid var(--border-strong);
  padding: 4px 0 4px 11px;
  margin-bottom: 9px;
}
.attempt.worked { border-left-color: var(--good); }
.attempt .step { font-size: 14px; }
.attempt .outcome { color: var(--muted); font-size: 13px; margin-top: 2px; }

pre.thread {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  max-height: 560px;
  overflow: auto;
  margin: 0;
}

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs a {
  display: block; width: 88px; height: 88px; border-radius: 5px;
  overflow: hidden; border: 1px solid var(--border); background: var(--bg);
}
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- modal ---------- */

dialog {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  max-width: 960px;
  width: calc(100% - 40px);
  max-height: 88vh;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(20, 18, 15, 0.45); }
.dialog-head {
  position: sticky; top: 0; background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px; display: flex; gap: 12px; align-items: baseline;
}
.dialog-head .subject { font-weight: 600; flex: 1; }
.dialog-body { padding: 18px; overflow: auto; }

/* ---------- misc ---------- */

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.empty { color: var(--faint); padding: 28px 0; text-align: center; }
.spinner { color: var(--muted); padding: 22px 0; }
.bar { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); }
.advice { white-space: pre-wrap; font-size: 14.5px; line-height: 1.6; }
.notice {
  font-size: 13px; color: var(--muted);
  background: var(--warn-soft); border-radius: var(--radius);
  padding: 9px 12px; margin-bottom: 14px;
}
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list td { padding: 5px 0; border-bottom: 1px solid var(--border); }
table.list td:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
table.list tr:last-child td { border-bottom: 0; }

/* ---------------------------------------------------------------------------
   Sign-in card
   The only place in the app with a bare <label>: everywhere else a field's
   caption is part of a composed control. Labels are inline by default, so
   they need to be told to stack above their input.
   --------------------------------------------------------------------------- */
.login {
  /* width, not max-width alone: on a 375px phone a 380px card would sit edge
     to edge with nothing to breathe. */
  width: calc(100% - 32px);
  max-width: 380px;
  margin: 12vh auto;
}

.login label, .password-form label {
  display: block;
  margin-bottom: 4px;
}

.login input, .password-form input {
  margin-bottom: 12px;
}

.login .notice, .password-form .notice {
  margin-bottom: 12px;
}

/* "Forgot your password?" and "Back to sign in": quiet, under the button. */
.login .link-button {
  appearance: none; border: 0; background: none; padding: 0;
  font: inherit; color: var(--accent); cursor: pointer;
}
.login .link-button:hover { text-decoration: underline; }

dialog.password { max-width: 420px; }

/* ---------- clients and notifications ---------- */

input[type="date"], input[type="number"] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 7px 10px;
}

button.small-btn { font-size: 12.5px; padding: 4px 10px; }

.field-label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }

.quote {
  font-size: 13px;
  color: var(--muted);
  border-left: 2px solid var(--border-strong);
  padding: 2px 0 2px 10px;
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.routing {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.memory { padding: 8px 0; border-bottom: 1px solid var(--border); }
.memory:last-of-type { border-bottom: 0; }
.memory.proposed {
  background: var(--warn-soft);
  border-radius: var(--radius);
  border-bottom: 0;
  padding: 9px 11px;
  margin: 6px 0;
}

.asset { padding: 9px 0; border-bottom: 1px solid var(--border); }
.asset-form { padding: 10px 0; border-bottom: 1px solid var(--border); }

.contact {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}

.signal-row { padding: 7px 0; border-bottom: 1px solid var(--border); }
.signal-row:last-child { border-bottom: 0; }

.mood {
  flex: 1;
  display: flex;
  height: 9px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg);
}

.notification { margin-bottom: 10px; }
.notification.correct { border-left: 3px solid var(--good); }
.notification.wrong { border-left: 3px solid var(--bad); }
button.verdict-good:hover { color: var(--good); border-color: var(--good); }
button.verdict-bad:hover { color: var(--bad); border-color: var(--bad); }

table.rules { width: 100%; border-collapse: collapse; font-size: 14px; }
table.rules th {
  text-align: left; font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--faint); padding: 0 8px 6px 0;
}
table.rules td { padding: 6px 8px 6px 0; border-top: 1px solid var(--border); }
table.rules td.bad { color: var(--bad); }
@media (max-width: 700px) {
  /* Only the notification rules table drops columns on phones; the replay
     tables need every one of theirs. */
  table.rules:not(.data) th:nth-child(2), table.rules:not(.data) td:nth-child(2),
  table.rules:not(.data) th:nth-child(4), table.rules:not(.data) td:nth-child(4) { display: none; }
}
table.rules.data td { vertical-align: top; }

/* The header gained two tabs. On a narrow window it scrolls sideways rather
   than wrapping labels onto two lines, and without a visible scrollbar, which
   drew a bright bar across the dark header. */
nav { overflow-x: auto; scrollbar-width: none; min-width: 0; }
nav::-webkit-scrollbar { display: none; }
nav button { white-space: nowrap; flex-shrink: 0; }

/* When the tabs do not fit beside the name and the tools, the menu gets its own
   full-width row and wraps onto as many lines as it needs, so every tab is
   visible and tappable. Squeezed between the name and the signed-in pill it
   had about 100px -- room for "Diagnose" and nothing else, with eight tabs
   hidden behind a sideways swipe nothing hinted at.
   Whether they fit is measured (fitNav in app.js), not guessed from the
   window: the tabs differ by role, and Ask Mímir open beside the page leaves
   a wide window with a narrow header. On phones the taller header would eat
   the screen if it stayed pinned, so there it scrolls away with the page. */
header.nav-wrap .header-inner { flex-wrap: wrap; gap: 6px 12px; padding: 10px 16px; }
header.nav-wrap .brand { order: 1; }
header.nav-wrap .header-tools { order: 2; }
header.nav-wrap nav {
  order: 3;
  flex-basis: 100%;
  flex-wrap: wrap;
  overflow-x: visible;
  gap: 4px;
}
header.nav-wrap nav button { padding: 6px 11px; }
@media (max-width: 760px) {
  header { position: static; }
  main { padding: 16px 16px 60px; }
}

/* Client cards: mood and needs line */
.card-signals { margin-top: 7px; gap: 14px; align-items: center; }
.mood-summary, .needs-summary { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mood.mini { flex: none; width: 56px; height: 7px; }
.card-signals .bad { color: var(--bad); }
.card-signals .good { color: var(--good); }

/* Clients list: search, sort and need filter on one line where they fit */
.client-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.client-controls input { flex: 2 1 220px; }
.client-controls select { flex: 1 1 200px; width: auto; }

/* Diagnose tab: unresolved tickets waiting for a session */
.unresolved-row {
  display: flex; gap: 10px; align-items: center;
  padding: 7px 0; border-top: 1px solid var(--border);
}

/* Replays: record issues waiting for review */
.issue { padding: 12px 0; border-top: 1px solid var(--border); }

/* ---------- diagnostic session: ticket beside tabbed work ---------- */

.session-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
/* Wide screens: the ticket is pinned beside the work, and scrolls on its own
   when the message is long, so it never leaves view while you work. */
/* Ticket, work, notes. Phones: one column, work before notes. Laptops: the
   ticket and notes share the left column (two pinned panels in one column
   would overlap, so neither is pinned). Wide screens: three columns, the
   ticket and the notes each pinned beside the work. */
.session-layout { grid-template-areas: "ticket" "main" "notes"; }
.session-ticket { grid-area: ticket; }
.session-main { grid-area: main; }
.session-notes { grid-area: notes; }
@media (min-width: 1000px) {
  .session-layout {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    grid-template-areas: "ticket main" "notes main";
    grid-template-rows: auto 1fr;
  }
}
@media (min-width: 1400px) {
  .session-layout {
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(280px, 330px);
    grid-template-areas: "ticket main notes";
    grid-template-rows: auto;
  }
  .session-ticket, .session-notes {
    position: sticky;
    top: 70px;
    max-height: calc(100vh - 90px);
    overflow: auto;
  }
}
.ticket-details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.ticket-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13.5px;
  color: var(--muted);
}
.session-outcome {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--good-soft);
}

.session-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}
.session-tabs::-webkit-scrollbar { display: none; }
.session-tabs button {
  appearance: none;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  color: var(--muted);
  padding: 8px 12px;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.session-tabs button:hover { color: var(--text); }
.session-tabs button[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 560;
}
.tab-count {
  margin-left: 6px;
  font-size: 11.5px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 400;
}
.session-tabs button[aria-selected="true"] .tab-count {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}
.session-actions { margin-top: 16px; }

/* Phones: the tabs wrap rather than hiding behind a sideways swipe. */
@media (max-width: 760px) {
  .session-tabs { flex-wrap: wrap; overflow-x: visible; }
}
.fact-fold { margin-top: 10px; }
.fact-fold summary { cursor: pointer; color: var(--warn); }

/* ---------- photos: gallery and full-screen viewer ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.gallery-tile {
  appearance: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  aspect-ratio: 1;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-tile:hover { border-color: var(--accent); }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-files { margin-top: 12px; }

body.viewer-open { overflow: hidden; }
/* A modal <dialog> covering the whole screen; the browser's dialog defaults
   (centered box, border, padding, max sizes) are undone here. */
dialog.viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: rgba(12, 11, 9, 0.96);
  color: #efece4;
  overflow: hidden;
}
dialog.viewer::backdrop { background: rgba(12, 11, 9, 0.6); }
.viewer-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
  /* Smooth at a glance, sharp when zoomed: the browser picks per frame. */
  image-rendering: auto;
}
.viewer-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: linear-gradient(rgba(12, 11, 9, 0.85), rgba(12, 11, 9, 0));
  pointer-events: none;
}
.viewer-top > * { pointer-events: auto; }
.viewer-caption { flex: 1 1 240px; min-width: 0; font-size: 13px; color: #cfc9bf; overflow-wrap: anywhere; }
/* Wraps on a narrow screen so Close is never pushed off the edge. */
.viewer-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.viewer-btn {
  appearance: none;
  font: inherit;
  font-size: 14px;
  color: #efece4;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 6px 11px;
  cursor: pointer;
  text-decoration: none;
}
.viewer-btn:hover { background: rgba(255, 255, 255, 0.2); text-decoration: none; }
.viewer-zoom { min-width: 44px; text-align: center; font-size: 13px; color: #cfc9bf; }
.viewer > .viewer-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  padding: 10px 14px;
}
.viewer > .viewer-btn:first-of-type { left: 12px; }
.viewer > .viewer-btn:last-of-type { right: 12px; }
.viewer-status {
  position: absolute;
  bottom: 18px; left: 0; right: 0;
  text-align: center;
  font-size: 13px;
  color: #cfc9bf;
}

.link-ticket {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Photo badge: a camera and a count, clickable straight to the photos. */
.photo-chip {
  cursor: pointer;
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
  gap: 4px;
}
.photo-chip:hover { filter: brightness(1.1); }
.photo-chip svg { flex: none; }

/* Tab counts are filled in once known; an empty one takes no room. */
.tab-count:empty { display: none; }
div.ticket-row { cursor: pointer; }
div.ticket-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* The marker under an endless list: always in the layout, so its position
   is real; text only while a page loads. */
.load-more { min-height: 1px; padding: 10px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- session: overview and hypotheses & checks ---------- */

.overview-head .headline { font-size: 17px; font-weight: 560; line-height: 1.45; }
.key-points { margin: 0; padding-left: 18px; }
.key-points li { margin-bottom: 6px; }
.full-reasoning { margin-top: 14px; }
.full-reasoning > summary,
.ruled-out > summary,
.check-detail > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}
.full-reasoning > .advice {
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hyp-card { margin-bottom: 10px; }
.hyp-card.confirmed { border-color: var(--good); }
.hyp-card .checks { margin-top: 12px; }
.hyp-card .checks > .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--faint); margin-bottom: 2px;
}
.check { padding: 10px 0; border-top: 1px solid var(--border); }
.card > .check:first-child { border-top: 0; padding-top: 0; }
.check.done { opacity: .85; }
.check-detail { margin-top: 6px; }
.check-detail > div { margin-top: 6px; color: var(--muted); }
.weak-lead { margin-bottom: 10px; border-style: dashed; }
.ruled-out { margin-top: 16px; }
.ruled-out > .hyp-card { margin-top: 10px; }


/* ---------- hypotheses as headers, checks as their task list ---------- */

.hyp-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  margin-bottom: 4px;
}
.hyp-eyebrow.confirmed { color: var(--good); }
.hyp-eyebrow.ruled_out { color: var(--bad); }
.hyp-title { font-size: 16px; font-weight: 600; line-height: 1.4; }

.tasks {
  margin-top: 14px;
  padding: 4px 14px 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
}
.tasks-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0 4px;
  font-size: 12px;
  font-weight: 560;
  color: var(--muted);
}

.task {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.card > .task:first-child { border-top: 0; padding-top: 0; }
.task-box {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}
.task.first .task-box { border-color: var(--accent); }
.task-box.done { background: var(--good); border-color: var(--good); color: var(--surface); }
.task-text { font-size: 14px; line-height: 1.5; }
.task.done .task-text { color: var(--muted); }
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--faint);
}
.task-tag {
  text-transform: lowercase;
  font-size: 11.5px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.task-tag.first { color: var(--accent); border-color: var(--accent); text-transform: none; }
.task-tag.good { color: var(--good); }
.task-tag.warn { color: var(--warn); }
.task-tag.bad { color: var(--bad); }

/* ---------- Overview as a handover: headline, then labelled bullets ---------- */

.glance-head { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.glance-head .pill { margin-top: 3px; }
.glance-headline { flex: 1 1 260px; font-size: 18px; font-weight: 600; line-height: 1.35; }
.glance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 4px 24px;
}
.glance-section { margin-top: 16px; }
.glance-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--faint);
  margin-bottom: 6px;
}
.glance-section ul { margin: 0; padding-left: 18px; }
.glance-section li { margin-bottom: 5px; line-height: 1.45; }
.glance-section.watch li::marker { color: var(--warn); }
.glance-section.watch .glance-label { color: var(--warn); }

/* ---------- notes & activity ---------- */

.note-composer textarea { font-size: 14px; }
.notes-filter { display: flex; gap: 4px; margin: 12px 0 4px; }
.notes-filter button {
  appearance: none; font: inherit; font-size: 12.5px; cursor: pointer;
  padding: 3px 10px; border-radius: 12px;
  border: 1px solid var(--border); background: none; color: var(--muted);
}
.notes-filter button.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.timeline { margin-top: 4px; }
.tl-item { padding: 9px 0; border-top: 1px solid var(--border); font-size: 13px; }
.tl-item:first-child { border-top: 0; }
.tl-head { color: var(--muted); display: flex; gap: 4px; align-items: baseline; flex-wrap: wrap; }
.tl-detail { color: var(--faint); margin-top: 2px; }
.tl-item.note {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin: 8px 0;
}
.tl-item.note + .tl-item { border-top: 0; }
.tl-item.note .tl-head { color: var(--text); }
.tl-body { margin-top: 4px; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.5; }
.tl-item.hypothesis_confirmed .tl-head span:first-child { color: var(--good); }
.tl-item.hypothesis_ruled_out .tl-head span:first-child { color: var(--bad); }
.link-btn {
  appearance: none; border: 0; background: none; padding: 0; margin-left: auto;
  font: inherit; font-size: 12px; color: var(--faint); cursor: pointer;
}
.link-btn:hover { color: var(--bad); text-decoration: underline; }
.link-btn + .link-btn { margin-left: 10px; }
.link-btn.edit:hover { color: var(--accent); }
.note-edit textarea { width: 100%; }
.result-byline { display: flex; align-items: baseline; flex-wrap: wrap; }
.result-byline .link-btn { margin-left: 10px; }

/* A solved ticket, and whether it is closed in Zendesk yet. */
.zendesk-close { margin-top: 8px; }
.zendesk-close.waiting { color: var(--warn); }
/* The ticket window: Mark solved, where it stands, and the "may be solved" hint. */
.close-state > * { margin: 0 0 14px; }
.close-state .zendesk-close .faint { color: var(--faint); margin-top: 2px; }
.resolved-hint { color: var(--text, inherit); }

/* A ticket that has moved on since its last assessment. */
.updates-banner { margin-bottom: 12px; border-color: var(--warn); background: var(--warn-soft); }

/* ---------- library ---------- */
.doc-row { padding: 10px 0; border-top: 1px solid var(--border); }
.card > .doc-row:first-child { border-top: 0; padding-top: 0; }
.upload-form input[type="file"] { font: inherit; font-size: 13px; color: var(--muted); max-width: 100%; }
.doc-passage { padding: 10px 0; border-top: 1px solid var(--border); }
.card > .doc-passage:first-of-type { border-top: 0; }
/* The browser's own file button is light even in dark mode; match the ghost buttons. */
.upload-form input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px 12px;
  margin-right: 10px;
  cursor: pointer;
}
.upload-form input[type="file"]::file-selector-button:hover { border-color: var(--accent); }

/* ---------- search: the answer above the results ---------- */
.search-answer { border-color: var(--accent); background: var(--accent-soft); margin: 12px 0 16px; }
.search-answer .answer-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.search-answer .answer-body p { margin: 0 0 8px; line-height: 1.55; }
.search-answer .answer-body ul { margin: 0 0 8px; padding-left: 20px; line-height: 1.55; }
.search-answer .answer-body ol { margin: 0 0 8px; padding-left: 22px; line-height: 1.55; }
.search-answer .answer-body ol > li { margin-bottom: 8px; }
.cite {
  display: inline-block; font: 600 11px/1.4 var(--mono); color: var(--accent); background: var(--surface);
  border: 1px solid var(--accent); border-radius: 4px; padding: 0 4px; margin: 0 1px; vertical-align: 1px; cursor: pointer;
}
button.cite:hover { background: var(--accent); color: var(--surface); }
.answer-sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.answer-source {
  font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 3px 8px; cursor: pointer; color: var(--text); max-width: 100%; text-align: left;
}
.answer-source:hover { border-color: var(--accent); }
.ticket-row .cite-badge {
  font: 600 11px/1.4 var(--mono); color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0 5px;
}
mark.hit { background: var(--warn-soft); color: inherit; font-weight: 560; padding: 0 1px; border-radius: 2px; }

/* ---------- starting up ---------- */
/* Until sign-in is settled only #boot shows. It fades in after a beat, so a
   quick start goes straight to the app with no loader flicker at all. */
#boot { display: none; }
html.booting body > :not(#boot) { display: none !important; }
html.booting #boot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; min-height: 100vh; padding: 0 16px; box-sizing: border-box; text-align: center;
  animation: boot-in .3s ease .2s both;
}
#boot .boot-brand { font-weight: 620; font-size: 24px; letter-spacing: -0.01em; color: var(--text); }
#boot .boot-sub { font-size: 13px; color: var(--muted); margin-top: -10px; }
#boot .boot-bar {
  position: relative; overflow: hidden; width: 160px; height: 3px; margin-top: 6px;
  border-radius: 3px; background: var(--border);
}
#boot .boot-bar::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%;
  border-radius: 3px; background: var(--accent); animation: boot-slide 1.1s ease-in-out infinite;
}
#boot .boot-error { max-width: 420px; font-size: 14px; color: var(--bad); }
@keyframes boot-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes boot-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) {
  html.booting #boot { animation: none; }
  #boot .boot-bar::after { animation: none; width: 100%; opacity: .5; }
}

/* ---------- a two-way switch (Search: question or customer email) ---------- */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.segmented button {
  border: 0; border-radius: 0; background: var(--surface); color: var(--muted); padding: 5px 12px; font-size: 13px; cursor: pointer;
}
.segmented button + button { border-left: 1px solid var(--border); }
.segmented button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 560; }

/* ---------- the one search box: short for a question, tall for an email ---------- */
#search-q.search-box { width: 100%; box-sizing: border-box; }
#search-q.answer { min-height: 0; max-height: 9.5em; resize: none; overflow-y: auto; }
#search-q.troubleshoot { min-height: 170px; resize: vertical; }

/* ---------- News ---------- */
.news-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.news-card {
  appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; padding: 0; overflow: hidden;
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.news-card:hover { border-color: var(--accent); }
.news-cover { aspect-ratio: 16 / 9; background: var(--bg) center / cover no-repeat; border-bottom: 1px solid var(--border); }
.news-cover.blank { background: linear-gradient(135deg, var(--accent-soft), var(--bg)); }
.news-card-body { padding: 12px 14px 14px; }
.news-title { font-weight: 600; font-size: 16px; line-height: 1.35; margin-bottom: 4px; }

.post { max-width: 760px; margin: 0 auto; }
.post h1 { font-size: 28px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -0.01em; }
.post-lede { font-size: 17px; color: var(--muted); margin: 0 0 6px; }
.post-meta { margin-bottom: 20px; }
.post-body { font-size: 15.5px; line-height: 1.7; }
.post-body h2, .post-body h3, .post-body h4 { margin: 26px 0 8px; line-height: 1.3; }
.post-body h2 { font-size: 21px; text-transform: none; letter-spacing: -0.005em; }
.post-body h3 { font-size: 17px; text-transform: none; }
.post-body h4 { font-size: 15.5px; text-transform: none; }
.post-body p { margin: 0 0 14px; }
.post-body ul, .post-body ol { margin: 0 0 14px; padding-left: 22px; }
.post-body li { margin-bottom: 4px; }
.post-body blockquote { margin: 0 0 14px; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.post-photo { position: relative; margin: 18px 0; }
.post-photo img { display: block; max-width: 100%; max-height: 520px; border-radius: var(--radius); border: 1px solid var(--border); }
.post-photo figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; }
.post-photo.pending img { outline: 2px dashed var(--warn); outline-offset: 2px; }
.post-photo-flag { position: absolute; top: 8px; left: 8px; }
.post-photo-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.post-photo-thumb { width: 120px; height: 90px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); flex-shrink: 0; }
.warn-text { color: var(--warn); }
.post-available { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.post-available-item { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.post-available-item img { width: 110px; height: 82px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border); }
.post-insert-thumb { width: 28px; height: 22px; object-fit: cover; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.post-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.post-editor-text { min-height: 520px; font-family: var(--mono); font-size: 13px; }
.post-preview { border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 18px; max-height: 640px; overflow-y: auto; background: var(--surface); }
@media (max-width: 900px) { .post-editor { grid-template-columns: 1fr; } }

/* ---------- writing to the client: ticked tasks, compose, photo library ---------- */

.task-pick {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.pick-bar {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pick-bar[hidden] { display: none; }
.linkish {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
}
.linkish:hover { text-decoration: underline; }
.linkish:disabled { color: var(--faint); cursor: default; text-decoration: none; }

dialog.compose { max-width: 1180px; }
.compose-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .compose-grid { grid-template-columns: 1fr; } }
.compose-field { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
/* The message as it will look in the client's inbox: light, whatever the app theme. */
.compose-editor {
  min-height: 320px;
  max-height: 58vh;
  overflow: auto;
  padding: 14px 16px;
  background: #ffffff;
  color: #1d1b18;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  outline: none;
}
.compose-editor:focus { border-color: var(--accent); }
.compose-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.photo-picker { max-height: 66vh; overflow: auto; }
.photo-pick-section { margin-bottom: 14px; }
.photo-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin-top: 6px; }
.photo-pick-cell { min-width: 0; }
.photo-pick-cell .gallery-tile { width: 100%; }
kbd.k {
  font-family: var(--mono);
  font-size: 11px;
  padding: 0 4px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg);
}
.photo-pick-caption { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.photo-card { min-width: 0; }
.photo-card .gallery-tile { width: 100%; }

/* ---------- Prospects ---------- */
.followup-row {
  appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  background: none; border: 0; border-top: 1px solid var(--border); padding: 8px 0;
}
.followup-row:first-of-type { border-top: 0; }
.followup-row:hover strong { color: var(--accent); }
.followup-when { min-width: 120px; font-size: 13px; }
.next-action { margin-top: 12px; }
/* The company page: one page from prospect to customer, in tabs. */
.company-tabs { margin-top: 16px; }
.company-pane { padding-top: 14px; }
.company-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.company-card > .card, .company-card .arrange-body > .card { margin: 0 !important; }
.company-card:empty, .company-sections:empty { display: none; }
.company-sections > div > .card:last-child { margin-bottom: 0 !important; }
/* Arranging: each card is a bar to drag or move with the arrows, over a dimmed preview. */
.arrange-hint { gap: 10px; margin-bottom: 14px; }
.arranging .company-col { min-height: 90px; padding: 6px; border: 1px dashed var(--border); border-radius: var(--radius); }
.arranging .company-col.is-empty::after { content: 'Drop cards here'; color: var(--faint); font-size: 13px; margin: auto; }
.arranging .company-card { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.arrange-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: grab; border-bottom: 1px solid var(--border); }
.arrange-bar select { padding: 2px 6px; }
.arrange-grip { color: var(--faint); font-size: 16px; line-height: 1; }
.arrange-body { opacity: 0.55; max-height: 150px; overflow: hidden; pointer-events: none; }
.arrange-body > .card { border: 0; }
.company-card.dragging { opacity: 0.35; }
.drop-line { height: 3px; border-radius: 2px; background: var(--accent); }
.session-tabs button.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }
.research-paste { min-height: 220px; }
textarea.short { min-height: 64px; }
.touch-form { padding: 10px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.touch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
@media (max-width: 600px) {
  .touch-grid { grid-template-columns: 1fr; }
  .touch-grid > [style*="span 2"] { grid-column: auto !important; }
}
.proposal { margin-top: 10px; }
.list-check-row { padding: 8px 0; border-top: 1px solid var(--border); }
.link-picker { margin-top: 8px; }
.acct-news-item { padding: 8px 0; border-top: 1px solid var(--border); }
.deck-bar .list-filter { width: 220px; max-width: 100%; }
.news-badge:empty { display: none; }
.acct-news-item:first-of-type { border-top: 0; }
.acct-news-headline { display: block; font-weight: 520; margin: 2px 0; }
/* Specs, comparisons and objection cards (specs.js, products.js, competitors.js). */
.spec-field { min-width: 0; }
.spec-field input[type="text"] { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.spec-short { font-weight: 560; margin: 2px 0; }
.spec-value { white-space: pre-wrap; }
.compare-scroll { overflow-x: auto; max-width: 100%; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.compare-table th, .compare-table td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.compare-table thead th { min-width: 140px; }
.compare-table tbody th { width: 150px; color: var(--muted); font-weight: 500; }
.compare-table td { cursor: pointer; }
.compare-table td.compare-draft { background: var(--warn-soft); }
.compare-full { margin-top: 4px; }
.objection { padding: 6px 0; }
.objection-q { font-weight: 560; margin-bottom: 2px; }
.objection-proof { margin: 4px 0 0; padding-left: 18px; }
.objection-row { padding: 8px 0; border-top: 1px solid var(--border); }
.objection-row:first-of-type { border-top: 0; }
.competitor-machine { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--border); font-size: 0.92em; }
.competitor-machine-name { min-width: 0; flex: 1; }
.equip-row { padding: 6px 0; border-top: 1px solid var(--border); font-size: 0.92em; overflow-wrap: anywhere; }
.acct-news-paste { margin: 0 0 10px; padding: 10px; border: 1px dashed var(--border); border-radius: 8px; }
.acct-news-paste.dragging { border-color: var(--accent); }
.acct-news-paste-text { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; }
.acct-news-shots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.acct-news-shots:empty { display: none; }
.acct-news-shot { position: relative; }
.acct-news-shot img { display: block; width: 72px; height: 72px; object-fit: cover; object-position: top; border: 1px solid var(--border); border-radius: 4px; }
.acct-news-shot-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; border-radius: 50%; line-height: 18px; font-size: 14px; }
.notice-row { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--border); padding: 8px 0; color: inherit; cursor: pointer; }
.notice-row.unread strong::before { content: '● '; color: var(--accent); }
.link-picker input { width: 100%; max-width: 360px; }
.list-check-row > .small { margin-left: 26px; }
.person { align-items: flex-start; }
#panel-prospects .bad { color: var(--bad); }
.hint { display: block; font-size: 12px; color: var(--faint); line-height: 1.4; margin-top: 2px; }
.hinted { display: flex; flex-direction: column; gap: 2px; }
.glossary { margin-top: 10px; }
.glossary summary { cursor: pointer; color: var(--muted); }
.glossary-group { margin-top: 8px; }
.glossary-title { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-bottom: 4px; }
.glossary dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.glossary dt { font-weight: 560; }
.glossary dd { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .glossary dl { grid-template-columns: 1fr; } .glossary dd { margin-bottom: 6px; } }
.research-guide { margin-bottom: 10px; }
.research-guide summary { cursor: pointer; font-size: 13px; font-weight: 560; }
.research-guide ul { margin: 0; padding-left: 18px; }
.research-guide li { margin-bottom: 3px; }
.gaps { margin-top: 10px; padding: 8px 11px; background: var(--warn-soft); border-radius: var(--radius); }
.gaps ul { margin: 4px 0 0; padding-left: 18px; }
.good-text { color: var(--good); }
.research-text { white-space: pre-wrap; font-size: 13px; line-height: 1.5; background: var(--bg); border-radius: var(--radius); padding: 10px 12px; margin-top: 6px; max-height: 480px; overflow: auto; }
.prompt-brief { min-height: 340px; font-family: var(--mono); font-size: 12.5px; }
.candidate { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); cursor: pointer; }
.candidate:first-child { border-top: 0; }
.candidate input { margin-top: 4px; }
.candidate.muted-row { cursor: default; }
.candidate.muted-row strong { color: var(--muted); }
.candidate-reasons { margin-top: 4px; display: grid; gap: 2px; }
.candidate-reason { line-height: 1.45; }
.candidate-reason-label { display: inline-block; min-width: 150px; color: var(--faint); font-size: 12px; }
@media (max-width: 600px) { .candidate-reason-label { display: block; min-width: 0; } }

/* ---------- Boards ---------- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.board-tile {
  appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px;
}
.board-tile:hover { border-color: var(--accent); }
.board-tile-name { font-weight: 620; margin-bottom: 4px; }
.board-templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.board-template {
  display: flex; gap: 8px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
}
.board-template:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.board-columns { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.board-column {
  flex: 0 0 280px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; display: flex; flex-direction: column; max-height: calc(100vh - 220px);
}
.board-column.done { opacity: 0.85; }
.board-column-head { display: flex; gap: 8px; align-items: baseline; padding: 2px 4px 8px; }
.board-cards { display: flex; flex-direction: column; gap: 8px; min-height: 40px; overflow-y: auto; padding: 2px; }
.board-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 10px; cursor: pointer; font-size: 13.5px;
}
.board-card:hover, .board-card:focus-visible { border-color: var(--accent); outline: none; }
.board-card.dragging { opacity: 0.4; }
.board-card-title { font-weight: 560; line-height: 1.35; word-break: break-word; }
.board-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.board-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.board-chip-open { cursor: pointer; }
.board-chip-open:hover { text-decoration: underline; }
.board-card-fields { margin-top: 6px; font-size: 12.5px; display: grid; gap: 1px; }
.board-card-foot { display: flex; gap: 8px; align-items: center; margin-top: 7px; font-size: 12px; flex-wrap: wrap; }
.board-card-foot .board-avatar { margin-left: auto; }
.board-card-foot .board-assigned { margin-left: auto; display: inline-flex; gap: 3px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.board-card-foot .board-assigned .board-avatar { margin-left: 0; }
.board-group-chip { font-size: 11px; padding: 1px 7px; }
.board-people-picker { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-height: 32px; }
.board-person-chip { display: inline-flex; align-items: center; gap: 4px; }
.board-person-chip.group { background: var(--accent-soft); color: var(--accent); }
.board-person-chip .link-btn { padding: 0 2px; font-size: 14px; line-height: 1; }
.board-people-add { width: auto; flex: none; min-width: 150px; }

/* The card dialog: the work on the left, a strip about the card on the right
   that stays in view while the work scrolls. On a phone the strip comes first. */
#board-card-dialog { width: min(1060px, calc(100vw - 32px)); }
.card-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.card-main { min-width: 0; }
.card-side { position: sticky; top: 0; display: grid; gap: 12px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border); }
.card-side .board-section { margin-top: 2px; }
.card-side .board-people-add { min-width: 0; width: 100%; }
.card-side .row > .ghost.small-btn { margin-left: 0; }
@media (max-width: 760px) {
  .card-layout { grid-template-columns: 1fr; }
  .card-side { position: static; order: -1; }
}
.card-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 14px; }
.card-field { gap: 4px; }
.card-field-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.card-field.is-empty .card-field-label { color: var(--faint); }
/* Empty: a dashed edge only. The background stays, because a see-through
   select makes Windows draw its list on white with the light text. */
.card-field.is-empty :is(input, select, textarea) { border-style: dashed; }
.card-field:not(.is-empty) :is(input, select, textarea) { color: var(--text); font-weight: 500; }
/* A dropdown's list in Mímir's own colors, light or dark, and normal weight. */
select option, select optgroup { background: var(--surface); color: var(--text); font-weight: 400; }
.card-field .hint { margin-top: 0; }
/* .hint sets display, which would otherwise beat the hidden attribute. */
.hint[hidden] { display: none; }
.card-check { font-size: 14px; color: var(--text); min-height: 34px; }
.card-heading { display: flex; align-items: center; gap: 6px; }
.card-heading-extra { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.info-dot { border: 0; background: none; padding: 0 2px; margin: 0; font-size: 12px; line-height: 1; color: var(--faint); cursor: help;
  text-transform: none; letter-spacing: 0; font-weight: 400; }
.info-dot:hover, .info-dot:focus-visible { color: var(--accent); }
.board-avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 640; flex-shrink: 0;
}
.board-due.bad { color: var(--bad); }
.board-drop-marker { height: 3px; border-radius: 2px; background: var(--accent); margin: -2px 0; }
.board-add { padding: 6px 2px 0; }
.board-add-btn { margin-left: 0; color: var(--muted); }
.board-add-btn:hover { color: var(--accent); }
.board-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; }
.board-dialog-head { display: flex; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.board-dialog-title { font-size: 17px; font-weight: 600; border-color: transparent; }
.board-dialog-title:hover { border-color: var(--border); }
.board-dialog-body { padding: 14px 18px 20px; overflow-y: auto; max-height: calc(100vh - 130px); }
.board-section { margin-top: 18px; }
.board-task { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 14px; cursor: pointer; }
.board-task.done span:first-of-type { text-decoration: line-through; color: var(--faint); }
.board-file { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); }
.board-file:first-of-type { border-top: 0; }
.board-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.board-field-row { padding: 10px 0; border-top: 1px solid var(--border); }
.board-field-row:first-child { border-top: 0; }
.board-members { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.board-col-table input[type="text"] { min-width: 140px; }
.table-scroll { overflow-x: auto; }
.board-pick { width: min(440px, calc(100vw - 32px)); padding: 18px 20px; }
.board-mini {
  appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: none; border: 0; border-top: 1px solid var(--border); padding: 7px 0; font-size: 13.5px;
}
.board-mini:first-of-type { border-top: 0; }
.board-mini:hover > span:first-child { color: var(--accent); }
@media (max-width: 600px) {
  .board-column { flex-basis: 82vw; max-height: none; }
}
.board-col-table td.c { text-align: center; }
.board-members[hidden], .board-field-row [hidden] { display: none; }
.board-cite { font: 500 12px/1.5 inherit; font-family: inherit; padding: 0 6px; border-radius: 10px; vertical-align: 0; }
.board-ask-knowledge { margin-top: 10px; }
.board-ask-knowledge > summary { cursor: pointer; color: var(--muted); }
.board-column-owner { padding: 0 4px 6px; margin-top: -4px; }
.board-queue { font-size: 11px; }
.board-step { padding: 10px 0; border-top: 1px solid var(--border); }
.board-step:first-of-type { border-top: 0; }
.board-step-rules { margin-top: 6px; }
.board-step-rules > summary { cursor: pointer; color: var(--muted); }
.board-flow td.c, .board-flow th { text-align: center; }
.board-flow td:first-child, .board-flow th:first-child, .board-flow td:last-child { text-align: left; }
.board-flow-row { cursor: pointer; }
.board-flow-row:hover td { background: var(--accent-soft); }
.board-flow-row.done td { opacity: 0.75; }
.board-column.flash { outline: 2px solid var(--accent); }
.outreach-checks { border-top: 1px solid var(--border); padding-top: 10px; }
.outreach-check { padding: 8px 0; border-bottom: 1px solid var(--border); }
.outreach-check:last-child { border-bottom: 0; }
.outreach-check .quote { margin: 4px 0; }
.outreach-check.missing { background: var(--warn-soft); padding: 8px; border-radius: var(--radius); }

/* ---------- Decks: slides from selected prospects ---------- */
.deck-pick { display: flex; align-items: stretch; gap: 8px; }
.deck-pick > .ticket-row { flex: 1; min-width: 0; }
.deck-pick-box { display: flex; align-items: center; padding: 0 2px; cursor: pointer; }
.deck-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; }
.deck-title-input { font-size: 18px; font-weight: 600; min-width: 260px; max-width: 520px; flex: 1; }
.deck-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .deck-layout { grid-template-columns: 1fr; } .deck-thumbs { flex-direction: row; overflow-x: auto; max-height: none; } }
.deck-thumbs { display: flex; flex-direction: column; gap: 10px; max-height: 78vh; overflow-y: auto; padding-right: 4px; }
.deck-thumb { display: grid; gap: 4px; padding: 4px; border: 2px solid transparent; border-radius: var(--radius); background: none; cursor: pointer; text-align: left; }
.deck-thumb.on { border-color: var(--accent); }
.deck-thumb .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 176px; }
.deck-stage { width: 100%; }
.deck-over { margin-top: 6px; }
.deck-section { margin-top: 12px; }
.deck-section-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 4px; }
.deck-bullet { padding: 6px 0; }
.deck-bullet textarea { flex: 1; min-height: 0; }
.deck-bullet.missing { background: var(--warn-soft); border-radius: var(--radius); padding: 6px; }
.deck-bullet-src { margin: 2px 0 0 18px; }
.quote-inline { font-style: italic; }

/* A slide is drawn at 1280x720 and scaled; its colors are its own, light,
   whatever theme Mímir is in, because it is shown on projectors and paper. */
.slide-frame { position: relative; overflow: hidden; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.25); background: #fff; }
.slide {
  position: absolute; top: 0; left: 0; transform-origin: top left;
  width: 1280px; height: 720px; overflow: hidden; box-sizing: border-box;
  padding: 56px 72px 64px; background: #ffffff; color: #1d1d1f;
  font-family: var(--font, system-ui, -apple-system, "Segoe UI", sans-serif); font-size: 20px; line-height: 1.38;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.slide .slide-body { height: 100%; overflow: hidden; display: flex; flex-direction: column; }
.slide h1 { font-size: 60px; line-height: 1.1; margin: 18px 0 14px; color: #111; }
.slide h2 { font-size: 40px; line-height: 1.15; margin: 0 0 10px; color: #111; }
.slide h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: #b4532a; margin: 14px 0 6px; }
.slide ul { margin: 0; padding-left: 22px; }
.slide li { margin: 0 0 8px; }
.slide a { color: #1d4ed8; text-decoration: none; }
.slide .muted { color: #5f6368; }
.slide-kicker { font-size: 16px; color: #5f6368; letter-spacing: .02em; margin-bottom: 6px; }
.slide-headline { font-size: 24px; color: #b4532a; margin: 0 0 12px; font-weight: 560; }
.slide-sub { font-size: 26px; color: #444; }
.slide-meta { font-size: 20px; color: #5f6368; margin-top: auto; }
.slide-conf { font-size: 15px; color: #8a8a8a; margin-top: 10px; }
.slide-cover { background: linear-gradient(135deg, #fff 0%, #fff 62%, #fbeee6 100%); }
.slide-cols { display: grid; gap: 34px; flex: 1; min-height: 0; }
.slide-cols.three { grid-template-columns: repeat(3, 1fr); }
.slide-cols.two { grid-template-columns: 1.15fr 1fr; }
.slide-col { overflow: hidden; min-height: 0; font-size: 19px; }
.slide-col h3:first-child { margin-top: 4px; }
.slide-none { color: #8a8a8a; font-style: italic; font-size: 18px; }
.slide-person { margin: 0 0 12px; font-size: 18px; }
.slide-person .contact { font-size: 16px; color: #333; }
.slide-role { font-size: 13px; color: #b4532a; border: 1px solid #e8c3b0; border-radius: 10px; padding: 1px 8px; margin-left: 8px; }
.slide-status { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 16px; color: #333; border-top: 1px solid #e5e5e5; padding-top: 10px; margin-top: 8px; }
.slide-table { width: 100%; border-collapse: collapse; font-size: 17px; }
.slide-table th { text-align: left; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: #5f6368; border-bottom: 2px solid #e5e5e5; padding: 6px 10px 6px 0; }
.slide-table td { border-bottom: 1px solid #eee; padding: 8px 10px 8px 0; vertical-align: top; }
.slide-table.tight td { padding: 4px 10px 4px 0; font-size: 15px; }
.slide-table td.why { color: #444; }
.slide-table td.nowrap { white-space: nowrap; }
.slide-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin: 16px 0 18px; }
.slide-tile { border: 1px solid #e5e5e5; border-radius: 10px; padding: 16px; }
.slide-tile .n { font-size: 44px; font-weight: 650; color: #b4532a; line-height: 1; }
.slide-tile .k { font-size: 15px; color: #5f6368; margin-top: 8px; }
.slide-source-grid { display: grid; gap: 48px; flex: 1; min-height: 0; overflow: hidden; }
.slide-source-group li { font-size: 15px; margin-bottom: 8px; }
.slide-source-group .url { font-size: 11px; color: #777; word-break: break-all; }
.slide-foot { position: absolute; left: 72px; right: 72px; bottom: 22px; display: flex; justify-content: space-between; font-size: 13px; color: #8a8a8a; }

.deck-present { position: fixed; inset: 0; z-index: 10000; background: #000; display: flex; align-items: center; justify-content: center; outline: none; }
.deck-present-slide { position: relative; overflow: hidden; }
.deck-count { position: fixed; right: 14px; bottom: 10px; font-size: 12px; color: rgba(255,255,255,.45); }

#deck-print { display: none; }
@page deck { size: 13.333in 7.5in; margin: 0; }
@media print {
  body.printing-deck > *:not(#deck-print) { display: none !important; }
  body.printing-deck { background: #fff !important; margin: 0; }
  body.printing-deck #deck-print { display: block; }
  #deck-print .slide { position: relative; transform: none; page: deck; break-after: page; page-break-after: always; }
  #deck-print .slide:last-child { break-after: auto; page-break-after: auto; }
}
.slide-approach .slide-col { font-size: 17.5px; }
.slide-approach li { margin-bottom: 5px; }
.slide-approach .slide-col h3 { margin-top: 10px; }
.slide-approach .slide-person { margin-bottom: 9px; font-size: 17px; }
.slide-source-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.slide-source-group { min-width: 0; }
.slide-source-group li { margin-bottom: 10px; }
.slide-source-group li a, .slide-source-group .url { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 540px; }
.slide-source-group li a { font-size: 17px; }
.slide-source-group .url { font-size: 13px; word-break: normal; }

/* ---------- Research settings ---------- */
.rs-profile summary { cursor: pointer; }
.rs-profile textarea, .rs-savebar input { width: 100%; }
.rs-savebar { position: sticky; bottom: 8px; margin-top: 14px; z-index: 5; }
.score-rubric { margin: 0; padding: 10px 14px; }
.score-rubric h4 { margin: 12px 0 6px; font-size: 13px; }
.score-rubric summary { cursor: pointer; }
.score-rubric td.nowrap, .card td.nowrap { white-space: nowrap; }
.slide-class { display: inline-block; font-size: 14px; padding: 2px 10px; border-radius: 10px; border: 1px solid #ddd; color: #333; background: #f5f5f5; }
.slide-class.good { color: #1e6b3a; background: #e6f4ea; border-color: #b7dfc3; }
.slide-class.accent { color: #8a3d1a; background: #fbeee6; border-color: #e8c3b0; }
.slide-class.warn { color: #7a5a00; background: #fff5d6; border-color: #ecd790; }
.slide-class.bad { color: #8a1c1c; background: #fdeaea; border-color: #efb9b9; }
.slide-class.big { font-size: 20px; padding: 4px 14px; }
.slide-score { font-size: 13px; color: #5f6368; margin-top: 3px; }
.slide-score.big { font-size: 18px; color: #333; margin: 0; }
.slide-qline { font-size: 15px; margin: 0 0 8px; color: #333; }
.slide-qline.warn { color: #7a5a00; }
.slide-table.qual td { font-size: 13px; padding: 4px 8px 4px 0; }
.slide-col ul li { font-size: 15px; }
.slide-qline.small { font-size: 13.5px; margin-bottom: 6px; line-height: 1.32; }
.slide-col ul.slide-qlist li { font-size: 13.5px; margin-bottom: 4px; line-height: 1.3; }
.slide-qualification .slide-col h3 { margin: 8px 0 4px; }

/* ---------- Report decks: an Insights report run as slides (reports.js) ---------- */
.report-deck-stage { width: 100%; }
.report-deck-thumbs { flex-direction: row; overflow-x: auto; max-height: none; margin-top: 10px; padding-bottom: 4px; }
.slide-tile.ink .n { color: #1d1d1f; }
.slide-tile .was { font-size: 13px; color: #5f6368; margin-top: 6px; }
.slide-trend { margin-top: auto; }
.slide-trend-title { font-size: 15px; color: #5f6368; margin-bottom: 8px; }
.slide-trend-plot { display: flex; align-items: flex-end; gap: 0; height: 200px; border-bottom: 1px solid #c9c9c9; }
.slide-trend-plot .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.slide-trend-plot .bar { width: 24px; background: #b4532a; border-radius: 4px 4px 0 0; }
.slide-trend-plot .v { font-size: 15px; color: #1d1d1f; margin-bottom: 4px; min-height: 20px; }
.slide-trend-plot .m { position: absolute; bottom: -24px; font-size: 14px; color: #5f6368; }
.slide-trend-note { font-size: 13px; color: #8a8a8a; margin-top: 30px; }
.slide-impact { font-size: 17px; color: #444; border-top: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5; padding: 6px 0; margin-bottom: 4px; }
.slide-examples { margin-top: auto; padding-top: 10px; font-size: 14px; color: #444; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.slide-examples .k { color: #8a8a8a; text-transform: uppercase; letter-spacing: .05em; font-size: 12px; align-self: center; }
.slide-examples .ex { max-width: 520px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-close { display: grid; gap: 18px; }
.slide-close .item h3 { margin-top: 0; }
.slide-close .slide-examples { margin-top: 6px; padding-top: 0; }
.slide ul.slide-big-list li { font-size: 22px; margin-bottom: 14px; }
/* Read from across a room: larger than prospect slides, which carry more. */
.slide-insight-summary .slide-table { margin-top: 18px; }
.slide-insight-summary .slide-table th { font-size: 14px; }
.slide-insight-summary .slide-table td { font-size: 21px; padding: 16px 14px 16px 0; }
.slide-insight-problem .slide-col ul li { font-size: 21px; margin-bottom: 12px; line-height: 1.3; }
.slide-insight-problem .slide-col h3 { font-size: 16px; }
.slide-insight-problem .slide-impact { font-size: 19px; }
.slide-insight-close .item { font-size: 21px; }
.slide-insight-close .item h3 { font-size: 17px; }

/* ---------- Prospect reports: a document to print or save as a PDF ---------- */
#report-print { display: none; }
@media print {
  body.printing-report > *:not(#report-print) { display: none !important; }
  body.printing-report { background: #fff !important; margin: 0; }
  body.printing-report #report-print { display: block; }
  #report-print { padding: 0.7in 0.75in; box-decoration-break: clone; -webkit-box-decoration-break: clone; color: #1d1d1f; font-family: var(--font, system-ui, -apple-system, "Segoe UI", sans-serif); font-size: 10.5pt; line-height: 1.45; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #report-print .rp-page { break-before: page; }
  #report-print .rp-page:first-child { break-before: auto; }
  #report-print h1 { font-size: 22pt; margin: 4pt 0 4pt; color: #111; }
  #report-print h2 { font-size: 13pt; margin: 16pt 0 6pt; color: #b4532a; border-bottom: 1px solid #e5e5e5; padding-bottom: 3pt; break-after: avoid; }
  #report-print h3 { font-size: 10.5pt; margin: 10pt 0 3pt; color: #333; break-after: avoid; }
  #report-print p { margin: 0 0 6pt; }
  #report-print a { color: #1d4ed8; text-decoration: none; }
  #report-print ul, #report-print ol { margin: 0 0 6pt 16pt; padding: 0; }
  #report-print li { margin-bottom: 3pt; }
  #report-print .rp-kicker { font-size: 9pt; color: #5f6368; text-transform: uppercase; letter-spacing: .05em; }
  #report-print .rp-meta { font-size: 10pt; color: #5f6368; margin-bottom: 6pt; }
  #report-print .rp-conf { font-size: 9pt; color: #8a8a8a; margin: 4pt 0 10pt; }
  #report-print .rp-cover h1 { font-size: 28pt; margin-top: 18pt; }
  #report-print .rp-next { background: #f6f6f4; border-radius: 4pt; padding: 6pt 8pt; margin: 6pt 0; }
  #report-print .rp-qhead { display: flex; align-items: baseline; gap: 10pt; margin-bottom: 6pt; flex-wrap: wrap; }
  #report-print .rp-score { font-size: 12pt; }
  #report-print .rp-small { font-size: 8.5pt; color: #5f6368; }
  #report-print .rp-faint { color: #8a8a8a; }
  #report-print .rp-nowrap { white-space: nowrap; }
  #report-print .rp-field p { white-space: pre-wrap; }
  #report-print .rp-table { width: 100%; border-collapse: collapse; margin: 2pt 0 8pt; font-size: 9pt; }
  #report-print .rp-table th { text-align: left; font-size: 8pt; text-transform: uppercase; letter-spacing: .04em; color: #5f6368; border-bottom: 1.5px solid #ddd; padding: 3pt 6pt 3pt 0; }
  #report-print .rp-table td { border-bottom: 1px solid #eee; padding: 4pt 6pt 4pt 0; vertical-align: top; }
  #report-print .rp-table tr { break-inside: avoid; }
  #report-print .rp-break { break-before: page; }
  #report-print .rp-dossier { white-space: pre-wrap; font-size: 9pt; line-height: 1.4; }
  #report-print .rp-sources li { font-size: 9pt; }
  #report-print .rp-sources .rp-small { word-break: break-all; }
  /* An Insights report: its answer, with ticket numbers as plain text. */
  #report-print .rp-answer { margin-top: 12pt; }
  #report-print .rp-answer ol > li { margin-bottom: 8pt; }
  #report-print .rp-answer ul { margin-top: 3pt; }
  #report-print .cite { border: 0; background: none; padding: 0; margin: 0 1pt; font: inherit; font-size: 8.5pt; color: #5f6368; }
}
.fit-questions { margin: 4px 0 0 18px; padding: 0; }
.fit-questions > li { margin-bottom: 6px; }
ul.fit-why { margin: 2px 0 0 16px; padding: 0; list-style: circle; color: var(--muted); }
.fit-moves { font-style: italic; }
.slide ul.fit-why { color: #5f6368; margin-left: 14px; }
.slide ul.fit-why li { font-size: 12px; margin-bottom: 2px; }
#report-print ul.fit-why { color: #5f6368; font-size: 9pt; }
.slide-qualification .slide-qline.small { font-size: 13px; }
.slide-qualification ul.slide-qlist li { font-size: 13px; }
.slide-qualification ul.fit-why li { font-size: 11.5px; }
.spinner-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: spin-dot .8s linear infinite; flex: none; }
@keyframes spin-dot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner-dot { animation-duration: 2.4s; } }
.notice.scoring-status { display: flex; align-items: center; }

/* What LSINC knows: Tell Mímir, links, the knowledge card, the machine import */
.ck-section { padding: 8px 0; border-top: 1px solid var(--border); }
.ck-section:first-of-type { border-top: 0; }
.ck-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.ck-fleet { padding: 5px 0; }
.ck-sub { margin: 2px 0 4px 14px; padding-left: 10px; border-left: 2px solid var(--border); }
.ck-link { padding: 5px 0; }
.ck-tell { margin-top: 8px; }
.ck-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.ck-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-top: 6px; align-items: end; }
.ck-grid input, .ck-grid select { width: 100%; min-width: 0; }
.ck-company { display: block; flex: 1; min-width: 0; }
.ck-co-field { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.ck-co-field .ck-company { width: 100%; }
.ck-company input { width: 100%; }
.ck-import { width: min(860px, calc(100vw - 32px)); padding: 18px 20px; }
.ck-table-wrap { overflow-x: auto; margin-top: 10px; }
.ck-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ck-table th, .ck-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ck-table tr.ck-dup td { background: var(--warn-soft, rgba(255, 180, 0, .08)); }
.rs-product { padding: 10px 0; border-bottom: 1px solid var(--border); display: grid; gap: 6px; }
.rs-product:last-child { border-bottom: 0; }
.rs-product input[type=text] { width: auto; min-width: 140px; flex: 1; }
.rs-product select { width: auto; }
.rs-product.eol { border-left: 3px solid var(--warn); padding-left: 10px; }

/* Applying research to an account Mímir already has */
.apply-panel { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.apply-section { margin-top: 10px; }
.apply-head { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.apply-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.apply-row:last-child { border-bottom: 0; }
.apply-row input { margin-top: 3px; }
.apply-now, .apply-found { font-size: 12.5px; margin-top: 2px; white-space: pre-wrap; }
.apply-now { color: var(--muted); }

/* Contract hours */
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.hours-dialog { width: min(500px, calc(100vw - 32px)); padding: 18px 20px; }
.hours-code { font-size: 13px; padding: 7px 10px; border-radius: var(--radius); background: var(--accent-soft); }
.hours-account { padding: 10px 0; border-top: 1px solid var(--border); }
.hours-account:first-of-type { border-top: 0; padding-top: 4px; }
.hours-account.low { border-left: 3px solid var(--warn); padding-left: 10px; }
.hours-account.over { border-left: 3px solid var(--bad); padding-left: 10px; }
.hours-left { font-size: 20px; font-weight: 620; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hours-account.over .hours-left { color: var(--bad); }
.hours-entry { padding: 7px 0; border-top: 1px solid var(--border); display: grid; gap: 2px; font-size: 13.5px; }
.hours-entry.struck .hours-amount { text-decoration: line-through; color: var(--faint); }
.hours-amount { font-variant-numeric: tabular-nums; font-weight: 600; }
.hours-amount.plus { color: var(--good); }
.hours-mini-list { display: grid; gap: 4px; font-size: 13.5px; }
.hours-table .num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
  .hours-table { display: block; overflow-x: auto; }
}

/* Calendar. Each kind of event has its own tint; travel days are the same
   tint, lighter and dashed. */
:root {
  --cal-service: #dbe8f5;  --cal-service-ink: #24527d;
  --cal-show: #ece2f4;     --cal-show-ink: #5b3a7a;
  --cal-visit: #f5ebe4;    --cal-visit-ink: #8a4b2a;
  --cal-meeting: #ebe9e4;  --cal-meeting-ink: #4a4740;
  --cal-pto: #e8f2eb;      --cal-pto-ink: #2f6b46;
  --cal-out: #f7f0dd;      --cal-out-ink: #8a6a1f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --cal-service: #1c2a38;  --cal-service-ink: #9cc3ea;
    --cal-show: #2b2236;     --cal-show-ink: #cdb0e6;
    --cal-visit: #33251b;    --cal-visit-ink: #e0a77f;
    --cal-meeting: #2a2922;  --cal-meeting-ink: #cfcabd;
    --cal-pto: #1c2b21;      --cal-pto-ink: #8fd0a6;
    --cal-out: #2d2718;      --cal-out-ink: #e0c274;
  }
}
.cal-controls { justify-content: space-between; margin: 10px 0 12px; }
.cal-controls select { width: auto; }
.cal-month { min-width: 150px; text-align: center; font-size: 16px; }
.cal-scroll { overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); min-width: 770px; }
.cal-dow { font-size: 12px; color: var(--muted); padding: 6px 8px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); }
.cal-day { min-height: 104px; padding: 4px 5px 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; gap: 3px; cursor: default; }
.cal-day.weekend { background: var(--bg); }
.cal-day.other .cal-date { color: var(--faint); }
.cal-day.today .cal-date { background: var(--accent); color: var(--surface); border-radius: 10px; padding: 0 7px; align-self: flex-start; }
.cal-date { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cal-chip {
  appearance: none; font: inherit; text-align: left; cursor: pointer; width: 100%;
  font-size: 12px; line-height: 1.3; padding: 2px 5px; border-radius: 4px; border: 1px solid transparent;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 4px; align-items: center;
}
.cal-chip .cal-who { margin-left: auto; font-size: 10.5px; opacity: .75; flex: none; }
.cal-chip.travel { opacity: .7; border-style: dashed; background: transparent !important; }
.cal-chip.conflict { border-color: var(--bad); }
.cal-travel-mark { font-style: italic; }
.cal-warn { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: var(--bad); color: var(--surface); font-size: 10px; font-weight: 700; flex: none; }
.k-service_visit { background: var(--cal-service); color: var(--cal-service-ink); border-color: var(--cal-service-ink); }
.k-convention    { background: var(--cal-show);    color: var(--cal-show-ink);    border-color: var(--cal-show-ink); }
.k-client_visit  { background: var(--cal-visit);   color: var(--cal-visit-ink);   border-color: var(--cal-visit-ink); }
.k-meeting, .k-other { background: var(--cal-meeting); color: var(--cal-meeting-ink); border-color: var(--cal-meeting-ink); }
.k-pto           { background: var(--cal-pto);     color: var(--cal-pto-ink);     border-color: var(--cal-pto-ink); }
.k-out_of_office { background: var(--cal-out);     color: var(--cal-out-ink);     border-color: var(--cal-out-ink); }
.cal-chip:not(.travel):not(.conflict) { border-color: transparent; }
table.cal-people { border-collapse: collapse; font-size: 12px; min-width: 100%; }
table.cal-people th, table.cal-people td { border: 1px solid var(--border); padding: 0; text-align: center; min-width: 24px; height: 28px; }
table.cal-people thead th { font-weight: 600; padding: 3px 0; background: var(--surface); }
table.cal-people .weekend { background: var(--bg); }
table.cal-people .cal-person { text-align: left; padding: 0 10px; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 500; }
.cal-block { appearance: none; width: 100%; height: 26px; border: 0; cursor: pointer; font: 700 11px/1 inherit; color: var(--bad); }
.cal-block.travel { opacity: .55; background-image: repeating-linear-gradient(135deg, transparent 0 4px, rgba(127, 127, 127, .25) 4px 6px); }
.cal-block.conflict { outline: 2px solid var(--bad); outline-offset: -2px; }
.cal-dialog[open] { width: min(640px, calc(100vw - 32px)); padding: 0; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.cal-dialog .board-dialog-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 16px 20px 8px; }
.cal-dialog .cal-dialog-body { padding: 4px 20px 10px; flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
.cal-dialog .board-dialog-head, .cal-dialog-foot { flex: none; }
.cal-dialog-foot { padding: 10px 20px 16px; border-top: 1px solid var(--border); gap: 8px; }
.cal-people-pick { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; max-height: 140px; overflow-y: auto; }
.cal-dialog [hidden] { display: none !important; }
@media (max-width: 600px) {
  .cal-controls { flex-direction: column; align-items: stretch; }
}

/* ---------------------------------------------------------------------------
   Ask Mímir: the panel beside every page. The page keeps working on the
   left; the panel scrolls on its own on the right. Narrow screens get it
   as a full-screen overlay instead.
   --------------------------------------------------------------------------- */
:root { --ask-w: 420px; }
body.ask-open { padding-right: var(--ask-w); }
.ask-toggle {
  appearance: none; border: 1px solid var(--border); background: var(--surface); font: inherit; color: var(--text);
  padding: 5px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.ask-toggle:hover { border-color: var(--accent); color: var(--accent); }
.ask-toggle.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 560; }
.ask-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: var(--ask-w); z-index: 25;
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border);
}
.ask-panel[hidden] { display: none; }
.ask-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 1; touch-action: none; }
.ask-resize:hover { background: var(--accent-soft); }
.ask-head { padding: 10px 14px 8px; border-bottom: 1px solid var(--border); }
.ask-thread-title { margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-close { font-size: 18px; line-height: 1; padding: 2px 8px; }
.ask-log, .ask-history { flex: 1; overflow-y: auto; padding: 12px 14px; overscroll-behavior: contain; }
.ask-log[hidden], .ask-history[hidden] { display: none; }
.ask-turn { margin-bottom: 18px; }
.ask-q { background: var(--accent-soft); border-radius: 10px; padding: 8px 11px; margin-left: 24px; }
.ask-q-text { white-space: pre-wrap; word-break: break-word; }
.ask-q-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ask-rewritten { flex-basis: 100%; font-style: italic; }
.ask-price { margin-top: 4px; text-align: right; }
.ask-price:empty { display: none; }
.ask-a { margin-top: 8px; }
.ask-a .card.search-answer { margin: 0; }
.ask-a h2 { font-size: 14px; margin: 12px 0 6px; }
.ask-a .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ask-results { margin-top: 8px; }
.ask-results > summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.ask-results .ticket-row { margin-top: 6px; }
.ask-empty { display: grid; gap: 10px; padding-top: 6px; }
.ask-starters { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ask-starters button { text-align: left; white-space: normal; }
.ask-compose { border-top: 1px solid var(--border); padding: 10px 14px 12px; display: grid; gap: 8px; }
.ask-context { display: flex; align-items: center; gap: 6px; }
.ask-context[hidden] { display: none; }
.ask-mode, .ask-client { width: auto; min-width: 0; flex: 1; font-size: 13px; }
.ask-client[hidden] { display: none; }
.ask-box { width: 100%; resize: vertical; min-height: 54px; max-height: 40vh; }
.ask-box.email { min-height: 140px; }
.ask-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-guide-link { margin-top: 4px; }
.ask-thread-row { display: flex; gap: 6px; align-items: flex-start; border-bottom: 1px solid var(--border); padding: 6px 0; }
.ask-thread { flex: 1; text-align: left; appearance: none; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; padding: 4px 0; min-width: 0; }
.ask-thread:hover { color: var(--accent); }
.ask-fab {
  display: none; position: fixed; right: 16px; bottom: 16px; z-index: 24;
  appearance: none; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 560;
  padding: 10px 18px; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
@media (max-width: 1000px) {
  body.ask-open { padding-right: 0; overflow: hidden; }
  .ask-panel { left: 0; width: auto; z-index: 40; }
  .ask-resize { display: none; }
  .ask-fab { display: block; }
  body.ask-open .ask-fab { display: none; }
  .ask-toggle { display: none; }
}
@media print { .ask-panel, .ask-fab { display: none !important; } body.ask-open { padding-right: 0; } }

/* How LSINC measures up (market.js) */
.market-scroll { overflow-x: auto; }
.market-table { border-collapse: collapse; width: 100%; font-size: 0.9em; }
.market-table th, .market-table td { padding: 6px 8px; border-top: 1px solid var(--border); text-align: left; vertical-align: top; }
.market-table thead th { border-top: none; font-weight: 600; white-space: nowrap; }
.market-table tbody th { font-weight: normal; min-width: 160px; }
.market-table .market-us { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.market-table .market-none { color: var(--muted, #888); }
.market-detail { margin-top: 10px; padding: 10px; border: 1px dashed var(--border); border-radius: 8px; }
.market-bar-row { display: grid; grid-template-columns: minmax(80px, 140px) 1fr minmax(90px, auto); gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); }
.market-bar-label { overflow-wrap: anywhere; }
.market-bar-track { background: var(--border); border-radius: 4px; height: 10px; }
.market-bar { background: var(--muted, #888); border-radius: 4px; height: 10px; }
.market-bar.us { background: var(--accent); }
.market-cite { display: inline; border: 1px solid var(--border); background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 0 7px; font-size: 0.85em; line-height: 1.5; cursor: pointer; margin: 0 1px; }
.market-cite:hover { border-color: var(--accent); }

/* Custom sections on the client page (client-sections.js). */
.csec-row:last-of-type { border-bottom: 0; }
.csec-dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.csec-dl dt { font-weight: 560; color: var(--muted); }
.csec-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .csec-dl { grid-template-columns: 1fr; } .csec-dl dd { margin-bottom: 6px; } }
.csec-table-wrap { overflow-x: auto; }
.csec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.csec-table th { text-align: left; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); padding: 0 10px 6px 0; white-space: nowrap; }
.csec-table td { padding: 6px 10px 6px 0; border-top: 1px solid var(--border); vertical-align: top; }
.csec-mini { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }

/* ---------- client briefing: the podcast card and its transcript ---------- */
.brief-transcript { margin-top: 10px; max-height: 420px; overflow-y: auto; border-top: 1px solid var(--border); }
.brief-turn { padding: 8px 0; border-top: 1px solid var(--border); }
.brief-turn:first-child { border-top: 0; }
.brief-turn.unfound { background: var(--warn-soft, transparent); }

/* "Research again" on a company's Research card (prospects.js, researchAgain). */
.research-again { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* Notes on a client (client-notes.js): the Diagnose timeline, with images. */
.client-notes .tl-body:empty { display: none; }
.note-tray { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.note-tray[hidden] { display: none; }
.note-tray-item { position: relative; width: 84px; height: 64px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--bg); }
.note-tray-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.note-tray-x {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, 0.65); color: #fff; font-size: 14px; line-height: 20px; padding: 0; cursor: pointer;
}
.note-images { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.note-images img { max-width: 220px; max-height: 160px; border-radius: 6px; border: 1px solid var(--border); display: block; }
.note-composer textarea.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* Who sees what (access-view.js): the tooltip by the mouse, the bar at the foot, and an outline on what is hovered. */
.access-tip {
  position: fixed; z-index: 1000; max-width: 320px; pointer-events: none;
  padding: 9px 11px; border-radius: var(--radius); font-size: 12.5px; line-height: 1.4;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.access-tip[hidden] { display: none; }
.access-name { font-weight: 620; margin-bottom: 6px; }
.access-line { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 4px; }
.access-k { color: var(--muted); min-width: 72px; }
.access-role { padding: 1px 7px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; }
.access-role.all { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.access-note { color: var(--muted); margin-top: 4px; }
.access-outer { color: var(--faint); margin-top: 6px; border-top: 1px solid var(--border); padding-top: 5px; }
.access-perm { color: var(--faint); font-size: 11px; margin-top: 5px; font-family: ui-monospace, monospace; }
.access-perm:empty { display: none; }
.access-bar {
  position: fixed; z-index: 999; left: 50%; bottom: 16px; transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--accent); box-shadow: var(--shadow); font-size: 13px;
}
.access-bar[hidden] { display: none; }
body.access-view .access-hover { outline: 2px dashed var(--accent); outline-offset: 2px; }

/* Our company (our-company.js): rows and numbers on its cards. */
.ours-machine { padding: 8px 0; border-top: 1px solid var(--border); }
.ours-machine:first-of-type { border-top: 0; }
.ours-row { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--border); }
.ours-row:first-of-type { border-top: 0; }
button.ours-stat { appearance: none; font: inherit; color: inherit; text-align: left; cursor: pointer; margin: 0; }
button.ours-stat:hover { border-color: var(--accent); }
.card.stat.ours-us .n { color: var(--accent); }
.ours-themes { width: 100%; border-collapse: collapse; }
.ours-themes th, .ours-themes td { text-align: left; padding: 5px 6px; border-top: 1px solid var(--border); vertical-align: top; }
.ours-themes th { color: var(--muted); font-weight: 500; }
.ours-themes td:nth-child(n+2), .ours-themes th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.ours-yes { color: var(--good); }
.ours-none { color: var(--warn); }

/* Printer Upkeep (upkeep.js). Made for a phone held at the machine: big
   targets, one column, the save button always in reach. */
.good-text { color: var(--good); }
.upkeep-stats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.upkeep-group { margin-bottom: 18px; }
.upkeep-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.upkeep-card { cursor: pointer; display: grid; gap: 10px; border-left: 3px solid var(--border); }
.upkeep-card:hover { border-color: var(--accent); }
.upkeep-card.state-attention { border-left-color: var(--bad); }
.upkeep-card.state-missed { border-left-color: var(--warn); }
.upkeep-card.state-due { border-left-color: var(--accent); }
.upkeep-card.state-done { border-left-color: var(--good); }
.upkeep-card-main { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.upkeep-name { font-weight: 620; font-size: 16px; }
.upkeep-go { width: 100%; padding: 11px 18px; }
.upkeep-thumb { padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
  width: 64px; height: 64px; overflow: hidden; cursor: zoom-in; flex: none; }
.upkeep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upkeep-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.upkeep-thumbs:empty { display: none; }
.upkeep-photos-big { display: flex; gap: 8px; flex-wrap: wrap; }
.upkeep-photos-big .upkeep-thumb { width: 140px; height: 140px; }
.upkeep-head { margin-bottom: 12px; }
.upkeep-today { margin-bottom: 12px; }
.upkeep-part { display: flex; gap: 10px; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.upkeep-part:first-of-type { border-top: 0; }
.upkeep-today h3 + .upkeep-part { border-top: 0; padding-top: 2px; }
.upkeep-issue { padding: 10px 0; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.upkeep-issue:first-of-type { border-top: 0; }
.upkeep-fixed { margin-top: 10px; }
.upkeep-fixed summary { cursor: pointer; }
.card + .card.upkeep-sheet-card, .upkeep-head + .card, .upkeep-today + .card { margin-top: 12px; }
.upkeep-sheet-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.upkeep-sheet { border-collapse: collapse; width: 100%; font-size: 13px; }
.upkeep-sheet th, .upkeep-sheet td { border-bottom: 1px solid var(--border); padding: 5px 6px; text-align: center; vertical-align: middle; }
.upkeep-sheet tbody th { text-align: left; font-weight: 500; color: var(--muted); min-width: 130px; }
.upkeep-sheet td { min-width: 52px; }
.upkeep-sheet td.missed { background: var(--warn-soft); }
.upkeep-sheet .upkeep-thumb { width: 40px; height: 40px; }
.upkeep-sheet tr.upkeep-section td { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--faint); padding-top: 12px; border-bottom: 0; }
.upkeep-sheet tr.upkeep-sign td { font-size: 12px; color: var(--muted); }
.upkeep-daybtn { font: inherit; font-weight: 600; background: none; border: 1px solid transparent; border-radius: var(--radius);
  padding: 3px 6px; cursor: pointer; color: var(--text); display: inline-flex; flex-direction: column; line-height: 1.2; }
.upkeep-daybtn:hover:not(:disabled) { border-color: var(--accent); }
.upkeep-daybtn.today { background: var(--accent-soft); color: var(--accent); }
.upkeep-daybtn:disabled { color: var(--faint); cursor: default; }
.upkeep-yes { color: var(--good); font-weight: 700; }
.upkeep-no { color: var(--bad); }
.upkeep-flag { color: var(--bad); font-weight: 560; }
.upkeep-note { cursor: help; color: var(--muted); }

.upkeep-dialog { width: min(560px, calc(100vw - 16px)); }
.upkeep-dialog-body { padding: 14px 18px 0; overflow: auto; }
.upkeep-form-section { padding: 12px 0; border-top: 1px solid var(--border); }
.upkeep-form-section:first-child { border-top: 0; padding-top: 0; }
.upkeep-item { padding: 8px 0; }
.upkeep-task { display: flex; gap: 12px; align-items: center; padding: 9px 0; font-size: 15px; cursor: pointer; }
.upkeep-task input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; margin: 0; }
.upkeep-question { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 7px 0; font-size: 15px; }
.upkeep-choices { display: flex; gap: 6px; flex: none; }
.upkeep-choice, .upkeep-ink { font: inherit; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: var(--radius); cursor: pointer; min-height: 40px; }
.upkeep-choice { min-width: 58px; padding: 6px 12px; }
.upkeep-choice[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.upkeep-inks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.upkeep-ink { min-width: 40px; padding: 4px 8px; font-family: var(--mono); font-weight: 600; }
.upkeep-ink[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.upkeep-nozzles .upkeep-ink[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); }
.upkeep-nozzles { display: grid; gap: 8px; margin-top: 6px; }
.upkeep-tunnel { display: flex; gap: 8px; align-items: center; }
.upkeep-tunnel .upkeep-inks { margin-top: 0; }
.upkeep-tunnel-name { font-weight: 600; font-family: var(--mono); width: 26px; flex: none; }
.upkeep-photo-slot { padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); margin: 8px 0; }
.upkeep-photo-slot.required { border-color: var(--accent); }
.upkeep-camera { min-height: 40px; }
.upkeep-issue-list { display: grid; gap: 10px; margin-top: 8px; }
.upkeep-issue-list:empty { display: none; }
.upkeep-issue-entry { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--border-strong); border-left: 3px solid var(--bad);
  border-radius: var(--radius); }
.upkeep-add-issue { width: 100%; min-height: 42px; margin-top: 10px; }
.upkeep-save-bar { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 16px; border-top: 1px solid var(--border);
  display: grid; gap: 4px; }
.upkeep-save { width: 100%; padding: 12px 18px; }
@media (max-width: 600px) {
  .upkeep-cards { grid-template-columns: 1fr; }
  .upkeep-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .upkeep-dialog-body { padding: 12px 14px 0; }
}
.upkeep-last7 { margin-top: 6px; }
.upkeep-pct { font-weight: 600; }
.upkeep-pct.good { color: var(--good); }
.upkeep-pct.warn { color: var(--warn); }
.upkeep-pct.bad { color: var(--bad); }
.upkeep-card-issues { display: grid; gap: 4px; margin-top: 6px; }
.upkeep-card-issues .pill { font-size: 11.5px; padding: 1px 7px; }
.upkeep-ink.static { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 0; padding: 1px 6px; cursor: default; font-size: 12.5px; }
.upkeep-bottles { display: grid; gap: 8px; margin-top: 8px; }
.upkeep-bottles:empty { display: none; }
.upkeep-bottle { display: grid; grid-template-columns: minmax(110px, 1fr) 1.2fr 1fr; gap: 8px; align-items: end; padding: 8px 10px;
  border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); }
.upkeep-bottle-ink { align-self: center; font-weight: 600; }
.upkeep-bottle input { min-height: 40px; }
@media (max-width: 600px) { .upkeep-bottle { grid-template-columns: 1fr 1fr; } .upkeep-bottle-ink { grid-column: 1 / -1; } }
.upkeep-ink-table { width: 100%; border-collapse: collapse; }
.upkeep-ink-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 8px 6px 0; }
.upkeep-ink-table td { padding: 6px 8px 6px 0; border-top: 1px solid var(--border); vertical-align: top; }
.upkeep-ink-table .pill { font-size: 11.5px; padding: 1px 7px; margin-top: 2px; }
.upkeep-grades .upkeep-ink[data-grade="green"] { background: var(--good); border-color: var(--good); color: var(--surface); }
.upkeep-grades .upkeep-ink[data-grade="yellow"] { background: var(--warn); border-color: var(--warn); color: var(--surface); }
.upkeep-grades .upkeep-ink[data-grade="red"] { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.upkeep-grades .upkeep-ink[data-grade="missing"] { border-color: var(--bad); color: var(--bad); }
.upkeep-grade-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 4px; }
.upkeep-grade-legend .upkeep-ink.static { min-width: 14px; width: 14px; height: 14px; padding: 0; vertical-align: -2px; }
.upkeep-grade-legend .upkeep-ink[data-grade="green"] { background: var(--good); border-color: var(--good); }
.upkeep-grade-legend .upkeep-ink[data-grade="yellow"] { background: var(--warn); border-color: var(--warn); }
.upkeep-grade-legend .upkeep-ink[data-grade="red"] { background: var(--bad); border-color: var(--bad); }
.upkeep-grade-text { font-family: var(--mono); font-weight: 600; }
.upkeep-grade-text.green { color: var(--good); }
.upkeep-grade-text.yellow { color: var(--warn); }
.upkeep-grade-text.red { color: var(--bad); }

/* ---------------------------------------------------------------------------
   Forms (forms.js, form-fill.js)
   --------------------------------------------------------------------------- */
.form-builder-cols { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 14px; align-items: start; margin-top: 10px; }
@media (max-width: 760px) { .form-builder-cols { grid-template-columns: 1fr; } }
.form-outline { display: grid; gap: 10px; }
.form-outline-block { border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; background: var(--surface); }
.form-outline-page, .form-outline-q { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  background: none; border: 1px solid transparent; border-radius: var(--radius); padding: 6px 8px; color: var(--text); cursor: pointer; font: inherit; }
.form-outline-page { font-weight: 600; }
.form-outline-q { padding-left: 14px; font-size: 14px; }
.form-outline-page:hover, .form-outline-q:hover { background: var(--bg); }
.form-outline-page.active, .form-outline-q.active { border-color: var(--accent); background: var(--accent-soft); }
.form-editor-col { min-width: 0; }
.form-editor-col .field-label { margin-top: 10px; }
.form-rule { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); }
.form-rule select, .form-rule input { max-width: 220px; }
.form-problems { border: 1px solid var(--bad); background: var(--bad-soft); color: var(--text); border-radius: var(--radius); padding: 8px 12px; font-size: 14px; }
.form-problems.ok { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.form-problems ul { margin: 0; padding-left: 18px; }
.form-problems li.clickable { cursor: pointer; text-decoration: underline; text-decoration-color: var(--border-strong); }
.form-flow-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 6px; }
.form-flow .flow-node rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.5; }
.form-flow .flow-node:not(.flow-submit) { cursor: pointer; }
.form-flow .flow-node:not(.flow-submit):hover rect, .form-flow .flow-node:focus rect { stroke: var(--accent); }
.form-flow .flow-node:focus { outline: none; }
.form-flow .flow-submit rect { fill: var(--good-soft); stroke: var(--good); }
.form-flow .flow-bad rect { fill: var(--bad-soft); stroke: var(--bad); }
.form-flow .flow-title { fill: var(--text); font-size: 14px; font-weight: 600; }
.form-flow .flow-sub { fill: var(--muted); font-size: 12px; }
.form-flow .flow-edge { stroke: var(--muted); stroke-width: 1.4; }
.form-flow .flow-arrowhead { fill: var(--muted); }
.form-flow .flow-label { fill: var(--accent); font-size: 12px; }
.form-fill-dialog { width: min(680px, calc(100vw - 32px)); }
.form-question { padding: 10px 0; border-top: 1px solid var(--border); }
.form-question:first-of-type { border-top: 0; }
.form-question input[type="text"], .form-question input[type="email"], .form-question input[type="tel"],
.form-question input[type="url"], .form-question select, .form-question textarea { width: 100%; }
.form-q-label { font-weight: 600; margin-bottom: 4px; white-space: pre-wrap; }
.form-required { color: var(--bad); }
.form-question.has-error input, .form-question.has-error select, .form-question.has-error textarea { border-color: var(--bad); }
.form-q-error { color: var(--bad); font-size: 13px; margin-top: 4px; }
.form-error-box { border: 1px solid var(--bad); background: var(--bad-soft); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.form-choices { display: grid; gap: 6px; }
.form-info { padding: 10px 12px; background: var(--bg); border-radius: var(--radius); white-space: pre-wrap; }
#panel-forms .bad:not(.pill), .form-fill-dialog .bad:not(.pill) { color: var(--bad); }
