/* Tidebook — "tide lines".
   Teal is the ink and the structure; cream is the paper. Status colour is a
   separate, sacred channel: amber/moss/clay may ONLY express booking state.
   Radii are binary: 10px everywhere, 9999px for status pills only.
   Surfaces are defined by a 1px hairline, not a shadow. */

:root {
  --ink: #0E3B40;
  --ink-soft: #4A6A6D;
  --tide: #12787F;
  --tide-deep: #0D5D63;
  --shallow: #D9EDEC;
  --paper: #FBF7EF;
  --card: #FFFFFF;
  --hairline: #E3DDD1;
  --pending: #C77B23;
  --confirmed: #2F6B4F;
  --cancelled: #A34234;

  --r: 10px;
  --pill: 9999px;
  --lift: 0 1px 2px rgba(14, 59, 64, .06);
  --col: 640px;
  --wide: 1120px;

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;

  --t-13: 13px; --t-15: 15px; --t-17: 17px; --t-21: 21px;
  --t-27: 27px; --t-34: 34px; --t-42: 42px;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-17)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

/* The mono time channel: dates, times, durations, references. Nothing else. */
.tnum, time, .ref, .dur, .clock {
  font-family: var(--mono);
  font-weight: 500;
  font-feature-settings: "tnum" 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

h1, h2, h3, h4 { font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: var(--t-34); }
h2 { font-size: var(--t-27); }
h3 { font-size: var(--t-21); }
p { margin: 0 0 var(--s4); }
p:last-child { margin-bottom: 0; }
small, .small { font-size: var(--t-15); }
.muted { color: var(--ink-soft); }
.tiny { font-size: var(--t-13); color: var(--ink-soft); }

a { color: var(--tide); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--tide-deep); }

:focus-visible {
  outline: 2px solid var(--tide);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper);
  padding: var(--s3) var(--s4); border-radius: 0 0 var(--r) 0; z-index: 50;
}
.skip:focus { left: 0; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--s5); }
.col  { width: 100%; max-width: var(--col);  margin: 0 auto; padding: 0 var(--s5); }
.stack > * + * { margin-top: var(--s4); }
.section { padding: var(--s9) 0; }
.section + .section { border-top: 1px solid var(--hairline); }

