/* The client's web view of a daily report (2026-11-23, plan 097).
   Phone width first; plain and calm; light and dark follow the device. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1d2430;
  --muted: #5d6777;
  --line: #dde1e7;
  --accent: #1f5fa8;
  --accent-text: #ffffff;
  --ok: #1d7a46;
  --ok-bg: #e4f3ea;
  --bad: #a3361f;
  --bad-bg: #f8e6e1;
  --warn: #8a5a00;
  --warn-bg: #fbf0d9;
  --live: #1f5fa8;
  --live-bg: #e3edf9;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b2129;
    --text: #e7ebf0;
    --muted: #a0a9b6;
    --line: #2e3640;
    --accent: #6aa3e6;
    --accent-text: #0d1420;
    --ok: #7fd3a0;
    --ok-bg: #173325;
    --bad: #f0a08c;
    --bad-bg: #3a1f19;
    --warn: #f0c870;
    --warn-bg: #3a2f14;
    --live: #9cc4f2;
    --live-bg: #1a2b40;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

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

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

h1 { font-size: 1.35rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0 0 8px; }
p { margin: 0 0 8px; }

.calm { color: var(--muted); }
.small { font-size: 0.875rem; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 16px;
}
.narrow { max-width: 420px; margin: 24px auto; }

label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
input:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
textarea { resize: vertical; min-height: 4.5em; }

button { font: inherit; cursor: pointer; }
button:disabled { opacity: 0.6; cursor: default; }
.primary {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.link {
  border: 0;
  background: none;
  padding: 6px 0;
  color: var(--accent);
  text-decoration: underline;
}
#code-back { display: block; margin-top: 12px; }

.msg { color: var(--bad); margin-top: 8px; min-height: 0; }
.msg:empty { display: none; }

.head { margin: 0 0 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--line);
  color: var(--text);
}
.pill.quiet { font-weight: 500; }
.pill.live { background: var(--live-bg); color: var(--live); }
.pill.filed { background: var(--ok-bg); color: var(--ok); }

.area-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.area-head .calm { white-space: nowrap; }

.items { list-style: none; margin: 0; padding: 0; }
.items > li { padding: 12px 0; border-top: 1px solid var(--line); }
.items > li:first-child { border-top: 0; padding-top: 4px; }
.line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.title { font-weight: 500; overflow-wrap: anywhere; }
.state {
  flex: none;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
}
.state.ok { background: var(--ok-bg); color: var(--ok); }
.state.bad { background: var(--bad-bg); color: var(--bad); }
.state.warn { background: var(--warn-bg); color: var(--warn); }
.meta { color: var(--muted); font-size: 0.875rem; margin: 4px 0 0; }
.note { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumbs:empty { display: none; }
.thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.comments { list-style: none; margin: 0 0 8px; padding: 0; }
.comments > li { padding: 10px 0; border-top: 1px solid var(--line); }
.comments > li:first-child { border-top: 0; padding-top: 0; }
.comments .who { font-weight: 600; }
.comments .about { color: var(--muted); font-size: 0.875rem; margin: 2px 0 0; }
.comments .body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; }

dialog:not([open]) { display: none; }
.viewer {
  border: 0;
  padding: 12px;
  max-width: 96vw;
  max-height: 96vh;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  text-align: center;
}
.viewer::backdrop { background: rgba(0, 0, 0, 0.7); }
.viewer img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; }
