:root {
  --ink: #151713;
  --green: #194d29;
  --green-dark: #123a1f;
  --sage: #aeb99b;
  --sage-light: #dfe4d5;
  --paper: #fbfaf6;
  --white: #ffffff;
  --line: #c9cbc5;
  --muted: #62675f;
  --danger: #9c2f27;
  --shadow: 0 12px 28px rgba(20, 36, 25, 0.12);
  --sans: "Helvetica Neue", "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", serif;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0; color: var(--ink); background: var(--white); font: 18px/1.85 var(--sans);
  line-break: strict; overflow-wrap: break-word; word-break: normal; text-rendering: optimizeLegibility;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 8px 14px; color: white; background: var(--green); transform: translateY(-170%); }
.skip-link:focus { transform: translateY(0); }

.site-header, .booking-shell, .admin-shell, footer { width: min(1180px, calc(100% - 80px)); margin-inline: auto; }
.site-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.site-header p { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .14em; }
.brand { font-size: 29px; font-weight: 700; letter-spacing: .14em; line-height: 1; }

.booking-shell { padding: 84px 0 110px; }
.booking-intro { max-width: 900px; }
.eyebrow { margin: 0 0 16px; color: var(--green); font-size: 14px; font-weight: 700; letter-spacing: .15em; }
h1 { margin: 0; font: 700 clamp(42px, 5.5vw, 68px)/1.25 var(--serif); letter-spacing: .06em; }
.booking-intro > p:not(.eyebrow) { max-width: 760px; margin: 28px 0 0; font-size: 20px; }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 46px 0 0; border: 1px solid var(--line); }
.summary-strip div { padding: 24px 28px; }
.summary-strip div + div { border-left: 1px solid var(--line); }
.summary-strip dt { color: var(--muted); font-size: 14px; font-weight: 700; }
.summary-strip dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; }

