/* ============================================
   How Many Tokens — style.css
   Warm cream palette, organic shapes, light mode
   ============================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Warm cream base */
  --bg: #faf6f1;
  --bg-warm: #f5ede3;
  --bg-card: #ffffff;
  --bg-card-alt: #fdf9f5;
  --bg-input: #faf6f1;

  /* Borders */
  --border: #e8ddd0;
  --border-hover: #d4c4b0;
  --border-focus: #c4956a;

  /* Text */
  --text: #2c1810;
  --text-secondary: #5c4a3a;
  --text-muted: #8a7968;
  --text-dim: #b0a090;

  /* Accent — terracotta / amber */
  --accent: #c4956a;
  --accent-hover: #b07d52;
  --accent-light: #f0dcc8;
  --accent-glow: rgba(196, 149, 106, 0.2);

  /* Semantic */
  --green: #5a9a6e;
  --green-bg: #edf5ef;
  --red: #c45c5c;
  --red-bg: #faeaea;
  --yellow: #b8923e;
  --yellow-bg: #faf3e0;

  /* Spacing & shape */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 3px rgba(44, 24, 16, 0.04), 0 1px 2px rgba(44, 24, 16, 0.03);
  --shadow: 0 4px 16px rgba(44, 24, 16, 0.06), 0 1px 3px rgba(44, 24, 16, 0.04);
  --shadow-lg: 0 12px 40px rgba(44, 24, 16, 0.08), 0 4px 12px rgba(44, 24, 16, 0.04);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Fonts */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.3;
  pointer-events: none;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Decorative blobs ---- */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.5;
  animation: blobFloat 25s ease-in-out infinite;
}

.bg-blob-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #f0dcc8 0%, transparent 70%);
  top: -150px; right: -100px;
}

.bg-blob-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #e8d5c0 0%, transparent 70%);
  bottom: 10%; left: -120px;
  animation-delay: -10s;
}

.bg-blob-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #dce8df 0%, transparent 70%);
  top: 40%; right: -80px;
  animation-delay: -18s;
}

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -25px) scale(1.04); }
  66% { transform: translate(-15px, 15px) scale(0.96); }
}

/* ---- Card ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

/* ---- Header ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  background: rgba(250, 246, 241, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  font-size: 22px;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link {
  color: var(--text-muted);
  transition: color var(--transition);
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link-text {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
}

.nav-link-text:hover {
  background: var(--bg-warm);
}

/* ---- Hero ---- */
.hero {
  text-align: center;
  padding: 56px 0 36px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-hover);
  background: var(--accent-light);
  border: 1px solid rgba(196, 149, 106, 0.25);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(34px, 5.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 14px;
  color: var(--text);
}

.gradient-text {
  background: linear-gradient(135deg, #c4956a, #b07d52, #8b6040);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---- Input Section ---- */
.input-section {
  padding: 0;
  overflow: hidden;
}

.input-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card-alt);
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  width: 60%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.tab-btn.active {
  color: var(--text);
  background: var(--bg-card);
}

.tab-btn.active::after {
  transform: scaleX(1);
}

.tab-btn:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(196, 149, 106, 0.04);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Textarea */
.textarea-wrapper {
  position: relative;
}

#text-input {
  width: 100%;
  min-height: 200px;
  max-height: 480px;
  padding: 20px;
  background: var(--bg-card);
  border: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  resize: vertical;
  outline: none;
}

#text-input::placeholder {
  color: var(--text-dim);
}

.textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card-alt);
}

