.demo-header,
.demo-selection-status,
.demo-board {
  --demo-gap: 16px;
  --demo-surface: #fff;
  --demo-ink: #182b3a;
  color: var(--demo-ink);
  font-family: system-ui, sans-serif;
}
.demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  flex-wrap: wrap;
}
.demo-header h1 {
  font-size: 24px;
  margin: 0;
}
.demo-header p,
.demo-card h2,
.demo-subtitle {
  margin: 0;
}
.demo-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.demo-header button,
.demo-toggle,
.demo-retry {
  min-height: 40px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}
.demo-selection-status {
  margin: 0;
  padding: 12px 16px;
  min-height: 24px;
  background: #dceef0;
}
.demo-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  background: #f3f6f8;
}
.demo-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto 320px;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background: var(--demo-surface);
  min-width: 0;
  min-height: 0;
}
.demo-card h2 {
  font-size: 20px;
}
.demo-subtitle {
  grid-column: 1;
  color: #617180;
}
.demo-toggle {
  grid-area: 1 / 2 / 3 / 3;
}
.demo-host {
  grid-area: 3 / 1 / 4 / -1;
  min-width: 0;
  min-height: 0;
}
.demo-state {
  display: none;
  grid-area: 3 / 1 / 4 / -1;
  z-index: 1;
  margin: 0;
  padding: 24px;
  background: var(--demo-surface);
  text-align: center;
  align-content: center;
}
.demo-card:is([data-state='loading'], [data-state='empty'], [data-state='error'], [data-state='hidden']) .demo-state {
  display: block;
}
.demo-card[data-state='timeout'] .demo-state {
  display: block;
  align-self: end;
  padding: 8px;
  background: #fff4df;
}
.demo-retry:not([hidden]) {
  grid-area: 3 / 1 / 4 / -1;
  z-index: 2;
  justify-self: center;
  align-self: end;
  margin-bottom: 12px;
}
@media (width < 760px) {
  .demo-board {
    grid-template-columns: minmax(0, 1fr);
  }
  .demo-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto 320px;
  }
  .demo-toggle {
    grid-area: 3 / 1;
    justify-self: start;
  }
  .demo-host,
  .demo-state,
  .demo-retry:not([hidden]) {
    grid-area: 4 / 1 / 5 / 2;
  }
}
