.demo-system {
  --demo-system-ink: #102732;
  --demo-system-muted: #48606a;
  --demo-system-line: #d1dedc;
  --demo-system-panel: #fff;
  color: var(--demo-system-ink);
  background: #ebf1ef;
  border: 1px solid var(--demo-system-line);
  border-radius: 15px;
  overflow: hidden;
}

.demo-system-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 25px;
  align-items: center;
  justify-content: space-between;
  padding: 14px clamp(13px, 2.4vw, 28px);
  background: #102732;
  color: #f6f9f7;
}

.demo-system-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
}

.demo-system-caption > span { color: #bcd1d2; font-size: .8125rem; }

.demo-system-roles {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
}

.demo-system button,
.demo-system input,
.demo-system select { font: inherit; font-size: .875rem; }

.demo-system-roles button {
  border: 1px solid #7d9b9e80;
  border-radius: 6px;
  background: transparent;
  color: #e3edeb;
  min-height: 44px;
  padding: 5px 11px;
  cursor: pointer;
}

.demo-system-roles button[aria-pressed="true"] {
  background: #f2f6f3;
  border-color: #f2f6f3;
  color: var(--demo-system-ink);
  font-weight: 700;
}

.demo-system button:focus-visible,
.demo-system :is(input, select, summary):focus-visible {
  outline: 2px solid #a87335;
  outline-offset: 2px;
}

.demo-system-content { padding: clamp(12px, 2.2vw, 24px); }

.demo-system-layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 12px;
  align-items: start;
}

.demo-system-card,
.demo-system-subcard {
  min-width: 0;
  padding: clamp(12px, 2vw, 21px);
  background: var(--demo-system-panel);
  border: 1px solid var(--demo-system-line);
  border-radius: 9px;
}

.demo-system-subcard { background: #f8faf9; }
.demo-system-card :is(h3, h4) { margin: 0 0 11px; color: inherit; font-size: 1rem; line-height: 1.55; }
.demo-system-form { display: grid; gap: 10px; }
.demo-system-form h3 { margin: 0 0 3px; }
.demo-system label { display: grid; gap: 4px; min-width: 0; color: #304a54; font-size: .8125rem; }

.demo-system :is(input, select) {
  min-width: 0;
  min-height: 44px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #baccca;
  border-radius: 6px;
  background: #fff;
  color: var(--demo-system-ink);
}

.demo-system-action {
  width: fit-content;
  min-height: 44px;
  padding: 6px 13px;
  color: #fff;
  background: #214853;
  border: 1px solid #214853;
  border-radius: 6px;
  cursor: pointer;
}

.demo-system-action:hover { background: #15333e; }
.demo-system-visits,
.demo-system-staff { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.demo-system-visits > li,
.demo-system-staff > li {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--demo-system-line);
  border-radius: 7px;
}

.demo-system-visit-info { display: grid; gap: 3px; max-width: 100%; overflow-wrap: anywhere; }
.demo-system-visit-info strong { font-size: .875rem; }
.demo-system-visit-info :is(span, small) { color: var(--demo-system-muted); font-size: .8125rem; }
.demo-system-status {
  display: inline-block;
  color: #255260;
  background: #e5f0f0;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: .75rem;
}

.demo-system-status[data-visit-status="paid"] { color: #235745; background: #e2f0e8; }
.demo-system-status[data-visit-status="completed"] { color: #6a4318; background: #f5ead7; }
.demo-system-inline-form {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 7px;
}

.demo-system :is(.demo-system-empty, .demo-system-hint) {
  color: var(--demo-system-muted);
  font-size: .8125rem;
  line-height: 1.75;
  margin: 0;
}

.demo-system-hint { flex-basis: 100%; }
.demo-system-hint a { color: #214853; text-decoration: underline; text-underline-offset: 3px; }
.demo-system-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 13px;
}

.demo-system-metrics > div {
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: #eaf2f0;
}

.demo-system-metrics dt { color: var(--demo-system-muted); font-size: .8125rem; }
.demo-system-metrics dd {
  margin: 3px 0 0;
  font-weight: 700;
  font-size: clamp(.875rem, 1.6vw, 1.2rem);
  overflow-wrap: anywhere;
}

.demo-system-receipt {
  margin-block: 5px;
  padding-inline: 10px;
  border: 1px solid var(--demo-system-line);
  border-radius: 7px;
  overflow-wrap: anywhere;
}

.demo-system-receipt summary { min-height: 44px; padding-block: 9px; cursor: pointer; }
.demo-system-receipt dl { display: grid; gap: 5px; margin: 3px 0 10px; font-size: .8125rem; }
.demo-system-receipt dl > div { display: flex; flex-wrap: wrap; gap: 4px 10px; justify-content: space-between; }
.demo-system-receipt dd { margin: 0; font-weight: 700; }
.demo-system-feedback {
  margin: 0 clamp(12px, 2.2vw, 24px) 12px;
  color: #235745;
  font-size: .875rem;
  line-height: 1.7;
}

.demo-system-feedback:empty { margin-block-end: 0; }
.demo-system-feedback[data-tone="error"] { color: #8c341e; }

@media (max-width: 730px) {
  .demo-system-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 420px) {
  .demo-system-inline-form { grid-template-columns: minmax(0, 1fr); }
  .demo-system-metrics { grid-template-columns: minmax(0, 1fr); }
}
