:root {
  --accent: #c2410c;
  --accent-soft: rgba(194, 65, 12, 0.12);
  --ink: #1c1917;
  --muted: #57534e;
  --panel: #ffffff;
  --ground: #faf7f2;
  --line: #e7e5e4;
  --danger: #b91c1c;
  --ok: #15803d;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--ground);
}

#app { max-width: 960px; margin: 0 auto; padding: 16px 16px 64px; }

header.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0 20px;
}
header.bar h1 { font-size: 26px; margin: 0; }
header.bar .who { color: var(--muted); font-size: 15px; }

h2 { font-size: 22px; margin: 24px 0 12px; }
h3 { font-size: 18px; margin: 20px 0 8px; }
p.hint { color: var(--muted); font-size: 16px; margin: 4px 0 12px; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}

button, .button {
  font: inherit; font-weight: 600; padding: 12px 18px; border-radius: 12px;
  border: 2px solid var(--accent); background: var(--accent); color: white; cursor: pointer;
}
button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button.small { padding: 8px 12px; font-size: 15px; }
button:disabled { opacity: 0.5; cursor: default; }
button.link { background: none; border: none; color: var(--accent); padding: 0; font-weight: 600; }

input, select, textarea {
  font: inherit; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  width: 100%; background: white;
}
label { display: block; font-weight: 600; margin: 12px 0 6px; }
label.inline { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 8px 0; }
label.inline input { width: auto; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > * { flex: 1 1 200px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

nav.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; }
nav.tabs button {
  background: white; color: var(--ink); border-color: var(--line);
}
nav.tabs button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
}
ul.list li:last-child { border-bottom: none; }
ul.list .main { flex: 1; min-width: 0; }
ul.list .title { font-weight: 600; }
ul.list .sub { color: var(--muted); font-size: 16px; }
ul.list .side { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.value { font-size: 20px; font-variant-numeric: tabular-nums; word-break: break-word; }
.inactive { opacity: 0.55; }

.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.status.done { background: #dcfce7; color: var(--ok); }
.status.pending { background: #fef3c7; color: #92400e; }
.status.missed, .status.skipped { background: #fee2e2; color: var(--danger); }

.message { padding: 12px 16px; border-radius: 10px; margin: 12px 0; font-size: 16px; }
.message.error { background: #fee2e2; color: var(--danger); }
.message.ok { background: #dcfce7; color: var(--ok); }

.code-input { font-size: 28px; letter-spacing: 0.3em; text-transform: uppercase; text-align: center; }

.turn { padding: 8px 0; border-bottom: 1px solid var(--line); }
.turn .meta { color: var(--muted); font-size: 14px; }
.turn.user .text::before { content: "Person: "; font-weight: 600; }
.turn.assistant .text::before { content: "Klara: "; font-weight: 600; color: var(--accent); }
.turn.tool { color: var(--muted); font-size: 15px; }

.perm { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.perm .yes { color: var(--ok); font-weight: 700; }
.perm .no { color: var(--muted); }

@media (max-width: 600px) {
  body { font-size: 17px; }
  ul.list li { flex-direction: column; }
  ul.list .side { justify-content: flex-start; }
}
