/* =========================================
   API Tester — Line / Stroke Style
   ========================================= */

:root {
  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --border: #D0D0D0;
  --border-hover: #888;
  --border-focus: #333;
  --text-primary: #1A1A1A;
  --text-secondary: #707070;
  --text-muted: #A0A0A0;
  --accent: #1A1A1A;
  --accent-light: rgba(26, 26, 26, 0.06);
  --success: #2D8A56;
  --error: #C0392B;
  --radius: 6px;
  --font: 'IBM Plex Sans', 'Noto Sans SC', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --transition: 150ms ease;
  --grid-color: rgba(0, 0, 0, 0.03);
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font);
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  letter-spacing: 0.01em;
  min-height: 100vh;
}

/* Grid background */
.grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.logo-icon {
  flex-shrink: 0;
}

.logo-text {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.04em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.lang-toggle:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.header-link {
  display: flex;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color var(--transition), color var(--transition);
}

.header-link:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Hero */
.hero {
  text-align: center;
  padding: 48px 24px 32px;
  max-width: 600px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.3;
}

.hero-desc {
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Main */
.main {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 48px;
}

/* ═══ Layout: Primary Zone (Config + Results) ═══ */
.layout-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

/* ═══ Layout: Secondary Zone (Saved + Export + Probe) ═══ */
.layout-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.layout-secondary-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
  display: flex;
  flex-direction: column;
}

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

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.card-dot {
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--border-hover);
  border-radius: 50%;
  flex-shrink: 0;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-transform: uppercase;
  flex: 1;
}

.card-header-actions {
  display: flex;
  gap: 4px;
}

.card-body {
  padding: 20px;
  flex: 1;
}

/* Fields */
.field {
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

/* Smart paste area */
.smart-paste-area {
  margin-bottom: 16px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.01);
}

.smart-paste-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.smart-paste-input {
  width: 100%;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  resize: vertical;
  min-height: 48px;
  max-height: 160px;
  outline: none;
  transition: border-color 0.2s;
}

.smart-paste-input:focus {
  border-color: var(--text-primary);
}

.smart-paste-input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 12px;
}

.smart-paste-btn {
  margin-top: 8px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.field-input {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
}

.field-input:focus {
  border-color: var(--border-focus);
}

.field-input::placeholder {
  color: var(--text-muted);
}

.field-textarea {
  resize: vertical;
  min-height: 52px;
  line-height: 1.5;
  font-family: var(--font);
}

.field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-input-wrap .field-input {
  padding-right: 40px;
}

.field-btn-icon {
  position: absolute;
  right: 4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color var(--transition);
}

.field-btn-icon:hover {
  color: var(--text-primary);
}

/* Buttons */
.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--border-focus);
}

.btn-outline:active {
  transform: scale(0.97);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Results */
.result-state {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
}

#card-results .card-body {
  display: flex;
  flex-direction: column;
}

#state-success,
#state-error,
#state-ping {
  align-items: stretch;
  justify-content: flex-start;
}

.idle-visual {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
}

.idle-text,
.loading-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Loader */
.loader {
  display: flex;
  justify-content: center;
  padding: 24px 0 12px;
}

.loader-ring {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result indicators */
.result-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 12px;
}

.success-indicator {
  border: 1px solid var(--success);
  color: var(--success);
  background: rgba(45, 138, 86, 0.05);
}

.error-indicator {
  border: 1px solid var(--error);
  color: var(--error);
  background: rgba(192, 57, 43, 0.05);
}

.result-output {
  padding: 14px 16px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-y: auto;
}

.error-output {
  color: var(--error);
  border-color: rgba(192, 57, 43, 0.2);
  background: rgba(192, 57, 43, 0.03);
}

/* Stats */
.stats-row {
  display: flex;
  gap: 1px;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  flex: 1;
  padding: 10px 14px;
  text-align: center;
  background: var(--accent-light);
}

.stat+.stat {
  border-left: 1px solid var(--border);
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.status-badge.success {
  border-color: var(--success);
  color: var(--success);
}

.status-badge.error {
  border-color: var(--error);
  color: var(--error);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Saved list */
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Provider cards */
.provider-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}

.provider-card:hover {
  border-color: var(--border-hover);
}

.provider-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--transition);
}

