* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: #eef2f7;
  color: #202124;
  font-family: Arial, Helvetica, sans-serif;
}

button {
  font: inherit;
}

.page {
  width: min(1320px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px;
  overflow-x: hidden;
}

.topbar,
.skin-section,
.activity,
.example-footer {
  min-width: 0;
  border: 1px solid #d9dee8;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(32, 33, 36, 0.12);
}

.topbar {
  margin-bottom: 24px;
  padding: 24px;
}

.skin-section {
  margin-bottom: 28px;
  padding: 24px;
}

.activity,
.example-footer {
  margin-bottom: 28px;
  padding: 20px 24px;
}

.eyebrow {
  margin: 0;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.18;
}

h2 {
  margin-top: 4px;
  font-size: 22px;
}

.section-heading {
  margin-bottom: 20px;
}

.example-copy {
  max-width: 760px;
  color: #475569;
  line-height: 1.6;
}

.stackblitz-row-link,
.method-bar button,
.small-button,
.keyboard-switches button,
.space-mode-switches button,
.headless-toolbar button,
.headless-group-head button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #c5cae9;
  border-radius: 999px;
  background: #eef2ff;
  color: #303f9f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.stackblitz-row-link:hover,
.stackblitz-row-link:focus-visible,
.method-bar button:hover,
.method-bar button:focus-visible,
.keyboard-switches button:hover,
.keyboard-switches button:focus-visible,
.space-mode-switches button:hover,
.space-mode-switches button:focus-visible {
  border-color: #7986cb;
  background: #ffffff;
  color: #1a237e;
  outline: none;
}

.keyboard-switches button.active,
.space-mode-switches button.active,
.method-bar button.active {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.example-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
  padding: 16px;
  border: 1px solid #e2e8f0;
  background: #fafafa;
}

.demo-cell,
.code-cell,
.dropdown-stack {
  min-width: 0;
  max-width: 100%;
}

.settings-preview {
  margin: 12px 0 0;
  color: #475569;
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.method-bar,
.keyboard-switches,
.space-mode-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.keyboard-demo {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.keyboard-json,
.state-json {
  min-height: 150px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid #d9dee8;
  background: #ffffff;
  color: #334155;
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.overflow-dialog-frame {
  max-width: 460px;
  padding: 18px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.demo-dialog-surface {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: end;
  gap: 14px;
  height: 150px;
  overflow: hidden;
  padding: 18px;
  border: 1px solid #60a5fa;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

.demo-dialog-surface.opens-up {
  height: 210px;
  padding-bottom: 24px;
}

.dialog-copy {
  display: grid;
  gap: 4px;
  color: #0f172a;
  font-size: 13px;
}

.dialog-copy span {
  color: #475569;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.code-card {
  min-width: 0;
}

.code-card strong {
  display: block;
  margin-bottom: 6px;
  color: #334155;
  font-size: 12px;
  text-transform: uppercase;
}

.code-card pre {
  min-height: 180px;
  max-height: 260px;
  margin: 0;
  overflow: auto;
  padding: 12px;
  border: 1px solid #1f334a;
  background: #13263a;
  color: #edf4fb;
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.activity h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.activity p {
  margin: 0 0 8px;
  color: #475569;
}

.footer-heading {
  margin-bottom: 18px;
}

.footer-link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.footer-link-grid a {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid #d9dee8;
  background: #ffffff;
  color: #334155;
  text-decoration: none;
}

.footer-link-grid a.active,
.footer-link-grid a:hover,
.footer-link-grid a:focus-visible {
  border-color: #0f766e;
  background: #ecfdf5;
  outline: none;
}

.route-title {
  font-weight: 800;
}

.route-path {
  color: #64748b;
  font-family: "Courier New", monospace;
  font-size: 12px;
}

.option-row,
.swatch-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.option-row small {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
}

.swatch,
.country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, #0f766e, #60a5fa);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.18);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.custom-skin-sample {
  --stackline-ms-primary: #b45309;
  --stackline-ms-primary-soft: rgba(180, 83, 9, 0.14);
  --stackline-ms-surface: #fffaf0;
  --stackline-ms-surface-soft: #fffbeb;
  --stackline-ms-surface-muted: #fef3c7;
  --stackline-ms-outline: #fcd34d;
  --stackline-ms-outline-strong: #b45309;
  --stackline-ms-on-surface: #2f1b05;
  --stackline-ms-on-surface-muted: #7c5b2e;
  --stackline-ms-chip-bg: #fef3c7;
  --stackline-ms-chip-text: #92400e;
  --stackline-ms-chip-remove: #92400e;
}

.headless-shell {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid #d9dee8;
  background: #ffffff;
}

.headless-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #475569;
  font-size: 13px;
}

.headless-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px;
  border: 1px solid #c5cae9;
  border-radius: 10px;
  background: #f8fafc;
  color: #172033;
  text-align: left;
}

.headless-trigger small {
  display: block;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
}

.headless-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.headless-chip,
.headless-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e8f2ff;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
}

.headless-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 800;
}

.headless-panel {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.headless-search-label {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.headless-search {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
}

.headless-listbox {
  display: grid;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d9dee8;
  background: #f8fafc;
}

.headless-group {
  display: grid;
  gap: 6px;
}

.headless-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.headless-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid transparent;
  background: #ffffff;
  cursor: pointer;
}

.headless-option.selected {
  border-color: #93c5fd;
  background: #eff6ff;
}

.headless-option:focus-visible {
  outline: 3px solid rgba(63, 81, 181, 0.32);
  outline-offset: 2px;
}

.headless-check {
  width: 16px;
  height: 16px;
  border: 2px solid #7986cb;
  background: #ffffff;
}

.headless-check[data-checked="true"] {
  background: #0079fe;
  box-shadow: inset 0 0 0 3px #ffffff;
}

.headless-option-copy {
  min-width: 0;
}

.headless-option-copy small {
  display: block;
  color: #64748b;
}

.headless-option code {
  color: #64748b;
  font-size: 11px;
}

@media (max-width: 1120px) {
  .example-row,
  .code-grid,
  .footer-link-grid {
    grid-template-columns: 1fr;
  }

  .code-card pre {
    min-height: 150px;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 16px 8px;
  }

  .topbar,
  .skin-section,
  .activity,
  .example-footer {
    padding: 16px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 20px;
  }

  .example-row {
    gap: 14px;
    padding: 16px;
  }

  .method-bar,
  .keyboard-switches,
  .space-mode-switches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .method-bar button,
  .keyboard-switches button,
  .space-mode-switches button,
  .stackblitz-row-link {
    width: 100%;
  }

  .overflow-dialog-frame {
    max-width: 100%;
    padding: 12px;
  }

  .demo-dialog-surface,
  .demo-dialog-surface.opens-up {
    height: auto;
    min-height: 170px;
    padding: 14px;
  }

  .code-card pre {
    min-height: 132px;
    max-height: 190px;
    padding: 10px;
    overflow-wrap: normal;
    font-size: 11px;
    line-height: 1.45;
    white-space: pre;
  }
}
