:root {
  --bg-top: #0f172a;
  --bg-bottom: #111827;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-border: rgba(148, 163, 184, 0.22);
  --text-main: #e5eefb;
  --text-muted: #94a3b8;
  --accent: #5eead4;
  --warn: #fbbf24;
  --error: #fb7185;
  --ok: #4ade80;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top, rgba(94, 234, 212, 0.12), transparent 28%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text-main);
}

.demo-shell {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.demo-shell[data-state="collapsed"] .demo-shell__panel,
.demo-shell[data-state="collapsed"] .demo-shell__footer {
  display: none;
}

.demo-shell[data-state="collapsed"] .demo-shell__fab {
  display: inline-flex;
}

.demo-shell__panel {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: min(26rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 1rem 1rem 0.85rem;
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
  overflow: auto;
  pointer-events: auto;
}

.demo-shell__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.demo-shell__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.demo-shell__title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.demo-shell__icon-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--text-main);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.demo-shell__copy {
  margin: 0.75rem 0 0;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

.demo-shell__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}

.demo-shell__card {
  padding: 0.75rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.demo-shell__label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.demo-shell__value {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.96rem;
  font-weight: 600;
}

.demo-shell__status {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 0.94rem;
}

.demo-shell__status[data-tone="ok"] {
  border-color: rgba(74, 222, 128, 0.35);
}

.demo-shell__status[data-tone="warn"] {
  border-color: rgba(251, 191, 36, 0.35);
}

.demo-shell__status[data-tone="error"] {
  border-color: rgba(251, 113, 133, 0.35);
}

.demo-shell__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.demo-shell__button {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  background: rgba(15, 23, 42, 0.88);
  color: var(--text-main);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
}

.demo-shell__button--accent {
  border-color: rgba(94, 234, 212, 0.34);
  color: #d9fffa;
  box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.08);
}

.demo-shell__button:disabled {
  opacity: 0.55;
  cursor: default;
}

.demo-shell__checklist {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.demo-shell__checklist strong {
  color: var(--text-main);
}

.demo-shell__footer {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 0.8rem 0.95rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: var(--text-muted);
  font-size: 0.88rem;
  pointer-events: auto;
}

.demo-shell__fab {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #d9fffa;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

@media (max-width: 720px) {
  .demo-shell__panel {
    top: auto;
    bottom: 1rem;
    max-height: min(70vh, calc(100vh - 2rem));
  }

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

  .demo-shell__actions {
    flex-direction: column;
  }

  .demo-shell__footer {
    display: none;
  }

  .demo-shell[data-state="collapsed"] .demo-shell__fab {
    bottom: env(safe-area-inset-bottom, 1rem);
  }
}
