/* ==========================================================================
   OmniCalc Ultra - Master Design System
   Cross-platform mobile & desktop aesthetics, glassmorphism, responsive grids
   ========================================================================== */

:root {
  /* Default: Onyx Obsidian */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-hover: rgba(51, 65, 85, 0.8);
  --bg-input: #030712;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #38bdf8;
  --accent-purple: #818cf8;
  --accent-pink: #f43f5e;
  --accent-amber: #fbbf24;
  --accent-green: #34d399;
  --key-digit-bg: rgba(255, 255, 255, 0.05);
  --key-digit-text: #f8fafc;
  --key-op-bg: rgba(129, 140, 248, 0.15);
  --key-op-text: #818cf8;
  --key-fn-bg: rgba(255, 255, 255, 0.08);
  --key-fn-text: #38bdf8;
  --key-equals-bg: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
  --key-equals-text: #ffffff;
  --key-clear-bg: rgba(244, 63, 94, 0.15);
  --key-clear-text: #f43f5e;
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-focus: #38bdf8;
  --shadow-key: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-key-active: 0 1px 3px rgba(0, 0, 0, 0.5);
  --glow-accent: 0 0 20px rgba(56, 189, 248, 0.35);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* Theme: Liquid Frosted Glass */
[data-theme="glass"] {
  --bg-primary: #0d1322;
  --bg-secondary: rgba(255, 255, 255, 0.05);
  --bg-card: rgba(255, 255, 255, 0.08);
  --bg-card-hover: rgba(255, 255, 255, 0.15);
  --bg-input: rgba(0, 0, 0, 0.4);
  --text-main: #ffffff;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  --accent-cyan: #67e8f9;
  --accent-purple: #c084fc;
  --accent-pink: #fb7185;
  --key-digit-bg: rgba(255, 255, 255, 0.09);
  --key-op-bg: rgba(192, 132, 252, 0.2);
  --key-op-text: #e9d5ff;
  --key-equals-bg: linear-gradient(135deg, #67e8f9, #c084fc);
  --border-subtle: rgba(255, 255, 255, 0.18);
  --shadow-key: 0 8px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(25px);
}

/* Theme: Cyberpunk 2077 */
[data-theme="cyberpunk"] {
  --bg-primary: #050508;
  --bg-secondary: #0d0d14;
  --bg-card: #12121e;
  --bg-card-hover: #1b1b2d;
  --bg-input: #000000;
  --text-main: #fcee0a;
  --text-muted: #00f0ff;
  --text-dim: #707090;
  --accent-cyan: #00f0ff;
  --accent-purple: #ff0055;
  --accent-pink: #ff0055;
  --key-digit-bg: #151522;
  --key-digit-text: #ffffff;
  --key-op-bg: rgba(0, 240, 255, 0.15);
  --key-op-text: #00f0ff;
  --key-fn-bg: rgba(252, 238, 10, 0.12);
  --key-fn-text: #fcee0a;
  --key-equals-bg: linear-gradient(135deg, #00f0ff, #ff0055);
  --key-equals-text: #000000;
  --key-clear-bg: rgba(255, 0, 85, 0.25);
  --key-clear-text: #ff0055;
  --border-subtle: #00f0ff33;
  --border-focus: #fcee0a;
  --glow-accent: 0 0 15px rgba(0, 240, 255, 0.6);
}

/* Theme: Retro Casio 1984 */
[data-theme="casio"] {
  --bg-primary: #879482;
  --bg-secondary: #74806f;
  --bg-card: #687463;
  --bg-card-hover: #5d6758;
  --bg-input: #9ca996;
  --text-main: #141c12;
  --text-muted: #273623;
  --text-dim: #3d5038;
  --accent-cyan: #141c12;
  --accent-purple: #1f2d1d;
  --accent-pink: #842323;
  --key-digit-bg: #273024;
  --key-digit-text: #ebf5e8;
  --key-op-bg: #404c3c;
  --key-op-text: #ebf5e8;
  --key-fn-bg: #404c3c;
  --key-fn-text: #a8b8a3;
  --key-equals-bg: #b94a2b;
  --key-equals-text: #ffffff;
  --key-clear-bg: #842323;
  --key-clear-text: #ffffff;
  --border-subtle: #3a4736;
  --border-focus: #141c12;
  --shadow-key: 0 3px 0 #182017;
}

/* Theme: Nordic Minimal (Light) */
[data-theme="nordic"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;
  --accent-cyan: #0284c7;
  --accent-purple: #6366f1;
  --accent-pink: #e11d48;
  --key-digit-bg: #ffffff;
  --key-digit-text: #0f172a;
  --key-op-bg: #e0f2fe;
  --key-op-text: #0284c7;
  --key-fn-bg: #f1f5f9;
  --key-fn-text: #475569;
  --key-equals-bg: #0284c7;
  --key-equals-text: #ffffff;
  --key-clear-bg: #ffe4e6;
  --key-clear-text: #e11d48;
  --border-subtle: #e2e8f0;
  --border-focus: #0284c7;
  --shadow-key: 0 2px 6px rgba(0, 0, 0, 0.06);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Background Ambient Glow */
.bg-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.6;
}

.ambient-blob-1 {
  position: absolute;
  top: -10%;
  left: 15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
  filter: blur(120px);
  opacity: 0.18;
}

.ambient-blob-2 {
  position: absolute;
  bottom: -10%;
  right: 15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
  filter: blur(140px);
  opacity: 0.15;
}

/* App Container */
.app-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

@media (min-width: 900px) {
  .app-container {
    height: 94vh;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    background: var(--bg-secondary);
  }
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 12px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--key-op-bg);
  color: var(--accent-cyan);
}

/* Mode Navigation Pills */
.mode-nav {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mode-nav::-webkit-scrollbar {
  display: none;
}

.mode-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-pill:hover {
  color: var(--text-main);
}

.mode-pill.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-focus);
}

.icon-btn.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Main Workspace Grid */
.workspace-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  overflow: hidden;
  margin-top: 6px;
}