/* ── Masthead: a deep tide band, like the header rule of a timetable ────── */
.masthead { background: var(--ink); color: #EFF6F4; }
.masthead .in {
  max-width: var(--wide); margin: 0 auto; padding: var(--s3) var(--s5);
  display: flex; align-items: center; gap: var(--s5); flex-wrap: wrap;
}
.mark { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 600; font-size: var(--t-21); letter-spacing: -.02em; }
.mark:hover { color: #fff; }
.mark svg { display: block; }
.masthead nav { margin-left: auto; display: flex; gap: var(--s5); font-size: var(--t-15); flex-wrap: wrap; }
.masthead nav a { color: #BBD6D6; text-decoration: none; padding: var(--s2) 0; border-bottom: 2px solid transparent; }
.masthead nav a:hover { color: #fff; }
.masthead nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--tide); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { padding: var(--s8) 0 var(--s7); }
.hero h1 { font-size: clamp(30px, 7vw, var(--t-42)); }
.hero .sub { font-size: var(--t-17); color: var(--ink-soft); max-width: 60ch; margin-top: var(--s4); }
.eyebrow {
  font-family: var(--mono); font-size: var(--t-13); font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--tide);
  margin: 0 0 var(--s3);
}

/* the thin hand-drawn tide rule used as a divider */
.tiderule { display: block; width: 100%; height: 8px; color: var(--hairline); margin: var(--s6) 0; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 12px var(--s5);
  border-radius: var(--r); border: 1px solid transparent;
  background: var(--tide); color: #fff;
  font: 600 var(--t-17)/1.2 var(--sans); text-decoration: none;
  cursor: pointer; transition: background 150ms ease-out, border-color 150ms ease-out;
}
.btn:hover { background: var(--tide-deep); color: #fff; }
.btn[disabled], .btn[aria-disabled="true"] { background: #9CB6B8; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--tide); border-color: var(--hairline); }
.btn.ghost:hover { background: var(--shallow); color: var(--tide-deep); }
.btn.danger { background: transparent; color: var(--cancelled); border-color: var(--hairline); }
.btn.danger:hover { background: #F6E9E6; color: var(--cancelled); }
.btn.small { min-height: 40px; padding: var(--s2) var(--s4); font-size: var(--t-15); }
.btn.block { width: 100%; }
.btnrow { display: flex; gap: var(--s3); flex-wrap: wrap; }

/* ── Cards & rows (the tide line) ───────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r); padding: var(--s5);
}
.card + .card { margin-top: var(--s3); }
.card h2, .card h3 { margin-bottom: var(--s3); }

.rows { display: block; margin: 0; padding: 0; list-style: none; }
.row {
  display: block; background: var(--card);
  border: 1px solid var(--hairline); border-left: 4px solid var(--ink-soft);
  border-radius: var(--r); padding: var(--s4) var(--s5);
  margin-bottom: var(--s3);
}
.row.is-pending   { border-left-color: var(--pending); }
.row.is-confirmed { border-left-color: var(--confirmed); }
.row.is-cancelled { border-left-color: var(--cancelled); }
.row .line1 { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.row .who { font-weight: 600; font-size: var(--t-17); }
.row .meta { color: var(--ink-soft); font-size: var(--t-15); margin-top: var(--s1); }
.row .acts { margin-top: var(--s3); display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

/* ── Status pills — word + shape, never colour alone ────────────────────── */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--pill); padding: 4px 12px;
  font-size: var(--t-13); font-weight: 600; letter-spacing: .01em;
  border: 1px solid currentColor; background: #fff; white-space: nowrap;
}
.status::before { content: ""; width: 8px; height: 8px; background: currentColor; display: block; }
.status.pending   { color: var(--pending);   } /* square  */
.status.pending::before   { border-radius: 1px; }
.status.confirmed { color: var(--confirmed); } /* circle  */
.status.confirmed::before { border-radius: 50%; }
.status.cancelled { color: var(--cancelled); } /* diamond */
.status.cancelled::before { transform: rotate(45deg); border-radius: 1px; }
.status.paid { color: var(--tide); }
.status.paid::before { border-radius: 2px; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
form { margin: 0; }
.field { display: block; margin-bottom: var(--s4); }
.field > .label { display: block; font-size: var(--t-15); font-weight: 600; margin-bottom: 6px; }
.field .hint { display: block; font-size: var(--t-13); color: var(--ink-soft); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 48px; padding: 12px var(--s3);
  font: 400 var(--t-17)/1.4 var(--sans);
  color: var(--ink); background: #fff;
  border: 1px solid var(--hairline); border-radius: var(--r);
}
input[type=date], input[type=time] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
textarea { min-height: 104px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--tide); outline-offset: 1px; border-color: var(--tide); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--cancelled); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%230E3B40' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
fieldset { border: 0; margin: 0 0 var(--s4); padding: 0; }
legend { font-size: var(--t-15); font-weight: 600; padding: 0; margin-bottom: var(--s2); }

/* choice pills: lessons, dates, times — all ≥48px tap targets */
.choices { display: flex; flex-wrap: wrap; gap: var(--s2); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice > input + span {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 48px; padding: var(--s2) var(--s4);
  border: 1px solid var(--hairline); border-radius: var(--r);
  background: #fff; font-size: var(--t-15); cursor: pointer;
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
.choice span .t { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.choice span .d { font-size: var(--t-13); color: var(--ink-soft); }
.choice input:hover + span { border-color: var(--tide); }
.choice input:focus-visible + span { outline: 2px solid var(--tide); outline-offset: 2px; }
.choice input:checked + span { background: var(--shallow); border-color: var(--tide); box-shadow: inset 0 0 0 1px var(--tide); }
.choice input:disabled + span { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.choice.lesson > input + span { min-width: 100%; }
@media (min-width: 560px) { .choice.lesson > input + span { min-width: 0; } }

.slotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: var(--s2); }
.slotgrid .choice > input + span { align-items: center; text-align: center; }

/* ── Notices ────────────────────────────────────────────────────────────── */
.notice {
  border: 1px solid var(--hairline); border-left: 4px solid var(--tide);
  background: #fff; border-radius: var(--r); padding: var(--s4) var(--s5);
  font-size: var(--t-15);
}
.notice.warn  { border-left-color: var(--pending); }
.notice.error { border-left-color: var(--cancelled); }
.notice.good  { border-left-color: var(--confirmed); }
.notice h3 { font-size: var(--t-17); margin-bottom: var(--s1); }

/* ── Data list (label / value in a timetable rhythm) ────────────────────── */
.facts { margin: 0; }
.facts div {
  display: flex; gap: var(--s4); justify-content: space-between;
  padding: var(--s3) 0; border-bottom: 1px solid var(--hairline);
}
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--ink-soft); font-size: var(--t-15); }
.facts dd { margin: 0; text-align: right; font-weight: 500; }

/* ── Lesson cards on the public pages ───────────────────────────────────── */
.lessons { display: grid; gap: var(--s3); }
@media (min-width: 720px) { .lessons { grid-template-columns: 1fr 1fr; } }
.lesson-card { background: var(--card); border: 1px solid var(--hairline); border-radius: var(--r); padding: var(--s5); display: flex; flex-direction: column; }
.lesson-card .dur { color: var(--tide); font-size: var(--t-13); letter-spacing: .06em; text-transform: uppercase; }
.lesson-card h3 { margin: var(--s2) 0; }
.lesson-card .price { font-family: var(--mono); font-weight: 500; font-size: var(--t-21); margin: var(--s2) 0 var(--s3); }
.lesson-card p { color: var(--ink-soft); font-size: var(--t-15); }
.lesson-card .go { margin-top: auto; padding-top: var(--s4); }

/* ── Numbered steps ─────────────────────────────────────────────────────── */
.steps { display: grid; gap: var(--s3); counter-reset: step; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { border-top: 2px solid var(--tide); padding-top: var(--s3); }
.step .n { font-family: var(--mono); font-weight: 500; color: var(--tide); font-size: var(--t-13); }
.step h3 { font-size: var(--t-17); margin: var(--s1) 0 var(--s2); }
.step p { color: var(--ink-soft); font-size: var(--t-15); }

/* ── Desk (tutor) chrome ────────────────────────────────────────────────── */
.deskbar { background: var(--ink); color: #DCE9E8; }
.deskbar .in { max-width: var(--wide); margin: 0 auto; padding: var(--s3) var(--s5); display: flex; gap: var(--s4); align-items: center; flex-wrap: wrap; }
.deskbar nav { display: flex; gap: var(--s4); font-size: var(--t-15); flex-wrap: wrap; }
.deskbar nav a { color: #BBD6D6; text-decoration: none; padding: var(--s2) 0; border-bottom: 2px solid transparent; }
.deskbar nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--tide); }
.deskbar .who { margin-left: auto; font-size: var(--t-13); color: #9FBCBC; display: flex; gap: var(--s3); align-items: center; }
.deskbar .who form { display: inline; }
.deskbar .who button { background: none; border: 0; color: #BBD6D6; font: inherit; text-decoration: underline; cursor: pointer; padding: 0; min-height: 0; }

.tabs { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); }
.tabs a {
  text-decoration: none; font-size: var(--t-15); padding: var(--s2) var(--s4);
  border: 1px solid var(--hairline); border-radius: var(--pill); background: #fff; color: var(--ink);
  min-height: 40px; display: inline-flex; align-items: center; gap: 6px;
}
.tabs a[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs .count { font-family: var(--mono); font-size: var(--t-13); }

.statgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-bottom: var(--s5); }
@media (min-width: 720px) { .statgrid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: #fff; border: 1px solid var(--hairline); border-radius: var(--r); padding: var(--s4); }
.stat .v { font-family: var(--mono); font-weight: 500; font-size: var(--t-27); display: block; }
.stat .k { font-size: var(--t-13); color: var(--ink-soft); }

.daygroup { margin-bottom: var(--s7); }
.daygroup > h3 {
  font-family: var(--mono); font-weight: 500; font-size: var(--t-15);
  padding-bottom: var(--s2); border-bottom: 1px solid var(--hairline); margin-bottom: var(--s3);
  display: flex; justify-content: space-between; gap: var(--s3);
}
.daygroup > h3 .n { color: var(--ink-soft); }

.inline-form { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; flex: 1 1 200px; }

.empty { border: 1px dashed var(--hairline); border-radius: var(--r); padding: var(--s7) var(--s5); text-align: center; color: var(--ink-soft); background: #fff; }
.empty h3 { color: var(--ink); margin-bottom: var(--s2); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: var(--s3) 0 var(--s3) var(--s5); border-bottom: 1px solid var(--hairline); position: relative; font-size: var(--t-15); }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--tide); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { font-family: var(--mono); font-size: var(--t-13); color: var(--ink-soft); display: block; }

/* sticky action bar — the one element genuinely floating above the page */
.sticky {
  position: sticky; bottom: 0; z-index: 10;
  background: var(--paper); border-top: 1px solid var(--hairline);
  padding: var(--s3) var(--s5); margin-top: var(--s6);
  box-shadow: var(--lift);
}

footer.foot { border-top: 1px solid var(--hairline); margin-top: var(--s9); padding: var(--s6) 0 var(--s8); color: var(--ink-soft); font-size: var(--t-13); }
footer.foot a { color: var(--ink-soft); }
footer.foot .links { display: flex; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s3); }

table.plain { width: 100%; border-collapse: collapse; font-size: var(--t-15); }
table.plain th, table.plain td { text-align: left; padding: var(--s3) var(--s2); border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.plain th { font-size: var(--t-13); color: var(--ink-soft); font-weight: 600; }

.scroll-x { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.fade-in { animation: fade 300ms ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

@media print {
  .masthead, .deskbar, .sticky, .btnrow { display: none; }
  body { background: #fff; }
}
