:root {
  --canvas: #f5f1e7;
  --surface: #fffdfa;
  --forest: #073d22;
  --forest-deep: #082f1d;
  --sage: #e6eee2;
  --ink: #162a21;
  --muted: #4d6054;
  --gold: #d5b66b;
  --gold-light: #f7eacb;
  --line: #e0d9c8;
  --input-line: #98947e;
  --error: #8e3438;
  --heading: Georgia, Cambria, "Times New Roman", serif;
  background: var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  scrollbar-color: #8e9e8b var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
::selection { background: var(--gold-light); color: var(--forest-deep); }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--heading); color: var(--forest); font-weight: 600; line-height: 1.08; letter-spacing: -.025em; }
h1 { font-size: clamp(2.85rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.56rem, 2.8vw, 2rem); }
p { color: var(--muted); }
button, input { font: inherit; }
input { caret-color: var(--forest); }
a { text-underline-offset: .18em; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }

.topbar { background: var(--forest-deep); color: #fff8e4; border-bottom: 2px solid #b99651; }
.topbar-inner, .shell { width: min(100% - 3.5rem, 75rem); margin-inline: auto; }
.topbar-inner { min-height: 4.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font: 600 1.4rem var(--heading); letter-spacing: -.025em; }
.brand span { margin-inline-start: .55rem; padding-inline-start: .7rem; border-inline-start: 1px solid #b99651; color: #ead9a9; font: 600 .79rem -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.shell { padding-block: clamp(2rem, 5vw, 4rem) 4rem; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-block-end: 1.8rem; }
.page-heading p, .login > p { margin-block-start: .65rem; font-size: 1rem; max-width: 60ch; }
.zoom-status { display: inline-flex; align-items: center; gap: .45rem; border-radius: 100vw; padding: .35rem .7rem; color: #624a1e; background: var(--gold-light); font-size: .82rem; font-weight: 650; white-space: nowrap; }
.zoom-status[data-configured="true"] { color: var(--forest); background: var(--sage); }
.zoom-status::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding: .55rem 1rem;
  border: 1px solid var(--input-line);
  border-radius: .48rem;
  color: var(--forest);
  background: var(--surface);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.25;
  cursor: pointer;
  transition: background 140ms ease-out, border-color 140ms ease-out, color 140ms ease-out;
}
.button:hover { background: var(--sage); border-color: #55745d; }
.button:active { background: #dce6da; }
.button:disabled { cursor: not-allowed; opacity: .62; }
.button svg { width: 1.1rem; height: 1.1rem; flex: none; }
.primary { background: var(--forest); border-color: var(--forest); color: #fffcec; }
.primary:hover { background: #175332; border-color: #175332; }
.primary:active { background: #20432d; }
.header-button { color: #fcf6e6; border-color: #adbaac; background: transparent; }
.header-button:hover { background: #1b4e33; border-color: #dfd5b7; }
.header-button:focus-visible, .calendar-head button:focus-visible { outline-color: var(--gold); }

.scheduler { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(19rem, 1fr); align-items: start; gap: 1.35rem; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: .9rem; }
.calendar { overflow: hidden; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; gap: .55rem; padding: 1.15rem 1.3rem; background: var(--forest); color: #fff9e9; }
.calendar-head h2 { color: #fff9e9; }
.calendar-head p { margin-top: .35rem; color: #e0e7d4; font-size: .84rem; }
.calendar-nav { display: flex; align-items: center; gap: .4rem; }
.calendar-nav .button { background: transparent; color: #fff9e9; border-color: #809783; }
.calendar-nav .button:hover { background: #255339; border-color: #c3c9a4; }
.arrow-button { min-width: 2.75rem; padding: .35rem; }
.arrow-button span { width: .52rem; height: .52rem; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
.arrow-button.next span { transform: rotate(225deg); }
.calendar-grid { table-layout: fixed; width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.calendar-grid th { text-align: center; background: #edf2e7; border-block-end: 1px solid var(--line); color: #354f3b; font-size: .78rem; padding: .65rem 0; }
.calendar-grid abbr { text-decoration: none; }
.calendar-grid td { padding: .23rem; border-block-end: 1px solid var(--line); border-inline-end: 1px solid var(--line); height: clamp(3.4rem, 6.5vw, 4.7rem); }
.calendar-grid td:last-child { border-inline-end: 0; }
.calendar-grid td.outside, .date-button:disabled { background: #f7f4ec; }
.date-button {
  width: 100%; height: 100%; min-height: 2.75rem;
  display: flex; align-items: center; justify-content: center;
  position: relative; border: 1px solid transparent; border-radius: .37rem;
  color: var(--ink); background: transparent; cursor: pointer; font-weight: 550;
  transition: background 140ms ease-out, color 140ms ease-out, border-color 140ms ease-out;
}
.date-button:not(:disabled):hover { background: var(--sage); }
.date-button:disabled { color: #665e4d; cursor: default; }
.date-button[aria-current="date"] { border-color: #93742d; }
.date-button[aria-pressed="true"], .date-button[aria-pressed="true"]:not(:disabled):hover { background: var(--forest); color: white; }
.date-button:focus-visible { outline-offset: -2px; }
.date-button[aria-pressed="true"]:focus-visible { outline-color: var(--gold); }
.event-key, .date-button[data-event="true"]::after { display: inline-block; width: .37rem; height: .37rem; border-radius: 50%; background: #886419; }
.date-button[data-event="true"]::after { content: ""; position: absolute; bottom: .36rem; left: calc(50% - .185rem); }
.date-button[data-event="true"][aria-pressed="true"]::after { background: #f3df9d; }
.calendar-foot { display: flex; align-items: center; gap: .5rem; padding: .7rem 1.3rem; color: var(--muted); font-size: .83rem; }

.schedule { padding: 1.35rem; }
.schedule h2 { margin-bottom: 1.15rem; }
form { display: grid; align-content: start; gap: .4rem; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend, form > label, .form-row label { display: block; color: var(--ink); font-size: .88rem; font-weight: 650; }
legend { margin: 0 0 .4rem; padding: 0; }
form > label:not(:first-child), .form-row { margin-top: .44rem; }
form input:not([type="radio"]) {
  min-width: 0; width: 100%; min-height: 2.8rem;
  border: 1px solid var(--input-line); border-radius: .45rem;
  padding: .52rem .65rem; color: var(--ink); background: white;
  font-size: 1rem;
}
form input::placeholder { color: #546257; }
form input:user-invalid { border-color: var(--error); }
form input:focus-visible { outline-offset: 2px; }
.session-types { display: flex; flex-wrap: wrap; gap: .4rem; }
.session-types label { position: relative; display: flex; cursor: pointer; }
.session-types input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.session-types span {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  padding: .42rem .65rem; border: 1px solid var(--input-line); border-radius: .45rem;
  color: var(--muted); font-size: .8rem; font-weight: 600;
}
.session-types label:hover span { background: var(--sage); }
.session-types input:checked + span { background: var(--sage); color: var(--forest); border-color: #54785d; }
.session-types input:focus-visible + span { outline: 2px solid var(--forest); outline-offset: 3px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.form-row > div { min-width: 0; display: grid; align-content: start; gap: .4rem; }
form > .button { justify-self: stretch; margin-top: .65rem; }
.message { background: var(--sage); color: var(--forest); border-radius: .45rem; padding: .65rem .75rem; font-size: .86rem; overflow-wrap: anywhere; }
form .message { margin-block-start: .5rem; }
.message[data-tone="error"] { color: var(--error); background: #fae7e3; }
.message[data-tone="info"] { color: #56421c; background: var(--gold-light); }

.upcoming { margin-top: 2rem; }
.upcoming-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.upcoming > .message { margin-block-end: .6rem; }
.empty { padding: 1.55rem 1.3rem; }
.empty p:first-child { color: var(--forest); font-weight: 650; }
.empty p + p { margin-top: .25rem; font-size: .88rem; }
.meeting { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: .85rem 1.15rem; }
.meeting + .meeting { border-top: 1px solid var(--line); }
.meeting-date { display: grid; text-align: center; background: var(--sage); color: var(--forest); border-radius: .44rem; padding: .35rem; line-height: 1.12; font-variant-numeric: tabular-nums; }
.meeting-date span { font-size: .71rem; font-weight: 700; }
.meeting-date strong { font-size: 1.3rem; }
.meeting-details h3 { color: var(--forest); font-size: 1.02rem; overflow-wrap: anywhere; }
.meeting-details p { margin-top: .2rem; font-size: .83rem; }
.meeting-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.outbound { position: relative; width: .63rem; height: .63rem; border: solid currentColor; border-width: 1px 1px 0 0; }
.outbound::after { content: ""; position: absolute; top: -.06rem; right: -.06rem; width: .84rem; height: 1px; background: currentColor; transform: rotate(-45deg); transform-origin: right; }

.login { max-width: 29rem; margin: clamp(0rem, 7vh, 4rem) auto 0; border: 1px solid var(--line); border-radius: .9rem; padding: clamp(1.2rem, 5vw, 2.5rem); background: var(--surface); }
.login h1 { font-size: clamp(2.25rem, 6vw, 3.35rem); }
.login form { margin-top: 1.35rem; }
.loading { padding: 1.25rem; text-align: center; }

@media (max-width: 50rem) {
  .scheduler { grid-template-columns: minmax(0, 1fr); }
  .calendar-grid td { height: 3.5rem; }
}

@media (max-width: 34rem) {
  .topbar-inner, .shell { width: calc(100% - 2rem); }
  .page-heading { align-items: start; flex-direction: column; margin-block-end: 1.1rem; }
  .topbar-inner { gap: .4rem; }
  .brand { font-size: 1.2rem; white-space: nowrap; }
  .brand span { margin-inline-start: .3rem; padding-inline-start: .45rem; font-size: .73rem; }
  .header-button { padding-inline: .65rem; white-space: nowrap; }
  .calendar-head { padding: .85rem .6rem .85rem .85rem; flex-wrap: wrap; }
  .calendar-head h2 { font-size: 1.35rem; }
  .calendar-nav { gap: .28rem; }
  .calendar-nav .today { padding-inline: .55rem; }
  .calendar-grid td { height: 3.2rem; padding: .1rem; }
  .calendar-foot, .schedule { padding: .9rem; }
  .meeting { grid-template-columns: 2.85rem minmax(0, 1fr); gap: .7rem; padding: .75rem; }
  .meeting-actions { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  .button, .date-button { transition: none; }
}