.provider-header:hover {
  background: var(--accent-light);
}

.provider-expand-icon {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}

.provider-info {
  flex: 1;
  min-width: 0;
}

.provider-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.provider-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.provider-actions {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.btn-icon-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.btn-icon-sm:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* Provider model list (collapsed/expanded) */
.provider-models {
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 400px;
  overflow-y: auto;
  margin-top: -1px;
}

.provider-model-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 14px 6px 38px;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  text-align: left;
}

.provider-model-item:hover {
  background: var(--accent-light);
}

.provider-model-item+.provider-model-item {
  border-top: 1px solid var(--border);
}

.provider-model-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-model-empty {
  padding: 12px 14px 12px 38px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Model Probe */
.probe-search {
  display: flex;
  gap: 8px;
  align-items: center;
}

.probe-search .field-input {
  flex: 1;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12px;
  gap: 5px;
  white-space: nowrap;
}

.probe-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 4px;
}

.probe-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.probe-result-count {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.probe-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 6px;
  transition: border-color var(--transition);
}

.probe-result-row:hover {
  border-color: var(--border-hover);
}

.probe-result-info {
  flex: 1;
  min-width: 0;
}

.probe-result-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.probe-result-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.probe-result-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 4px;
}

.probe-result-status.ps-ok {
  color: var(--success);
  border-color: var(--success);
}

.probe-result-status.ps-fail {
  color: var(--error);
  border-color: var(--error);
}

.probe-result-status.ps-run {
  color: var(--text-muted);
}

.probe-result-status.ps-wait {
  color: var(--text-muted);
  border-color: var(--border);
}

.probe-result-latency {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  min-width: 45px;
  text-align: right;
}

.probe-no-match {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Export */
.export-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.export-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}

.export-item:hover {
  border-color: var(--border-focus);
  background: var(--accent-light);
}

.export-item:active {
  transform: scale(0.98);
}

