:root {
  --bg: #faf6f0;
  --card: #ffffff;
  --ink: #2a211c;
  --muted: #7a6b60;
  --line: #eadfd2;
  --accent: #b5482a;      /* terracotta */
  --accent-soft: #f6e3da;
  --olive: #5f6f3a;
  --olive-soft: #e8ecd9;
  --sky: #2f6690;
  --sky-soft: #dde9f3;
  --warn: #9a5b00;
  --warn-soft: #fbecd0;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 4px 14px rgba(60, 40, 20, .05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1613; --card: #241f1b; --ink: #f2ebe4; --muted: #a8988b; --line: #3a322c;
    --accent: #e7795a; --accent-soft: #3d2620; --olive: #b4c47f; --olive-soft: #2c3220;
    --sky: #8fbde0; --sky-soft: #1e2d3a; --warn: #f0b860; --warn-soft: #3a2c15;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1613; --card: #241f1b; --ink: #f2ebe4; --muted: #a8988b; --line: #3a322c;
  --accent: #e7795a; --accent-soft: #3d2620; --olive: #b4c47f; --olive-soft: #2c3220;
  --sky: #8fbde0; --sky-soft: #1e2d3a; --warn: #f0b860; --warn-soft: #3a2c15;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; line-height: 1.2; margin: 0; }
.muted { color: var(--muted); }
a { color: var(--accent); }

.top { padding: 20px 0 12px; }
.top .wrap { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }
.brand h1 { font-size: 30px; color: var(--accent); }
.brand p { margin: 2px 0 0; font-size: 14px; }
.clocks { display: flex; gap: 10px; }
.clock { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; min-width: 120px; box-shadow: var(--shadow); }
.clock .lbl { font-size: 12px; color: var(--muted); }
.clock .t { font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.clock .d { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 6px; margin-top: 4px; margin-bottom: 16px; }
.tabs a {
  flex: 1; text-align: center; text-decoration: none; color: var(--ink);
  padding: 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600;
}
.tabs a.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card h2 { font-size: 20px; margin-bottom: 10px; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }

.status { border-left: 5px solid var(--sky); }
.status .big { font-family: Fraunces, Georgia, serif; font-size: 22px; font-weight: 600; }
.status p { margin: 6px 0 0; }

.banner { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.banner strong { color: inherit; }

.kids { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kid { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.kid .n { font-weight: 600; }
.kid .n span { color: var(--muted); font-weight: 400; font-size: 13px; }
.kid .who { margin-top: 4px; display: inline-block; font-size: 14px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.kid .until { font-size: 13px; color: var(--muted); margin-top: 4px; }
.who.care { background: var(--olive-soft); color: var(--olive); }
.who.self { background: var(--sky-soft); color: var(--sky); }
.who.none { background: var(--warn-soft); color: var(--warn); }
.who.parents { background: var(--accent-soft); color: var(--accent); }

.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl li:first-child { border-top: 0; }
.tl .when { font-weight: 600; font-variant-numeric: tabular-nums; }
.tl .when small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.tl .what { min-width: 0; }
.tl .what .ttl { font-weight: 600; }
.tl .what .det { font-size: 14px; color: var(--muted); }
.tl li.past { opacity: .5; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 1px 7px; border-radius: 6px; margin-right: 6px; vertical-align: 1px; }
.tag.flight { background: var(--sky-soft); color: var(--sky); }
.tag.handoff { background: var(--olive-soft); color: var(--olive); }
.tag.event { background: var(--accent-soft); color: var(--accent); }
.tag.clock { background: var(--warn-soft); color: var(--warn); }
.empty { color: var(--muted); font-style: italic; margin: 0; }

.btn { display: block; width: 100%; text-align: center; padding: 14px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; font-size: 17px; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.chips a { flex: 0 0 auto; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 13px; text-align: center; line-height: 1.2; }
.chips a b { display: block; font-size: 16px; }
.chips a.today { border-color: var(--accent); color: var(--accent); }

.day.today { border: 2px solid var(--accent); }
.day .head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.day .head h2 { margin: 0; }
.pill { font-size: 12px; font-weight: 600; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 10px; }
.cov { list-style: none; padding: 0; margin: 0 0 10px; }
.cov li { font-size: 14px; padding: 4px 0; }
.cov li b { font-weight: 600; }
.sub { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 12px 0 4px; }

.foot { padding: 10px 16px 40px; font-size: 14px; }
.foot .contacts { display: grid; gap: 4px; margin-bottom: 10px; }

@media (max-width: 520px) {
  .brand h1 { font-size: 26px; }
  .clocks { width: 100%; }
  .clock { flex: 1; min-width: 0; }
  .tl li { grid-template-columns: 72px 1fr; gap: 10px; }
}
@media (max-width: 360px) {
  .kids { grid-template-columns: 1fr; }
}

/* ---- login / admin ---- */
.narrow { max-width: 420px; padding-top: 48px; }
.logo { font-size: 32px; color: var(--accent); text-align: center; margin-bottom: 18px; }
.center { text-align: center; }
.form label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.form input, .form select {
  display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; font-weight: 400;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.form input:focus, .form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form .btn { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.form .btn:disabled { opacity: .6; }
.err { color: var(--accent); font-weight: 600; min-height: 1.2em; margin: 4px 0 10px; font-size: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .row2 { grid-template-columns: 1fr; } }
.btn.small { display: inline-block; width: auto; padding: 8px 14px; font-size: 14px; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.users .user { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.users .user:first-child { border-top: 0; }
.small-t { font-size: 13px; }
.u-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.u-actions button { font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.u-actions button.danger { color: var(--accent); border-color: var(--accent); }
.userbar { display: flex; gap: 12px; align-items: center; justify-content: flex-end; font-size: 14px; margin: -4px 0 8px; }
.userbar button { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
