/* Tutor page styles. Light by default, dark when the device asks for it or the tutor picks it. */

@font-face { font-family: "Figtree"; src: url("/assets/fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("/assets/fonts/dm-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --ground: #F5F3EE;
  --ink: #111111;
  --muted: #5B5850;
  --line: #E0DCD2;
  --line-strong: #C9C3B6;
  --card: #FFFFFF;
  --inset: #F5F3EE;
  --segment: #EAE6DD;
  --primary: #8F4455;
  --primary-hover: #6E3341;
  --on-primary: #FFFFFF;
  --ok-bg: #DFF2E0;
  --ok-ink: #1D5A21;
  --warn-bg: #FFEFD2;
  --warn-ink: #6A4400;
  --bad-bg: #FFE1E1;
  --bad-ink: #8A1F1F;
  --display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --body: Figtree, "Segoe UI", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #151413;
    --ink: #F3F1EC;
    --muted: #B5B0A6;
    --line: #3A3733;
    --line-strong: #6B665D;
    --card: #201F1D;
    --inset: #2B2927;
    --segment: #2B2927;
    --primary: #DE93A2;
    --primary-hover: #EBB2BD;
    --on-primary: #1D0E12;
    --ok-bg: #1E3A22;
    --ok-ink: #A9E5AC;
    --warn-bg: #40300F;
    --warn-ink: #FFD591;
    --bad-bg: #4A1F1F;
    --bad-ink: #FFB3B3;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #151413;
  --ink: #F3F1EC;
  --muted: #B5B0A6;
  --line: #3A3733;
  --line-strong: #6B665D;
  --card: #201F1D;
  --inset: #2B2927;
  --segment: #2B2927;
  --primary: #DE93A2;
  --primary-hover: #EBB2BD;
  --on-primary: #1D0E12;
  --ok-bg: #1E3A22;
  --ok-ink: #A9E5AC;
  --warn-bg: #40300F;
  --warn-ink: #FFD591;
  --bad-bg: #4A1F1F;
  --bad-ink: #FFB3B3;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; }
h1, h2, p { margin: 0; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.page { max-width: 520px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.page-entry { padding: 56px 28px 28px; gap: 28px; }
/* Sign-in pages read as one centered column: logo, heading and the line under it. Form fields stay left-aligned. */
.page-entry > .stack, .page-entry > p { text-align: center; }
.page-entry > .icon-box { align-self: center; }

/* The right logo for the theme in use. */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }

.display { font-family: var(--display); font-weight: 800; line-height: 1.05; }
.title { font-size: 30px; }
.title-entry { font-size: 34px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.push { margin-top: auto; }

/* Header */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 17px; }
.brand:hover { color: var(--ink); }
.brand img { height: 44px; width: auto; }
.entry-logo { height: 150px; width: auto; align-self: center; }

.top-actions { display: flex; align-items: center; gap: 10px; }
/* The owner's way between the two sides: always in view, never something to remember an address for. */
.button-switch { height: 44px; border-radius: 999px; border-color: var(--primary); color: var(--primary); font-weight: 700; white-space: nowrap; }
.button-switch:hover { border-color: var(--primary-hover); color: var(--primary-hover); }
.account { position: relative; }
.account > summary { list-style: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; cursor: pointer; }
.account > summary::-webkit-details-marker { display: none; }
.menu { position: absolute; right: 0; top: 52px; z-index: 2; width: 240px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.14); }
.menu-name { font-weight: 700; }
.menu form { margin: 0; }
.menu-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.segment { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--segment); border-radius: 12px; }
.segment button, .segment a { display: flex; align-items: center; justify-content: center; height: 40px; padding: 0 6px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.segment [aria-pressed="true"], .segment [aria-current="page"] { background: var(--card); color: var(--ink); font-weight: 700; }

/* Buttons and fields */
.button { display: inline-flex; align-items: center; justify-content: center; height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-weight: 600; text-decoration: none; }
.button:hover { color: var(--ink); border-color: var(--ink); }
.button-wide { width: 100%; height: 54px; border-radius: 12px; font-weight: 700; }
.button-primary { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.button-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.button-outline { border: 1.5px solid var(--primary); color: var(--primary); }
.button-outline:hover { color: var(--primary-hover); border-color: var(--primary-hover); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input { font: inherit; width: 100%; height: 54px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--card); color: var(--ink); }
.form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.link-row { display: flex; align-items: center; justify-content: center; height: 44px; font-weight: 600; font-size: 15px; }
.alert { padding: 12px 14px; border-radius: 12px; background: var(--bad-bg); color: var(--bad-ink); font-size: 15px; }

.icon-box { width: 72px; height: 72px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.steps { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; margin: 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; font-size: 15px; counter-reset: step; }
.steps li { display: flex; gap: 10px; counter-increment: step; }
.steps li::before { content: counter(step); font-family: var(--mono); color: var(--muted); }
.strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

/* Day view */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.card-now { border: 2px solid var(--primary); padding: 13px 15px; }
.card-cancelled { background: transparent; }
.card-cancelled .student-name { text-decoration: line-through; color: var(--muted); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--segment); color: var(--muted); white-space: nowrap; }
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill-bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill-now { background: var(--primary); color: var(--on-primary); }
.card-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.day-head { display: flex; flex-direction: column; gap: 16px; }
.student { display: flex; flex-direction: column; gap: 8px; }
.student + .student { padding-top: 10px; border-top: 1px solid var(--line); }
.student-name { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.2; }
.student-off { text-decoration: line-through; color: var(--muted); }
.note { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; background: var(--inset); border-radius: 10px; }
.note-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.note-text { font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.open { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px; border: 1.5px dashed var(--line-strong); border-radius: 14px; color: var(--muted); font-size: 14px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 16px; border: 1.5px dashed var(--line-strong); border-radius: 14px; color: var(--muted); text-align: center; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 4px; }

/* Owner's page: the same pieces on a wider sheet. */
.page-wide { max-width: 1040px; gap: 24px; }
.section { display: flex; flex-direction: column; gap: 12px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.15; }
.h3 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.25; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.tile-label { font-size: 13px; color: var(--muted); line-height: 1.25; }
.tile-value { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; }
.tone-warn { color: var(--warn-ink); }
.tone-bad { color: var(--bad-ink); }
.note-line { padding: 12px 14px; border: 1.5px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 15px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.card .table-wrap { border: 0; border-radius: 0; background: transparent; margin: 0 -16px -14px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 10px 14px; font-family: var(--mono); font-weight: 400; font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.table td { padding: 10px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.table form { margin: 0; }
.nowrap { white-space: nowrap; }
.button-small { height: 34px; padding: 0 12px; font-size: 14px; }
.strip { display: flex; flex-wrap: wrap; gap: 6px; }
.slot { flex: 1 1 120px; min-width: 0; padding: 8px 10px; background: var(--inset); border-radius: 10px; font-size: 14px; }
.slot-open { background: transparent; border: 1.5px dashed var(--line-strong); color: var(--muted); }
.option { display: flex; flex-direction: column; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.option-kind { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.option-title { font-weight: 700; }
.pills-left { justify-content: flex-start; }
.plain { margin: 0; padding-left: 18px; color: var(--muted); }
.contact { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 12px; background: var(--inset); border-radius: 10px; }
.contact-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; width: 100%; font-size: 14px; font-weight: 600; }
.draft { font-size: 14px; overflow-wrap: anywhere; }
.menu .button { text-decoration: none; }

/* Calendar: the bar that switches view and date, then the week and month grids. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.struck { text-decoration: line-through; color: var(--muted); }
.cal-bar { display: flex; flex-direction: column; gap: 10px; }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button-square { width: 44px; padding: 0; font-size: 20px; line-height: 1; }
.button-current { background: var(--card); font-weight: 700; }
.cal-pick { display: flex; gap: 8px; margin: 0 0 0 auto; }
.cal-pick input { font: inherit; height: 44px; min-width: 0; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); }

.week-wrap { overflow-x: auto; }
.week { --n: 5; display: grid; grid-template-columns: 46px repeat(var(--n), minmax(0, 1fr)); gap: 6px; font-size: 13px; }
.week-4 { --n: 4; } .week-5 { --n: 5; } .week-6 { --n: 6; } .week-7 { --n: 7; }
/* Everyone's week has several sessions to a cell, so its columns keep a workable width and the grid scrolls sideways on a phone. */
.week-wide .week { min-width: calc(46px + var(--n) * 124px); }
.week-day { padding: 7px 0; border-radius: 8px; text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); text-decoration: none; }
.week-day:hover { color: var(--ink); background: var(--segment); }
.week-today, .week-today:hover { background: var(--primary); color: var(--on-primary); }
.week-time { padding-top: 8px; font-size: 12px; }
.week-cell { display: flex; flex-direction: column; gap: 4px; min-height: 54px; min-width: 0; }
.week-empty { border-radius: 8px; background: var(--segment); opacity: 0.55; }
.week-open { justify-content: center; padding: 6px 8px; border-radius: 8px; border: 1.5px dashed var(--warn-ink); background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.chip { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1px; min-width: 0; padding: 6px 8px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.chip-now { border: 2px solid var(--primary); padding: 5px 7px; }
.chip-tutor { font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.chip-cancelled { background: transparent; color: var(--muted); }
.chip-cancelled .chip-who { text-decoration: line-through; }
.chip-note { font-size: 11px; font-weight: 400; }

.month { --n: 6; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
.month-6 { --n: 6; } .month-7 { --n: 7; }
.month-head { padding: 4px 0; text-align: center; font-size: 12px; }
.month-cell { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 56px; padding: 6px; align-items: center; border-radius: 10px; background: var(--card); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 12px; }
.month-cell:hover { border-color: var(--line-strong); color: var(--ink); }
.month-out { background: transparent; opacity: 0.5; }
.month-today { border: 2px solid var(--primary); padding: 5px; }
.month-num { font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1; }
.month-dot { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-weight: 700; }
/* On a phone a cell has room for the count only. */
.month-lines { display: none; flex-direction: column; gap: 2px; min-width: 0; width: 100%; }
.month-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.month-count { font-weight: 700; color: var(--ink); }

/* Laptop and tablet: the same pages, laid out across the width instead of stacked. */
@media (min-width: 820px) {
  .page { max-width: 1040px; padding: 28px 32px 32px; gap: 20px; }
  .title { font-size: 38px; }

  /* Sign-in pages become a centered column. */
  .page-entry { max-width: 480px; justify-content: center; padding: 40px 32px; }
  .page-entry .push { margin-top: 0; }
  .entry-logo { height: 132px; }

  /* Day view: date on the left, day switcher on the right. */
  .day-head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .day-head .segment { width: 340px; flex: none; }

  /* Each session is a row: when, who, and the previous note beside them. */
  .card-session { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 4px 24px; align-items: start; padding: 18px 20px; }
  .card-session.card-now { padding: 17px 19px; }
  .card-when { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; }
  .card-when .mono { font-size: 14px; }
  .student { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 8px 24px; align-items: start; }
  .student-name { font-size: 21px; }
  .note { padding: 12px 14px; }
  .note-text { font-size: 15px; }
  .open { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 24px; padding: 14px 20px; justify-items: start; }
  .empty { padding: 48px 16px; }

  /* Calendar bar sits to the right of the title; the grids get room to show names. */
  .cal-bar { align-items: flex-end; }
  .week { grid-template-columns: 64px repeat(var(--n), minmax(0, 1fr)); gap: 8px; font-size: 14px; }
  .week-wide .week { min-width: 0; }
  .week-day { font-size: 13px; }
  .week-cell { min-height: 60px; }
  .month { gap: 8px; }
  .month-cell { min-height: 112px; padding: 10px; align-items: flex-start; }
  .month-today { padding: 9px; }
  .month-dot { display: none; }
  .month-lines { display: flex; }
}
