/* Core styles from aac.css */
:root{
  --deep-navy: #0D1B2A;
  --ocean-blue: #1B3A4B;
  --teal: #62B6CB;
  --coral: #FF6B6B;
  --light: #E8F4F8;
  --muted2: #8FA3AD;
  --success: #4ECDC4;

  --bg: var(--deep-navy);
  --panel: rgba(27,58,75,0.35);
  --panel2: rgba(27,58,75,0.45);
  --text: var(--light);
  --muted: rgba(143,163,173,0.95);
  --brand: var(--teal);
  --accent: var(--coral);
  --good: var(--success);
  --warn: #ffcc66;
  --bad: var(--coral);
  --border: rgba(232,244,248,0.14);
  --shadow: 0 18px 60px rgba(0,0,0,0.45);
  --radius: 16px;
  --radius2: 12px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 20% 10%, rgba(98,182,203,0.18), transparent 55%),
              radial-gradient(900px 600px at 90% 20%, rgba(255,107,107,0.12), transparent 55%),
              var(--bg);
  color: var(--text);
}

.brand{ display: inline-flex; align-items: baseline; gap: 10px; }
.logo{ font-size: 1.15rem; font-weight: 800; letter-spacing: 0.2px; color: var(--brand); }
.logo span{ color: var(--text); }
.logo-tag{ font-size: 0.85rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(98,182,203,0.28); background: rgba(98,182,203,0.12); color: var(--text); }

.app{ min-height: 100%; display: flex; flex-direction: column; gap: 16px; padding: 18px; max-width: 1120px; margin: 0 auto; }
.app-header{ display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }

