/* ── Main layout ──────────────────────────────────────────────────────────── */
/* Mobile model selector */
.mobile-model-selector {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

@media (min-width: 640px) { .mobile-model-selector { display: none; } }

.mobile-model-selector label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .1em;
  white-space: nowrap;
}

.mobile-select-wrapper {
  position: relative;
  flex: 1;
}

.mobile-select-wrapper select {
  width: 100%;
  padding: .6rem 2rem .6rem .875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  outline: none;
  appearance: none;
  box-shadow: var(--shadow-sm);
}

.mobile-select-wrapper svg {
  width: 14px; height: 14px;
  stroke: var(--text-faint);
  position: absolute; right: .625rem; top: 50%; transform: translateY(-50%);
  pointer-events: none;
}

/* Two-column grid */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 900px) { .layout { grid-template-columns: 7fr 5fr; } }

/* ── Input section ────────────────────────────────────────────────────────── */
.input-section {
  display: flex;
  flex-direction: column;
}

/* ── Textarea ─────────────────────────────────────────────────────────────── */
textarea {
  width: 100%;
  flex: 1;
  min-height: 288px;
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-size: .9375rem;
  line-height: 1.65;
  color: var(--text);
  resize: none;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

textarea::placeholder { color: var(--text-faint); }

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1), var(--shadow-sm);
}

@media (min-width: 900px) { textarea { min-height: 328px; } }

/* ── Stats ────────────────────────────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .625rem;
  margin-top: .875rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}

.stat-card:hover { box-shadow: var(--shadow); }

.stat-tokens {
  border-color: var(--accent-border);
  background: var(--accent-light);
}

.stat-label {
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: .3rem;
}

.stat-tokens .stat-label { color: var(--accent); opacity: .7; }

.stat-value {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.stat-tokens .stat-value { color: var(--accent); }

/* ── Visualizer ───────────────────────────────────────────────────────────── */
.viz-section { display: flex; flex-direction: column; gap: .875rem; }

#toggle-viz {
  border: none;
  background: none;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0;
  letter-spacing: .02em;
}

#toggle-viz:hover { color: var(--accent); }

#visualizer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 360px;
}

#visualizer.hidden { display: none; }

.viz-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .625rem 1rem;
  border-bottom: 1px solid var(--border-soft);
  background: #fafafa;
}

.viz-toolbar span:first-child {
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.live-badge {
  font-size: .65rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: .04em;
}

#viz-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.125rem;
  font-family: 'Menlo', 'Consolas', 'Monaco', monospace;
  font-size: .8rem;
  line-height: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-content: flex-start;
  align-items: flex-start;
}

.viz-empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .875rem;
  color: var(--text-faint);
  font-family: inherit;
  text-align: center;
  padding: 1rem;
}

.viz-empty svg { width: 36px; height: 36px; opacity: .25; }
.viz-empty p { font-size: .8125rem; max-width: 200px; line-height: 1.5; }

/* Token colors */
.token {
  display: inline-block;
  border-radius: 3px;
  padding: 2px 4px;
  white-space: pre;
  line-height: 1.4;
  transition: opacity .1s;
}

.token:hover { opacity: .75; }

.t0 { background: #dbeafe; color: #1e40af; }
.t1 { background: #dcfce7; color: #166534; }
.t2 { background: #fef9c3; color: #854d0e; }
.t3 { background: #fee2e2; color: #991b1b; }
.t4 { background: #f3e8ff; color: #6b21a8; }
.t5 { background: #fce7f3; color: #9d174d; }
.t6 { background: #e0e7ff; color: #3730a3; }
.t7 { background: #ffedd5; color: #9a3412; }
.t8 { background: #ccfbf1; color: #134e4a; }
.t9 { background: #e0f2fe; color: #0c4a6e; }

/* ── Model info card ──────────────────────────────────────────────────────── */
.model-info {
  display: flex;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: .875rem 1rem;
  box-shadow: var(--shadow-sm);
}

.info-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
}

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

.model-name {
  font-size: .8125rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .25rem;
}

.model-desc {
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── SEO content section ──────────────────────────────────────────────────── */
.seo-section {
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
  padding: 4rem 1.5rem;
}

.seo-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.seo-intro h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.03em;
  margin-bottom: .75rem;
}

.seo-intro p {
  font-size: .9375rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 680px;
}

.seo-block h2 {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.02em;
  margin-bottom: 1.5rem;
}

.use-cases { display: flex; flex-direction: column; gap: 1.5rem; }

.use-case { display: flex; gap: 1rem; align-items: flex-start; }

.use-case-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.use-case-icon svg { width: 16px; height: 16px; stroke: var(--accent); }
.use-case h3 { font-size: .9375rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; }
.use-case p { font-size: .875rem; color: var(--text-muted); line-height: 1.7; }

.faq {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq-item { border-bottom: 1px solid var(--border-soft); }
.faq-item:last-child { border-bottom: none; }

.faq-item summary {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .15s;
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-faint);
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { background: var(--bg); }
.faq-item[open] summary { background: var(--accent-light); color: var(--accent); }
.faq-item[open] summary::after { color: var(--accent); }

.faq-item p {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.75;
  padding: 0 1.25rem 1.125rem;
}
