:root {
  --teal: #0f766e;
  --teal-deep: #115e59;
  --teal-soft: #e6f4f2;
  --teal-line: #cfe6e3;
  --ink: #15333a;
  --muted: #4f6b70;
  --paper: #ffffff;
  --wash: #f6fbfa;
  --warn: #a15c07;
  --warn-soft: #fdf3e1;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { font-size: 20px; }
body {
  margin: 0; display: flex; min-height: 100vh;
  font-family: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink); background: var(--wash); line-height: 1.4;
}
.nav {
  width: 220px; flex: none; background: var(--paper); border-right: 2px solid var(--teal-line);
  padding: 1.4rem 1rem; display: flex; flex-direction: column; gap: 1.6rem;
  position: sticky; top: 0; height: 100vh;
}
.brand { font-size: 1.25rem; font-weight: 700; color: var(--teal-deep); display: flex; align-items: center; gap: .6rem; }
.brand-mark { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.nav nav { display: flex; flex-direction: column; gap: .4rem; }
.nav a {
  display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border-radius: 12px;
  color: var(--ink); text-decoration: none; font-size: 1.1rem; font-weight: 600;
}
.nav a svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a:hover { background: var(--teal-soft); }
.nav a.on { background: var(--teal); color: #fff; }
.nav a:focus-visible, .seg a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.stamp { margin-top: auto; font-size: .8rem; color: var(--muted); padding-left: .4rem; }
.stamp::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--teal); margin-right: .5rem; }
.stamp.stale::before { background: var(--warn); }

.content { flex: 1; min-width: 0; padding: 1.6rem 2.2rem 3rem; }
.head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.2rem; }
h1 { font-size: 2.2rem; margin: 0; color: var(--teal-deep); }
h2 { font-size: 1.6rem; margin: 0 0 .8rem; display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; }
h2 small { font-size: 1.1rem; font-weight: 500; color: var(--muted); }
h3 { font-size: 1.25rem; margin: 0 0 .4rem; color: var(--teal-deep); display: flex; justify-content: space-between; }
h3 span { color: var(--muted); font-weight: 500; }
.count { background: var(--teal-soft); color: var(--teal-deep); border-radius: 999px; padding: 0 .7rem; font-size: 1.1rem; font-weight: 700; }

.seg { display: inline-flex; border: 2px solid var(--teal); border-radius: 999px; overflow: hidden; background: var(--paper); }
.seg a { padding: .5rem 1.3rem; font-size: 1.1rem; font-weight: 700; color: var(--teal-deep); text-decoration: none; }
.seg a.on { background: var(--teal); color: #fff; }

.days { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 1.6rem; align-items: start; }
.day, .panel { background: var(--paper); border: 2px solid var(--teal-line); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin-bottom: 1.6rem; }
.days .day { margin-bottom: 0; }
.group { margin-top: 1.1rem; }
table { width: 100%; border-collapse: collapse; }
.group td { padding: .6rem .5rem; border-top: 1px solid var(--teal-line); vertical-align: top; font-size: 1.15rem; }
td small { display: block; color: var(--muted); font-size: .85rem; }
td.time { font-weight: 700; white-space: nowrap; width: 1%; font-variant-numeric: tabular-nums; font-size: 1.3rem; color: var(--teal-deep); }
td.time small { display: inline; font-weight: 500; }
td.status { text-align: right; white-space: nowrap; width: 1%; }
.pill { display: inline-block; padding: .1rem .7rem; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--teal-soft); color: var(--teal-deep); }
.st-cancelled td:not(.status), .st-noshow td:not(.status) { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.st-cancelled .pill, .st-noshow .pill { background: var(--warn-soft); color: var(--warn); }
.st-completed .pill { background: var(--teal); color: #fff; }

.search { background: var(--teal-soft); border-radius: var(--radius); padding: 1.2rem 1.5rem; margin-bottom: 1.6rem; }
.search label { display: block; font-size: 1.3rem; font-weight: 700; color: var(--teal-deep); margin-bottom: .6rem; }
.search div { display: flex; gap: .8rem; flex-wrap: wrap; }
input[type=search] { flex: 1; min-width: 14rem; font: inherit; font-size: 1.4rem; padding: .7rem 1rem; border: 2px solid var(--teal); border-radius: 12px; background: #fff; color: var(--ink); }
button { font: inherit; font-size: 1.3rem; font-weight: 700; padding: .7rem 2rem; border: 0; border-radius: 12px; background: var(--teal); color: #fff; cursor: pointer; }
button:hover { background: var(--teal-deep); }

table.list th { text-align: left; font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: .3rem .6rem; }
table.list td { padding: .7rem .6rem; border-top: 1px solid var(--teal-line); font-size: 1.2rem; }
table.list tr:first-child th, table.list tr:first-child td { border-top: 0; }
.chart { position: relative; height: 320px; }
.chart.tall { height: 460px; }
.empty { color: var(--muted); font-size: 1.15rem; margin: .6rem 0; }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: .8rem 1.1rem; font-size: 1.15rem; font-weight: 600; }

#toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; display: flex; flex-direction: column; gap: .6rem; max-width: 24rem; z-index: 10; }
.toast { background: var(--teal-deep); color: #fff; padding: .8rem 1.1rem; border-radius: 12px; font-size: 1rem; box-shadow: 0 6px 20px rgba(17, 94, 89, .25); animation: in .25s ease-out; }
.toast small { display: block; opacity: .85; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }
#live { transition: opacity .2s; }
#live.fetching { opacity: .85; }

@media (max-width: 760px) {
  body { flex-direction: column; }
  .nav { width: auto; height: auto; position: static; flex-direction: row; align-items: center; padding: .6rem .8rem; border-right: 0; border-bottom: 2px solid var(--teal-line); gap: .8rem; }
  .nav nav { flex-direction: row; }
  .nav a span, .brand, .stamp { display: none; }
  .content { padding: 1rem; }
}
