/* ============================================================
   QA Candidate Testing — Design Tokens
   Clean modern SaaS aesthetic (Linear / Vercel inspired)
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-muted: #f4f4f5;
  --bg-hover: #f1f1f2;

  /* Text */
  --fg: #09090b;
  --fg-muted: #52525b;
  --fg-subtle: #71717a;
  --fg-faint: #a1a1aa;

  /* Borders */
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --border-faint: #ececef;

  /* Accent (tweakable) */
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-fg: #ffffff;
  --accent-soft: #eef2ff;
  --accent-soft-fg: #3730a3;

  /* Semantic */
  --success: #16a34a;
  --success-soft: #dcfce7;
  --warning: #ca8a04;
  --warning-soft: #fef9c3;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-sm: 0 1px 3px rgba(9, 9, 11, 0.06), 0 1px 2px rgba(9, 9, 11, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(9, 9, 11, 0.08), 0 2px 4px -2px rgba(9, 9, 11, 0.04);
  --shadow-lg: 0 12px 32px -8px rgba(9, 9, 11, 0.12), 0 4px 8px -4px rgba(9, 9, 11, 0.06);
  --shadow-focus: 0 0 0 3px color-mix(in oklch, var(--accent) 22%, transparent);

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 20px;
  --r-full: 999px;

  /* Density (tweakable) */
  --d: 1;
  --space-1: calc(4px * var(--d));
  --space-2: calc(8px * var(--d));
  --space-3: calc(12px * var(--d));
  --space-4: calc(16px * var(--d));
  --space-5: calc(20px * var(--d));
  --space-6: calc(24px * var(--d));
  --space-8: calc(32px * var(--d));
  --space-10: calc(40px * var(--d));
  --space-12: calc(48px * var(--d));
  --space-16: calc(64px * var(--d));

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #09090b;
  --bg-elevated: #18181b;
  --bg-muted: #1c1c1f;
  --bg-hover: #27272a;

  --fg: #fafafa;
  --fg-muted: #a1a1aa;
  --fg-subtle: #71717a;
  --fg-faint: #52525b;

  --border: #27272a;
  --border-strong: #3f3f46;
  --border-faint: #1f1f23;

  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  --accent-soft-fg: color-mix(in oklch, var(--accent) 70%, #ffffff);

  --success-soft: rgba(22, 163, 74, 0.18);
  --warning-soft: rgba(202, 138, 4, 0.18);
  --danger-soft: rgba(220, 38, 38, 0.2);
  --info-soft: rgba(37, 99, 235, 0.18);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.6);
}

/* ===== reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--font-mono); }

/* ===== layout primitives ===== */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 56px;
  padding: 0 var(--space-6);
  background: color-mix(in oklch, var(--bg-elevated) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: var(--r-md);
  background: var(--fg);
  color: var(--bg-elevated);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 13px;
}
.topbar-crumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg-muted);
  font-size: 14px;
}
.topbar-crumbs .sep { color: var(--fg-faint); }
.topbar-crumbs a:hover { color: var(--fg); }
.topbar-spacer { flex: 1; }
.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 13px;
  color: var(--fg-muted);
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--accent);
  color: var(--accent-fg);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-6);
}
.container-narrow {
  max-width: 760px;
}

/* ===== buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-fg);
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--fg);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--fg); }

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

/* ===== inputs ===== */
.input, .textarea, .select {
  display: block;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-elevated);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.input::placeholder, .textarea::placeholder { color: var(--fg-faint); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
.textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
}
.field-hint {
  font-size: 12px;
  color: var(--fg-muted);
}
.field-error {
  font-size: 12px;
  color: var(--danger);
}

/* ===== card ===== */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}
.card-pad { padding: var(--space-6); }

