/* Layout: one working surface. Sticky header with project switch, tab bar with live counts, then a single column of agent groups / lists. */
:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --sunk: #e9edeb;
  --fg: #17211e;
  --muted: #5d6b66;
  --line: #d5dcd9;
  --accent: #0f6b5c;
  --accent-fg: #ffffff;
  --accent-soft: #dcefea;
  --warn: #8a5a00;
  --warn-soft: #fbeecf;
  --info: #2b4f9c;
  --info-soft: #e0e8fa;
  --crit: #a3302a;
  --crit-soft: #f9e1df;
  --ok: #1f6b3a;
  --ok-soft: #dff2e5;
  --display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111715;
    --surface: #1a2220;
    --sunk: #232d2a;
    --fg: #e7eeeb;
    --muted: #9aa9a4;
    --line: #33403c;
    --accent: #4cc2ad;
    --accent-fg: #06211c;
    --accent-soft: #17362f;
    --warn: #f0c060;
    --warn-soft: #3a2e10;
    --info: #9db8f5;
    --info-soft: #1c2947;
    --crit: #f29a94;
    --crit-soft: #421d1b;
    --ok: #7fd79a;
    --ok-soft: #173322;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #111715;
  --surface: #1a2220;
  --sunk: #232d2a;
  --fg: #e7eeeb;
  --muted: #9aa9a4;
  --line: #33403c;
  --accent: #4cc2ad;
  --accent-fg: #06211c;
  --accent-soft: #17362f;
  --warn: #f0c060;
  --warn-soft: #3a2e10;
  --info: #9db8f5;
  --info-soft: #1c2947;
  --crit: #f29a94;
  --crit-soft: #421d1b;
  --ok: #7fd79a;
  --ok-soft: #173322;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.45;
}
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--surface);
}
.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 9;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding-block: 12px 8px;
}
h1 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.demo {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warn);
  background: var(--warn-soft);
  padding: 2px 8px;
  border-radius: 99px;
}
.spacer {
  flex: 1;
}
select,
input,
button {
  font: inherit;
  color: inherit;
}
select,
input[type='text'] {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  min-width: 0;
  max-width: 100%;
}
button,
.btn {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
button:hover,
.btn:hover {
  border-color: var(--muted);
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.danger {
  color: var(--crit);
}
.small {
  padding: 3px 9px;
  font-size: 13px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
nav button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  padding: 8px 10px;
  color: var(--muted);
}
nav button[aria-current='true'] {
  color: var(--fg);
  border-bottom-color: var(--accent);
}
.count {
  font-size: 12px;
  background: var(--sunk);
  border-radius: 99px;
  padding: 0 7px;
  font-variant-numeric: tabular-nums;
}
.count.hot {
  background: var(--warn-soft);
  color: var(--warn);
}
main {
  padding-block: 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  color: var(--muted);
}
.summary b {
  color: var(--fg);
  font-family: var(--display);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}
.group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.ghead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.ghead h2 {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.ghead .meta {
  color: var(--muted);
  font-size: 13px;
}
.scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
}
th,
td {
  text-align: left;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}
tr:last-child td {
  border-bottom: 0;
}
th {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  background: var(--sunk);
}
td.wrapcell {
  white-space: normal;
  min-width: 160px;
}
.unit,
.mono {
  font-family: var(--mono);
  font-size: 13px;
}
.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.chip.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.chip.info {
  background: var(--info-soft);
  color: var(--info);
}
.chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.chip.crit {
  background: var(--crit-soft);
  color: var(--crit);
}
.chip.none {
  color: var(--muted);
}
.item {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
  gap: 10px 16px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.item:last-child {
  border-bottom: 0;
}
.item .who {
  min-width: 0;
}
.item .edit {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.item .edit input {
  flex: 1 1 140px;
}
.item .acts {
  display: flex;
  gap: 6px;
}
.note {
  font-size: 12px;
  color: var(--muted);
}
.alert {
  font-size: 12px;
  color: var(--crit);
}
@media (max-width: 720px) {
  .item {
    grid-template-columns: 1fr;
  }
}
.empty {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
}
.tabs {
  display: flex;
  gap: 2px;
  padding: 8px 8px 0;
  background: var(--sunk);
  overflow-x: auto;
}
.tabs button {
  border-radius: 6px 6px 0 0;
  border-bottom: 0;
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.tabs button[aria-current='true'] {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--line);
}
.sheet td,
.sheet th {
  border-right: 1px solid var(--line);
  padding: 5px 10px;
  font-size: 13px;
}
.sheet .rn {
  background: var(--sunk);
  color: var(--muted);
  text-align: center;
  width: 36px;
  font-variant-numeric: tabular-nums;
}
.log {
  list-style: none;
  margin: 0;
  padding: 0;
}
.log li {
  display: flex;
  gap: 14px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}
.log li:last-child {
  border-bottom: 0;
}
.log time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 13px;
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 16, 0.55);
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top, 0px)) 16px 24px;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 100%;
  max-width: 520px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal h3 {
  font-family: var(--display);
  font-size: 16px;
  margin: 0;
  text-wrap: balance;
}
.modal .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
pre.msg {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--body);
  background: var(--ok-soft);
  color: var(--fg);
  border-radius: 8px;
  padding: 10px 12px;
}
label.f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.phone {
  max-width: 380px;
  border-radius: 22px;
  border-width: 6px;
  border-color: var(--sunk);
}
.url {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--sunk);
  border-radius: 99px;
  padding: 4px 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.case {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.case strong {
  display: block;
}
.done {
  text-align: center;
  padding: 26px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.tick {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.book {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 760px) {
  .book {
    grid-template-columns: 1fr;
  }
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.panel h2 {
  font-family: var(--display);
  font-size: 15px;
  margin: 0;
}
.drop {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 30px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.drop p {
  margin: 0;
  max-width: 52ch;
}
.photo {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
  display: block;
}
.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.sec {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}
label.f input,
label.f select {
  color: var(--fg);
  font-size: 14px;
}
label.f.unsure input {
  border-color: var(--warn);
  background: var(--warn-soft);
}
label.f.unsure::after {
  content: 'Hard to read. Check against the photo.';
  color: var(--warn);
}
.checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}
.checks .okc {
  color: var(--ok);
}
.checks .warnc {
  color: var(--warn);
}
.checks .critc {
  color: var(--crit);
}
.status {
  background: var(--sunk);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
div.f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.brow {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}
.bphoto {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.bphoto .btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bfields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}
.bfields .wide {
  grid-column: span 2;
}
.bfields .full {
  grid-column: 1/-1;
}
@media (max-width: 760px) {
  .brow {
    grid-template-columns: 1fr;
  }
  .bfields {
    grid-template-columns: 1fr;
  }
  .bfields .wide {
    grid-column: auto;
  }
  .brow > .x,
  .brow > .acts {
    justify-self: end;
  }
}
.attach {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--sunk);
  border-radius: 6px;
  padding: 7px 10px;
  min-width: 0;
}
.attach .doc {
  width: 11px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 2px;
  flex: none;
}
.fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--fg);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--accent-soft);
  color: var(--fg);
  border-radius: 99px;
  padding: 2px 2px 2px 10px;
  font-size: 13px;
}
.x {
  border: 0;
  background: none;
  padding: 2px 7px;
  font-size: 17px;
  line-height: 1;
  color: var(--muted);
}
.linkbtn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  font-weight: 400;
  font-size: 12px;
  align-self: flex-start;
  white-space: normal;
  text-align: left;
}
input.vh:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.gobar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
}
.gobar p {
  margin: 0;
  flex: 1 1 260px;
}
.acts.col {
  flex-direction: column;
}
.addrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--sunk);
}
.addrow label.f {
  flex: 1 1 180px;
}
.big {
  max-width: 720px;
}
.big img {
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid var(--line);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tag input.pct {
  width: 46px;
  padding: 1px 4px;
  text-align: right;
  border-radius: 4px;
  font-size: 13px;
  margin-left: 6px;
}
.tag.ext {
  background: var(--sunk);
  outline: 1px dashed var(--muted);
}
.addag {
  flex: 1 1 180px;
  min-width: 150px;
}
#toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--fg);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 8px;
  z-index: 30;
  max-width: calc(100% - 32px);
}
.banner {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: 8px;
  padding: 10px 14px;
}
.banner.crit {
  background: var(--crit-soft);
  color: var(--crit);
}
textarea {
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  resize: vertical;
  min-width: 0;
}
[hidden] {
  display: none !important;
}
html {
  color-scheme: light;
}
body {
  margin: 0;
}
img {
  max-width: 100%;
}
a {
  color: var(--accent);
}
