/* DraftLayer — App Shell Styles
 * Depends on tokens.css being loaded first.
 * No hardcoded colors, font stacks, or sizes — use tokens only.
 */

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

html { height: 100%; }

body {
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition:
    background var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast),
    opacity var(--transition-fast);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-primary {
  background: var(--color-accent);
  color: #030714;
  border: 1px solid transparent;
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
  box-shadow: 0 0 20px rgba(79, 125, 255, 0.22);
}
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ─── Header ─────────────────────────────────────────────────────────── */
#app-header {
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.app-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}
.header-back:hover { color: var(--color-text-secondary); }
.header-logo {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 8px 28px 7px;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text-primary);
  letter-spacing: -0.01em;
  line-height: 1;
  background:
    linear-gradient(currentColor, currentColor) center 3px / calc(100% - 18px) 2px no-repeat,
    linear-gradient(currentColor, currentColor) center calc(100% - 3px) / calc(100% - 18px) 2px no-repeat,
    linear-gradient(currentColor, currentColor) left 9px center / 9px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right 9px center / 9px 2px no-repeat;
  border-radius: var(--radius-sm);
}
.header-logo span { color: var(--color-accent); }
.header-spacer { flex: 1; max-width: 160px; }

/* ─── App Layout ─────────────────────────────────────────────────────── */
#app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 480px 1fr;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  gap: var(--space-6);
  align-items: start;
  min-width: 0;
}

/* ─── Panels ─────────────────────────────────────────────────────────── */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
}
.panel-input {
  display: flex;
  flex-direction: column;
}
.panel-output {
  min-height: 480px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(56px + var(--space-8)); /* updated by JS in demo mode to account for banner */
}

/* ─── Tab Bar ────────────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
  flex-shrink: 0;
  min-width: 0;
}
.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition:
    color var(--transition-fast),
    border-color var(--transition-fast),
    background var(--transition-fast);
  min-width: 0;
}
.tab:hover {
  color: var(--color-text-secondary);
  background: rgba(255,255,255,0.02);
}
.tab.active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ─── Tab tooltip (coming-soon hype) ─────────────────────────────────── */
.tab-tooltip-wrap {
  position: relative;
  flex: 1;
  display: flex;
  min-width: 0;
}
.tab-tooltip-wrap .tab {
  flex: 1;
}
.tab-tooltip {
  position: absolute;
  bottom: calc(100% + var(--space-2));
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  white-space: nowrap;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition:
    opacity var(--transition-fast),
    transform var(--transition-fast);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.tab-tooltip-wrap:hover .tab-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.tab-tooltip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ─── Tab Panes ──────────────────────────────────────────────────────── */
.tab-pane {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}
.tab-pane[hidden] { display: none; }

/* ─── Dropzone ───────────────────────────────────────────────────────── */
.dropzone {
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--transition-base),
    background var(--transition-base);
  position: relative;
}
.dropzone:hover,
.dropzone:focus-visible,
.dropzone.drag-over {
  border-color: var(--color-accent);
  background: var(--color-accent-dim);
  outline: none;
}
.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  pointer-events: none;
}
.dropzone-icon { color: var(--color-accent); opacity: 0.7; }
.dropzone-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
}
.dropzone-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.dropzone-link {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  pointer-events: all;
}
.dropzone-file {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-primary);
  pointer-events: none;
}
.dropzone-file svg { color: var(--color-accent); flex-shrink: 0; }
.dropzone-file span { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone-clear {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: var(--space-1);
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  pointer-events: all;
  flex-shrink: 0;
}
.dropzone-clear:hover { color: var(--color-error); }

/* ─── Upload coming soon ─────────────────────────────────────────────── */
.upload-coming-soon {
  border: 1.5px dashed var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.upload-coming-soon-icon { color: var(--color-text-muted); }
.upload-coming-soon-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
}
.upload-coming-soon-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  max-width: 28ch;
}

