* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 0;
  max-width: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
}

.showcase-header {
  padding: 20px 24px;
  background: #16213e;
  border-bottom: 1px solid #0f3460;
}

.showcase-header h1 {
  margin: 0 0 4px;
  font-size: 22px;
  color: #fff;
}

.showcase-header p {
  margin: 0 0 8px;
  font-size: 13px;
  color: #888;
}

.back-link {
  font-size: 13px;
  color: #4fc3f7;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.showcase-layout {
  display: flex;
  min-height: calc(100vh - 100px);
}

.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #16213e;
  border-right: 1px solid #0f3460;
  padding: 16px 0;
  overflow-y: auto;
  position: relative;
  z-index: 1;
}

.sidebar-search {
  padding: 0 12px 12px;
}

.sidebar-search input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #24466d;
  border-radius: 4px;
  background: #0d1b2a;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.sidebar-search input:focus {
  border-color: #4fc3f7;
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.15);
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-group {
  padding: 4px 0 8px;
  border-top: 1px solid rgba(79, 195, 247, 0.12);
}

.sidebar-search + .sidebar-group {
  border-top: none;
}

.sidebar-group-title {
  padding: 8px 16px 2px;
  color: #7f8ea3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.sidebar-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4fc3f7;
  padding: 8px 16px 4px;
  margin: 0;
  cursor: pointer;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 24px;
  font-size: 13px;
  color: #aaa;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  border-left: 3px solid transparent;
}

.nav-badge {
  flex: 0 0 auto;
  min-width: 46px;
  padding: 2px 5px;
  border: 1px solid #24466d;
  border-radius: 4px;
  color: #4fc3f7;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-list li:hover {
  background: #1a1a3e;
  color: #fff;
}

.sidebar-list li.active {
  background: #0f3460;
  color: #fff;
  border-left-color: #4fc3f7;
}

.content {
  flex: 1;
  padding: 24px;
  overflow: visible;
  min-height: 0;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #666;
  font-size: 16px;
}

.example-meta {
  margin-bottom: 16px;
}

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

.example-breadcrumb {
  margin-bottom: 6px;
  color: #7f8ea3;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.example-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.example-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 3px 7px;
  border: 1px solid #24466d;
  border-radius: 4px;
  background: #0d1b2a;
  color: #4fc3f7;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.example-badge_option {
  color: #80cbc4;
  border-color: #26645e;
}

.example-badge_event {
  color: #ffcc80;
  border-color: #7d5a24;
}

.example-badge_method {
  color: #ce93d8;
  border-color: #6d3f75;
}

.example-badge_wrapper {
  color: #90caf9;
  border-color: #335d86;
}

.standalone-link {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #24466d;
  border-radius: 4px;
  color: #4fc3f7;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.standalone-link:hover {
  border-color: #4fc3f7;
  color: #fff;
}

.example-meta h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: #fff;
}

.example-desc {
  margin: 0;
  font-size: 13px;
  color: #888;
}

.example-preview {
  margin-bottom: 20px;
}

.example-state {
  margin: 0 0 20px;
  max-width: 720px;
  border: 1px solid #24466d;
  border-radius: 6px;
  overflow: hidden;
  background: #0d1b2a;
}

.example-state h3 {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #24466d;
  color: #aaa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.example-state pre {
  margin: 0;
  padding: 12px;
  color: #80cbc4;
  font:
    12px/1.5 'Fira Code',
    'Consolas',
    monospace;
  overflow-x: auto;
  white-space: pre-wrap;
}

.reference-panel {
  max-width: 1000px;
}

.reference-intro {
  margin: 0 0 10px;
  color: #aaa;
  font-size: 13px;
}

.reference-filter {
  width: min(100%, 360px);
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid #24466d;
  border-radius: 4px;
  background: #0d1b2a;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.reference-filter:focus {
  border-color: #4fc3f7;
  box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.15);
}

