/* ── Text Generation Page ── */
.tgen-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 80vh;
  padding: 3rem 1.5rem 6rem;
  position: relative;
}
.tgen-page .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}
.tgen-page .orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, #a78bfa, transparent 70%); top: -120px; left: -100px; }
.tgen-page .orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, #38bdf8, transparent 70%); top: 60px; right: -80px; }
.tgen-page .orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, #f472b6, transparent 70%); bottom: 0; left: 30%; }

.tgen-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

/* Greeting */
.tgen-greeting { text-align: center; margin-bottom: 0.5rem; }
.tgen-greeting h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--text-primary, #f1f5f9);
  margin: 0 0 0.5rem;
  line-height: 1.15;
}
.tgen-greeting h1 em {
  font-style: italic;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.tgen-greeting p {
  font-family:Verdana, Geneva, Tahoma, sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.04em;
}

/* Input area */
.tgen-input-wrap {
  width: 100%;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 18px;
  padding: 1.1rem 1.1rem 0.75rem;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s;
  box-shadow: 0 4px 40px rgba(0,0,0,0.25);
  position: relative;
}
.tgen-input-wrap:focus-within {
  border-color: rgba(167,139,250,0.45);
  box-shadow: 0 4px 40px rgba(0,0,0,0.25), 0 0 0 3px rgba(167,139,250,0.08);
}
.tgen-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.97rem;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.65;
  min-height: 96px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 56px;
}
.tgen-textarea::placeholder { color: rgba(148,163,184,0.45); }
.tgen-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.6rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tgen-mode-pills { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tgen-pill {
  font-family: 'DM Mono', monospace;
  font-size: 0.67rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(148,163,184,0.7);
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.tgen-pill:hover, .tgen-pill.active {
  border-color: rgba(167,139,250,0.5);
  background: rgba(167,139,250,0.1);
  color: #c4b5fd;
}
.tgen-submit-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1.2rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.18s, transform 0.15s;
  flex-shrink: 0;
}
.tgen-submit-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* Model & Settings row */
.tgen-settings-row {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  flex-wrap: wrap;
}
.tgen-settings-row .tgen-select-wrap {
  flex: 1;
  min-width: 160px;
  position: relative;
}
.tgen-settings-row label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.6);
  margin-bottom: 0.35rem;
}
.tgen-select {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  color: var(--text-primary, #f1f5f9);
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.83rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: border-color 0.2s;
}
.tgen-select:focus { border-color: rgba(167,139,250,0.45); }
.tgen-select option { background: #1e1b4b; color: #f1f5f9; }

/* Voice button */
.tgen-voice-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
  z-index: 10;
}
.tgen-voice-btn:hover { transform: scale(1.05); box-shadow: 0 6px 20px rgba(102,126,234,0.6); }
.tgen-voice-btn.recording { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); animation: voicePulse 1.5s infinite; }
.tgen-voice-btn.processing { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); animation: voiceSpin 1s linear infinite; }
.tgen-voice-btn:disabled { opacity: 0.6; cursor: not-allowed; }
@keyframes voicePulse {
  0%,100% { box-shadow: 0 4px 15px rgba(245,87,108,0.4); transform: scale(1); }
  50% { box-shadow: 0 6px 25px rgba(245,87,108,0.8); transform: scale(1.1); }
}
@keyframes voiceSpin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.tgen-voice-status {
  position: absolute;
  right: 58px;
  top: 14px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 10;
  white-space: nowrap;
}
.tgen-voice-status.active { display: flex; }

