:root {
  --ink: #1a1a1a;
  --paper: #f4f1ea;
  --rule: #c8c2b6;
  --muted: #6b655c;
  --accent: #2a2a2a;
  --frame-bg: #e8e4db;
  --danger: #8b2e2e;
  --radius: 6px;
  --font: ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  background: #efebe3;
  position: sticky;
  top: 0;
  z-index: 10;
}

.chrome-brand h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.chrome-brand .sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.chrome-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.seg {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}

.seg legend {
  padding: 0;
}

.seg-btn {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
  font: inherit;
  cursor: pointer;
}

.seg-btn:last-child {
  border-right: 0;
}

.seg-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--paper);
}

.toggle,
.field {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.field select {
  font: inherit;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 4px 6px;
}

.chrome-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 8px 16px 16px;
  color: var(--muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--rule);
}

.chrome-foot a {
  color: var(--ink);
}

.stage {
  padding: 16px;
  min-height: calc(100vh - 140px);
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.nav-row button,
.ab-pick select {
  font: inherit;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 6px 10px;
  cursor: pointer;
}

.hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin-left: auto;
}

.frame-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.frame-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  font-size: 0.82rem;
}

.frame-meta .id {
  font-weight: 650;
  font-family: var(--mono);
}

.frame-meta .muted {
  color: var(--muted);
}

.frame-meta a {
  color: var(--ink);
}

.frame-shell {
  background: var(--frame-bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px;
  width: fit-content;
  max-width: 100%;
}

.frame-shell iframe {
  display: block;
  border: 1px solid var(--ink);
  background: #fff;
  border-radius: 4px;
}

.vp-phone iframe {
  width: 390px;
  height: 844px;
}

.vp-desktop iframe {
  width: 1280px;
  height: 800px;
}

.mode-1up .one-up {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-ab .ab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 410px), 1fr));
  gap: 16px;
}

.mode-grid .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(410px, 1fr));
  gap: 16px;
}

.card-pending {
  border: 1px dashed var(--rule);
  border-radius: 10px;
  padding: 16px;
  background: #f7f4ee;
  min-height: 120px;
}

.card-pending .status {
  color: var(--danger);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.error {
  color: var(--danger);
  padding: 24px;
}
