:root {
  color-scheme: light;
  --ink: #172b43;
  --muted: #485c72;
  --blue: #164d84;
  --blue-deep: #153b64;
  --blue-soft: #edf5ff;
  --orange: #f4a348;
  --orange-deep: #df8731;
  --orange-soft: #fff2df;
  --paper: #f3f6fa;
  --white: #fff;
  --line: #d7e1ec;
  --green: #185a40;
  --green-soft: #e5f3ea;
  --neutral-soft: #edf0f4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 "Segoe UI", system-ui, sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 66px;
}

.brand {
  margin: 0;
  color: var(--blue-deep);
  font-size: 1.0625rem;
  font-weight: 750;
}

.demo-note {
  margin: 0;
  padding: 0.28rem 0.68rem;
  border-radius: 6px;
  background: var(--orange-soft);
  color: #754616;
  font-size: 0.8125rem;
  font-weight: 650;
  white-space: nowrap;
}

.page-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 32px 0 24px;
}

.business-name {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 0.875rem;
  font-weight: 700;
}

h1, h2, h3 { margin: 0; line-height: 1.22; }

h1 {
  font-size: clamp(2rem, 3.8vw, 2.85rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

h3 { font-size: 0.975rem; }

.intro-note, .section-note, .service-duration, .site-footer, .empty-state {
  color: var(--muted);
}

.intro-note { margin: 9px 0 0; }

.service {
  flex-shrink: 0;
  padding-left: 13px;
  border-left: 3px solid var(--orange);
  font-weight: 700;
}

.service p { margin: 0; }
.service-duration { font-size: 0.875rem; font-weight: 400; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr);
  align-items: start;
  gap: 20px;
}

.column { display: grid; gap: 20px; min-width: 0; }

.card {
  min-width: 0;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.card-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.agenda-heading h2 { padding-bottom: 8px; }
.date-control { min-width: 158px; }
.schedule-group { margin-top: 22px; }

.appointments-group {
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin-block-start: 10px;
}

.slot-grid > .empty-state { grid-column: 1 / -1; }

input, select, textarea, button { font: inherit; }

.field { display: grid; gap: 5px; min-width: 0; }

label {
  font-size: 0.875rem;
  font-weight: 650;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #a9bbcf;
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
  padding: 8px 10px;
}

textarea { resize: vertical; }

input::placeholder { color: #576b81; }

button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--blue);
  border-radius: 7px;
  background: var(--blue);
  color: var(--white);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
}

button:hover { background: var(--blue-deep); }
button:disabled { cursor: not-allowed; opacity: 0.55; }

button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

.button-primary {
  border-color: #bc6619;
  background: var(--orange);
  color: #21170e;
}
.button-primary:hover { background: var(--orange-deep); }

.button-secondary, .slot {
  border-color: #96afca;
  background: var(--white);
  color: var(--blue-deep);
}

.button-secondary:hover, .slot:hover { background: var(--blue-soft); }

.slot[aria-pressed="true"], .slot[aria-selected="true"], .slot.selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-deep);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.section-note, .empty-state {
  margin: 8px 0 0;
  font-size: 0.875rem;
}

.stacked-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.stacked-form > button { justify-self: start; }

.appointment-list, .waiting-list {
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
}

.waiting-list:not(:empty) { margin-top: 16px; }

.appointment, .queue-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-wrap: anywhere;
}

.appointment p, .queue-item p { margin: 0; }

.appointment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.appointment-actions button { font-size: 0.8125rem; }

.badge, .badge-cancelled {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.8125rem;
  font-weight: 700;
}

.badge-cancelled {
  background: var(--neutral-soft);
  color: #49596a;
}

.status-message { margin: 0; }

.status-message:not(:empty) {
  margin: 0 0 20px;
  padding: 9px 13px;
  border: 1px solid #b7cce2;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 0.9rem;
}

.status-message.error, .status-message[data-kind="error"] {
  background: #fff0eb;
  border-color: #e6b3a3;
  color: #852d1c;
}

.reminder-panel { border-left: 3px solid var(--orange); }
.reminder-field { margin: 15px 0 11px; }
.reminder-field textarea { background: #fbfcfe; }
.site-footer { padding-block: 22px; font-size: 0.875rem; }

@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr); gap: 14px; }
  .column { gap: 14px; }
  .card { padding: 18px; }
}

@media (max-width: 680px) {
  .shell { width: calc(100% - 32px); }
  .page-intro { align-items: start; flex-direction: column; gap: 15px; margin-top: 23px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 360px) {
  .site-header-inner, .card-heading { flex-wrap: wrap; }
  .site-header-inner { padding-block: 11px; gap: 5px; }
  .agenda-heading h2 { padding-bottom: 0; }
  .date-control { width: 100%; }
}
