/* Iframe tester UI */

:root {
  color-scheme: light;
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --surface-3: #e7e9f1;
  --border: #e0e3ec;
  --border-strong: #c9cdda;
  --text: #1b1d29;
  --text-muted: #646a80;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #f1eafe;
  --accent-text: #ffffff;
  --success: #15803d;
  --success-soft: #e8f6ee;
  --warning: #b45309;
  --warning-soft: #fdf3e2;
  --danger: #c0262d;
  --danger-soft: #fdecec;
  --info: #1d63c9;
  --info-soft: #e8f0fc;
  --stage-bg: #e9ebf2;
  --stage-dot: #d4d7e2;
  --code-bg: #f6f7fb;
  --shadow-sm: 0 1px 2px rgb(20 22 40 / 6%);
  --shadow-lg: 0 12px 32px rgb(20 22 40 / 14%), 0 2px 6px rgb(20 22 40 / 8%);
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar-width: 380px;
  --topbar-height: 56px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #12131a;
    --surface: #1a1c25;
    --surface-2: #222531;
    --surface-3: #2b2f3d;
    --border: #2c303e;
    --border-strong: #3d4253;
    --text: #e8e9f0;
    --text-muted: #9a9fb3;
    --accent: #a37bff;
    --accent-hover: #b796ff;
    --accent-soft: #2c2443;
    --accent-text: #14111f;
    --success: #4ccb7f;
    --success-soft: #16301f;
    --warning: #f1b04c;
    --warning-soft: #33270f;
    --danger: #ff7b7f;
    --danger-soft: #3a1a1c;
    --info: #74a8ff;
    --info-soft: #172640;
    --stage-bg: #0d0e13;
    --stage-dot: #232633;
    --code-bg: #14161e;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-lg: 0 12px 32px rgb(0 0 0 / 50%), 0 2px 6px rgb(0 0 0 / 30%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12131a;
  --surface: #1a1c25;
  --surface-2: #222531;
  --surface-3: #2b2f3d;
  --border: #2c303e;
  --border-strong: #3d4253;
  --text: #e8e9f0;
  --text-muted: #9a9fb3;
  --accent: #a37bff;
  --accent-hover: #b796ff;
  --accent-soft: #2c2443;
  --accent-text: #14111f;
  --success: #4ccb7f;
  --success-soft: #16301f;
  --warning: #f1b04c;
  --warning-soft: #33270f;
  --danger: #ff7b7f;
  --danger-soft: #3a1a1c;
  --info: #74a8ff;
  --info-soft: #172640;
  --stage-bg: #0d0e13;
  --stage-dot: #232633;
  --code-bg: #14161e;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --shadow-lg: 0 12px 32px rgb(0 0 0 / 50%), 0 2px 6px rgb(0 0 0 / 30%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

code,
pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code {
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: var(--surface-2);
}

svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Layout ---------------------------------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.app.is-sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}

.app.is-sidebar-collapsed .sidebar {
  visibility: hidden;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.url-form {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
  max-width: 900px;
}

.url-form input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 13px;
}

.url-form input:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* --- Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  border-color: var(--border-strong);
  background: var(--surface);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn--sm {
  width: 28px;
  height: 28px;
}

.icon-btn--sm svg {
  width: 16px;
  height: 16px;
}

.chip {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 1px;
}