/* ─── Textarea ───────────────────────────────────────────────────────── */
.textarea-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.section-textarea {
  width: 100%;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  line-height: 1.65;
  resize: vertical;
  min-height: 160px;
  transition: border-color var(--transition-fast);
  min-width: 0;
}
.section-textarea::placeholder { color: var(--color-text-muted); }
.section-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}
.char-count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: right;
}
.char-count.near-limit { color: var(--color-warning); }

/* ─── Convert Button ─────────────────────────────────────────────────── */
.btn-convert { width: 100%; }

/* ─── Detail Preview ─────────────────────────────────────────────────── */
.json-preview {
  border-top: 1px solid var(--color-border-subtle);
  margin-top: var(--space-2);
}
.json-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  transition: color var(--transition-fast);
  text-align: left;
}
.json-toggle:hover { color: var(--color-accent); }
.json-chevron {
  color: var(--color-accent);
  flex-shrink: 0;
  transition: transform var(--transition-base);
}
.json-toggle[aria-expanded="true"] .json-chevron {
  transform: rotate(180deg);
}
.json-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--color-accent);
  background: var(--color-accent-dim);
  border: 1px solid rgba(79, 125, 255, 0.3);
  border-radius: var(--radius-full);
  padding: 1px var(--space-2);
  letter-spacing: 0.05em;
}
.json-body {
  padding: 0 var(--space-6) var(--space-6);
}
.json-note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.07);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.json-code {
  background: #000;
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: 11px;
  color: #7d96b0;
  line-height: 1.65;
  overflow-x: auto;
  max-height: 380px;
  overflow-y: auto;
  white-space: pre;
}

/* ─── Output States ──────────────────────────────────────────────────── */
.output-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-6);
  min-height: 480px;
}
.output-state--success {
  align-items: flex-start;
  padding-top: var(--space-6);
}
.output-state.hidden { display: none; }

/* Default */
.output-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  text-align: center;
}
.output-empty-icon { color: var(--color-text-muted); }
.output-empty-label {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  font-weight: 500;
}
.output-empty-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 280px;
}

/* Processing */
.output-processing {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  width: 100%;
  max-width: 360px;
}
.processing-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.processing-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-base);
}
.processing-step.active { color: var(--color-text-primary); }
.processing-step.done { color: var(--color-success); }
.step-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-border);
  flex-shrink: 0;
  transition: background var(--transition-base), box-shadow var(--transition-base);
}
.processing-step.active .step-dot {
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(79, 125, 255, 0.52);
  animation: dotPulse 1.2s ease-in-out infinite;
}
.processing-step.done .step-dot {
  background: var(--color-success);
  box-shadow: none;
  animation: none;
}
@keyframes dotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
}
.processing-bar-wrap {
  height: 2px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.processing-bar {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
  box-shadow: 0 0 8px rgba(79, 125, 255, 0.4);
}

/* Success */
.output-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  text-align: center;
  width: 100%;
}
.success-icon {
  color: var(--color-success);
  width: 48px; height: 48px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}
.success-label {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
}
.file-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  text-align: left;
}
.file-card-icon {
  color: var(--color-accent);
  flex-shrink: 0;
}
.file-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.file-card-name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-card-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.btn-download { width: 100%; }
.btn-again {
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  border: none;
  color: var(--color-text-muted);
}
.btn-again:hover { color: var(--color-text-secondary); border: none; }

/* Error */
.output-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
  max-width: 320px;
}
.error-icon {
  color: var(--color-error);
  width: 48px; height: 48px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-label {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text-primary);
}
.error-sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

/* ─── Auth Gate ──────────────────────────────────────────────────────── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-gate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.auth-gate-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-10);
  max-width: 400px;
  width: calc(100% - var(--space-8));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.auth-gate-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  transition: color var(--transition-fast);
}
.auth-gate-close:hover { color: var(--color-text-secondary); }
.auth-gate-logo {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-primary);
}
.auth-gate-logo span { color: var(--color-accent); }
.auth-gate-heading {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.auth-gate-sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.65;
  max-width: 300px;
}
.auth-gate-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}
.auth-btn { width: 100%; }
.auth-gate-back {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.link-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: inherit;
  padding: 0;
  transition: color var(--transition-fast);
}
.link-btn:hover { color: var(--color-accent); }

/* ─── Demo Banner ────────────────────────────────────────────────────── */
.demo-banner {
  background: var(--color-surface-elevated);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}