.reference-table-scroll {
  overflow-x: auto;
  border: 1px solid #24466d;
  border-radius: 6px;
  background: #0d1b2a;
}

.reference-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.reference-table th,
.reference-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #24466d;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
  line-height: 1.45;
}

.reference-table th {
  color: #4fc3f7;
  background: #10243a;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.reference-table tr:last-child td {
  border-bottom: none;
}

.reference-table code {
  color: #80cbc4;
  font:
    12px/1.45 'Fira Code',
    'Consolas',
    monospace;
  overflow-wrap: anywhere;
  white-space: normal;
}

.reference-table th:nth-child(1),
.reference-table td:nth-child(1) {
  width: 22%;
}

.reference-table th:nth-child(2),
.reference-table td:nth-child(2) {
  width: 28%;
}

.reference-table th:nth-child(3),
.reference-table td:nth-child(3) {
  width: 20%;
}

.reference-table[data-reference-type='options'] th:nth-child(1),
.reference-table[data-reference-type='options'] td:nth-child(1) {
  width: 14%;
}

.reference-table[data-reference-type='options'] th:nth-child(2),
.reference-table[data-reference-type='options'] td:nth-child(2) {
  width: 18%;
}

.reference-table[data-reference-type='options'] th:nth-child(3),
.reference-table[data-reference-type='options'] td:nth-child(3) {
  width: 14%;
}

.reference-table[data-reference-type='callbacks'] th:nth-child(1),
.reference-table[data-reference-type='callbacks'] td:nth-child(1) {
  width: 16%;
}

.reference-table[data-reference-type='callbacks'] th:nth-child(2),
.reference-table[data-reference-type='callbacks'] td:nth-child(2) {
  width: 30%;
}

.troubleshooting-panel {
  display: grid;
  gap: 12px;
  max-width: 1000px;
}

.troubleshooting-intro {
  margin: 0;
  color: #aaa;
  font-size: 13px;
  line-height: 1.55;
}

.troubleshooting-card {
  border: 1px solid #24466d;
  border-radius: 6px;
  background: #0d1b2a;
  overflow: hidden;
}

.troubleshooting-card h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid #24466d;
  color: #fff;
  font-size: 15px;
}

.troubleshooting-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.troubleshooting-cell {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid #24466d;
}

.troubleshooting-cell:last-child {
  border-right: none;
}

.troubleshooting-cell h4 {
  margin: 0 0 6px;
  color: #4fc3f7;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.troubleshooting-cell p {
  margin: 0;
  color: #c6d0dc;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.troubleshooting-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 12px;
}

.troubleshooting-code {
  margin: 0;
  padding: 12px;
  border-top: 1px solid #24466d;
  background: #081421;
  color: #80cbc4;
  font:
    12px/1.5 'Fira Code',
    'Consolas',
    monospace;
  overflow-x: auto;
  white-space: pre-wrap;
}

.example-preview .input-group {
  max-width: 320px;
}

.example-preview .input-group_range {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 320px));
  gap: 12px;
  max-width: 660px;
}

.example-preview .range-field {
  min-width: 0;
}

.example-preview .range-control {
  position: relative;
  width: 100%;
}

.example-preview .range-control .dtp-host {
  width: 100%;
}

.example-preview .input-group label {
  display: block;
  font-size: 13px;
  color: #aaa;
  margin-bottom: 4px;
}

.example-preview .input-group input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #0d1b2a;
  color: #fff;
  outline: none;
}

.example-preview .input-group input:focus {
  border-color: #4fc3f7;
}

.example-preview .iframe-wrapper {
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  max-width: 100%;
}

.example-preview .iframe-wrapper iframe {
  width: 100%;
  border: none;
  display: block;
}

.wrapper-contract {
  display: grid;
  gap: 16px;
}

.wrapper-summary {
  padding: 12px 14px;
  border: 1px solid #26384d;
  border-radius: 6px;
  background: #0b1624;
}

.wrapper-summary h3 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 14px;
}

