/* The desk's pages. Colours are theme-aware pairs (a fill and the ink on it), redefined for dark mode. */
:root {
  --bg: #f8fafd; --surface: #ffffff; --ink: #1f1f1f; --muted: #444746; --line: #dde3ea; --outline: #747775;
  --accent: #0b57d0; --on-accent: #ffffff; --focus: #0b57d0;
  --pri-c: #d3e3fd; --on-pri-c: #041e49; --sec-c: #c2e7ff; --on-sec-c: #001d35; --tert-c: #c4eed0; --on-tert-c: #0f5223;
  --err-c: #f9dedc; --on-err-c: #410e0b; --bad: #b3261e; --warn-c: #ffefc9; --on-warn-c: #3d2c00;
  --sc-low: #f0f4f9; --sc-high: #e9eef6;
  --font: "Google Sans", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131314; --surface: #1e1f20; --ink: #e3e3e3; --muted: #c4c7c5; --line: #3c4043; --outline: #8e918f;
    --accent: #a8c7fa; --on-accent: #062e6f; --focus: #a8c7fa;
    --pri-c: #0842a0; --on-pri-c: #d3e3fd; --sec-c: #004a77; --on-sec-c: #c2e7ff; --tert-c: #0f5223; --on-tert-c: #c4eed0;
    --err-c: #8c1d18; --on-err-c: #f9dedc; --bad: #f2b8b5; --warn-c: #4d3700; --on-warn-c: #ffefc9;
    --sc-low: #282a2c; --sc-high: #333537;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131314; --surface: #1e1f20; --ink: #e3e3e3; --muted: #c4c7c5; --line: #3c4043; --outline: #8e918f;
  --accent: #a8c7fa; --on-accent: #062e6f; --focus: #a8c7fa;
  --pri-c: #0842a0; --on-pri-c: #d3e3fd; --sec-c: #004a77; --on-sec-c: #c2e7ff; --tert-c: #0f5223; --on-tert-c: #c4eed0;
  --err-c: #8c1d18; --on-err-c: #f9dedc; --bad: #f2b8b5; --warn-c: #4d3700; --on-warn-c: #ffefc9;
  --sc-low: #282a2c; --sc-high: #333537;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 500; margin: 0 0 4px; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }
p { margin: 0 0 12px; }
code { font: 13px var(--mono); background: var(--sc-high); padding: 1px 6px; border-radius: 4px; }
.muted { color: var(--muted); }
.ic { width: 18px; height: 18px; flex: none; }

/* the bar */
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px;
  padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16px; min-height: 40px; }
.brand .ic { color: var(--accent); }
.bar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.nav, .me { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; color: var(--ink);
  text-decoration: none; font: 500 14px var(--font); background: none; border: 0; cursor: pointer; }
.nav:hover { background: var(--sc-high); }
.nav.on { background: var(--sec-c); color: var(--on-sec-c); }
.me { color: var(--muted); cursor: default; }
form.inline { display: inline; margin: 0; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 16px 0; padding: 10px 16px; border-radius: 12px;
  background: var(--warn-c); color: var(--on-warn-c); }
.banner span { flex: 1 1 240px; }

/* page bodies */
main { padding: 24px 16px 64px; margin: 0 auto; }
main.narrow { max-width: 560px; }
main.wide { max-width: 1100px; }
.head { margin-bottom: 16px; }
.row-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.help h1 { font-size: 28px; margin-bottom: 12px; }
.team-link { display: flex; align-items: center; gap: 8px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }

