:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1d1f1a;
  --muted: #5d6157;
  --border: #d9d6cb;
  --accent: #2f3a2a;
  --accent-text: #ffffff;
  --open-bg: #fff1d6;
  --open-text: #7a4a00;
  --resolved-bg: #dff3e3;
  --resolved-text: #1f5a2c;
  --notice-bg: #fdecea;
  --notice-text: #7a1f17;
  --focus: #1a5fd0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15170f;
    --surface: #1f2218;
    --text: #ecebe3;
    --muted: #a3a79a;
    --border: #35382c;
    --accent: #cdd8c0;
    --accent-text: #14170f;
    --open-bg: #4a3a12;
    --open-text: #ffd98a;
    --resolved-bg: #1f3a26;
    --resolved-text: #a9e3b6;
    --notice-bg: #4a1f1b;
    --notice-text: #ffb4ab;
    --focus: #7fb0ff;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.session { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.content { max-width: 960px; margin: 0 auto; padding: 16px; outline: none; }
h2 { margin: 0 0 8px; font-size: 20px; line-height: 1.25; }
p { margin: 0 0 12px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  max-width: 560px;
  margin: 24px auto;
}
.panel.busy h2::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .panel.busy h2::after { animation: none; } }
.panel .btn + .btn { margin-left: 8px; }
.notice {
  background: var(--notice-bg);
  color: var(--notice-text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
}
.btn {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible, .content:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cases { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.case { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); }
.chip.status-open { background: var(--open-bg); color: var(--open-text); border-color: transparent; }
.chip.status-resolved { background: var(--resolved-bg); color: var(--resolved-text); border-color: transparent; }
.fields { margin: 0; display: grid; gap: 6px 16px; grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; min-width: 0; }
.field dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.field dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; }
@media (min-width: 640px) {
  .content { padding: 24px; }
  .fields { grid-template-columns: 90px 190px 1fr; }
  .bar { padding: 12px 24px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.noscript { padding: 16px; }

.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.panel.inline { max-width: none; margin: 12px 0; }
.panel.inline h3 { margin: 0 0 6px; font-size: 17px; }
h3 { margin: 20px 0 8px; font-size: 17px; line-height: 1.3; }
.detail-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.detail-fields { margin: 8px 0 0; }
.muted { color: var(--muted); }
.warn {
  background: var(--open-bg);
  color: var(--open-text);
  border-left: 4px solid var(--open-text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}
.chip-muted { color: var(--muted); font-weight: 500; }
.tally { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-width: 420px; }
.tally li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--border); padding: 2px 0; }
.reports, .artwork-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.report, .artwork-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.report .when { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.text-block { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 8px; }
.notes { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.art-title { margin: 0 0 4px; font-weight: 600; }
.art-path { margin: 0 0 8px; overflow-wrap: anywhere; color: var(--muted); }
.art-frame { margin: 8px 0; }
.artwork-img { display: block; max-width: 100%; height: auto; max-height: 70vh; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); }
.busy-line { color: var(--muted); }
.artwork-section { margin-top: 8px; }
.artwork-section .warn { margin: 0 0 12px; }
@media (min-width: 640px) {
  .detail-fields { grid-template-columns: 1fr 1fr; }
  .detail-fields .field.mono { grid-column: 1 / -1; }
  .art-fields { grid-template-columns: 1fr; }
}
.artwork-list + .btn, .artwork-section > .btn, .artwork-section > p + .btn { margin-top: 12px; }
