
:root {
  --demo-accent: var(--accent, #0556f3);
  --demo-ink: var(--ink, #1f2a37);
  --demo-muted: #5a6570;
  --demo-surface: #ffffff;
  --demo-tint: #eef4ff;
  --demo-line: #cfdcf2;
  --demo-on-accent: #ffffff;
}
:root[data-theme="dark"] {
  --demo-ink: #e6edf5;
  --demo-muted: #a7b3c2;
  --demo-surface: #141b24;
  --demo-tint: #17243a;
  --demo-line: #2b3b55;
}

.demo-ribbon {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 0 0 14px; padding: 8px 12px;
  background: var(--demo-tint); border: 1px solid var(--demo-line); border-radius: 10px;
  color: var(--demo-ink); font-size: 13px; line-height: 1.4;
}
.demo-ribbon a { color: var(--demo-accent); font-weight: 600; text-decoration: none; margin-left: auto; white-space: nowrap; }
.demo-ribbon a:hover, .demo-ribbon a:focus-visible { text-decoration: underline; }
.demo-ribbon a.demo-version { margin-left: auto; font-weight: 600; color: var(--demo-muted); }
.demo-ribbon a.demo-version + a { margin-left: 0; }
.demo-tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--demo-accent); color: var(--demo-on-accent);
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}

.demo-panel { max-width: 720px; }
.demo-panel h1 { font-size: 22px; margin: 0; }

.demo-dialog {
  position: fixed; inset: 0; z-index: 10000;
  display: grid; place-items: center; padding: 16px;
  background: rgba(15, 23, 42, .45);
}
.demo-dialog-box {
  width: min(460px, 100%); padding: 20px 22px;
  background: var(--demo-surface); color: var(--demo-ink);
  border: 1px solid var(--demo-line); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .25);
}
.demo-dialog-box h2 { margin: 0 0 8px; font-size: 18px; }
.demo-dialog-box p { margin: 0 0 16px; color: var(--demo-muted); font-size: 14px; line-height: 1.5; }
.demo-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-dialog-actions .btn { min-height: 36px; }

@media (prefers-reduced-motion: no-preference) {
  .demo-dialog-box { animation: demo-pop .14s ease-out; }
  @keyframes demo-pop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media print { .demo-ribbon, .demo-dialog { display: none !important; } }