.char-count {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.btn-clear {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-clear:hover {
  color: var(--red);
  border-color: var(--red);
  background: var(--red-bg);
}

/* File Drop */
.file-drop {
  padding: 44px 20px;
  text-align: center;
  border: 2px dashed var(--border);
  margin: 16px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  cursor: pointer;
}

.file-drop:hover,
.file-drop.drag-over {
  border-color: var(--accent);
  background: rgba(196, 149, 106, 0.04);
}

.file-drop-icon {
  color: var(--text-dim);
  margin-bottom: 14px;
}

.file-drop-text {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.file-browse {
  color: var(--accent-hover);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.file-browse:hover {
  color: var(--accent);
}

.file-drop-hint {
  font-size: 11px;
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* File Processing Spinner */
.file-processing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.processing-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* File Summary */
.file-summary {
  margin: 16px;
}

.file-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--accent-light);
  border: 1px solid rgba(196, 149, 106, 0.2);
  border-radius: var(--radius-sm);
}

.file-summary-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.file-summary-icon { font-size: 24px; }

.file-summary-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.file-summary-size {
  font-size: 12px;
  color: var(--text-muted);
}

.file-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-sm {
  padding: 5px 12px !important;
  font-size: 12px !important;
}

.btn-remove-file {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}

.btn-remove-file:hover {
  color: var(--red);
}

/* File Breakdown */
.file-breakdown {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-card);
}

.file-breakdown-list {
  display: flex;
  flex-direction: column;
}

.file-breakdown-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  transition: background var(--transition);
}

.file-breakdown-row:last-child { border-bottom: none; }

.file-breakdown-row:hover {
  background: var(--bg-card-alt);
}

.file-breakdown-icon { font-size: 16px; flex-shrink: 0; }

.file-breakdown-name {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.file-breakdown-tokens {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-hover);
  font-weight: 600;
  white-space: nowrap;
}

.file-breakdown-size {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* ---- Results Section ---- */
.results-section {
  margin-top: 28px;
  animation: fadeUp 0.4s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats Bar */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 28px;
  gap: 0;
  background: var(--bg-card);
}

.stat {
  flex: 1;
  text-align: center;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
  color: var(--accent-hover);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* Optimize Section */
.optimize-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  margin-top: 14px;
  gap: 20px;
}

.optimize-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text);
}

.optimize-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.btn-optimize {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-optimize:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-optimize:active {
  transform: translateY(0);
}

.btn-optimize:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-optimize.loading {
  pointer-events: none;
}

.btn-optimize.loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Optimized Result */
.optimized-result {
  margin-top: 14px;
  padding: 22px;
  border-color: rgba(90, 154, 110, 0.25);
  background: var(--bg-card);
  animation: fadeUp 0.4s ease-out;
}

.optimized-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.optimized-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.optimized-savings {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.savings-badge {
  padding: 3px 10px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 100px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 13px;
}

.optimized-text {
  padding: 16px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.optimized-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.btn-secondary {
  padding: 9px 18px;
  background: var(--accent-light);
  border: 1px solid rgba(196, 149, 106, 0.3);
  border-radius: var(--radius-sm);
  color: var(--accent-hover);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: rgba(196, 149, 106, 0.2);
  border-color: var(--accent);
}

.btn-ghost {
  padding: 9px 18px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
  background: var(--bg-card-alt);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 24, 16, 0.3);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: 90%;
  max-width: 420px;
  padding: 32px;
  position: relative;
  text-align: center;
  animation: scaleIn 0.3s ease-out;
  background: var(--bg-card);
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
}

.modal-close:hover { color: var(--text); }

.modal-icon { font-size: 36px; margin-bottom: 10px; }

.modal-title {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.6;
}

.modal-provider-select {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 16px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
}

.radio-label:hover { color: var(--text); }

.radio-label input[type="radio"] { display: none; }

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-hover);
  border-radius: 50%;
  position: relative;
  transition: all var(--transition);
}

.radio-label input[type="radio"]:checked + .radio-custom {
  border-color: var(--accent);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.modal-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}

.modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
  margin-bottom: 18px;
}

.btn-primary {
  width: 100%;
  padding: 11px 22px;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* ---- Models Grid ---- */
.models-section {
  margin-top: 28px;
}

.models-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.models-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}

.models-updated {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 500;
  margin-left: 10px;
  padding: 3px 10px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 100px;
  white-space: nowrap;
}

.models-filter {
  display: flex;
  gap: 3px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.filter-btn {
  padding: 6px 14px;
  background: none;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.filter-btn:hover:not(.active) {
  color: var(--text-secondary);
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 10px;
}

.model-card {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
  cursor: default;
  background: var(--bg-card);
}

.model-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.model-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.model-name-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-provider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.8);
}

.model-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.model-provider {
  font-size: 11px;
  color: var(--text-dim);
}

.model-status {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.model-status.compatible {
  background: var(--green-bg);
  color: var(--green);
}

.model-status.exceeded {
  background: var(--red-bg);
  color: var(--red);
}

.model-status.tight {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.model-bar-wrapper { width: 100%; }

.model-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-warm);
  border-radius: 3px;
  overflow: hidden;
}

