:root {
  color-scheme: light;
  --ink: #152925;
  --muted: #65736f;
  --line: #dcded8;
  --paper: #fff;
  --wash: #f3f1eb;
  --green: #17584d;
  --green-2: #28776a;
  --cream: #f8f6f0;
  --amber: #d79c45;
  --danger: #9d403c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--wash); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(40,119,106,.25); outline-offset: 2px; }
.desk-shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 clamp(20px,4vw,58px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.86); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand span { display: grid; }
.brand strong { font-size: .98rem; }
.brand small { color: var(--muted); font-size: .7rem; margin-top: 1px; }
.topbar nav { display: flex; gap: 8px; align-items: center; }
.topbar nav a, .topbar nav button { border: 0; background: transparent; color: #344843; text-decoration: none; padding: 10px 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .82rem; }
.topbar nav a:hover, .topbar nav button:hover { background: #eef1ed; }
.topbar svg, button svg, a svg { width: 17px; height: 17px; }
.access-gate { max-width: 1180px; min-height: calc(100vh - 76px); margin: 0 auto; padding: clamp(48px,8vw,108px) clamp(22px,5vw,70px); display: grid; grid-template-columns: minmax(0,1.2fr) minmax(320px,.7fr); gap: clamp(40px,8vw,110px); align-items: center; }
.access-gate h1 { margin: 10px 0 18px; max-width: 700px; font-family: Georgia, serif; font-size: clamp(2.5rem,5vw,5rem); line-height: .98; letter-spacing: -.055em; }
.access-gate > div > p:last-of-type { color: var(--muted); max-width: 660px; line-height: 1.7; font-size: 1.04rem; }
.eyebrow { margin: 0; color: var(--green-2); text-transform: uppercase; letter-spacing: .14em; font-size: .67rem; font-weight: 900; }
.gate-points { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.gate-points span { padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.65); display: inline-flex; align-items: center; gap: 7px; font-weight: 750; font-size: .78rem; }
.gate-points svg { width: 15px; }
.gate-card { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 28px; box-shadow: 0 20px 60px rgba(20,46,40,.09); display: grid; gap: 13px; }
.gate-card h2 { margin: 2px 0 8px; font-size: 1.6rem; }
.gate-card label, .field-grid label { display: grid; gap: 7px; color: #44554f; font-weight: 800; font-size: .76rem; }
.account-help-link { width: fit-content; color: var(--green); font-size: .72rem; font-weight: 800; text-decoration: none; }
.gate-card input, .field-grid input, .field-grid select { width: 100%; border: 1px solid #cfd5d0; border-radius: 10px; padding: 12px; background: #fbfcfa; color: var(--ink); }
.gate-icon, .link-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: #e8f2ee; color: var(--green); }
.primary-button, .secondary-button, .record-button { border-radius: 10px; min-height: 42px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 850; font-size: .8rem; }
.primary-button { border: 1px solid var(--green); background: var(--green); color: white; }
.secondary-button { border: 1px solid #cfd5d0; background: white; color: var(--ink); }
.record-button { border: 1px solid #8d3530; background: #a5433e; color: white; }
.form-error { color: var(--danger); font-weight: 750; font-size: .78rem; }
.workspace { max-width: 1480px; margin: 0 auto; padding: 34px clamp(18px,4vw,56px) 70px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.hero h1 { margin: 8px 0 8px; font-family: Georgia, serif; font-size: clamp(2.4rem,4vw,4.3rem); line-height: 1; letter-spacing: -.05em; }
.hero > div > p:last-child { margin: 0; color: var(--muted); max-width: 780px; }
.hero-actions, .link-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-line { display: block; margin: 16px 0; min-height: 20px; color: var(--muted); font-size: .78rem; }
.status-line.is-error { color: var(--danger); }
.booking-link-card { display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center; background: #e9f2ee; border: 1px solid #ccddd7; border-radius: 16px; padding: 18px; }
.booking-link-card div:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.booking-link-card strong { font-size: 1rem; }
.booking-link-card span { color: #567069; font-size: .76rem; overflow-wrap: anywhere; }
.metric-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; margin: 16px 0; }
.metric-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 7px; }
.metric-card span { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { font-family: Georgia, serif; font-size: 2.2rem; line-height: 1; }
.metric-card small { color: var(--muted); }
.schedule-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(330px,.7fr); gap: 14px; }
.calendar-panel, .agenda-panel { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.panel-heading { min-height: 76px; padding: 17px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 4px 0 0; font-size: 1.15rem; }
.month-controls { display: flex; align-items: center; gap: 6px; }
.month-controls button { border: 1px solid var(--line); background: white; min-height: 34px; border-radius: 8px; padding: 0 10px; font-weight: 750; color: var(--ink); }
.weekday-row, .calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.weekday-row { border-bottom: 1px solid var(--line); background: #fafaf7; }
.weekday-row span { padding: 9px 8px; color: var(--muted); font-size: .66rem; font-weight: 900; text-align: center; text-transform: uppercase; letter-spacing: .08em; }
.calendar-day { position: relative; min-height: 114px; padding: 9px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; text-align: left; color: inherit; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.is-outside { background: #fafaf7; color: #a2aaa6; }
.calendar-day.is-today .day-number { background: var(--green); color: white; }
.calendar-day.is-selected { box-shadow: inset 0 0 0 2px var(--green-2); z-index: 1; }
.day-number { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; font-size: .76rem; font-weight: 850; }
.day-events { display: grid; gap: 4px; margin-top: 7px; }
.day-event { display: block; border-left: 3px solid var(--green-2); border-radius: 4px; padding: 4px 5px; background: #edf5f2; font-size: .63rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-event.is-attention { border-color: var(--amber); background: #fff6e7; }
.day-more { color: var(--muted); font-size: .62rem; padding-left: 7px; }
.agenda-panel { min-height: 590px; }
.agenda-panel .panel-heading > span { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; background: #e8f2ee; color: var(--green); font-weight: 900; }
.agenda-list { max-height: 660px; overflow: auto; }
.agenda-item { padding: 15px 17px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 54px 1fr; gap: 12px; }
.agenda-time { color: var(--green); font-weight: 900; font-size: .78rem; }
.agenda-copy { display: grid; gap: 4px; min-width: 0; }
.agenda-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-copy span { color: var(--muted); font-size: .72rem; }
.status-chip { width: fit-content; padding: 4px 7px; border-radius: 999px; background: #eef1ed; color: #52635e; font-size: .6rem !important; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.empty { padding: 28px; color: var(--muted); text-align: center; line-height: 1.6; }
dialog { width: min(650px,calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 18px; padding: 0; color: var(--ink); box-shadow: 0 30px 100px rgba(19,42,37,.25); }
dialog::backdrop { background: rgba(14,28,25,.48); backdrop-filter: blur(4px); }
dialog form > header { padding: 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
dialog h2 { margin: 4px 0; }
dialog header span { color: var(--muted); font-size: .78rem; }
.icon-button { border: 1px solid var(--line); background: white; width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; }
.field-grid { padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field-grid .full { grid-column: 1 / -1; }
.field-grid .consent { display: flex; grid-template-columns: auto 1fr; align-items: flex-start; }
.field-grid .consent input { width: 18px; margin-top: 1px; }
.privacy { margin: 0 20px; padding: 11px; border-radius: 9px; background: #f0f5f2; color: #48635b; display: flex; gap: 8px; font-size: .74rem; }
.privacy svg { flex: 0 0 auto; width: 17px; }
dialog .form-error { margin: 12px 20px 0; }
dialog footer { padding: 17px 20px 20px; display: flex; justify-content: flex-end; gap: 8px; }
[hidden] { display: none !important; }

@media (max-width: 980px) {
  .access-gate, .schedule-layout { grid-template-columns: 1fr; }
  .access-gate { min-height: auto; }
  .metric-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 680px) {
  .topbar nav a { display: none; }
  .topbar { height: 66px; padding: 0 16px; }
  .access-gate { padding: 38px 18px; gap: 28px; }
  .access-gate h1 { font-size: 2.7rem; }
  .workspace { padding: 25px 12px 50px; }
  .hero, .booking-link-card { align-items: stretch; grid-template-columns: 1fr; display: grid; }
  .hero-actions, .link-actions { width: 100%; }
  .hero-actions > *, .link-actions > * { flex: 1; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .calendar-day { min-height: 78px; padding: 5px; }
  .day-events { margin-top: 4px; }
  .day-event { padding: 3px; font-size: .55rem; }
  .weekday-row span { font-size: .56rem; padding: 8px 2px; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .full { grid-column: auto; }
}