@media (min-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr 340px;
  }
}

/* Primary View Area */
.primary-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 12px;
  position: relative;
}

/* Display Screen (Standard / Scientific) */
.calc-screen {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  min-height: 120px;
  max-height: 150px;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
  cursor: text;
}

.screen-badges {
  position: absolute;
  top: 10px;
  left: 14px;
  display: flex;
  gap: 8px;
}

.mode-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  cursor: pointer;
}

.mode-tag.active {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.15);
}

.screen-history-line {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  min-height: 24px;
  word-break: break-all;
  text-align: right;
  overflow-x: auto;
  scrollbar-width: none;
  width: 100%;
}

.screen-main-result {
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: right;
  word-break: break-all;
  width: 100%;
  transition: font-size 0.15s ease;
}

/* Keypad Section */
.keypad-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  overflow-y: auto;
}

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

.scientific-tray {
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 4px;
}

.scientific-tray.show {
  display: grid;
}

/* Keypad Buttons */
.calc-btn {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.1s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-key);
  min-height: 52px;
}

.calc-btn:active {
  transform: translateY(2px);
  box-shadow: var(--shadow-key-active);
}

.calc-btn .shortcut-hint {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.55rem;
  color: var(--text-dim);
  opacity: 0.5;
  display: none;
}

@media (min-width: 900px) {
  .calc-btn .shortcut-hint {
    display: block;
  }
}

/* Button Classes */
.btn-digit {
  background: var(--key-digit-bg);
  color: var(--key-digit-text);
}
.btn-digit:hover {
  background: var(--bg-card-hover);
}

.btn-op {
  background: var(--key-op-bg);
  color: var(--key-op-text);
  font-size: 1.4rem;
}
.btn-op:hover {
  filter: brightness(1.15);
}

.btn-fn {
  background: var(--key-fn-bg);
  color: var(--key-fn-text);
  font-size: 0.95rem;
  font-weight: 600;
}
.btn-fn:hover {
  background: var(--bg-card-hover);
}

.btn-clear {
  background: var(--key-clear-bg);
  color: var(--key-clear-text);
  font-weight: 700;
}

.btn-equals {
  background: var(--key-equals-bg);
  color: var(--key-equals-text);
  font-size: 1.6rem;
  box-shadow: var(--glow-accent);
}
.btn-equals:hover {
  filter: brightness(1.1);
}

.btn-span-2 {
  grid-column: span 2;
}

/* Smart Tape View */
.smart-tape-view {
  display: none;
  flex-direction: column;
  height: 100%;
}

.tape-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.tape-templates {
  display: flex;
  gap: 6px;
}

.sm-pill-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sm-pill-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.tape-editor-container {
  flex: 1;
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}

.tape-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 14px;
  resize: none;
  user-select: text;
  white-space: pre;
}

.tape-gutter {
  width: 140px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 1px solid var(--border-subtle);
  padding: 14px 10px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: right;
  overflow-y: hidden;
  color: var(--accent-cyan);
}

.tape-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-top: 10px;
}

.tape-total-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.tape-total-val {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Grapher View */
.grapher-view {
  display: none;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.grapher-controls-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.grapher-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 8px 12px;
  outline: none;
  user-select: text;
}

.grapher-canvas-wrapper {
  flex: 1;
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  touch-action: none;
}

#graphCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.grapher-floating-actions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Converter View */
.converter-view {
  display: none;
  flex-direction: column;
  height: 100%;
  gap: 12px;
  overflow-y: auto;
}

.category-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.category-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.category-chip.active {
  background: var(--key-op-bg);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.converter-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.convert-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.convert-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.convert-input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  width: 60%;
  user-select: text;
}

.convert-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.convert-swap-btn {
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.convert-swap-btn:hover {
  transform: rotate(180deg);
}

/* Programmer View */
.programmer-view {
  display: none;
  flex-direction: column;
  height: 100%;
  gap: 10px;
  overflow-y: auto;
}

.radix-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radix-row {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.radix-row.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.radix-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 42px;
}

.radix-val {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-main);
  word-break: break-all;
  flex: 1;
  text-align: right;
}

.bit-matrix-container {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.bit-cell {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-mono);
}

.bit-cell.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.bit-index {
  font-size: 0.55rem;
  color: var(--text-dim);
}

.bit-val {
  font-size: 0.85rem;
  font-weight: bold;
}

/* Sidebar: History & Memory (Desktop) */
.history-sidebar {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

@media (min-width: 900px) {
  .history-sidebar {
    display: flex;
  }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 10px;
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
}

.history-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item:hover {
  border-color: var(--accent-cyan);
  transform: translateX(-2px);
}

.history-item-expr {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
  word-break: break-all;
}

.history-item-res {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-align: right;
}

.history-item-time {
  font-size: 0.65rem;
  color: var(--text-dim);
}

.empty-history {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  padding: 30px 10px;
}

/* Modal / Drawer for Mobile History & Settings */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
}

.theme-card-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.theme-card-btn.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.theme-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* Animations */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--accent-cyan);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-lg);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  z-index: 200;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