.model-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 2px;
}

.model-bar-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}

.model-bar-label {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.model-meta {
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: var(--text-dim);
}

.model-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- Trust Bar ---- */
.trust-bar {
  padding: 0 0 8px;
}

.trust-items {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex: 1;
  max-width: 280px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.trust-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow);
}

.trust-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.trust-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.trust-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 44px 0 28px;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-privacy {
  max-width: 600px;
  margin: 0 auto 20px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.footer-lock {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.footer-privacy p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
}

.footer-privacy em {
  font-style: italic;
  color: var(--text-secondary);
}

.footer-bottom {
  margin-top: 8px;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--text-dim);
}

/* ---- Demo Page ---- */
.demo-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.demo-step {
  display: flex;
  gap: 20px;
  padding: 24px;
  align-items: flex-start;
}

.demo-step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent-hover);
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.demo-step-content h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.demo-step-content p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.demo-example-box {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-example-box code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: block;
}

.btn-try {
  align-self: flex-start;
  padding: 7px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-try:hover {
  background: var(--accent-hover);
}

.demo-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.demo-tag {
  padding: 4px 10px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.demo-cta {
  text-align: center;
  padding: 36px 24px;
  margin-top: 24px;
  margin-bottom: 24px;
}

.demo-cta h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.demo-cta p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 18px;
}

/* ---- Blog / Tricks Page ---- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.blog-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.blog-card-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  align-self: flex-start;
}

.tag-prompts { background: #f0dcc8; color: #8b6040; }
.tag-cost { background: #edf5ef; color: #3d7a50; }
.tag-models { background: #e8eaf6; color: #4a5899; }
.tag-code { background: #faeaea; color: #a04040; }
.tag-rag { background: #f5eafc; color: #7a4a99; }
.tag-basics { background: var(--accent-light); color: var(--accent-hover); }

.blog-card h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text);
}

.blog-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.55;
  flex: 1;
}

.blog-card-meta {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
}

/* Article Page */
.article-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
  transition: color var(--transition);
}

.article-back:hover { color: var(--accent-hover); }

.article-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}

.article-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--text);
}

.article-meta {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 32px;
  display: flex;
  gap: 14px;
}

.article-body h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text);
}

.article-body h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--text);
}

.article-body p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.article-body ul, .article-body ol {
  margin: 0 0 16px 20px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.75;
}

.article-body li { margin-bottom: 6px; }

.article-body code {
  font-family: var(--font-mono);
  font-size: 13.5px;
  background: var(--bg-warm);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-hover);
}

.article-body pre {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.article-body pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 0 0 16px;
  background: var(--bg-card-alt);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-cta {
  margin-top: 36px;
  padding: 24px;
  text-align: center;
}

.article-cta h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.article-cta p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .demo-step { flex-direction: column; }
  .blog-grid { grid-template-columns: 1fr; }
}

/* ---- FAQ Section ---- */
.faq-section {
  padding: 40px 0 8px;
}

.faq-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 20px;
  color: var(--text);
}

.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 700px;
  margin: 0 auto;
}

.faq-item {
  padding: 0;
  cursor: pointer;
}

.faq-question {
  padding: 16px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.faq-question::after {
  content: '+';
  font-size: 20px;
  color: var(--text-dim);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

details[open] .faq-question::after {
  content: '−';
  color: var(--accent);
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-answer {
  padding: 0 20px 16px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ---- Utilities ---- */
.hidden {
  display: none !important;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 11px 22px;
  background: var(--text);
  border-radius: var(--radius-sm);
  color: var(--bg);
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  transition: transform 0.3s ease-out;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  .hero { padding: 36px 0 20px; }
  .hero-title { font-size: 30px; }

  .trust-items {
    flex-direction: column;
    align-items: center;
  }

  .trust-item {
    max-width: 100%;
  }

  .stats-bar {
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px;
  }

  .stat-divider { display: none; }
  .stat { flex: 0 0 calc(50% - 8px); }

  .optimize-section {
    flex-direction: column;
    text-align: center;
  }

  .models-grid { grid-template-columns: 1fr; }

  .models-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .optimized-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .optimized-actions { flex-direction: column; }

  .footer-privacy {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
}
