:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9e0ec;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --danger: #b42318;
  --ok: #067647;
  --radius: 10px;
  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;
  background: var(--bg);
  color: var(--text);
}

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0 16px;
}

button:hover {
  background: var(--accent-dark);
}

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

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

button.secondary:hover {
  background: #eef4ff;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
}

.brand {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.2;
}

.lede {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.api-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 10px 16px;
}

.api-chip span {
  margin-right: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(23, 32, 51, 0.07);
  padding: 22px;
}

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

.panel-heading p,
.hint {
  margin-bottom: 0;
  color: var(--muted);
}

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

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

.booking-panel {
  grid-row: span 2;
}

.wide-panel {
  grid-column: 1 / -1;
}

.form {
  display: grid;
  gap: 14px;
}

.compact-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.hint {
  margin-top: 14px;
  font-size: 14px;
}

.details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 16px;
  margin: 0;
}

.details dt {
  color: var(--muted);
  font-weight: 700;
}

.details dd {
  margin: 0;
}

.stack {
  display: grid;
  gap: 10px;
}

.panel-stack {
  margin-top: 16px;
}

.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
  padding: 13px;
}

.item strong {
  display: block;
  margin-bottom: 4px;
}

.item span {
  color: var(--muted);
  font-size: 14px;
}

.appointment-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.appointment-item > div {
  min-width: 0;
}

.appointment-item .danger-button {
  flex: 0 0 auto;
}

.appointment-note {
  display: block;
  margin-top: 6px;
}

.item-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.item-heading,
.button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.item-heading {
  margin-bottom: 8px;
}

.button-row {
  justify-content: flex-start;
  margin-top: 12px;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.checkbox-label {
  align-items: center;
  display: flex;
  min-height: 43px;
}

.checkbox-label input {
  width: auto;
}

.child-item.inactive {
  opacity: 0.72;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  text-transform: uppercase;
}

.ok-badge {
  border-color: rgba(6, 118, 71, 0.35);
  color: var(--ok);
}

.muted-badge {
  background: #eef2f7;
}

.danger-button {
  border: 1px solid rgba(180, 35, 24, 0.2);
  background: #fff5f4;
  color: var(--danger);
}

.danger-button:hover {
  background: #ffe7e3;
}

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

.catalog-item {
  min-width: 0;
}

.wide-item {
  grid-column: 1 / -1;
}

.mini-details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 10px;
  margin: 12px 0 0;
  font-size: 13px;
}

.mini-details dt {
  color: var(--muted);
  font-weight: 800;
}

.mini-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 700;
}

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

.status.ok {
  color: var(--ok);
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .hero,
  .row-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .api-chip {
    width: fit-content;
  }

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

  .compact-form,
  .inline-form,
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .button-row {
    align-items: stretch;
    flex-direction: column;
  }
}