.demo-banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-width: 0;
}
.demo-banner-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  min-width: 0;
}
.demo-banner-label svg { color: var(--color-accent); flex-shrink: 0; }

/* ─── Demo Upload Prompt ─────────────────────────────────────────────── */
.demo-upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-10) var(--space-6);
  text-align: center;
  border: 1.5px dashed var(--color-border);
  border-radius: var(--radius-lg);
}
.demo-upload-icon { color: var(--color-text-muted); opacity: 0.5; }
.demo-upload-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-primary);
}
.demo-upload-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  max-width: 260px;
  line-height: 1.6;
}
.demo-upload-or {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ─── Demo Example Bar ───────────────────────────────────────────────── */
.demo-example-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
}
.demo-example-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.demo-example-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-accent);
  letter-spacing: 0.05em;
}
.demo-example-title {
  font-size: var(--text-sm);
  color: var(--color-text-primary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-example-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.example-nav-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  width: 26px; height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), border-color var(--transition-fast);
}
.example-nav-btn:hover:not(:disabled) {
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.example-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.example-counter {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  min-width: 36px;
  text-align: center;
}

/* ─── Textarea read-only state ───────────────────────────────────────── */
.section-textarea[readonly] {
  color: var(--color-text-secondary);
  cursor: default;
  border-color: var(--color-border-subtle);
}

/* ─── Demo Preview (success state) ──────────────────────────────────── */
.demo-preview-wrap {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
}
.demo-preview-chrome {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface-elevated);
  border-bottom: 1px solid var(--color-border-subtle);
}
.demo-preview-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-border);
}
.demo-preview-dot:nth-child(1) { background: #ff5f56; }
.demo-preview-dot:nth-child(2) { background: #febc2e; }
.demo-preview-dot:nth-child(3) { background: #28c840; }
.demo-preview-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-left: var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-preview-img {
  display: block;
  width: 100%;
  height: auto;
}

/* ─── Auth success wrap ───────────────────────────────────────────────── */
.auth-success-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
}

/* ─── Success upsell ─────────────────────────────────────────────────── */
.success-demo-upsell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
  width: 100%;
}
.upsell-text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}
.upsell-btn { width: 100%; }
.upsell-signin-link {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ─── Text link button ───────────────────────────────────────────────── */
.btn-text-link {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: 0;
  transition: color var(--transition-fast);
}
.btn-text-link:hover { color: var(--color-text-secondary); }

/* ─── Utility ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
    padding: var(--space-5) var(--space-4);
  }
  .panel-output {
    position: static;
    min-height: 360px;
  }
}
@media (max-width: 600px) {
  .app-header-inner {
    max-width: 390px;
    margin-left: 0;
    margin-right: 0;
    padding: 0 var(--space-4);
  }
  .header-spacer { display: none; }
  .app-layout {
    max-width: 390px;
    margin-left: 0;
    margin-right: 0;
    padding: var(--space-4);
    gap: var(--space-4);
  }
  .tab-pane { padding: var(--space-4); }
  .demo-banner-inner {
    max-width: 390px;
    margin-left: 0;
    margin-right: 0;
    align-items: flex-start;
    flex-direction: column;
  }
  .demo-banner-label {
    align-items: flex-start;
    line-height: 1.5;
  }
  .demo-banner-inner .btn {
    width: 100%;
  }
  .tab {
    padding: var(--space-3) var(--space-2);
    font-size: var(--text-xs);
  }
  .tab svg {
    flex-shrink: 0;
  }
  .demo-example-bar { align-items: flex-start; }
  .demo-example-title { white-space: normal; }
}