/* Prompt suggestion chips */
.tgen-suggestions { width: 100%; display: flex; flex-direction: column; gap: 0.85rem; }
.tgen-sugg-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  text-align: center;
}
.tgen-chips-row { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.tgen-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.9rem;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: rgba(203,213,225,0.75);
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
}
.tgen-chip:hover {
  border-color: rgba(167,139,250,0.4);
  background: rgba(167,139,250,0.08);
  color: #e2d9fe;
  transform: translateY(-1px);
}
.tgen-chip svg { opacity: 0.55; flex-shrink: 0; }
.tgen-chip i.fa { opacity: 0.7; flex-shrink: 0; font-size: 0.82rem; width: 14px; text-align: center; }
.tgen-chip--smart i.fa { color: #a78bfa; opacity: 0.95; }

/* Output area */
.tgen-output { width: 100%; display: none; flex-direction: column; gap: 0.75rem; animation: fadeUp 0.3s ease both; }
.tgen-output.visible { display: flex; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.tgen-output-card {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text-primary, #f1f5f9);
  white-space: pre-wrap;
}
.tgen-output-actions { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }
.tgen-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(148,163,184,0.8);
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.15s;
}
.tgen-action-btn:hover { border-color: rgba(167,139,250,0.4); color: #c4b5fd; background: rgba(167,139,250,0.08); }

.tgen-loading {
  display: none;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  padding: 1rem 0;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: rgba(148,163,184,0.6);
  letter-spacing: 0.04em;
}
.tgen-loading.visible { display: flex; }
.tgen-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(167,139,250,0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tgen-chip--smart {
  border-color: rgba(34,211,238,0.2);
  position: relative;
}
.tgen-chip--smart:hover {
  border-color: rgba(34,211,238,0.5);
  background: rgba(34,211,238,0.07);
  color: #a5f3fc;
}
.tgen-chip-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #06b6d4, #7c3aed);
  color: white;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  vertical-align: middle;
  margin-left: 2px;
  opacity: 0.85;
}
.tgen-chip--smart .tgen-chip-badge { opacity: 1; }

/* DeepSeek provider label in model select */
.tgen-deepseek-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  background: linear-gradient(135deg, #06b6d4, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  margin-left: 4px;
  letter-spacing: 0.02em;
}

/* Auto-generate indicator */
.tgen-autogenerate-notice {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: rgba(34,211,238,0.7);
  text-align: center;
  letter-spacing: 0.03em;
  margin-top: 0.25rem;
  display: none;
}
.tgen-autogenerate-notice.visible { display: block; }

/* Loading message variants */
.tgen-loading-msg { display: none; }
.tgen-loading-msg.visible { display: inline; }


.tgen-word-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: rgba(148,163,184,0.55);
  letter-spacing: 0.03em;
}

/* History section */
.tgen-history {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}
.tgen-history h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary, #f1f5f9);
  margin-bottom: 0.4rem;
}
.tgen-history > p {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: rgba(148,163,184,0.55);
  margin-bottom: 1.2rem;
}
.tgen-history table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.85rem;
  color: var(--text-primary, #f1f5f9);
}
.tgen-history thead th {
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.tgen-history tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); transition: background 0.15s; }
.tgen-history tbody tr:hover { background: rgba(255,255,255,0.025); }
.tgen-history tbody td { padding: 0.75rem 0.9rem; vertical-align: middle; }
.tgen-history .view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(148,163,184,0.7);
  text-decoration: none;
  transition: all 0.15s;
}
.tgen-history .view-btn:hover { border-color: rgba(167,139,250,0.4); color: #c4b5fd; background: rgba(167,139,250,0.08); }
.tgen-pagination { display: flex; gap: 0.4rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.tgen-pagination a, .tgen-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.03);
  color: rgba(148,163,184,0.7);
  font-family: 'DM Mono', monospace; font-size: 0.75rem;
  text-decoration: none; transition: all 0.15s; cursor: pointer;
}
.tgen-pagination a:hover { border-color: rgba(167,139,250,0.4); color: #c4b5fd; background: rgba(167,139,250,0.08); }
.tgen-pagination span.current { border-color: rgba(167,139,250,0.5); background: rgba(167,139,250,0.12); color: #c4b5fd; }

/* Powered by */
.tgen-poweredby {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.65);
  text-align: center;
  width: 100%;
  max-width: 480px;
  margin: 0.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.tgen-poweredby a { color: rgba(167,139,250,0.85); text-decoration: none; font-weight: 600; transition: color 0.15s; }
.tgen-poweredby a:hover { color: #a78bfa; }

/* ── Light theme overrides ── */
body.theme-light .tgen-input-wrap { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.14); box-shadow: 0 4px 24px rgba(0,0,0,0.10); }
body.theme-light .tgen-input-wrap:focus-within { border-color: rgba(124,58,237,0.4); box-shadow: 0 4px 40px rgba(0,0,0,0.07), 0 0 0 3px rgba(124,58,237,0.08); }
body.theme-light .tgen-textarea { color: #181c2e; }
body.theme-light .tgen-textarea::placeholder { color: rgba(90,96,119,0.5); }
body.theme-light .tgen-pill { border-color: rgba(0,0,0,0.1); background: rgba(0,0,0,0.03); color: rgba(30,27,75,0.75); }
body.theme-light .tgen-pill:hover, body.theme-light .tgen-pill.active { border-color: rgba(124,58,237,0.4); background: rgba(124,58,237,0.08); color: #7c3aed; }
body.theme-light .tgen-output-card { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.12); color: #1a1a2e; box-shadow: 0 2px 16px rgba(0,0,0,0.10); }
body.theme-light .tgen-output-card strong { color: #3b0764; }
body.theme-light .tgen-output-card em { color: #4c1d95; }
body.theme-light .tgen-action-btn { border-color: rgba(0,0,0,0.15); background: rgba(0,0,0,0.04); color: #1e1b4b; }
body.theme-light .tgen-action-btn:hover { border-color: rgba(124,58,237,0.45); color: #7c3aed; background: rgba(124,58,237,0.08); }
body.theme-light .tgen-chip { border-color: rgba(0,0,0,0.12); background: rgba(255,255,255,0.85); color: #374151; }
body.theme-light .tgen-chip:hover { border-color: rgba(124,58,237,0.45); background: rgba(124,58,237,0.08); color: #6d28d9; }
body.theme-light .tgen-loading { color: #374151; }
body.theme-light .tgen-page .orb { opacity: 0.08; }
body.theme-light .tgen-history h2 { color: #111827; }
body.theme-light .tgen-history table { color: #1a1a2e; }
body.theme-light .tgen-history tbody tr:hover { background: rgba(0,0,0,0.025); }
body.theme-light .tgen-select { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.18); color: #111827; }
body.theme-light .tgen-select option { background: #f8fafc; color: #111827; }
body.theme-light .tgen-greeting h1 { color: #0f172a; }
body.theme-light .tgen-greeting p { color: #6b7280; }
body.theme-light .tgen-sugg-label { color: #6b7280; }
body.theme-light .tgen-poweredby { color: #6b7280; border-top-color: rgba(0,0,0,0.08); }
body.theme-light .tgen-quick-label { color: #6b7280; }
body.theme-light .tgen-quick-btn--all { border-color: rgba(0,0,0,0.18); color: #374151; background: rgba(255,255,255,0.8); }
body.theme-light .tgen-settings-row label { color: #6b7280; }
body.theme-light .tgen-word-count { color: #9ca3af !important; }
body.theme-light .tgen-history-header { background: rgba(255,255,255,0.9); border-color: rgba(0,0,0,0.12); }
body.theme-light .tgen-history-header h2 { color: #0f172a; }
body.theme-light .tgen-history-header p { color: #6b7280; }
body.theme-light .tgen-history-table-wrap { border-color: rgba(0,0,0,0.12); background: rgba(255,255,255,0.85); }
body.theme-light .tgen-history-table { color: #1a1a2e; }
body.theme-light .tgen-history-table thead tr { background: linear-gradient(135deg, rgba(124,58,237,0.07), rgba(56,189,248,0.04)); }
body.theme-light .tgen-history-table thead th { color: #6d28d9; }
body.theme-light .tgen-history-row:hover { background: rgba(124,58,237,0.04); }
body.theme-light .td-prompt span { color: #1a1a2e; }
body.theme-light .tgen-date-text { color: #6b7280; }
body.theme-light .tgen-history-stat-num { background: linear-gradient(135deg, #6d28d9, #0284c7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
body.theme-light .tgen-history-stat-label { color: #6b7280; }
body.theme-light .tgen-history-stat-divider { background: rgba(0,0,0,0.12); }
/* AI Tools cards light */
body.theme-light .ai-tools-section { background: transparent; }
body.theme-light .ai-tools-section-label { color: #6b7280; }
body.theme-light .ai-tool-card { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.10); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
body.theme-light .ai-tool-card:hover { border-color: rgba(124,58,237,0.35); background: #fff; }
body.theme-light .ai-tool-card-title { color: #0f172a; }
body.theme-light .ai-tool-card-desc { color: #6b7280; }
body.theme-light .ai-tool-card-use-btn { background: rgba(124,58,237,0.09); border-color: rgba(124,58,237,0.25); color: #6d28d9; }
/* View modal light */
body.theme-light .tgen-modal-overlay { background: rgba(0,0,0,0.45); }
body.theme-light .tgen-modal { background: #f8fafc; border-color: rgba(0,0,0,0.12); }
body.theme-light .tgen-modal-title { color: #0f172a; }
body.theme-light .tgen-modal-meta { color: #6b7280; border-color: rgba(0,0,0,0.10); }
body.theme-light .tgen-modal-body { color: #1a1a2e; background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.10); }
body.theme-light .tgen-modal-close { color: #374151; background: rgba(0,0,0,0.05); border-color: rgba(0,0,0,0.10); }

/* ── Quick Action Buttons (above textarea) ── */
.tgen-quick-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tgen-quick-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.5);
}
.tgen-quick-btns {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tgen-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
}
.tgen-quick-btn--create { background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(99,102,241,0.12)); border-color: rgba(124,58,237,0.35); color: #a78bfa; }
.tgen-quick-btn--create:hover { background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(99,102,241,0.2)); border-color: rgba(124,58,237,0.6); transform: translateY(-1px); }
.tgen-quick-btn--explore { background: linear-gradient(135deg, rgba(56,189,248,0.14), rgba(6,182,212,0.08)); border-color: rgba(56,189,248,0.3); color: #38bdf8; }
.tgen-quick-btn--explore:hover { background: linear-gradient(135deg, rgba(56,189,248,0.25), rgba(6,182,212,0.15)); border-color: rgba(56,189,248,0.55); transform: translateY(-1px); }
.tgen-quick-btn--code { background: linear-gradient(135deg, rgba(52,211,153,0.14), rgba(16,185,129,0.08)); border-color: rgba(52,211,153,0.3); color: #34d399; }
.tgen-quick-btn--code:hover { background: linear-gradient(135deg, rgba(52,211,153,0.25), rgba(16,185,129,0.15)); border-color: rgba(52,211,153,0.55); transform: translateY(-1px); }
.tgen-quick-btn--email { background: linear-gradient(135deg, rgba(251,191,36,0.14), rgba(245,158,11,0.08)); border-color: rgba(251,191,36,0.3); color: #fbbf24; }
.tgen-quick-btn--email:hover { background: linear-gradient(135deg, rgba(251,191,36,0.25), rgba(245,158,11,0.15)); border-color: rgba(251,191,36,0.55); transform: translateY(-1px); }
.tgen-quick-btn--proposal { background: linear-gradient(135deg, rgba(244,114,182,0.14), rgba(236,72,153,0.08)); border-color: rgba(244,114,182,0.3); color: #f472b6; }
.tgen-quick-btn--proposal:hover { background: linear-gradient(135deg, rgba(244,114,182,0.25), rgba(236,72,153,0.15)); border-color: rgba(244,114,182,0.55); transform: translateY(-1px); }
.tgen-quick-btn--learn { background: linear-gradient(135deg, rgba(251,146,60,0.14), rgba(249,115,22,0.08)); border-color: rgba(251,146,60,0.3); color: #fb923c; }
.tgen-quick-btn--learn:hover { background: linear-gradient(135deg, rgba(251,146,60,0.25), rgba(249,115,22,0.15)); border-color: rgba(251,146,60,0.55); transform: translateY(-1px); }
.tgen-quick-btn--all { background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03)); border-color: rgba(255,255,255,0.12); color: rgba(148,163,184,0.8); }
.tgen-quick-btn--all:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.2); color: #f1f5f9; transform: translateY(-1px); }

/* Light theme quick buttons */
body.theme-light .tgen-quick-btn--all { border-color: rgba(0,0,0,0.1); color: rgba(90,96,119,0.8); background: rgba(0,0,0,0.03); }

/* ── Styled select containers ── */
.tgen-select-container {
  position: relative;
}
.tgen-select-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: rgba(148,163,184,0.5);
}
.tgen-select-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 5px;
  opacity: 0.65;
  vertical-align: middle;
}
.tgen-settings-row label {
  display: flex;
  align-items: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.6);
  margin-bottom: 0.4rem;
}

/* ── Colorful Action Buttons ── */
.tgen-action-btn--pdf {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  border-color: rgba(220,38,38,0.5) !important;
  color: #fff !important;
  position: relative;
  overflow: hidden;
  padding: 0.45rem 1rem !important;
  gap: 0.4rem !important;
}
.tgen-action-btn--pdf:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(220,38,38,0.4) !important; }
.tgen-action-btn--word {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: rgba(37,99,235,0.5) !important;
  color: #fff !important;
  position: relative;
  overflow: hidden;
  padding: 0.45rem 1rem !important;
  gap: 0.4rem !important;
}
.tgen-action-btn--word:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,99,235,0.4) !important; }
.tgen-btn-badge {
  font-family: 'DM Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.22);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 700;
  margin-left: 2px;
}
.tgen-action-btn--regen {
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(99,102,241,0.1)) !important;
  border-color: rgba(124,58,237,0.3) !important;
  color: #c4b5fd !important;
}
.tgen-action-btn--regen:hover { background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(99,102,241,0.2)) !important; transform: translateY(-1px); }
.tgen-action-btn--clear { color: rgba(148,163,184,0.6) !important; }
.tgen-action-btn--clear:hover { color: #f87171 !important; border-color: rgba(248,113,113,0.3) !important; background: rgba(248,113,113,0.06) !important; }

/* ── Premium History Section ── */
.tgen-history { width: 100%; max-width: 860px; margin: 0 auto; padding: 1rem 0 5rem; }

.tgen-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 1.2rem 1.4rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  flex-wrap: wrap;
  gap: 1rem;
}
.tgen-history-title-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tgen-history-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(56,189,248,0.15));
  border: 1px solid rgba(124,58,237,0.3);
  display: flex; align-items: center; justify-content: center;
  color: #a78bfa;
  flex-shrink: 0;
}
.tgen-history-header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text-primary, #f1f5f9);
  margin: 0 0 2px;
}
.tgen-history-header > .tgen-history-title-wrap + * p,
.tgen-history-header p {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: rgba(148,163,184,0.5);
  margin: 0;
  letter-spacing: 0.02em;
}
.tgen-history-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 0.55rem 1rem;
}
.tgen-history-stat { text-align: center; }
.tgen-history-stat-num {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  line-height: 1.2;
}
.tgen-history-stat-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(148,163,184,0.5);
}
.tgen-history-stat-divider {
  width: 1px; height: 28px;
  background: rgba(255,255,255,0.1);
}

.tgen-history-table-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
}
.tgen-history-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.87rem;
  color: var(--text-primary, #f1f5f9);
}
.tgen-history-table thead tr {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(56,189,248,0.06));
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tgen-history-table thead th {
  text-align: left;
  padding: 0.8rem 1rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(167,139,250,0.7);
  white-space: nowrap;
  display: table-cell;
}
.tgen-history-table thead th svg {
  vertical-align: middle;
  margin-right: 5px;
  opacity: 0.7;
}
.tgen-history-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.15s;
  animation: rowFadeIn 0.3s ease both;
}
@keyframes rowFadeIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
.tgen-history-row:hover { background: rgba(124,58,237,0.06); }
.tgen-history-row:last-child { border-bottom: none; }
.tgen-history-table td { padding: 0.8rem 1rem; vertical-align: middle; }

.td-prompt-inner {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}
.td-prompt-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #38bdf8);
  margin-top: 6px;
  flex-shrink: 0;
}
.td-prompt span {
  color: rgba(226,220,255,0.9);
  line-height: 1.5;
  font-size: 0.84rem;
}
.tgen-model-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(6,182,212,0.12), rgba(124,58,237,0.1));
  border: 1px solid rgba(6,182,212,0.25);
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  color: #22d3ee;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tgen-word-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(99,102,241,0.08));
  border: 1px solid rgba(124,58,237,0.25);
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: #c4b5fd;
  font-weight: 600;
}
.tgen-date-text {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: rgba(148,163,184,0.6);
  white-space: nowrap;
}
.tgen-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.32rem 0.75rem;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(37,99,235,0.12));
  border: 1px solid rgba(124,58,237,0.3);
  color: #a78bfa;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.16s;
  white-space: nowrap;
}
.tgen-view-btn:hover {
  background: linear-gradient(135deg, rgba(124,58,237,0.35), rgba(37,99,235,0.2));
  border-color: rgba(124,58,237,0.55);
  color: #ddd6fe;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}

.tgen-history-empty { text-align: center; padding: 3rem 1rem !important; }
.tgen-history-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(148,163,184,0.5);
}
.tgen-history-empty-inner p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(148,163,184,0.5);
  margin: 0 0 4px;
}
.tgen-history-empty-inner span {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  color: rgba(148,163,184,0.35);
}

/* ── Premium Pagination ── */
.tgen-pagination {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.tgen-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.5rem;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.03);
  color: rgba(148,163,184,0.7);
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
}
.tgen-page-btn:hover { border-color: rgba(167,139,250,0.4); color: #c4b5fd; background: rgba(167,139,250,0.08); transform: translateY(-1px); }
.tgen-page-btn.current {
  border-color: rgba(124,58,237,0.6);
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(99,102,241,0.15));
  color: #c4b5fd;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(124,58,237,0.2);
}
.tgen-page-btn.ellipsis { cursor: default; background: transparent; border-color: transparent; }

/* Light theme history overrides */
body.theme-light .tgen-history-header { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
body.theme-light .tgen-history-header h2 { color: #181c2e; }
body.theme-light .tgen-history-table-wrap { border-color: rgba(0,0,0,0.08); background: rgba(0,0,0,0.02); }
body.theme-light .tgen-history-table thead tr { background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(56,189,248,0.04)); }
body.theme-light .tgen-history-row:hover { background: rgba(124,58,237,0.04); }
body.theme-light .td-prompt span { color: #1e1b4b; }
body.theme-light .tgen-date-text { color: rgba(90,96,119,0.7); }
body.theme-light .tgen-stats { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
body.theme-light .tgen-history-stat-divider { background: rgba(0,0,0,0.1); }

/* ── AI Tools Cards Section ── */
.ai-tools-section {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 0 0;
}
.ai-tools-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(148,163,184,0.55);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ai-tools-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(167,139,250,0.2), transparent);
}
.ai-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.ai-tool-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.2rem 1.25rem 1.1rem;
  cursor: pointer;
  transition: all 0.22s;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: relative;
  overflow: hidden;
}
.ai-tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.22s;
  border-radius: 16px;
}
.ai-tool-card:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }
.ai-tool-card:hover::before { opacity: 1; }

.ai-tool-card--humanize { border-color: rgba(167,139,250,0.2); }
.ai-tool-card--humanize::before { background: linear-gradient(135deg, rgba(167,139,250,0.06), rgba(139,92,246,0.04)); }
.ai-tool-card--humanize:hover { border-color: rgba(167,139,250,0.45); box-shadow: 0 8px 30px rgba(139,92,246,0.15); }
.ai-tool-card--humanize .ai-tool-icon { background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(124,58,237,0.12)); color: #c4b5fd; border-color: rgba(139,92,246,0.3); }

.ai-tool-card--newsletter { border-color: rgba(56,189,248,0.2); }
.ai-tool-card--newsletter::before { background: linear-gradient(135deg, rgba(56,189,248,0.06), rgba(14,165,233,0.04)); }
.ai-tool-card--newsletter:hover { border-color: rgba(56,189,248,0.45); box-shadow: 0 8px 30px rgba(14,165,233,0.15); }
.ai-tool-card--newsletter .ai-tool-icon { background: linear-gradient(135deg, rgba(56,189,248,0.2), rgba(14,165,233,0.12)); color: #7dd3fc; border-color: rgba(56,189,248,0.3); }

.ai-tool-card--email { border-color: rgba(251,191,36,0.2); }
.ai-tool-card--email::before { background: linear-gradient(135deg, rgba(251,191,36,0.06), rgba(245,158,11,0.04)); }
.ai-tool-card--email:hover { border-color: rgba(251,191,36,0.45); box-shadow: 0 8px 30px rgba(245,158,11,0.15); }
.ai-tool-card--email .ai-tool-icon { background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(245,158,11,0.12)); color: #fde68a; border-color: rgba(251,191,36,0.3); }

.ai-tool-card--proposal { border-color: rgba(244,114,182,0.2); }
.ai-tool-card--proposal::before { background: linear-gradient(135deg, rgba(244,114,182,0.06), rgba(236,72,153,0.04)); }
.ai-tool-card--proposal:hover { border-color: rgba(244,114,182,0.45); box-shadow: 0 8px 30px rgba(236,72,153,0.15); }
.ai-tool-card--proposal .ai-tool-icon { background: linear-gradient(135deg, rgba(244,114,182,0.2), rgba(236,72,153,0.12)); color: #fbcfe8; border-color: rgba(244,114,182,0.3); }

.ai-tool-card--product { border-color: rgba(52,211,153,0.2); }
.ai-tool-card--product::before { background: linear-gradient(135deg, rgba(52,211,153,0.06), rgba(16,185,129,0.04)); }
.ai-tool-card--product:hover { border-color: rgba(52,211,153,0.45); box-shadow: 0 8px 30px rgba(16,185,129,0.15); }
.ai-tool-card--product .ai-tool-icon { background: linear-gradient(135deg, rgba(52,211,153,0.2), rgba(16,185,129,0.12)); color: #6ee7b7; border-color: rgba(52,211,153,0.3); }

.ai-tool-card--ghost { border-color: rgba(251,146,60,0.2); }
.ai-tool-card--ghost::before { background: linear-gradient(135deg, rgba(251,146,60,0.06), rgba(249,115,22,0.04)); }
.ai-tool-card--ghost:hover { border-color: rgba(251,146,60,0.45); box-shadow: 0 8px 30px rgba(249,115,22,0.15); }
.ai-tool-card--ghost .ai-tool-icon { background: linear-gradient(135deg, rgba(251,146,60,0.2), rgba(249,115,22,0.12)); color: #fdba74; border-color: rgba(251,146,60,0.3); }

.ai-tool-card--paraphrase { border-color: rgba(99,102,241,0.2); }
.ai-tool-card--paraphrase::before { background: linear-gradient(135deg, rgba(99,102,241,0.06), rgba(79,70,229,0.04)); }
.ai-tool-card--paraphrase:hover { border-color: rgba(99,102,241,0.45); box-shadow: 0 8px 30px rgba(79,70,229,0.15); }
.ai-tool-card--paraphrase .ai-tool-icon { background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(79,70,229,0.12)); color: #c7d2fe; border-color: rgba(99,102,241,0.3); }

.ai-tool-card--summarize { border-color: rgba(20,184,166,0.2); }
.ai-tool-card--summarize::before { background: linear-gradient(135deg, rgba(20,184,166,0.06), rgba(13,148,136,0.04)); }
.ai-tool-card--summarize:hover { border-color: rgba(20,184,166,0.45); box-shadow: 0 8px 30px rgba(13,148,136,0.15); }
.ai-tool-card--summarize .ai-tool-icon { background: linear-gradient(135deg, rgba(20,184,166,0.2), rgba(13,148,136,0.12)); color: #99f6e4; border-color: rgba(20,184,166,0.3); }

.ai-tool-card--grammar { border-color: rgba(239,68,68,0.2); }
.ai-tool-card--grammar::before { background: linear-gradient(135deg, rgba(239,68,68,0.06), rgba(220,38,38,0.04)); }
.ai-tool-card--grammar:hover { border-color: rgba(239,68,68,0.45); box-shadow: 0 8px 30px rgba(220,38,38,0.15); }
.ai-tool-card--grammar .ai-tool-icon { background: linear-gradient(135deg, rgba(239,68,68,0.2), rgba(220,38,38,0.12)); color: #fca5a5; border-color: rgba(239,68,68,0.3); }

.ai-tool-card--story { border-color: rgba(236,72,153,0.2); }
.ai-tool-card--story::before { background: linear-gradient(135deg, rgba(236,72,153,0.06), rgba(219,39,119,0.04)); }
.ai-tool-card--story:hover { border-color: rgba(236,72,153,0.45); box-shadow: 0 8px 30px rgba(219,39,119,0.15); }
.ai-tool-card--story .ai-tool-icon { background: linear-gradient(135deg, rgba(236,72,153,0.2), rgba(219,39,119,0.12)); color: #f9a8d4; border-color: rgba(236,72,153,0.3); }

.ai-tool-card--blog { border-color: rgba(234,179,8,0.2); }
.ai-tool-card--blog::before { background: linear-gradient(135deg, rgba(234,179,8,0.06), rgba(202,138,4,0.04)); }
.ai-tool-card--blog:hover { border-color: rgba(234,179,8,0.45); box-shadow: 0 8px 30px rgba(202,138,4,0.15); }
.ai-tool-card--blog .ai-tool-icon { background: linear-gradient(135deg, rgba(234,179,8,0.2), rgba(202,138,4,0.12)); color: #fef08a; border-color: rgba(234,179,8,0.3); }

.ai-tool-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ai-tool-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.ai-tool-card-title {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.3;
}
.ai-tool-card-desc {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.78rem;
  color: rgba(148,163,184,0.65);
  line-height: 1.55;
  flex: 1;
}
.ai-tool-card-use-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(203,213,225,0.8);
  cursor: pointer;
  transition: all 0.15s;
  align-self: flex-start;
}
.ai-tool-card-use-btn:hover { background: rgba(255,255,255,0.12); color: #f1f5f9; }

/* ── View Content Modal ── */
.tgen-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}
.tgen-modal-overlay.visible { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.tgen-modal {
  background: rgba(15,10,40,0.97);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: modalUp 0.25s ease;
}
@keyframes modalUp { from { opacity:0; transform: translateY(20px) scale(0.97); } to { opacity:1; transform: none; } }
.tgen-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.4rem 1.6rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  gap: 1rem;
}
.tgen-modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text-primary, #f1f5f9);
  line-height: 1.4;
}
.tgen-modal-meta {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: rgba(148,163,184,0.5);
  margin-top: 4px;
  letter-spacing: 0.03em;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.tgen-modal-close {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(148,163,184,0.7);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.tgen-modal-close:hover { border-color: rgba(248,113,113,0.4); color: #f87171; background: rgba(248,113,113,0.08); }
.tgen-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.6rem;
}
.tgen-modal-body {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.92rem;
  line-height: 1.72;
  color: var(--text-primary, #f1f5f9);
  white-space: pre-wrap;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 1.25rem 1.4rem;
}
.tgen-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.6rem 1.3rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}

/* ── Multi-model picker (compare up to 3 AI models) ── */
.tgen-model-picker-wrap { flex: 1 1 100%; }
.tgen-model-picker-hint {
  text-transform: none;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0;
  color: rgba(148,163,184,0.45);
}
.tgen-model-picker { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tgen-model-check-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: rgba(203,213,225,0.8);
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.18s;
  user-select: none;
}
.tgen-model-check-item:has(input:checked) {
  border-color: rgba(167,139,250,0.55);
  background: rgba(167,139,250,0.12);
  color: #e2d9fe;
}
.tgen-model-check-item:has(input:disabled) { opacity: 0.35; cursor: not-allowed; }
.tgen-model-check-item input { accent-color: #a78bfa; cursor: pointer; }
.tgen-model-check-item small {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  color: rgba(148,163,184,0.6);
}

/* ── Comparison grid: 1-3 model result cards side by side ── */
.tgen-compare-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.tgen-compare-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tgen-compare-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .tgen-compare-grid--2, .tgen-compare-grid--3 { grid-template-columns: 1fr; }
}

.tgen-model-card {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.1rem 1.3rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
}
.tgen-model-card--error { border-color: rgba(248,113,113,0.35); background: rgba(248,113,113,0.05); }
.tgen-model-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.tgen-model-card-name {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: #c4b5fd;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.tgen-model-card-name i { opacity: 0.75; }
.tgen-model-card-words {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  color: rgba(148,163,184,0.6);
  white-space: nowrap;
}
.tgen-model-card-body {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.88rem;
  line-height: 1.68;
  color: var(--text-primary, #f1f5f9);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 480px;
  overflow-y: auto;
}
.tgen-model-card-error { color: #fca5a5; font-size: 0.82rem; display: flex; align-items: flex-start; gap: 0.4rem; }
.tgen-model-card-actions { display: flex; justify-content: flex-end; }
.tgen-mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(148,163,184,0.8);
  font-family: 'DM Mono', monospace;
  font-size: 0.63rem;
  cursor: pointer;
  transition: all 0.15s;
}
.tgen-mini-btn:hover { border-color: rgba(167,139,250,0.4); color: #c4b5fd; background: rgba(167,139,250,0.08); }

body.theme-light .tgen-model-check-item { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.12); color: #374151; }
body.theme-light .tgen-model-check-item:has(input:checked) { background: rgba(167,139,250,0.14); border-color: rgba(124,58,237,0.4); color: #4c1d95; }
body.theme-light .tgen-model-card { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.12); color: #1a1a2e; box-shadow: 0 2px 16px rgba(0,0,0,0.10); }
body.theme-light .tgen-model-card-body { color: #1a1a2e; }
body.theme-light .tgen-model-card-body strong { color: #3b0764; }
body.theme-light .tgen-model-card-body em { color: #4c1d95; }
/* ── AI Model Selector (compare up to 3 models) ── */
.tgen-model-select {
  width: 100%;
  margin: 0.25rem 0;
  padding: 1rem 1.15rem 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(167,139,250,0.22);
  background: rgba(255,255,255,0.035);
  backdrop-filter: blur(12px);
}
.tgen-model-select-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-bottom: 0.85rem;
}
.tgen-model-select-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary, #f1f5f9);
}
.tgen-model-select-title i { color: #a78bfa; font-size: 0.9rem; }
.tgen-model-select-hint {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: rgba(148,163,184,0.75);
}
.tgen-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.6rem;
}
.tgen-model-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.tgen-model-option:hover { border-color: rgba(167,139,250,0.45); transform: translateY(-1px); }
.tgen-model-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.tgen-model-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(124,58,237,0.18);
  color: #a78bfa;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.tgen-model-option-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tgen-model-option-name {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-primary, #f1f5f9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tgen-model-option-provider {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: rgba(148,163,184,0.65);
}
.tgen-model-option-check {
  margin-left: auto;
  font-size: 1rem;
  color: rgba(255,255,255,0.18);
  flex-shrink: 0;
}
.tgen-model-option.is-checked {
  border-color: #7c3aed;
  background: linear-gradient(135deg, rgba(124,58,237,0.22), rgba(56,189,248,0.1));
}
.tgen-model-option.is-checked .tgen-model-option-check { color: #38bdf8; }
.tgen-model-option.is-checked .tgen-model-option-icon { background: rgba(56,189,248,0.2); color: #38bdf8; }
.tgen-model-option.is-disabled { opacity: 0.45; cursor: not-allowed; }
.tgen-model-option.is-disabled:hover { transform: none; border-color: rgba(255,255,255,0.09); }

/* ── About / trust section ── */
.tgen-about-section {
  width: 100%;
  max-width: 640px;
  margin: 0.5rem auto 0;
  padding: 1.15rem 1.35rem 1.3rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  position: relative;
  overflow: hidden;
}
.tgen-about-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #a78bfa, #38bdf8);
  opacity: 0.55;
}
.tgen-about-section h2 {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}
.tgen-about-section p {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.84rem;
  line-height: 1.65;
  color: rgba(148,163,184,0.85);
  margin: 0 0 0.65rem;
}
.tgen-about-section p:last-of-type { margin-bottom: 0; }
.tgen-trust-list {
  list-style: none;
  margin: 0.9rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.45rem 0.9rem;
}
.tgen-trust-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.78rem;
  color: var(--text-primary, #f1f5f9);
}
.tgen-trust-list li i { color: #38bdf8; font-size: 0.78rem; }

/* ── FAQ section (matches FAQPage schema) ── */
.tgen-faq-section { width: 100%; max-width: 640px; margin: 0.25rem auto 0; }
.tgen-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.6rem;
}
.tgen-faq-item {
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  padding: 0.65rem 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tgen-faq-item:hover { border-color: rgba(167,139,250,0.28); background: rgba(255,255,255,0.045); }
.tgen-faq-item[open] { border-color: rgba(167,139,250,0.32); }
.tgen-faq-item summary {
  cursor: pointer;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary, #f1f5f9);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.tgen-faq-item summary::after {
  content: '\002B';
  font-size: 1rem;
  color: #a78bfa;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.tgen-faq-item[open] summary::after { content: '\2212'; }
.tgen-faq-item summary::-webkit-details-marker { display: none; }
.tgen-faq-item p {
  margin: 0.55rem 0 0.1rem;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 0.8rem;
  line-height: 1.6;
  color: rgba(148,163,184,0.85);
}

/* ── Light theme overrides: model selector / about / FAQ ── */
body.theme-light .tgen-model-select { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.1); }
body.theme-light .tgen-model-select-title { color: #0f172a; }
body.theme-light .tgen-model-select-hint { color: #6b7280; }
body.theme-light .tgen-model-option { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.1); }
body.theme-light .tgen-model-option:hover { border-color: rgba(124,58,237,0.4); }
body.theme-light .tgen-model-option-name { color: #111827; }
body.theme-light .tgen-model-option-provider { color: #6b7280; }
body.theme-light .tgen-model-option-check { color: rgba(0,0,0,0.15); }
body.theme-light .tgen-model-option.is-checked { border-color: #7c3aed; background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(56,189,248,0.06)); }
body.theme-light .tgen-about-section { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.1); box-shadow: 0 2px 16px rgba(0,0,0,0.06); }
body.theme-light .tgen-about-section h2 { color: #0f172a; }
body.theme-light .tgen-about-section p { color: #4b5563; }
body.theme-light .tgen-trust-list { border-top-color: rgba(0,0,0,0.08); }
body.theme-light .tgen-trust-list li { color: #1f2937; }
body.theme-light .tgen-faq-item { background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.1); }
body.theme-light .tgen-faq-item:hover { border-color: rgba(124,58,237,0.3); background: #fff; }
body.theme-light .tgen-faq-item[open] { border-color: rgba(124,58,237,0.35); }
body.theme-light .tgen-faq-item summary { color: #0f172a; }
body.theme-light .tgen-faq-item p { color: #4b5563; }