.export-label {
  font-weight: 500;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fade-in 150ms ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 90%;
  max-width: 620px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modal-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-code {
  background: #F5F5F5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 360px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 20px;
  background: var(--text-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: all 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.footer-sub {
  margin-top: 6px;
}

.footer-sub a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dashed var(--border);
  transition: color var(--transition);
}

.footer-sub a:hover {
  color: var(--text-primary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* Security badge */
.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Field hints */
.field-hint {
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Field label badge (encrypted tag) */
.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-label-badge {
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid var(--success);
  color: var(--success);
  border-radius: 3px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Button small */
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Ping results */
.ping-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ping-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  transition: border-color 0.3s;
}

.ping-step.step-ok {
  border-color: var(--success);
}

.ping-step.step-fail {
  border-color: var(--error);
}

.ping-step.step-wait {
  border-color: var(--border);
  opacity: 0.5;
}

.ping-step.step-running {
  border-color: var(--text-muted);
}

.ping-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.ping-icon .mini-spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ping-info {
  flex: 1;
  min-width: 0;
}

.ping-label {
  font-weight: 500;
  color: var(--text-primary);
}

.ping-detail {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
  word-break: break-all;
}

/* ─── Onboarding Overlay ─── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
}

.onboarding-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  transition: opacity 200ms;
}

.onboarding-highlight {
  position: relative;
  z-index: 9001 !important;
  box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.45);
  border-radius: var(--radius);
}

.onboarding-tooltip {
  position: fixed;
  z-index: 9002;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  animation: modal-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.onboarding-step-indicator {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.onboarding-step-indicator .step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  transition: all 200ms;
}

.onboarding-step-indicator .step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

.onboarding-step-indicator .step-dot.done {
  background: var(--success);
  border-color: var(--success);
}

.onboarding-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.onboarding-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 18px;
}

.onboarding-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ─── Model Dropdown ─── */
.model-dropdown {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fade-in 150ms ease;
}

.model-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-light);
}

.model-dropdown-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.model-dropdown-count {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.model-dropdown-list {
  max-height: 200px;
  overflow-y: auto;
}

.model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.model-option:hover {
  background: var(--accent-light);
}

.model-option+.model-option {
  border-top: 1px solid var(--border);
}

.model-option.selected {
  font-weight: 600;
  color: var(--success);
}

.model-option-id {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-option-owner {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 8px;
}

.model-loading {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Fetch button spinning */
.field-btn-icon.spinning svg {
  animation: spin 0.8s linear infinite;
}

/* ─── Test All Modal ─── */
.modal-wide {
  max-width: 800px;
}

.testall-provider {
  margin-bottom: 16px;
}

.testall-provider:last-child {
  margin-bottom: 0;
}

.testall-provider-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px;
  font-weight: 600;
}

.testall-provider-name {
  flex: 1;
}

.testall-provider-url {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.testall-provider-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.testall-provider-status.s-ok {
  color: var(--success);
  border-color: var(--success);
}

.testall-provider-status.s-fail {
  color: var(--error);
  border-color: var(--error);
}

.testall-provider-status.s-run {
  color: var(--text-muted);
}

.testall-models {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.testall-model-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 12.5px;
  transition: background var(--transition);
}

.testall-model-row:hover {
  background: var(--accent-light);
}

.testall-model-row+.testall-model-row {
  border-top: 1px solid var(--border);
}

.testall-model-name {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.testall-model-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.testall-model-status.ms-ok {
  color: var(--success);
}

.testall-model-status.ms-fail {
  color: var(--error);
}

.testall-model-status.ms-wait {
  color: var(--text-muted);
}

.testall-model-status.ms-run {
  color: var(--text-secondary);
}

.testall-model-latency {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
}

.testall-summary {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
  align-items: center;
}

.testall-summary .sum-ok {
  color: var(--success);
  font-weight: 600;
}

.testall-summary .sum-fail {
  color: var(--error);
  font-weight: 600;
}

.mini-spinner-sm {
  display: inline-block;
  width: 10px;
  height: 10px;
  border: 1.2px solid var(--border);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ─── Test All Modal ─── */
.modal-wide {
  max-width: 800px;
}

.testall-provider {
  margin-bottom: 16px;
}

.testall-provider:last-child {
  margin-bottom: 0;
}

.testall-provider-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  font-size: 13px;
  font-weight: 600;
}

.testall-provider-name {
  flex: 1;
}

.testall-provider-url {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.testall-provider-count {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.testall-provider-status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.testall-provider-status.s-ok {
  color: var(--success);
  border-color: var(--success);
}

.testall-provider-status.s-fail {
  color: var(--error);
  border-color: var(--error);
}

.testall-provider-status.s-run {
  color: var(--text-muted);
}

.testall-models {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 400px;
  overflow-y: auto;
}

.testall-model-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  font-size: 12px;
  transition: background var(--transition);
}

.testall-model-row:hover {
  background: var(--accent-light);
}

.testall-model-row+.testall-model-row {
  border-top: 1px solid var(--border);
}

.testall-model-name {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.testall-model-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.testall-model-status.ms-ok {
  color: var(--success);
}

.testall-model-status.ms-fail {
  color: var(--error);
}

.testall-model-status.ms-wait {
  color: var(--text-muted);
}

.testall-model-status.ms-run {
  color: var(--text-secondary);
}

.testall-model-latency {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
}

.testall-summary {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  gap: 16px;
  align-items: center;
}

.testall-summary .sum-ok {
  color: var(--success);
  font-weight: 600;
}

.testall-summary .sum-fail {
  color: var(--error);
  font-weight: 600;
}

/* Proxy toggle */
.proxy-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  user-select: none;
}

.toggle-label input {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 28px;
  height: 14px;
  background: var(--border);
  border-radius: 7px;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-label input:checked+.toggle-switch {
  background: var(--text-primary);
}

.toggle-label input:checked+.toggle-switch::after {
  transform: translateX(14px);
}

.proxy-hint {
  font-size: 10px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 900px) {
  .layout-primary {
    grid-template-columns: 1fr;
  }

  .layout-secondary {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 32px 16px 24px;
  }

  .main {
    padding: 0 16px 32px;
  }

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

  .card-actions {
    flex-wrap: wrap;
  }

  .onboarding-tooltip {
    max-width: 320px;
  }

  .modal-wide {
    max-width: 95%;
  }
}