/* buttons, fields, chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 20px; border-radius: 999px;
  border: 0; font: 500 14px var(--font); cursor: pointer; text-decoration: none; }
.btn.filled { background: var(--accent); color: var(--on-accent); }
.btn.tonal { background: var(--sec-c); color: var(--on-sec-c); }
.btn.text { background: none; color: var(--accent); padding: 0 12px; }
.btn.text:hover, .btn.tonal:hover { filter: brightness(0.96); }
.btn.danger { color: var(--bad); }
.btn.big { min-height: 48px; padding: 0 28px; font-size: 15px; margin: 12px 0; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; border: 0;
  background: var(--surface); color: var(--ink); cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
input:not([type=checkbox]), select, textarea { font: 15px var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--outline);
  border-radius: 8px; padding: 9px 12px; min-height: 40px; width: 100%; min-width: 0; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.stack .field { align-self: stretch; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--outline);
  color: var(--ink); text-decoration: none; font: 500 14px var(--font); }
.chip.on { background: var(--sec-c); color: var(--on-sec-c); border-color: transparent; }
.chip .sel { width: 16px; height: 16px; }
.kind, .status { display: inline-flex; align-items: center; gap: 4px; padding: 1px 10px 1px 8px; border-radius: 999px; font: 500 12px/20px var(--font); }
.kind .ic { width: 14px; height: 14px; }
.k-issue { background: var(--err-c); color: var(--on-err-c); }
.k-question { background: var(--sec-c); color: var(--on-sec-c); }
.k-feature { background: var(--tert-c); color: var(--on-tert-c); }
.status { background: var(--pri-c); color: var(--on-pri-c); padding: 1px 10px; }
.status.shut { background: var(--sc-high); color: var(--ink); }
.err { color: var(--bad); }
.flash { padding: 8px 14px; border-radius: 8px; margin: 0 0 12px; }
.flash.ok { background: var(--tert-c); color: var(--on-tert-c); }
.flash.err { background: var(--err-c); color: var(--on-err-c); }
.fold > summary { cursor: pointer; color: var(--accent); font-weight: 500; min-height: 40px; display: flex; align-items: center; }
.fold[open] > summary { margin-bottom: 8px; }

/* the inbox */
section, .closed-group { margin: 0 0 20px; }
.group { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.group .n { background: var(--sc-high); color: var(--ink); border-radius: 999px; padding: 0 8px; letter-spacing: 0; }
.closed-group > summary { list-style: none; cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.closed-group > summary::-webkit-details-marker { display: none; }
.closed-group > summary .group::after { content: "show"; text-transform: none; letter-spacing: 0; color: var(--accent); font-weight: 500; }
.closed-group[open] > summary .group::after { content: "hide"; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.card { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; }
.card:hover { background: var(--sc-low); }
.card .t { font-weight: 600; font-size: 16px; }
.card .l2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--muted); }
.card .l3 { font-size: 13px; color: var(--muted); }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); background: var(--surface); border-radius: 12px; border: 1px dashed var(--line); }

/* one report */
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: -8px 0 8px -4px; text-decoration: none; font-weight: 500; }
.head .chips { margin: 8px 0; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.thread { display: flex; flex-direction: column; gap: 8px; background: var(--sc-low); border-radius: 12px; padding: 16px; }
.msg { display: flex; }
.msg.us { justify-content: flex-end; }
.msg .b { max-width: 85%; padding: 8px 14px 6px; border-radius: 16px; background: var(--surface); color: var(--ink); box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.msg.them .b { border-top-left-radius: 4px; }
.msg.us .b { background: var(--pri-c); color: var(--on-pri-c); border-top-right-radius: 4px; }
.msg .by { display: block; font-size: 12px; font-weight: 600; }
.msg p { margin: 2px 0 4px; white-space: pre-wrap; }
.msg time { display: block; font-size: 12px; opacity: .85; text-align: right; }
.reply { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-top: 8px; }
.reply .field { align-self: stretch; }
.reply .muted { align-self: stretch; font-size: 13px; margin: 0; }
.side { display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.ph { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-self: stretch; }
.shots { display: flex; flex-direction: column; gap: 8px; }
.shot img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; min-width: 0; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.lightbox::backdrop { background: rgba(0,0,0,.75); }
.lightbox img { display: block; max-width: 96vw; max-height: 90vh; border-radius: 8px; }
.lightbox form { position: absolute; top: 8px; right: 8px; margin: 0; }

/* settings */
.saved { font-size: 13px; min-height: 20px; margin: 0; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 20px; }
.srow { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 8px 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.srow:last-child { border-bottom: 0; }
.sl { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-top: 10px; }
.sv form { margin: 0; }
.sv > form > input[name=name] { max-width: 360px; }
.wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--sc-high); border: 2px solid var(--outline); flex: none; }
.track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--outline); transition: all .15s; }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { left: 18px; top: 2px; width: 16px; height: 16px; background: var(--on-accent); }
.switch input:focus-visible + .track { outline: 2px solid var(--focus); outline-offset: 2px; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; }
.inline-field input { width: 90px; }
.inline-field select { width: auto; }
.list { list-style: none; margin: 0 0 8px; padding: 0; }
.list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .who { font-weight: 500; }
.list .muted { font-size: 14px; flex: 1 1 auto; }
.list form { margin-left: auto; }
.invite { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 8px 0; }
.invite .field { flex: 1 1 220px; }
.sv .muted { font-size: 13px; margin: 8px 0 0; }
.once { padding: 12px 16px; border-radius: 12px; background: var(--warn-c); color: var(--on-warn-c); margin: 0 0 16px; }
.once p { margin: 0 0 6px; }
.once .muted { color: inherit; }
.once .tok { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.once code { background: var(--surface); color: var(--ink); font-size: 13px; padding: 4px 8px; word-break: break-all; }
.once .btn.text { color: inherit; }

@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .srow { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .sl { padding-top: 0; }
  .sheet { padding: 4px 16px; }
  .bar nav .nav span, .me span { display: none; }
  .bar nav .nav, .me { padding: 0 10px; }
  .msg .b { max-width: 92%; }
  main { padding-top: 16px; }
}
