:root {
  color-scheme: light;
  --bg: #e9f0f2;
  --ink: #161b1f;
  --muted: #65727a;
  --line: #d5dee2;
  --panel: #f8fbfb;
  --brand: #1f8f64;
  --brand-dark: #15694a;
  --danger: #cf3b3b;
  --warn-bg: #ffc8c5;
  --ok-bg: #c8f0cc;
  --free-bg: #eef4f5;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(31, 143, 100, .16), transparent 28%),
    linear-gradient(160deg, #f6faf9, var(--bg));
}

button,
input,
select {
  font: inherit;
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 12px 28px;
}

.topbar,
.admin-head,
.step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  margin-bottom: 14px;
}

.kicker,
.step-head p,
.hint,
.section-label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

h1,
h2 {
  margin: 3px 0 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 19px;
}

.admin-link,
button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  min-height: 44px;
  padding: 0 15px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.admin-link {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  min-height: 36px;
  font-size: 13px;
}

.panel {
  background: rgba(248, 251, 251, .92);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 10px 28px rgba(22, 27, 31, .12);
}

.dots {
  display: flex;
  gap: 5px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #becace;
}

.dot.active {
  background: var(--brand);
}

.step {
  display: none;
  padding-top: 16px;
}

.step.active,
.admin-view.active {
  display: block;
}

.option-list,
.agenda-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.option,
.booking-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  min-height: auto;
  padding: 11px;
  text-align: left;
  display: block;
  font-weight: 400;
}

.option strong,
.booking-card strong {
  display: block;
  font-size: 16px;
}

.option span,
.booking-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.time-range {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(31, 143, 100, .28);
  border-radius: 8px;
  background: #e9f8ef;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 800;
}

.free-slot .time-range {
  border-color: var(--line);
  background: var(--free-bg);
  color: var(--muted);
}

.option.selected {
  border-color: var(--brand);
  background: #e9f8ef;
  box-shadow: inset 0 0 0 1px var(--brand);
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.ref-card {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  min-height: 92px;
  padding: 0;
}

.ref-card.selected {
  border-color: var(--brand);
}

.day-grid,
.time-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.day-grid.compact {
  grid-template-columns: repeat(2, 1fr);
}

.time-grid {
  grid-template-columns: repeat(2, 1fr);
}

.day-btn,
.time-btn,
.tab,
.small-btn,
.secondary {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
}

.day-btn,
.time-btn {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px;
}

.day-btn strong,
.time-btn strong {
  font-size: 15px;
}

.day-btn span,
.time-btn span,
.day-btn small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  word-break: break-word;
}

.day-btn.selected,
.time-btn.selected,
.tab.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

.day-btn.selected span,
.day-btn.selected small,
.time-btn.selected span {
  color: rgba(255, 255, 255, .86);
}

.day-btn.sold-out,
.time-btn.sold-out {
  background: #ffe1df;
  color: #8b2525;
  border-color: #f0b5b1;
  text-decoration: line-through;
  opacity: .82;
}

.day-btn:disabled,
.time-btn:disabled {
  cursor: not-allowed;
}

label {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
}

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

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}

.actions .secondary {
  display: none;
}

.actions .secondary.visible {
  display: inline-flex;
}

.hint {
  min-height: 16px;
  margin-top: 10px;
}

.warning {
  min-height: 18px;
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
}

.payment-list .option {
  text-align: center;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: end center;
  padding: 16px;
  background: rgba(22, 27, 31, .42);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(100%, 390px);
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(22, 27, 31, .24);
}

.modal h2 {
  margin: 0;
}

.modal-actions {
  margin-top: 4px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.tabs .tab {
  min-width: 0;
  padding: 0 8px;
}

.admin-view {
  display: none;
}

.booking-card {
  border-left: 5px solid #b8c6cb;
}

.booking-card.done {
  background: var(--ok-bg);
  border-left-color: var(--brand);
}

.booking-card.missed {
  background: var(--warn-bg);
  border-left-color: var(--danger);
}

.booking-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.booking-actions button,
.small-btn {
  min-height: 36px;
  padding: 0 8px;
  font-size: 12px;
}

.manual-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.manual-form[hidden] {
  display: none;
}

.manual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.schedule-days {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.schedule-day {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px;
  background: #f3f6f7;
  color: var(--ink);
  border: 1px solid var(--line);
}

.schedule-day span {
  color: var(--muted);
  font-size: 12px;
}

.schedule-day.open {
  background: #e9f8ef;
  border-color: rgba(31, 143, 100, .35);
}

.schedule-day.closed {
  background: #ffe1df;
  border-color: #f0b5b1;
  color: #8b2525;
}

.schedule-day.selected {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.day-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 14px;
  border-top: 2px solid var(--line);
  color: var(--ink);
}

.day-total span {
  color: var(--muted);
}

.day-total strong {
  font-size: 18px;
}

.empty {
  padding: 18px 0;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 360px) {
  .day-grid,
  .time-grid {
    grid-template-columns: 1fr 1fr;
  }

  .day-grid.compact {
    grid-template-columns: 1fr 1fr;
  }
}