.wrapper-summary p {
  margin: 0;
  color: #b6c2d2;
  font-size: 13px;
  line-height: 1.45;
}

.wrapper-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.wrapper-links a,
.wrapper-links span {
  display: block;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #24466d;
  border-radius: 6px;
  color: #90caf9;
  background: #0d1b2a;
  font-size: 12px;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.wrapper-links a:hover {
  border-color: #4fc3f7;
  color: #fff;
}

.wrapper-links span {
  color: #b6c2d2;
  border-color: #26384d;
}

.wrapper-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.wrapper-section,
.wrapper-code-block {
  display: grid;
}

.wrapper-section h3,
.wrapper-code-block h3 {
  margin: 0;
  color: #fff;
  font-size: 13px;
}

.wrapper-code-block {
  align-content: start;
  border: 1px solid #26384d;
  border-radius: 6px;
  overflow: hidden;
  background: #0b1624;
}

.wrapper-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid #26384d;
  background: #0d1b2a;
}

.wrapper-copy-btn {
  flex: 0 0 auto;
  margin: 0;
  padding: 4px 10px;
}

.wrapper-code-block pre {
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: #0b1624;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.45;
  overflow-x: auto;
}

.wrapper-contract-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #26384d;
  border-radius: 6px;
  overflow: hidden;
}

.wrapper-contract-table th,
.wrapper-contract-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #26384d;
  border-right: 1px solid #26384d;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.wrapper-contract-table th {
  color: #90caf9;
  background: #0d1b2a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.wrapper-contract-table td {
  color: #c7d2e1;
  font-size: 13px;
  line-height: 1.45;
}

.wrapper-contract-table th:last-child,
.wrapper-contract-table td:last-child {
  border-right: 0;
}

.wrapper-contract-table tr:last-child td {
  border-bottom: 0;
}

.wrapper-contract-table code {
  white-space: normal;
}

.wrapper-contract-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.wrapper-contract-list {
  border: 1px solid #26384d;
  border-radius: 6px;
  padding: 12px;
  background: #0b1624;
}

.wrapper-contract-list h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 13px;
}

.wrapper-contract-list ul {
  margin: 0;
  padding-left: 18px;
}

.wrapper-contract-list li {
  margin: 6px 0;
  color: #b6c2d2;
  font-size: 13px;
  line-height: 1.45;
}

.example-code {
  border: 1px solid #333;
  border-radius: 6px;
  overflow: hidden;
}

.code-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: #0d1b2a;
  border-bottom: 1px solid #333;
}

.code-lang {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4fc3f7;
}

.copy-btn {
  font-size: 11px;
  padding: 4px 12px;
  border: 1px solid #333;
  border-radius: 4px;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.copy-btn:hover {
  background: #333;
  color: #fff;
}

.copy-btn.copied {
  background: #1b5e20;
  border-color: #1b5e20;
  color: #fff;
}

.example-code pre {
  margin: 0;
  padding: 16px;
  background: #0d1b2a;
  overflow-x: auto;
}

.example-code code {
  font-size: 13px;
  line-height: 1.5;
  font-family: 'Fira Code', 'Consolas', monospace;
}

.events-log {
  margin-top: 12px;
  max-width: 400px;
}

.event-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.event-btn {
  padding: 7px 12px;
  border: 1px solid #333;
  border-radius: 4px;
  background: #0d1b2a;
  color: #e0e0e0;
  font-size: 12px;
  cursor: pointer;
}

.event-btn:hover {
  border-color: #4fc3f7;
  color: #fff;
}

.listener-status {
  max-width: 520px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #24466d;
  border-radius: 4px;
  background: #0d1b2a;
  color: #80cbc4;
  font:
    12px/1.45 'Fira Code',
    'Consolas',
    monospace;
}

.accessibility-checklist {
  max-width: 680px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #24466d;
  border-radius: 6px;
  background: #0d1b2a;
}

.accessibility-checklist h4 {
  margin: 0 0 8px;
  color: #4fc3f7;
  font-size: 13px;
}

.accessibility-checklist ul {
  margin: 0;
  padding-left: 18px;
}

.accessibility-checklist li {
  margin: 0 0 5px;
  color: #aaa;
  font-size: 12px;
  line-height: 1.45;
}

.events-log h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #aaa;
}

