:root {
  --brand: #00974a;
  --brand-dark: #006f39;
  --ink: #151a18;
  --muted: #65716c;
  --line: #d8ded9;
  --surface: #ffffff;
  --background: #f8faf6;
  --soft: #eef4ee;
  --warning: #f6e6b9;
  --warning-ink: #5f4300;
  --danger: #b42318;
  --focus: #1f7aec;
  --shadow: 0 18px 50px rgba(35, 49, 41, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: var(--brand-dark);
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.topbar {
  max-width: 1180px;
  margin: 0 auto 22px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: center;
}

.back-link {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 26px;
}

.back-link:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 8px;
}

.brand h1,
.brand p,
.section-heading h2,
.summary-panel h2,
.confirm-dialog h2,
.result-panel h2 {
  margin: 0;
}

.brand h1 {
  font-size: 24px;
  line-height: 1.15;
}

.brand p {
  color: var(--muted);
  font-size: 14px;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
}

.reservation-form,
.summary-panel,
.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.reservation-form {
  position: relative;
  overflow: hidden;
}

.loading-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  gap: 14px;
  min-height: 360px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  text-align: center;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 4px solid var(--soft);
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-section {
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  margin-bottom: 18px;
}

.step-label {
  margin: 0 0 4px;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-heading h2,
.summary-panel h2 {
  font-size: 22px;
  line-height: 1.25;
}

.pax-control {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 14px;
  align-items: center;
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 24px;
  cursor: pointer;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pax-display {
  display: grid;
  gap: 10px;
}

.pax-display strong {
  color: var(--brand);
  font-size: 34px;
  line-height: 1;
}

input[type="range"] {
  accent-color: var(--brand);
  width: 100%;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.time-header {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--soft);
  padding: 11px 13px;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
}

.compact-field {
  max-width: 180px;
}

.checkbox-line,
.switch-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-line {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.checkbox-line input {
  margin-top: 3px;
}

.branch-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice-button,
.time-button {
  min-height: 46px;
  border: 1px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 700;
}

.choice-button.is-selected,
.time-button.is-selected {
  background: var(--brand);
  color: #fff;
}

.notice {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #dfc36f;
  border-radius: 8px;
  background: var(--warning);
  color: var(--warning-ink);
}

.notice p {
  margin: 4px 0 0;
}

.contact-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.contact-link.phone {
  background: #2471d6;
}

.time-area {
  margin-top: 18px;
}

.time-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.muted {
  color: var(--muted);
}

.time-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  min-height: 48px;
}

.time-loading {
  grid-column: 1 / -1;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
}

.inline-spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 3px solid var(--soft);
  border-top-color: var(--brand);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.toggle-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.toggle-block + .toggle-block {
  margin-top: 12px;
}

.switch-line {
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.switch-line input,
.checkbox-line input {
  accent-color: var(--brand);
}

.nested-control {
  margin-top: 14px;
}

.form-actions {
  padding: 18px 24px 24px;
  display: grid;
  gap: 12px;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 8px;
  padding: 11px 18px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.form-message.error {
  color: var(--danger);
}

.error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
}

.summary-panel {
  position: sticky;
  top: 18px;
  padding: 24px;
}

.summary-content {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.summary-row {
  display: grid;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.summary-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-row strong {
  color: var(--brand-dark);
  font-size: 17px;
}

.confirm-dialog {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.confirm-summary {
  margin: 14px 0;
  color: var(--muted);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-panel {
  max-width: 520px;
  margin: 60px auto 0;
  padding: 32px;
  text-align: center;
}

.result-mark {
  width: 112px;
  height: 112px;
  margin: 0 auto 12px;
  display: grid;
  place-content: center;
  border: 5px solid var(--brand);
  border-radius: 999px;
  color: var(--brand);
  font-size: 60px;
  font-weight: 900;
}

.hidden {
  display: none !important;
}

@media (max-width: 880px) {
  .app-shell {
    padding: 16px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .summary-panel {
    position: static;
  }
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: 36px 1fr;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand p {
    display: none;
  }

  .form-section,
  .summary-panel {
    padding: 18px;
  }

  .field-grid,
  .branch-options,
  .dialog-actions {
    grid-template-columns: 1fr;
  }

  .pax-control {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .time-header {
    display: grid;
  }
}
