/* ============================================================
   KERKITO v9.3 — IDENTITÉ PRO
   Palette "Confiance" — Bleu Nuit + Clean Tech
   ============================================================ */

:root {
  /* Palette Confiance (Bleu Nuit Dominant) */
  --bg-app: #f8fafc;
  --bg-bento: #ffffff;
  --bg-bento-hover: #f8fafc;
  --bg-input: #f8fafc;
  --bg-input-focus: #ffffff;

  /* Zone Background Colors (Clean - Blanc uniforme) */
  --bg-input-zone: #ffffff;
  --bg-config-zone: #ffffff;
  --bg-output-zone: #0f172a;       /* Dark Slate (Bleu Nuit foncé) */

  /* P.O.N.T Color Coding (Accents uniquement) */
  --color-profil: #3b82f6;         /* Bleu Électrique */
  --color-profil-light: #eff6ff;
  --color-operation: #f97316;      /* Orange */
  --color-operation-light: #fff7ed;
  --color-norme: #10b981;          /* Vert Tech */
  --color-norme-light: #ecfdf5;
  --color-terrain: #8b5cf6;        /* Violet */
  --color-terrain-light: #f5f3ff;

  /* Borders (Fines et discrètes) */
  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-focus: #3b82f6;

  /* Text (Bleu Nuit pour textes importants) */
  --text-primary: #0f172a;         /* Bleu Nuit (vs #111827 noir) */
  --text-secondary: #64748b;       /* Gris/Bleu (vs #6b7280) */
  --text-muted: #94a3b8;           /* Gris clair/Bleu */
  --text-disabled: #cbd5e1;

  /* Accent Colors */
  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;
  --accent-error: #ef4444;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Header/Footer (from global.css) */
  --header-height: 56px;
  --footer-height: 32px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   HERO SECTION
   ============================================================ */

.hero-simple {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--spacing-2xl) var(--spacing-lg);
  text-align: center;
}

.hero-simple h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: 'Inter Tight', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ============================================================
   COGNITIVE WORKSHOP — 3-ZONE GRID LAYOUT
   ============================================================ */

.magic-box {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg) var(--spacing-2xl);
}

.magic-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--spacing-lg);
  align-items: start;
}

/* ============================================================
   BENTO CARDS (Base)
   ============================================================ */

.bento-card {
  background: var(--bg-bento);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.bento-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--border-medium);
}

.bento-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--border-subtle);
}

.bento-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-family: 'Inter Tight', 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

.bento-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.bento-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 4px 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================================
   ZONE 1 — TA DEMANDE (Clean Tech: Bordure fine)
   ============================================================ */

.input-zone .bento-card {
  background: var(--bg-input-zone);
  border-left: 3px solid var(--color-terrain);
}

.input-zone .bento-header {
  border-bottom-color: var(--border-subtle);
}

.input-zone .bento-header h2 {
  color: var(--color-terrain);
}

/* Field Groups */
.field-group {
  margin-bottom: var(--spacing-lg);
}

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

/* Smart Templates (Quick Actions) */
.smart-templates {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
  flex-wrap: wrap;
}

.template-pill {
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--color-profil-light) 0%, var(--color-terrain-light) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.template-pill:hover {
  background: linear-gradient(135deg, var(--color-profil) 0%, var(--color-terrain) 100%);
  color: white;
  border-color: var(--color-profil);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

.field-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 0.9375rem;
}

.field-input,
.field-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  padding: var(--spacing-md);
  transition: all var(--transition-base);
}

.field-input {
  height: 48px;
}

.field-textarea {
  resize: vertical;
  min-height: 280px;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.6;
  font-size: 0.875rem;
}

.field-input:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

/* Field Actions */
.field-actions {
  display: flex;
  gap: var(--spacing-md);
  margin-top: var(--spacing-sm);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--transition-fast);
  padding: var(--spacing-xs) 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

/* ============================================================
   ZONE 2 — CONFIGURATION SYSTÈME P.O.N.T (Clean Tech: Bordure fine)
   ============================================================ */

.config-zone .bento-card {
  background: var(--bg-config-zone);
  border-left: 3px solid var(--color-profil);
}

.config-zone .bento-header {
  border-bottom-color: var(--border-subtle);
}

.config-zone .bento-header h2 {
  color: var(--color-profil);
}

/* Configuration Sections */
.config-section {
  margin-bottom: var(--spacing-xl);
}

.config-section:last-child {
  margin-bottom: 0;
}

.config-section-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.config-section-title {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.config-section-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* Profile Tiles (Compact - 4 tiles in grid) */
.profile-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-sm);
}

.profile-tile {
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-tile-icon {
  font-size: 1.125rem;
  line-height: 1;
}

.profile-tile:hover {
  background: var(--bg-bento-hover);
  border-color: var(--color-profil);
  color: var(--text-primary);
}

.profile-tile.active {
  background: white;
  border-color: var(--color-profil);
  border-width: 2px;
  color: var(--color-profil);
  font-weight: 700;
}

/* Multi-Select Format Control (Horizontal Toggle Buttons) */
.format-segmented {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}

.format-segment {
  flex: 1;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
  position: relative;
}

.format-segment:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* Multi-select active state (cumulative) */
.format-segment.active {
  background: var(--color-operation);
  color: white;
  font-weight: 600;
  border-color: var(--color-operation);
  box-shadow: 0 2px 4px rgba(249, 115, 22, 0.2);
}

.format-segment.active::after {
  content: '✓';
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--accent-success);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Hidden radio inputs (no longer used) */
.format-segmented input[type="radio"] {
  display: none;
}

/* Encapsulation Toggle ([T] Terrain) */
.encapsulation-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.encapsulation-toggle-wrapper:hover {
  border-color: var(--color-terrain);
}

.encapsulation-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.encapsulation-toggle-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.encapsulation-toggle-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Chain-of-Thought Toggle ([N] Norme) */
.cot-toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.cot-toggle-wrapper:hover {
  border-color: var(--color-norme);
}

.cot-toggle-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cot-toggle-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.cot-toggle-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-medium);
  transition: var(--transition-base);
  border-radius: var(--radius-full);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: var(--transition-base);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--color-norme);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* ============================================================
   ZONE 3 — BLUEPRINT FINAL (Chromatic: Dark Mode Local)
   ============================================================ */