/* ===== badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-full);
  background: var(--bg-muted);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
}
.badge-mono { font-family: var(--font-mono); }
.badge-accent { background: var(--accent-soft); color: var(--accent-soft-fg); border-color: transparent; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ===== utility text ===== */
.h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0;
}
.h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0;
}
.h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.subtle { color: var(--fg-muted); }
.mono { font-family: var(--font-mono); }
.kbd {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ===== page-loader (every nav has small delay) ===== */
.page-loader {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  z-index: 100;
  overflow: hidden;
}
.page-loader-bar {
  height: 100%;
  background: var(--accent);
  width: 30%;
  animation: page-loader 1.2s ease-in-out infinite;
}
@keyframes page-loader {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.page-skeleton {
  padding: var(--space-10) var(--space-6);
  max-width: 1080px;
  margin: 0 auto;
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 0%, var(--bg-hover) 50%, var(--bg-muted) 100%);
  background-size: 200% 100%;
  border-radius: var(--r-md);
  animation: skeleton 1.4s ease-in-out infinite;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== login screen ===== */
.login-screen {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.login-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
}
.login-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.login-card .h1 { font-size: 26px; }
.login-form { display: flex; flex-direction: column; gap: var(--space-4); }
.login-credentials-hint {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklch, var(--accent) 20%, transparent);
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--accent-soft-fg);
}
.login-credentials-hint code {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.login-illustration {
  background:
    radial-gradient(circle at 30% 20%, color-mix(in oklch, var(--accent) 22%, transparent), transparent 55%),
    radial-gradient(circle at 75% 75%, color-mix(in oklch, var(--accent) 16%, transparent), transparent 60%),
    var(--bg-elevated);
  border-left: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-illustration-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-faint) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 80%);
}
.login-illustration-inner {
  position: relative;
  z-index: 1;
  padding: var(--space-8);
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.login-illust-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 13px;
  color: var(--fg-muted);
}
.login-illust-card .num {
  width: 28px;
  height: 28px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  background: var(--bg-muted);
  color: var(--fg);
  flex-shrink: 0;
}

@media (max-width: 880px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-illustration { display: none; }
}

/* ===== home grid ===== */
.home-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
  text-align: left;
  font: inherit;
  color: inherit;
}
.topic-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.topic-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
.topic-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.topic-card-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-faint);
  letter-spacing: 0.05em;
}
.topic-card-time {
  font-size: 11px;
  color: var(--fg-muted);
  background: var(--bg-muted, color-mix(in oklch, var(--fg) 6%, transparent));
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.topic-card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg);
}
.topic-card-desc {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.topic-card-foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-faint);
}

.home-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.search-input {
  flex: 1;
  max-width: 320px;
  position: relative;
}
.search-input .input { padding-left: 32px; }
.search-input svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-faint);
  pointer-events: none;
}

/* ===== topic page ===== */
.topic-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}
.topic-meta-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg-muted);
  font-size: 13px;
}
.topic-title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: 0;
}

.section {
  margin-bottom: var(--space-8);
}
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.section-label::before {
  content: "";
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
}
.section-body {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.65;
  text-wrap: pretty;
}
.section-body p { margin: 0 0 var(--space-3); }
.section-body p:last-child { margin-bottom: 0; }
.section-body strong { color: var(--fg); font-weight: 600; }
.section-body code {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--fg);
}

.scenario-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: scenario;
}
.scenario-list li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-3) 0;
  font-size: 14px;
  color: var(--fg);
  line-height: 1.55;
}
.scenario-list li::before {
  counter-increment: scenario;
  content: counter(scenario);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
}

/* Test surface — clearly demarcated playground area */
.test-surface {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.test-surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--bg-muted);
  font-size: 12px;
  color: var(--fg-muted);
}
.test-surface-head .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--success);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--success) 18%, transparent);
}
.test-surface-body {
  padding: var(--space-8) var(--space-6);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.test-result {
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  width: 100%;
}
.test-result.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.test-result.danger  { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* Navigation footer on topic pages */
.topic-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}
.topic-nav a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--fg-muted);
  font-size: 13px;
  padding: var(--space-3);
  border-radius: var(--r-md);
  cursor: pointer;
}
.topic-nav a:hover { background: var(--bg-hover); color: var(--fg); }
.topic-nav a strong { font-weight: 600; color: var(--fg); font-size: 14px; }
.topic-nav .next { text-align: right; align-items: flex-end; }
.topic-nav .placeholder { visibility: hidden; }