.tag:empty {
  display: none;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.segmented button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.segmented--sm button {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
}

/* --- Sidebar --------------------------------------------------------------- */

.tabs {
  display: flex;
  flex: none;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 8px 0;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  height: 36px;
  padding: 0 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow-y: auto;
}

.tab-panel.is-active {
  display: flex;
}

.card {
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.card > summary::-webkit-details-marker {
  display: none;
}

.card-title {
  font-weight: 700;
}

.chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.15s;
}

details:not([open]) > summary .chevron {
  transform: rotate(-90deg);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 12px 12px;
}

.card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.card-actions--start {
  justify-content: flex-start;
}

.hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.group-title {
  margin: 4px 0 -4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sub-details > summary {
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
}

.sub-details .checks {
  margin-top: 8px;
}

/* --- Form fields ----------------------------------------------------------- */

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

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select,
.code-input,
.viewport-custom input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.field input:focus,
.field select:focus,
.code-input:focus,
.viewport-custom input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.code-input {
  height: auto;
  padding: 8px 10px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.switch-row small,
.check small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

.switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--border-strong);
  cursor: pointer;
  transition: background-color 0.15s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
  transition: transform 0.15s;
}

.switch:checked {
  background: var(--accent);
}

.switch:checked::after {
  transform: translateX(16px);
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checks--compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.check--inline {
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.check--inline input {
  margin: 0;
}

.check .badge-doc {
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
}

.presets {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 12px;
}

.attr-preview,
.code-block {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-block {
  white-space: pre;
  overflow-x: auto;
  overflow-wrap: normal;
}

.attr-preview:empty {
  display: none;
}

.checklist h4 {
  margin: 4px 0 -6px;
  font-size: 13px;
}

.checklist p,
.checklist ul {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

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

.checklist li + li {
  margin-top: 4px;
}

.copy-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-line code {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  overflow-wrap: anywhere;
}

/* --- Stage ----------------------------------------------------------------- */

.stage-toolbar .segmented {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.viewport-custom {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.viewport-custom input {
  width: 76px;
  height: 30px;
}

.status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.status-chip b {
  color: var(--text);
  font-weight: 600;
}

.status-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.status-chip[data-state="ok"] i {
  background: var(--success);
}

.status-chip[data-state="pending"] i {
  background: var(--warning);
  animation: pulse 1.2s ease-in-out infinite;
}

.status-chip[data-state="warn"] {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.status-chip[data-state="warn"] i {
  background: var(--warning);
}

.status-chip[data-state="error"] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.status-chip[data-state="error"] i {
  background: var(--danger);
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
}

.alerts:not(:empty) {
  max-height: 40%;
  padding-top: 10px;
  padding-bottom: 10px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
}

.alert {
  display: flex;
  flex: none;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 13px;
}

.alert--warn {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.alert--error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.alert--info {
  border-color: var(--info);
  background: var(--info-soft);
}

.alert-body {
  flex: 1;
  min-width: 0;
}

.alert-body strong {
  display: block;
  margin-bottom: 2px;
}

.alert-body p {
  margin: 0;
}

.alert-body summary {
  cursor: pointer;
}

.alert-action {
  margin-top: 8px;
}

.alert-body ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.alert-body code {
  background: rgb(127 127 127 / 15%);
}

.stage {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background-color: var(--stage-bg);
  background-image: radial-gradient(var(--stage-dot) 1px, transparent 1px);
  background-size: 16px 16px;
}

.device {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
}

.device iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.device.is-sized {
  flex: none;
  margin: auto;
  padding: 32px 0 24px;
}

.device.is-sized iframe {
  flex: none;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.device-label {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.device:not(.is-sized) .device-label {
  display: none;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: auto;
}

.empty-card {
  max-width: 520px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.empty-icon {
  font-size: 40px;
}

.empty-card h1 {
  margin: 8px 0;
  font-size: 20px;
}

.empty-card p {
  margin: 0;
  color: var(--text-muted);
}

.recent {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  text-align: left;
}

.recent:empty {
  display: none;
}

.recent-title {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.recent a {
  display: block;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Console --------------------------------------------------------------- */

.console {
  display: flex;
  flex-direction: column;
  height: 240px;
  min-height: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.console.is-collapsed {
  height: auto;
}

.console.is-collapsed .log {
  display: none;
}

.console.is-collapsed .console-toggle .chevron {
  transform: rotate(-90deg);
}

.console-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}

.console-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 700;
  cursor: pointer;
}

.console-header .icon-btn {
  margin-left: auto;
}

.log {
  flex: 1;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
}

.log-empty {
  padding: 10px 12px;
  color: var(--text-muted);
  font-family: var(--font);
}

.log-entry > details > summary,
.log-entry > .log-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 12px;
  list-style: none;
}

.log-entry > details > summary {
  cursor: pointer;
}

.log-entry > details > summary::-webkit-details-marker {
  display: none;
}

.log-entry:hover {
  background: var(--surface-2);
}

.log-entry--warn {
  background: var(--warning-soft);
}

.log-entry--error {
  background: var(--danger-soft);
}

.log-time {
  flex: none;
  color: var(--text-muted);
}

.log-badge {
  flex: none;
  min-width: 64px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
}

.log-badge--resizer {
  background: var(--accent-soft);
  color: var(--accent);
}

.log-badge--message {
  background: var(--info-soft);
  color: var(--info);
}

.log-badge--tcf {
  background: var(--success-soft);
  color: var(--success);
}

.log-title {
  flex: none;
  font-family: var(--font);
  font-weight: 600;
}

.log-summary {
  min-width: 0;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-detail {
  margin: 0 12px 6px 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--code-bg);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 240px;
  overflow: auto;
}

/* --- Toast ----------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
}

.toast--error {
  background: var(--danger);
  color: #fff;
}

/* --- Guided tour (driver.js) ---------------------------------------------- */

#btn-tour {
  position: relative;
}

#btn-tour.has-hint::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

/* Instant layout changes so that driver.js measures the final positions */
.app.is-touring .sidebar,
.app.is-touring .chevron {
  transition: none;
}

.driver-popover.tour-popover {
  --driver-popover-font-family: var(--font);
  max-width: 340px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.tour-popover .driver-popover-title {
  font-size: 16px;
}

.tour-popover .driver-popover-description {
  color: var(--text-muted);
  font-size: 13.5px;
}

.tour-popover .driver-popover-description code,
.tour-popover .driver-popover-description kbd {
  padding: 0.05em 0.35em;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.tour-popover .driver-popover-progress-text {
  color: var(--text-muted);
  font-size: 12px;
}

.tour-popover .driver-popover-close-btn {
  color: var(--text-muted);
}

.tour-popover .driver-popover-close-btn:hover,
.tour-popover .driver-popover-close-btn:focus {
  color: var(--text);
}

/* driver.js focuses this button on each step */
.tour-popover .driver-popover-close-btn:focus-visible {
  border-radius: 6px;
  outline-offset: -4px;
}

.tour-popover .driver-popover-footer-btn {
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-shadow: none;
}

.tour-popover .driver-popover-footer-btn:hover,
.tour-popover .driver-popover-footer-btn:focus {
  background: var(--surface-2);
}

.tour-popover .driver-popover-next-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.tour-popover .driver-popover-next-btn:hover,
.tour-popover .driver-popover-next-btn:focus {
  background: var(--accent-hover);
}

.tour-popover .driver-popover-arrow-side-left {
  border-left-color: var(--surface);
}

.tour-popover .driver-popover-arrow-side-right {
  border-right-color: var(--surface);
}

.tour-popover .driver-popover-arrow-side-top {
  border-top-color: var(--surface);
}

.tour-popover .driver-popover-arrow-side-bottom {
  border-bottom-color: var(--surface);
}

/* --- Responsive ------------------------------------------------------------ */

@media (max-width: 1100px) {
  .btn-ghost#btn-share span,
  .btn-ghost#btn-tour span {
    display: none;
  }

  .status {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .app,
  .app.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: var(--topbar-actual-height, var(--topbar-height));
    bottom: 0;
    left: 0;
    z-index: 20;
    width: min(var(--sidebar-width), 100%);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform 0.2s;
  }

  .app.is-sidebar-open .sidebar {
    transform: none;
  }

  .app.is-sidebar-collapsed .sidebar {
    visibility: visible;
  }

  .workspace {
    grid-column: 1;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 8px 8px;
  }

  .url-form {
    order: 3;
    flex-basis: 100%;
  }

  .brand span,
  #btn-open-src,
  #btn-theme {
    display: none;
  }

  .url-form .btn {
    padding: 0 10px;
  }

  .stage-toolbar {
    padding: 8px;
  }

  .console {
    height: 180px;
  }

  .console-header .check--inline {
    display: none;
  }
}
