:root {
  --bg: #14161a; --surface: #1e2128; --line: #3a3f4a;
  --text: #f2f0ea; --muted: #a9adb5; --accent: #5cc8b6; --on-accent: #0b1412;
  --warn: #f0b45a; --danger: #ff8a80;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r: 12px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5f1; --surface: #ffffff; --line: #cfd2d8;
    --text: #1b1d22; --muted: #555b66; --accent: #0f7566; --on-accent: #ffffff;
    --warn: #8a5a00; --danger: #b3261e;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 Heebo, "Segoe UI", system-ui, -apple-system, sans-serif;
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
}
.top { padding: var(--s5) var(--s4) var(--s2); display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.top h1 { margin: 0; font-size: 28px; font-weight: 700; }
#view { flex: 1; overflow-y: auto; padding: var(--s2) var(--s4) var(--s5); }
#tabs {
  display: flex; background: var(--surface);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
#tabs a {
  flex: 1; min-height: 56px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 600;
  border-top: 3px solid transparent;
}
#tabs a[aria-current="page"] { color: var(--accent); border-top-color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h2 { font-size: 20px; margin: 0 0 var(--s3); }
.card { background: var(--surface); border-radius: var(--r); padding: var(--s4); margin-bottom: var(--s4); }
.field { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s3); }
.field label, .legend { font-size: 13px; font-weight: 600; color: var(--muted); }
.row { display: flex; gap: var(--s3); }
.row > .field { flex: 1; min-width: 0; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: var(--s3); border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
input[type="time"], input[type="date"] { direction: ltr; text-align: end; }
input[type="time"]::-webkit-datetime-edit, input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit-fields-wrapper, input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  direction: ltr;
}
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; min-height: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s4);
  border-radius: var(--r); border: 1px solid var(--line); color: var(--muted); font-weight: 600;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn {
  min-height: 48px; padding: 0 var(--s5); border-radius: var(--r); border: 0;
  background: var(--accent); color: var(--on-accent); font: 700 15px inherit; font-family: inherit; cursor: pointer;
}
.btn.ghost { background: none; border: 1px solid var(--line); color: var(--text); font-weight: 600; }
.actions { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.msg { font-size: 13px; color: var(--accent); min-height: 20px; }
.errors { color: var(--danger); font-size: 13px; margin: 0 0 var(--s3); padding-inline-start: var(--s4); }
.empty { text-align: center; color: var(--muted); padding: var(--s6) var(--s4); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.list { list-style: none; margin: 0; padding: 0; }
.list li { background: var(--surface); border-radius: var(--r); padding: var(--s3) var(--s4); margin-bottom: var(--s2); overflow-wrap: anywhere; }
.list .sub { display: block; font-size: 13px; color: var(--muted); }