.btn-home{
  border: 1px solid rgba(98,182,203,0.30);
  background: rgba(98,182,203,0.15);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-home:hover{ background: rgba(98,182,203,0.25); }

.pill{
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(232,244,248,0.18);
  background: rgba(0,0,0,0.16);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}
.pill:hover{
  background: rgba(255,255,255,0.1);
}

/* Layout */
.layout{
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px){ .layout{ grid-template-columns: 1fr; } }

.panel{
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-inner{ padding: 16px; }

/* Camera Section */
.video-wrap{
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(238,243,255,0.12);
  background: #000;
  aspect-ratio: 4/3;
}
#video{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}
#output_canvas{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1); /* Match video mirror */
}

/* Loading Overlay */
.camera-overlay{
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 42, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.5s ease;
}
.camera-overlay.hidden { opacity: 0; pointer-events: none; }

.spinner{
  width: 40px;
  height: 40px;
  border: 4px solid rgba(98,182,203,0.3);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Status Bar & Metrics */
.statusbar{ display: flex; align-items: center; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; gap: 10px; }
.status-pill{ display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); }
.dot{ width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.dot.active{ background: var(--good); box-shadow: 0 0 8px var(--good); }

.metrics{ display: flex; gap: 8px; }
.metric{ font-size: 0.85rem; padding: 4px 10px; background: rgba(255,255,255,0.05); border-radius: 6px; color: var(--muted2); border: 1px solid rgba(255,255,255,0.05); }
.metric b{ color: var(--text); margin-left: 4px; }

/* Right Column */
.right-column{ display: flex; flex-direction: column; gap: 20px; }

/* Emotion Display */
.emotion-content{
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
}
.emoji-display{
  font-size: 4.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.emotion-info{ flex: 1; }
.emotion-info h2{ margin: 0 0 8px; font-size: 2rem; color: var(--text); }
.confidence-wrap{ display: flex; align-items: center; gap: 10px; }
.confidence-bar{
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
}
.confidence-fill{
  height: 100%;
  background: var(--brand);
  width: 0%;
  transition: width 0.3s ease;
}
#confidence-val{ font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; width: 3em; text-align: right; }

/* Phrases Grid */
.subtitle{ margin: 0 0 16px; color: var(--muted); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.phrases-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.phrase{
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 18px;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.phrase:hover{
  background: rgba(98,182,203,0.15);
  border-color: rgba(98,182,203,0.4);
  transform: translateX(4px);
}
.phrase:active{ transform: translateX(2px); }

/* Animation for phrase click */
.phrase.playing {
  background: rgba(78, 205, 196, 0.2);
  border-color: var(--success);
}

/* --- New Controls Styles --- */

/* Controls Header */
.controls-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.controls-between .subtitle { margin: 0; }

.btn-small {
  background: rgba(98,182,203,0.15);
  border: 1px solid rgba(98,182,203,0.3);
  color: var(--teal);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-small:hover {
  background: rgba(98,182,203,0.25);
  transform: translateY(-1px);
}
.btn-small:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Add Phrase Row */
.add-phrase-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
#custom-phrase-input {
  flex: 1;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
}
#custom-phrase-input:focus { border-color: var(--brand); }
#btn-add-phrase {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  width: 36px;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
}
#btn-add-phrase:hover { background: rgba(255,255,255,0.2); }

/* Settings Panel */
.settings-panel {
  background: rgba(13, 27, 42, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: auto; /* Push to bottom if space allows */
}
.settings-panel summary {
  padding: 14px;
  font-weight: 600;
  color: var(--muted);
  outline: none;
}
.settings-content {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.setting-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 0.9rem;
}
.setting-group .row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}
.setting-group input[type="range"] {
  flex: 1;
}
.setting-group input[type="password"] {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 8px;
  border-radius: 8px;
}
.help-text {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 4px 0 0;
}

/* Expression Guide Panel */
.guide-panel {
  background: rgba(98, 182, 203, 0.08);
  border: 1px solid rgba(98, 182, 203, 0.25);
  border-radius: var(--radius);
}
.guide-panel summary {
  padding: 12px 14px;
  font-weight: 600;
  color: var(--brand);
  outline: none;
  cursor: pointer;
}
.guide-panel summary:hover {
  color: var(--text);
}
.guide-content {
  padding: 12px 14px;
  border-top: 1px solid rgba(98, 182, 203, 0.15);
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.guide-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}
.guide-emoji {
  font-size: 1.4rem;
}
.guide-text {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.3;
}

@media (max-width: 600px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
}

/* Header Actions */
.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Enhanced Settings Panel */
.settings-panel .settings-content {
  max-height: 60vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(98,182,203,0.3) transparent;
}

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

.settings-panel .settings-content::-webkit-scrollbar-track {
  background: transparent;
}

.settings-panel .settings-content::-webkit-scrollbar-thumb {
  background: rgba(98,182,203,0.3);
  border-radius: 3px;
}

/* Settings Sections */
.settings-section {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.settings-section:last-child {
  border-bottom: none;
}

.settings-section-title {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Setting Value Display */
.setting-value {
  min-width: 40px;
  text-align: right;
  font-weight: 700;
  color: var(--brand);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* Threshold Grid */
.threshold-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.threshold-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

.threshold-emoji {
  font-size: 1.3rem;
}

.threshold-item input[type="range"] {
  flex: 1;
  min-width: 50px;
}

.threshold-item .setting-value {
  min-width: 30px;
  font-size: 0.8rem;
}

/* Checkbox Grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.1);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  transition: all 0.2s;
}

.checkbox-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}

.checkbox-item input[type="checkbox"]:checked + span {
  color: var(--text);
}

/* Color Options */
.color-options {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-btn:hover {
  transform: scale(1.1);
}

.color-btn.active {
  border-color: var(--text);
  box-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* Voice Select */
#voice-select {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

#voice-select option {
  background: var(--deep-navy);
  color: var(--text);
}

/* Buttons Row */
.buttons-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn-warning {
  background: rgba(255,107,107,0.15) !important;
  border-color: rgba(255,107,107,0.35) !important;
  color: var(--coral) !important;
}

.btn-warning:hover {
  background: rgba(255,107,107,0.25) !important;
}

/* Scores Display */
.scores-display {
  display: none;
  margin-top: 10px;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: monospace;
}

.scores-display.visible {
  display: block;
}

.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

.score-bar-label {
  width: 24px;
  text-align: center;
}

.score-bar-fill {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill-inner {
  height: 100%;
  background: var(--brand);
  transition: width 0.15s;
}

.score-bar-value {
  width: 35px;
  text-align: right;
  color: var(--muted);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .threshold-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

/* Hidden file input for import */
#import-file-input {
  display: none;
}

/* =====================================================
   COCKPIT PANEL STYLES
   ===================================================== */

/* Settings Summary Enhanced */
.settings-panel summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.settings-panel summary:hover {
  background: rgba(255,255,255,0.03);
}

.settings-icon {
  font-size: 1.2rem;
}

.settings-badge {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(98,182,203,0.2);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Section Title Enhanced */
.settings-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.section-icon {
  font-size: 1rem;
}

/* Presets Section */
.presets-section {
  background: rgba(98,182,203,0.08);
  margin: -14px -14px 14px;
  padding: 14px !important;
  border-bottom: 1px solid rgba(98,182,203,0.2);
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(98,182,203,0.3);
  color: var(--text);
  transform: translateY(-2px);
}

.preset-btn.active {
  background: rgba(98,182,203,0.15);
  border-color: var(--brand);
  color: var(--text);
  box-shadow: 0 0 15px rgba(98,182,203,0.2);
}

.preset-icon {
  font-size: 1.5rem;
}

.preset-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.preset-desc {
  font-size: 0.7rem;
  opacity: 0.7;
}

@media (max-width: 500px) {
  .presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Resolution Grid */
.resolution-grid {
  display: flex;
  gap: 8px;
}

.resolution-btn {
  flex: 1;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.resolution-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.resolution-btn.active {
  background: rgba(98,182,203,0.15);
  border-color: var(--brand);
  color: var(--brand);
}

/* Performance Dashboard */
.performance-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.perf-gauge {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.gauge-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.gauge-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
}

.gauge-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width 0.3s;
}

.gauge-fill.latency {
  background: var(--warn);
}

.gauge-fill.cpu {
  background: var(--coral);
}

.gauge-fill.detections {
  background: var(--success);
}

@media (max-width: 500px) {
  .performance-dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* AI Provider Tabs */
.ai-provider-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ai-tab {
  flex: 1;
  min-width: 70px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ai-tab:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.ai-tab.active {
  background: rgba(98,182,203,0.15);
  border-color: var(--brand);
  color: var(--text);
}

.ai-tab-icon {
  font-size: 0.9rem;
}

/* AI Provider Config Sections */
.ai-provider-config {
  margin-top: 14px;
  padding: 14px;
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}

.ai-provider-config.hidden {
  display: none;
}

/* API Key Input */
.api-key-input {
  display: flex;
  gap: 8px;
}

.api-key-input input {
  flex: 1;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-family: monospace;
}

.api-key-input input:focus {
  outline: none;
  border-color: var(--brand);
}

.btn-icon {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255,255,255,0.15);
}

/* Theme Options */
.theme-options {
  display: flex;
  gap: 8px;
}

.theme-btn {
  flex: 1;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text);
}

.theme-btn.active {
  background: rgba(98,182,203,0.15);
  border-color: var(--brand);
  color: var(--text);
}

/* Emotion History Display */
.emotion-history-display {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 10px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  min-height: 50px;
  max-height: 100px;
  overflow-y: auto;
}

.emotion-history-display .history-item {
  padding: 4px 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.emotion-history-display .history-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 0.85rem;
}

/* Profile Row */
.profile-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.profile-row select {
  flex: 1;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
}

/* Storage Info */
.storage-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
}

.storage-label {
  color: var(--muted);
}

.storage-value {
  color: var(--brand);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Shortcuts Grid */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.shortcut-item kbd {
  padding: 4px 8px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text);
  box-shadow: 0 2px 0 rgba(0,0,0,0.3);
}

/* AI Section Special Styling */
.ai-section {
  background: linear-gradient(135deg, rgba(98,182,203,0.05), rgba(78,205,196,0.05));
  margin: 0 -14px;
  padding: 14px !important;
  border-top: 1px solid rgba(98,182,203,0.15);
  border-bottom: 1px solid rgba(98,182,203,0.15);
}

/* Select Styling */
.settings-section select {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.settings-section select:focus {
  outline: none;
  border-color: var(--brand);
}

.settings-section select option {
  background: var(--deep-navy);
  color: var(--text);
}

/* Help text links */
.help-text a {
  color: var(--brand);
  text-decoration: none;
}

.help-text a:hover {
  text-decoration: underline;
}

/* Light Theme Support */
body.theme-light {
  --bg: #f5f7fa;
  --panel: rgba(255,255,255,0.8);
  --panel2: rgba(255,255,255,0.9);
  --text: #1a2332;
  --muted: rgba(26,35,50,0.7);
  --border: rgba(0,0,0,0.1);
}

body.theme-light .settings-section select,
body.theme-light .api-key-input input,
body.theme-light .settings-section input[type="password"] {
  background: rgba(255,255,255,0.8);
  border-color: rgba(0,0,0,0.15);
  color: var(--text);
}

/* High Contrast Theme */
body.theme-high-contrast {
  --bg: #000000;
  --panel: rgba(20,20,20,0.95);
  --panel2: rgba(30,30,30,0.95);
  --text: #ffffff;
  --brand: #00ffff;
  --border: rgba(255,255,255,0.3);
}

/* Large Text Mode */
body.large-text {
  font-size: 18px;
}

body.large-text .settings-section-title {
  font-size: 1rem;
}

body.large-text .setting-group label {
  font-size: 1rem;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce), body.reduce-motion {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body.reduce-motion * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