.booking-form { margin-top: 68px; }
.booking-step { padding: 48px 0 56px; border-top: 1px solid var(--line); }
.step-heading { display: grid; grid-template-columns: 78px 1fr; align-items: baseline; margin-bottom: 34px; }
.step-heading > span { color: var(--green); font: 700 38px/1 var(--serif); }
.step-heading h2 { margin: 0; font: 700 30px/1.4 var(--serif); }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.choice-card { position: relative; display: block; min-height: 132px; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card > span { height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 28px 32px; border: 1px solid var(--line); transition: border-color 160ms, background 160ms; }
.choice-card strong { font-size: 22px; }
.choice-card small { margin-top: 6px; font-size: 16px; }
.choice-card input:checked + span { border: 2px solid var(--green); background: var(--paper); box-shadow: inset 7px 0 0 var(--green); }
.choice-card input:focus-visible + span { outline: 3px solid var(--sage); outline-offset: 3px; }

label { display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
label > span { margin-left: 8px; color: var(--green); font-size: 13px; }
input, textarea { width: 100%; min-height: 54px; padding: 12px 15px; border: 1px solid #9fa39c; border-radius: 0; background: white; color: var(--ink); }
textarea { resize: vertical; line-height: 1.7; }
.date-field { max-width: 420px; }
.date-input-wrap {
  position: relative; display: block; min-height: 58px; margin-left: 0;
  border: 1px solid #9fa39c; background: white; color: inherit; font-size: inherit;
}
.date-input-wrap:focus-within { outline: 3px solid var(--sage); outline-offset: 3px; }
.date-input-wrap input {
  position: absolute; z-index: 3; inset: 0; min-height: 100%; padding: 0; border: 0;
  opacity: 0; cursor: pointer; touch-action: manipulation;
}
.date-input-wrap input::-webkit-calendar-picker-indicator {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0;
  opacity: 0; cursor: pointer;
}
.date-readable {
  position: absolute; z-index: 1; top: 50%; right: 56px; left: 16px; margin: 0; transform: translateY(-50%);
  color: var(--ink); font-size: 18px; font-weight: 700; line-height: 1.4; pointer-events: none;
}
.date-picker-icon {
  position: absolute; z-index: 1; top: 50%; right: 17px; width: 22px; height: 22px; transform: translateY(-50%);
  fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
.field-help, .hold-note { color: var(--muted); font-size: 16px; }
.slot-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.slot-option { min-height: 58px; border: 1px solid var(--line); background: white; cursor: pointer; font-weight: 700; }
.slot-option:hover, .slot-option[aria-pressed="true"] { color: white; border-color: var(--green); background: var(--green); }
.empty-state { grid-column: 1 / -1; margin: 0; padding: 30px; color: var(--muted); background: var(--paper); text-align: center; }
.availability-loading strong, .availability-loading span { display: block; }
.availability-loading strong { color: var(--ink); }
.availability-loading span { margin-top: 6px; font-size: 16px; }
.field-error { min-height: 1.4em; margin: 9px 0 0; color: var(--danger); font-size: 16px; font-weight: 700; }
.booking-step.has-error { background: linear-gradient(90deg, rgba(246, 208, 92, .24), transparent 42%); }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border: 2px solid var(--danger); }
.choice-card input[aria-invalid="true"] + span { border: 2px solid var(--danger); }
.slot-list[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 5px; }
.form-error-summary { margin: 22px 0 0; }

.confirmation { background: var(--paper); margin-inline: -40px; padding-inline: 40px; }
.booking-preview { margin: 0; border-top: 1px solid var(--line); }
.booking-preview div { display: grid; grid-template-columns: 180px 1fr; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.booking-preview dt { color: var(--muted); font-weight: 700; }
.booking-preview dd { margin: 0; font-weight: 700; }
.primary-button, .secondary-button, .danger-button { min-height: 58px; padding: 12px 26px; border: 1px solid var(--green); cursor: pointer; font-weight: 700; }
.primary-button { width: min(100%, 430px); display: flex; justify-content: space-between; margin-top: 28px; color: white; background: var(--green); }
.form-error-summary + .primary-button { margin-top: 16px; }
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { cursor: wait; opacity: .58; }
.secondary-button { background: white; }
.danger-button { color: var(--danger); border-color: #cda5a1; background: white; }
.status-message { margin: 30px 0 0; padding: 16px 20px; border-left: 6px solid var(--green); background: var(--paper); font-weight: 700; }
.status-message.is-error { border-color: var(--danger); color: var(--danger); }
.booking-complete { margin-top: 68px; padding: clamp(36px, 6vw, 72px); background: var(--paper); border: 1px solid var(--line); }
.booking-complete h2 { margin: 0 0 18px; font: 700 clamp(30px, 4vw, 46px)/1.35 var(--serif); }

footer { min-height: 92px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
footer .booking-footer-brand { font-size: 22px; font-weight: 700; letter-spacing: .14em; }
footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 22px; }
footer nav a { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
footer nav a:hover, footer nav a:focus-visible { color: var(--green); }

.admin-page { background: #f4f4f0; }
.admin-shell { padding: 64px 0 100px; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.admin-heading h1 { font-size: clamp(38px, 5vw, 58px); }
.admin-key { margin-top: 42px; padding: 28px 32px; background: white; border: 1px solid var(--line); }
.admin-key h2 { margin: 0 0 14px; font-size: 22px; }
.admin-key label { max-width: 420px; }
.admin-key p { margin: 10px 0 0; font-size: 15px; color: var(--muted); }
.state-filters { display: flex; gap: 10px; margin: 34px 0 18px; }
.state-filters button { min-height: 48px; padding: 8px 20px; border: 1px solid var(--line); background: white; cursor: pointer; }
.state-filters button[aria-pressed="true"] { color: white; background: var(--green); }
.admin-list { display: grid; gap: 20px; }
.admin-card { padding: 30px 34px; background: white; border: 1px solid var(--line); }
.admin-card > header { display: flex; align-items: start; justify-content: space-between; gap: 24px; }
.card-service { margin: 0; color: var(--green); font-size: 14px; font-weight: 700; letter-spacing: .08em; }
.card-date { margin: 5px 0 0; font: 700 27px/1.4 var(--serif); }
.state-badge { padding: 5px 12px; color: white; background: var(--green); font-size: 14px; font-weight: 700; }
.state-badge[data-state="rejected"], .state-badge[data-state="cancelled"], .state-badge[data-state="expired"] { color: var(--ink); background: var(--sage-light); }
.admin-details { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 28px; margin: 26px 0; }
.admin-details div { padding-top: 12px; border-top: 1px solid var(--line); }
.admin-details dt { color: var(--muted); font-size: 14px; font-weight: 700; }
.admin-details dd { margin: 3px 0 0; white-space: pre-wrap; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-actions label { flex: 1 1 360px; }
.admin-actions button { align-self: end; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header, .booking-shell, .admin-shell, footer { width: calc(100% - clamp(36px, 10.6vw, 44px)); }
  .site-header { min-height: 68px; }
  .site-header p { display: none; }
  .brand { font-size: 24px; }
  .booking-shell { padding: 56px 0 78px; }
  h1 { font-size: clamp(32px, 9vw, 40px); }
  .booking-intro > p:not(.eyebrow) { font-size: 16px; }
  .summary-strip { grid-template-columns: 1fr; margin-top: 32px; }
  .summary-strip div { padding: 17px 20px; }
  .summary-strip div + div { border-left: 0; border-top: 1px solid var(--line); }
  .summary-strip dd { font-size: 18px; }
  .booking-form { margin-top: 50px; }
  .booking-step { padding: 38px 0 44px; }
  .step-heading { grid-template-columns: 52px 1fr; margin-bottom: 26px; }
  .step-heading > span { font-size: 30px; }
  .step-heading h2 { font-size: clamp(24px, 7vw, 30px); }
  .choice-grid, .field-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 112px; }
  .choice-card > span { padding: 22px; }
  .choice-card strong { font-size: 19px; }
  .choice-card small { font-size: 15px; }
  .slot-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .confirmation { margin-inline: calc(clamp(18px, 5.3vw, 22px) * -1); padding-inline: clamp(18px, 5.3vw, 22px); }
  .booking-preview div { grid-template-columns: 1fr; gap: 2px; }
  .field-help, .hold-note, .field-error { font-size: 15px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 12px; padding-block: 24px; }
  footer nav { justify-content: flex-start; }
  .admin-heading { align-items: stretch; flex-direction: column; }
  .admin-key, .admin-card { padding: 22px; }
  .admin-card > header { flex-direction: column; }
  .admin-details { grid-template-columns: 1fr; }
}