.events-log .log-entry {
  font-size: 12px;
  padding: 4px 8px;
  margin-bottom: 2px;
  background: #0d1b2a;
  border-radius: 3px;
  color: #4fc3f7;
  font-family: 'Fira Code', 'Consolas', monospace;
}

@media (max-width: 768px) {
  .showcase-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #0f3460;
  }

  .content {
    padding: 16px;
  }

  .example-preview .input-group_range {
    grid-template-columns: minmax(0, 320px);
  }

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

  .troubleshooting-cell {
    border-right: none;
    border-bottom: 1px solid #24466d;
  }

  .troubleshooting-cell:last-child {
    border-bottom: none;
  }
}

/* ── Business-case styles ── */

.business-btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #4fc3f7;
  color: #0d1b2a;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.business-btn:hover {
  background: #29b6f6;
}

.business-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.business-form_wide {
  max-width: 680px;
}

.business-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.business-field label {
  font-size: 13px;
  color: #aaa;
}

.business-field .dtp-host {
  width: 100%;
}

.business-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.business-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.business-output {
  max-width: 680px;
  margin: 12px 0 0;
  padding: 12px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #0d1b2a;
  color: #4fc3f7;
  font:
    12px/1.5 'Fira Code',
    'Consolas',
    monospace;
  white-space: pre-wrap;
}

.business-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}
.business-modal-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  z-index: 1001;
  min-width: 280px;
}
.business-modal-box .dtp-wrapper {
  z-index: 1002 !important;
}

.business-scroll-container {
  max-height: 200px;
  overflow: auto;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px;
  background: #0d1b2a;
}
.business-scroll-container p {
  margin: 0 0 6px;
  font-size: 12px;
  color: #666;
}

.business-theme-container .dtp-host {
  --dtp-card-bg: #1e293b;
  --dtp-text-main: #e2e8f0;
  --dtp-text-muted: #94a3b8;
  --dtp-line: #334155;
  --dtp-accent: #f59e0b;
  --dtp-accent-soft: #2d1f00;
  --dtp-range-fill: #1a3a2a;
  --dtp-danger: #ef4444;
}

.business-validation {
  max-width: 320px;
}
.business-validation-input[aria-invalid='true'] {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--dtp-danger, #d3455b);
  border-radius: 4px;
  background: #0d1b2a;
  color: #fff;
  outline: none;
  box-shadow: 0 0 0 2px #d3455b2e;
}
.business-validation-msg {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--dtp-danger, #d3455b);
}

/* Guide styles */

.guide-panel {
  display: grid;
  gap: 14px;
  max-width: 980px;
}

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

.guide-note {
  min-width: 0;
  padding: 10px;
  border: 1px solid #24466d;
  border-radius: 6px;
  background: #0d1b2a;
}

.guide-note strong {
  display: block;
  margin-bottom: 4px;
  color: #4fc3f7;
  font-size: 12px;
}

.guide-note span {
  display: block;
  color: #aaa;
  font-size: 12px;
  line-height: 1.45;
}

.guide-form {
  display: grid;
  gap: 12px;
  max-width: 440px;
}

.guide-form_wide {
  max-width: 760px;
}

.guide-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.guide-range-sections {
  display: grid;
  gap: 16px;
}

.guide-range-section {
  display: grid;
  gap: 8px;
}

.guide-range-section h4 {
  margin: 0;
  color: #e0e0e0;
  font-size: 13px;
}

@media (max-width: 768px) {
  .business-range {
    grid-template-columns: minmax(0, 1fr);
  }

  .guide-notes,
  .guide-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