.output-zone .bento-card {
  background: var(--bg-output-zone);
  border-left: 4px solid var(--color-norme);
  position: sticky;
  top: calc(var(--header-height) + var(--spacing-lg));
}

.output-zone .bento-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.output-zone .bento-header h2 {
  color: #e2e8f0;
}

/* Stats */
.output-stats {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-dot {
  color: #475569;
}

/* Preview Area */
.preview-area {
  margin-bottom: var(--spacing-lg);
}

.preview-output {
  width: 100%;
  min-height: 500px;
  max-height: 600px;
  overflow-y: auto;
  background: #0f172a;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  resize: vertical;
  transition: all var(--transition-base);
}

.preview-output:focus {
  outline: none;
  border-color: var(--color-norme);
  background: #0f172a;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.preview-output::placeholder {
  color: #64748b;
}

/* Custom scrollbar for dark output */
.preview-output::-webkit-scrollbar {
  width: 8px;
}

.preview-output::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.preview-output::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.preview-output::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Output Actions */
.output-actions {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.btn-primary-large {
  width: 100%;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-md);
  font-family: 'Inter Tight', 'Inter', sans-serif;
}

.btn-primary-large:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-primary-large:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary-large:disabled {
  background: var(--border-medium);
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.btn-primary-large .btn-icon {
  font-size: 1.25rem;
}

.btn-secondary {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: #94a3b8;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--color-norme);
  color: #e2e8f0;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:disabled {
  color: #475569;
  cursor: not-allowed;
  opacity: 0.5;
}

.status-message {
  padding: var(--spacing-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.5;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
  .magic-container {
    grid-template-columns: 1fr 1fr;
  }

  .output-zone {
    grid-column: 1 / -1;
  }

  .output-zone .bento-card {
    position: static;
  }
}

@media (max-width: 768px) {
  .magic-container {
    grid-template-columns: 1fr;
  }

  .hero-simple h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .magic-box {
    padding: 0 var(--spacing-md) var(--spacing-xl);
  }

  .bento-card {
    padding: var(--spacing-lg);
  }

  .profile-tiles {
    grid-template-columns: 1fr;
  }

  .btn-primary-large {
    height: 52px;
    font-size: 0.9375rem;
  }

  .output-stats {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-xs);
  }

  .stat-dot {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-simple {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .hero-simple h1 {
    font-size: 1.75rem;
  }

  .field-textarea {
    min-height: 200px;
  }

  .preview-output {
    min-height: 300px;
  }
}

/* ============================================================
   HISTORY DRAWER — TIME CAPSULE
   ============================================================ */

/* Floating Trigger Button */
.history-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: var(--accent-primary);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  transition: all var(--transition-base);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.history-trigger:active {
  transform: scale(1.05);
}

/* Drawer Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-slow);
  z-index: 9998;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Drawer Container */
.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 100vh;
  background: var(--bg-bento);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-drawer.active {
  transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
  padding: var(--spacing-xl);
  border-bottom: 2px solid var(--border-subtle);
  background: linear-gradient(135deg, var(--color-profil-light) 0%, var(--color-norme-light) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.drawer-close {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

/* Drawer Content */
.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--spacing-lg);
}

.drawer-content::-webkit-scrollbar {
  width: 6px;
}

.drawer-content::-webkit-scrollbar-track {
  background: var(--bg-input);
}

.drawer-content::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
}

.drawer-content::-webkit-scrollbar-thumb:hover {
  background: var(--border-focus);
}

/* History Empty State */
.history-empty {
  text-align: center;
  padding: var(--spacing-2xl);
  color: var(--text-muted);
}

.history-empty-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

.history-empty-text {
  font-size: 0.9375rem;
  line-height: 1.6;
}

/* History Cards */
.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.history-card {
  background: var(--bg-input);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.history-card:hover {
  border-color: var(--accent-primary);
  background: var(--bg-bento);
  transform: translateX(-4px);
  box-shadow: var(--shadow-md);
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-sm);
}

.history-card-profile {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.history-card-profile-icon {
  font-size: 1.125rem;
}

.history-card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.history-card-intention {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xs);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.history-card-terrain {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 0, 0, 0.03);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card-format {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--color-operation-light);
  color: var(--color-operation);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Drawer Actions */
.drawer-actions {
  padding: var(--spacing-lg) var(--spacing-xl);
  border-top: 2px solid var(--border-subtle);
  background: var(--bg-input);
}

.drawer-clear-btn {
  width: 100%;
  height: 40px;
  background: transparent;
  border: 2px solid var(--accent-error);
  border-radius: var(--radius-md);
  color: var(--accent-error);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.drawer-clear-btn:hover {
  background: var(--accent-error);
  color: white;
}

/* Mobile Responsive (Bottom Sheet) */
@media (max-width: 768px) {
  .history-drawer {
    width: 100%;
    height: 70vh;
    top: auto;
    bottom: 0;
    right: 0;
    transform: translateY(100%);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
  }

  .history-drawer.active {
    transform: translateY(0);
  }

  .history-trigger {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    font-size: 1.375rem;
  }

  .drawer-header {
    padding: var(--spacing-lg);
  }

  .drawer-content {
    padding: var(--spacing-md);
  }
}