/* Empty state */
.empty {
  text-align: center;
  padding: var(--space-12);
  color: var(--fg-muted);
}

/* ===== topic components — local styles ===== */
.tc-row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.tc-stack { display: flex; flex-direction: column; gap: var(--space-3); width: 100%; max-width: 420px; }

/* Hidden Layers */
.hl-stack {
  position: relative;
  width: 200px;
  height: 80px;
}
.hl-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--r-md);
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: white;
}
.hl-btn.blue { background: #2563eb; }
.hl-btn.green { background: #16a34a; }

/* Progress bar */
.pb-track {
  width: 100%;
  height: 18px;
  background: var(--bg-muted);
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.pb-fill {
  height: 100%;
  background: var(--accent);
  transition: width 100ms linear;
}
.pb-label {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  min-width: 56px;
  text-align: right;
}

/* Scrollbars */
.sb-container {
  width: 100%;
  height: 200px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: auto;
  background: var(--bg-muted);
  position: relative;
}
.sb-inner {
  width: 2400px;
  height: 600px;
  position: relative;
  background:
    linear-gradient(var(--border-faint) 1px, transparent 1px) 0 0/40px 40px,
    linear-gradient(90deg, var(--border-faint) 1px, transparent 1px) 0 0/40px 40px;
}
.sb-button {
  position: absolute;
  top: 480px;
  left: 2200px;
}

/* Dynamic table */
.dt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dt-table th, .dt-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.dt-table th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-muted);
  background: var(--bg-muted);
}
.dt-cpu-label {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
}

/* Visibility playground */
.vs-target {
  padding: 12px 24px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  display: inline-block;
}
.vs-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-2);
}

/* Overlapped */
.ov-container {
  position: relative;
  width: 100%;
  max-width: 360px;
  height: 110px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: auto;
  padding: var(--space-3);
  background: var(--bg-muted);
}
.ov-fixed {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  margin-bottom: var(--space-2);
}

/* File upload */
.fu-drop {
  width: 100%;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  background: var(--bg-muted);
  transition: border-color 120ms, background 120ms;
  cursor: pointer;
}
.fu-drop.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.fu-drop input { display: none; }
.fu-drop-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto var(--space-3);
  color: var(--fg-muted);
}
.fu-files {
  margin-top: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.fu-file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13px;
  font-family: var(--font-mono);
}

/* Auto wait */
.aw-stage {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}
.aw-log {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  padding: var(--space-3);
  border-radius: var(--r-md);
  max-height: 120px;
  overflow: auto;
}

/* Frame */
.frame-wrap {
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.frame-wrap iframe {
  width: 100%;
  height: 200px;
  border: 0;
  display: block;
}

/* Chart layout */
.chart-layout {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: var(--space-5);
  width: 100%;
  align-items: start;
}
.chart-host {
  height: 280px;
  width: 100%;
  min-width: 0;
}
.chart-legend {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--space-3);
}
.chart-legend-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--space-2);
}
.chart-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chart-legend-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: var(--r-sm);
  color: var(--fg-muted);
  transition: background 120ms ease, color 120ms ease;
}
.chart-legend-list li.active {
  background: var(--accent-soft);
  color: var(--accent-soft-fg);
}
.chart-legend-list .cat { font-weight: 500; }
.chart-legend-list .val { font-family: var(--font-mono); }
@media (max-width: 640px) {
  .chart-layout { grid-template-columns: 1fr; }
}

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid color-mix(in oklch, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: var(--r-full);
  animation: spin 700ms linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Reset button on test-surface header */
.test-reset {
  background: transparent;
  border: 1px solid var(--border);
  height: 26px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  font-size: 12px;
  color: var(--fg-muted);
  cursor: pointer;
}
.test-reset:hover { background: var(--bg-hover); color: var(--fg); }

.mono { font-family: var(--font-mono); }
