/* ═══════════════════════════════════════════════════════════
   MakeAI Talk — Fluent 2 LIGHT · Modern Edition
   Microsoft 365 Fluent 2 (Light theme) + pastel aurora
   Reference: fluent2.microsoft.design
   ═══════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════
   DEFAULT THEME · Fluent 2 LIGHT
   ═══════════════════════════════════════════════════════════ */
:root {
  /* Brand ramp — Fluent Communication Blue */
  --brand-50:  #001F4E;
  --brand-60:  #003079;
  --brand-70:  #0050B3;
  --brand-80:  #0078D4;
  --brand-90:  #2899F5;
  --brand-100: #4FB0FF;
  --brand-110: #7DC4FF;
  --brand-120: #A8D8FF;
  --brand-130: #C8E4FF;
  --brand-140: #E5F2FF;
  --brand-150: #F3F9FF;

  /* Signature accents (vibrant pop on light bg) */
  --magenta-80:  #B4009E;
  --magenta-100: #E3008C;
  --magenta-120: #F7378A;
  --berry-100:   #C30052;

  --cyan-80:  #008B95;
  --cyan-100: #00B7C3;
  --cyan-120: #43D6E0;

  --mint-100: #13A10E;
  --peach-100: #F7630C;
  --lilac-100: #8764B8;

  /* Functional */
  --color-success: #107C10;
  --color-warning: #C19C00;
  --color-danger:  #D13438;

  /* Body wallpaper — deep azure (overrideable by user setting) */
  --bg-body: #0679c1;

  /* Canvas + surfaces — semi-transparent Mica so wallpaper tints through */
  --canvas:       #F5F7FB;
  --mica-base:    rgba(255, 255, 255, 0.74);
  --mica-alt:     rgba(255, 255, 255, 0.84);
  --mica-strong:  rgba(255, 255, 255, 0.92);
  --frost-tint:   rgba(247, 249, 253, 0.65);

  /* Tinted surfaces */
  --tint-1: rgba(15, 26, 60, 0.04);
  --tint-2: rgba(15, 26, 60, 0.06);
  --tint-3: rgba(15, 26, 60, 0.10);
  --tint-4: rgba(15, 26, 60, 0.14);

  --input-bg:    rgba(255, 255, 255, 0.85);
  --input-hover: rgba(255, 255, 255, 1);

  /* Foreground — dark navy on light bg */
  --fg-primary:   #1A1F36;
  --fg-secondary: rgba(26, 31, 54, 0.78);
  --fg-tertiary:  rgba(26, 31, 54, 0.58);
  --fg-disabled:  rgba(26, 31, 54, 0.36);
  --fg-on-accent: #FFFFFF;

  /* Stroke */
  --stroke-1: rgba(15, 26, 60, 0.06);
  --stroke-2: rgba(15, 26, 60, 0.10);
  --stroke-3: rgba(15, 26, 60, 0.16);
  --stroke-focus: var(--brand-80);

  /* Legacy aliases */
  --bg-primary:    var(--mica-base);
  --bg-secondary:  var(--mica-strong);
  --bg-glass:      var(--mica-alt);
  --bg-input:      var(--input-bg);
  --bg-hover:      var(--tint-2);
  --bg-active:     var(--tint-3);
  --border-subtle: var(--stroke-1);
  --border-light:  var(--stroke-2);
  --border-focus:  var(--stroke-focus);
  --text-primary:    var(--fg-primary);
  --text-secondary:  var(--fg-secondary);
  --text-muted:      var(--fg-tertiary);
  --text-provisional: var(--fg-disabled);
  --accent:        var(--brand-80);
  --accent-hover:  var(--brand-70);
  --accent-bright: var(--brand-90);
  --accent-glow:   rgba(0, 120, 212, 0.16);
  --success: var(--color-success);
  --warning: var(--color-warning);
  --error:   var(--color-danger);
  --surface: var(--mica-base);
  --border:  var(--stroke-2);
  --text:    var(--fg-primary);
  --text2:   var(--fg-secondary);
  --red:     var(--color-danger);

  /* Radius — modern, larger */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-circle: 9999px;

  /* Sizing */
  --control-bar-height: 46px;

  /* Motion */
  --ease-out:  cubic-bezier(0.33, 0, 0.10, 1);
  --ease-in:   cubic-bezier(0.90, 0, 0.67, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-fast:   140ms var(--ease-out);
  --transition-normal: 240ms var(--ease-out);

  /* Soft pastel shadows */
  --shadow-2:  0 1px 2px rgba(15, 26, 60, 0.05), 0 0 1px rgba(15, 26, 60, 0.04);
  --shadow-4:  0 2px 6px rgba(15, 26, 60, 0.06), 0 1px 2px rgba(15, 26, 60, 0.04);
  --shadow-8:  0 4px 12px rgba(15, 26, 60, 0.08), 0 1px 4px rgba(15, 26, 60, 0.04);
  --shadow-16: 0 8px 24px rgba(15, 26, 60, 0.10), 0 2px 8px rgba(15, 26, 60, 0.06);
  --shadow-28: 0 16px 48px rgba(15, 26, 60, 0.14), 0 4px 16px rgba(15, 26, 60, 0.08);
  --shadow-64: 0 24px 80px rgba(15, 26, 60, 0.20), 0 8px 24px rgba(15, 26, 60, 0.10);
  --shadow-glow-brand:   0 0 0 1px rgba(0, 120, 212, 0.30),   0 4px 16px rgba(0, 120, 212, 0.22);
  --shadow-glow-magenta: 0 0 0 1px rgba(227, 0, 140, 0.30),   0 4px 16px rgba(227, 0, 140, 0.24);
  --shadow-glow-cyan:    0 0 0 1px rgba(0, 183, 195, 0.32),   0 4px 16px rgba(0, 183, 195, 0.24);
}

/* ═══ Theme: Dark (opt-in via data-theme=dark) ═══ */
[data-theme="dark"] {
  --canvas: #0A0E1A;
  --bg-body: #06080F;
  --mica-base:    rgba(20, 22, 32, 0.82);
  --mica-alt:     rgba(28, 30, 42, 0.74);
  --mica-strong:  rgba(15, 17, 26, 0.94);
  --tint-1: rgba(255, 255, 255, 0.04);
  --tint-2: rgba(255, 255, 255, 0.06);
  --tint-3: rgba(255, 255, 255, 0.10);
  --tint-4: rgba(255, 255, 255, 0.14);
  --input-bg:    rgba(255, 255, 255, 0.05);
  --input-hover: rgba(255, 255, 255, 0.08);
  --fg-primary:   rgba(255, 255, 255, 0.96);
  --fg-secondary: rgba(255, 255, 255, 0.78);
  --fg-tertiary:  rgba(255, 255, 255, 0.56);
  --fg-disabled:  rgba(255, 255, 255, 0.36);
  --stroke-1: rgba(255, 255, 255, 0.08);
  --stroke-2: rgba(255, 255, 255, 0.14);
  --stroke-3: rgba(255, 255, 255, 0.22);
  --shadow-28: 0 14px 28px rgba(0, 0, 0, 0.40), 0 0 8px rgba(0, 0, 0, 0.20);
  --shadow-64: 0 32px 64px rgba(0, 0, 0, 0.48), 0 0 8px rgba(0, 0, 0, 0.20);
}

/* ═══ Theme: Midnight (deep blue dark) ═══ */
[data-theme="midnight"] {
  --canvas: #060C1E;
  --bg-body: #060C1E;
  --mica-base:    rgba(8, 14, 30, 0.86);
  --mica-strong:  rgba(6, 10, 24, 0.95);
  --input-bg:     rgba(255, 255, 255, 0.06);
  --input-hover:  rgba(255, 255, 255, 0.10);
  --fg-primary:   rgba(225, 235, 255, 0.96);
  --fg-secondary: rgba(180, 200, 240, 0.78);
  --fg-tertiary:  rgba(150, 175, 220, 0.58);
  --stroke-1: rgba(140, 170, 220, 0.08);
  --stroke-2: rgba(140, 170, 220, 0.14);
  --stroke-3: rgba(140, 170, 220, 0.22);
}

/* ═══ Theme: Charcoal (warm grey dark) ═══ */
[data-theme="charcoal"] {
  --canvas: #141416;
  --bg-body: #141416;
  --mica-base:    rgba(24, 24, 28, 0.84);
  --mica-strong:  rgba(18, 18, 22, 0.96);
  --input-bg:     rgba(255, 255, 255, 0.06);
  --input-hover:  rgba(255, 255, 255, 0.10);
  --fg-primary:   rgba(255, 255, 255, 0.94);
  --fg-secondary: rgba(255, 255, 255, 0.72);
  --fg-tertiary:  rgba(255, 255, 255, 0.50);
  --stroke-1: rgba(255, 255, 255, 0.07);
  --stroke-2: rgba(255, 255, 255, 0.13);
  --stroke-3: rgba(255, 255, 255, 0.20);
}

html,
body {
  width: 100%;
  min-height: 100%;
  font-family: 'Inter', 'Segoe UI Variable', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-weight: 450;
  color: var(--fg-primary);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.003em;
}

body {
  position: relative;
  overflow-x: hidden;
}

/* Vibrant aurora orbs on body — pop against the electric purple wallpaper */
body::before,
body::after {
  content: '';
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
}
body::before {
  width: 620px; height: 620px;
  top: -180px; left: -160px;
  background: var(--cyan-100);
  opacity: 0.45;
}
body::after {
  width: 560px; height: 560px;
  bottom: -180px; right: -140px;
  background: var(--magenta-100);
  opacity: 0.45;
}

html::before {
  content: '';
  position: fixed;
  z-index: 0;
  width: 520px; height: 520px;
  top: 38%; right: 18%;
  border-radius: 50%;
  filter: blur(140px);
  background: var(--lilac-100);   /* warm pop against azure body */
  opacity: 0.42;
  pointer-events: none;
}

#root, .view, .login-container, .user-panel, #overlay-view, #settings-view, .modal-overlay {
  position: relative;
  z-index: 1;
}

.view {
  display: none;
  width: 100%;
  min-height: 100vh;
  flex-direction: column;
}

.view.active {
  display: flex;
  animation: viewFadeIn 0.24s var(--ease-out);
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: scale(0.99); }
  to   { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════
   OVERLAY / TRANSLATOR VIEW
   ═══════════════════════════════════════════════════════════ */

#overlay-view {
  background:
    radial-gradient(ellipse 70% 60% at 0% 0%,    rgba(0, 120, 212, 0.10), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 0%,  rgba(0, 183, 195, 0.10), transparent 55%),
    radial-gradient(ellipse 70% 60% at 100% 100%,rgba(227, 0, 140, 0.10), transparent 55%),
    rgba(255, 255, 255, 0.86);          /* Mica — tints with wallpaper through blur */
  border-radius: var(--radius-xl);
  border: 1px solid var(--stroke-2);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow-28);
  overflow: hidden;
  min-height: 100vh;
}

#drag-region {
  flex-shrink: 0;
  height: var(--control-bar-height);
  border-bottom: 1px solid var(--stroke-1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.25));
  backdrop-filter: blur(12px);
}

.control-bar {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 10px;
  gap: 6px;
}

.app-logo {
  height: 28px;
  width: auto;
  margin-right: 6px;
  filter: drop-shadow(0 2px 8px rgba(0, 120, 212, 0.25));
}

#btn-settings { margin-right: 2px; }

/* Icon buttons */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0 6px;
  gap: 1px;
}

.icon-btn:hover {
  background: var(--mica-strong);
  border-color: var(--stroke-2);
  color: var(--brand-80);
  box-shadow: var(--shadow-2);
}

.icon-btn:active {
  transform: scale(0.94);
  background: var(--tint-2);
}

.icon-btn.small {
  min-width: 30px;
  width: 30px;
  height: 30px;
}

.close-btn:hover {
  background: rgba(209, 52, 56, 0.10);
  border-color: rgba(209, 52, 56, 0.3);
  color: var(--color-danger);
}

.btn-label {
  font-size: 9px;
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.6;
  white-space: nowrap;
  margin-top: 2px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 4px;
  border-left: 1px solid var(--stroke-1);
  border-right: 1px solid var(--stroke-1);
  margin: 0 2px;
}

/* TTS pill */
.tts-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-circle);
  background: var(--mica-strong);
  color: var(--fg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast), box-shadow var(--transition-normal);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.tts-action-btn:hover {
  background: #FFFFFF;
  border-color: var(--stroke-3);
  color: var(--brand-80);
  box-shadow: var(--shadow-4);
}

.tts-action-btn:active { transform: scale(0.97); }

.tts-action-btn.active {
  background: linear-gradient(135deg, var(--cyan-100) 0%, var(--brand-80) 50%, var(--magenta-100) 100%);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.28), 0 2px 6px rgba(227, 0, 140, 0.18);
}

.tts-action-btn.active:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.tts-label { font-weight: 700; letter-spacing: 0.06em; }

#btn-pin.active {
  color: var(--brand-80);
  background: var(--brand-140);
  border-color: var(--brand-110);
}

#btn-pin.active:hover { background: var(--brand-130); }

#btn-minimize:hover {
  background: rgba(193, 156, 0, 0.14);
  border-color: rgba(193, 156, 0, 0.3);
  color: var(--color-warning);
}

#drag-region.compact-hidden { display: none !important; }

.compact-mode::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  z-index: 100;
  cursor: pointer;
}

.compact-mode:hover #drag-region.compact-hidden {
  display: flex !important;
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 99;
  background: var(--mica-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border-bottom: 1px solid var(--stroke-2);
  height: var(--control-bar-height);
  box-shadow: var(--shadow-4);
}

.compact-mode #transcript-container { padding-top: 4px; }

/* Status pill */
.status-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-left: 4px;
  flex: 1;
  pointer-events: none;
  background: var(--mica-strong);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-circle);
  align-self: center;
  max-width: fit-content;
  height: 30px;
  box-shadow: var(--shadow-2);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background var(--transition-normal), box-shadow var(--transition-normal);
}

.status-dot.disconnected { background: var(--fg-tertiary); }
.status-dot.connecting {
  background: var(--color-warning);
  animation: dotPulse 1.6s var(--ease-out) infinite;
  color: rgba(193, 156, 0, 0.5);
}
.status-dot.connected {
  background: var(--mint-100);
  animation: dotPulse 1.8s var(--ease-out) infinite;
  color: rgba(19, 161, 14, 0.45);
}
.status-dot.error {
  background: var(--color-danger);
  box-shadow: 0 0 10px rgba(209, 52, 56, 0.4);
}

@keyframes dotPulse {
  0%   { box-shadow: 0 0 0 0 currentColor; }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

.status-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-primary);
  letter-spacing: 0.02em;
}

.status-subtext {
  font-size: 10px;
  color: var(--fg-tertiary);
  letter-spacing: 0.02em;
}

/* Source segmented */
.source-controls {
  display: flex;
  gap: 2px;
  background: var(--tint-1);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  padding: 3px;
}

.source-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-width: 34px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0 10px;
  gap: 1px;
  font-weight: 700;
}

.source-btn:hover {
  color: var(--brand-80);
  background: var(--mica-strong);
}
.source-btn:active { transform: scale(0.92); }
.source-btn.active {
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
  color: var(--fg-on-accent);
  box-shadow: 0 2px 6px rgba(0, 120, 212, 0.32);
}
.source-btn.active .btn-label { opacity: 1; }

/* Action button */
.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-80) 0%, var(--brand-70) 100%);
  color: var(--fg-on-accent);
  cursor: pointer;
  transition: all var(--transition-fast), box-shadow var(--transition-normal);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.32), 0 1px 3px rgba(0, 120, 212, 0.18);
}

.action-btn:hover {
  background: linear-gradient(135deg, var(--brand-90), var(--brand-80));
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 120, 212, 0.40), 0 2px 6px rgba(0, 120, 212, 0.24);
}

.action-btn:active { transform: scale(0.94); }

.action-btn.recording {
  background: linear-gradient(135deg, var(--magenta-100) 0%, var(--berry-100) 100%);
  box-shadow: 0 4px 14px rgba(227, 0, 140, 0.40), 0 1px 4px rgba(227, 0, 140, 0.22);
  animation: recordPulse 2.2s var(--ease-out) infinite;
}

.action-btn.recording:hover {
  background: linear-gradient(135deg, var(--magenta-120), var(--magenta-100));
  box-shadow: 0 6px 20px rgba(227, 0, 140, 0.48), 0 2px 6px rgba(227, 0, 140, 0.28);
}

@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 0, 140, 0.45), 0 4px 14px rgba(227, 0, 140, 0.30); }
  50%      { box-shadow: 0 0 0 8px rgba(227, 0, 140, 0),    0 4px 18px rgba(227, 0, 140, 0.42); }
}

/* Transcript */
#transcript-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 22px 22px;
}

#transcript-container::-webkit-scrollbar,
.settings-body::-webkit-scrollbar {
  width: 8px;
}

#transcript-container::-webkit-scrollbar-track,
.settings-body::-webkit-scrollbar-track {
  background: transparent;
}

#transcript-container::-webkit-scrollbar-thumb,
.settings-body::-webkit-scrollbar-thumb {
  background: var(--stroke-3);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background var(--transition-fast);
}

#transcript-container::-webkit-scrollbar-thumb:hover,
.settings-body::-webkit-scrollbar-thumb:hover {
  background: var(--brand-80);
  background-clip: content-box;
}

.transcript-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 16px;
  color: var(--fg-tertiary);
}

.transcript-placeholder p {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ─── Hero placeholder (richer empty state) ──────────────── */
.hero-placeholder {
  position: relative;
  gap: 0;
  padding: 36px 24px;
  overflow: hidden;
}

.hp-aurora {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle 280px at 30% 30%, rgba(0, 183, 195, 0.22), transparent 60%),
    radial-gradient(circle 320px at 70% 40%, rgba(0, 120, 212, 0.18), transparent 60%),
    radial-gradient(circle 260px at 50% 80%, rgba(227, 0, 140, 0.16), transparent 60%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
  animation: hpAurora 14s var(--ease-out) infinite alternate;
}

@keyframes hpAurora {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-20px, 12px) scale(1.06); }
}

.hp-mic-ring,
.hp-bars,
.hp-title,
.hp-sub,
.hp-shortcuts,
.hp-tips {
  position: relative;
  z-index: 1;
}

.hp-mic-ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--mica-strong);
  border: 1px solid var(--stroke-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  box-shadow:
    0 12px 40px rgba(0, 120, 212, 0.20),
    0 4px 16px rgba(227, 0, 140, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: hpRingPulse 3.2s var(--ease-out) infinite;
}

@keyframes hpRingPulse {
  0%, 100% { transform: scale(1);     box-shadow: 0 12px 40px rgba(0, 120, 212, 0.20), 0 4px 16px rgba(227, 0, 140, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
  50%      { transform: scale(1.04);  box-shadow: 0 14px 48px rgba(0, 120, 212, 0.28), 0 6px 20px rgba(227, 0, 140, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
}

.hp-mic-ring-inner {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFFFFF, #F0F4FB);
  border: 1px solid var(--stroke-2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -8px 16px rgba(0, 120, 212, 0.04);
}

.hp-bars {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 32px;
  margin-bottom: 24px;
  opacity: 0.92;
}
.hp-bars span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan-100), var(--brand-80), var(--magenta-100));
  animation: hpBar 1.6s var(--ease-out) infinite;
}
.hp-bars span:nth-child(1)  { animation-delay: 0.00s; }
.hp-bars span:nth-child(2)  { animation-delay: 0.08s; }
.hp-bars span:nth-child(3)  { animation-delay: 0.16s; }
.hp-bars span:nth-child(4)  { animation-delay: 0.24s; }
.hp-bars span:nth-child(5)  { animation-delay: 0.32s; }
.hp-bars span:nth-child(6)  { animation-delay: 0.40s; }
.hp-bars span:nth-child(7)  { animation-delay: 0.48s; }
.hp-bars span:nth-child(8)  { animation-delay: 0.56s; }
.hp-bars span:nth-child(9)  { animation-delay: 0.64s; }
.hp-bars span:nth-child(10) { animation-delay: 0.72s; }
.hp-bars span:nth-child(11) { animation-delay: 0.80s; }
.hp-bars span:nth-child(12) { animation-delay: 0.88s; }
.hp-bars span:nth-child(13) { animation-delay: 0.96s; }

@keyframes hpBar {
  0%, 100% { height: 6px; opacity: 0.5; }
  50%      { height: 28px; opacity: 1; }
}

.hp-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--fg-primary);
  margin: 0 0 12px;
  text-align: center;
  background: linear-gradient(135deg, var(--cyan-100) 0%, var(--brand-80) 45%, var(--magenta-100) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hp-sub {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-secondary);
  text-align: center;
  max-width: 460px;
  line-height: 1.55;
  margin: 0 0 22px;
}

.hp-sub .hp-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
  color: #FFFFFF;
  vertical-align: -4px;
  margin: 0 2px;
  box-shadow: 0 2px 6px rgba(0, 120, 212, 0.30);
}

.hp-shortcuts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 26px;
}
.hp-shortcuts .hp-plus,
.hp-shortcuts .hp-or {
  color: var(--fg-tertiary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0 4px;
}
.hp-shortcuts .hp-or {
  margin: 0 8px;
  text-transform: uppercase;
}

.hp-tips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.hp-tip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--mica-strong);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-circle);
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-secondary);
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-2);
}
.hp-tip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.hp-tip-dot.b { background: var(--brand-80); box-shadow: 0 0 6px var(--brand-80); }
.hp-tip-dot.m { background: var(--magenta-100); box-shadow: 0 0 6px var(--magenta-100); }
.hp-tip-dot.c { background: var(--cyan-100); box-shadow: 0 0 6px var(--cyan-100); }

.shortcut-hint {
  font-size: 11px !important;
  color: var(--fg-secondary) !important;
  background: var(--mica-strong);
  padding: 4px 12px !important;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke-2);
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  letter-spacing: 0.04em;
  font-weight: 600;
  box-shadow: var(--shadow-2);
}

.listening-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 18px;
  color: var(--fg-tertiary);
  animation: fadeInUp 0.32s var(--ease-out);
}

.listening-indicator p {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-80);
}

.listening-waves {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
}

.listening-waves span {
  display: block;
  width: 4px;
  height: 8px;
  background: linear-gradient(180deg, var(--cyan-100), var(--brand-80), var(--magenta-100));
  border-radius: 3px;
  animation: wave 1.2s ease-in-out infinite;
}

.listening-waves span:nth-child(1) { animation-delay: 0s; }
.listening-waves span:nth-child(2) { animation-delay: 0.15s; }
.listening-waves span:nth-child(3) { animation-delay: 0.3s; }
.listening-waves span:nth-child(4) { animation-delay: 0.45s; }
.listening-waves span:nth-child(5) { animation-delay: 0.6s; }

@keyframes wave {
  0%, 100% { height: 6px; opacity: 0.5; }
  50%      { height: 30px; opacity: 1; }
}

.transcript-flow {
  font-size: var(--transcript-font-size, 16px);
  line-height: 1.65;
  padding: 4px 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  letter-spacing: -0.005em;
}

/* Transcript grid (conversation 2-column) */
.transcript-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  padding: 4px 0;
}

.transcript-grid-header {
  display: contents;
}

.transcript-grid-header > * {
  position: sticky;
  top: 0;
  background: var(--mica-strong);
  backdrop-filter: blur(20px);
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--stroke-2);
  z-index: 2;
}

.seg-col-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-80);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.seg-row { display: contents; }

.seg-row-provisional .seg-col {
  background: linear-gradient(90deg, rgba(0, 120, 212, 0.08), rgba(227, 0, 140, 0.06));
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin: -8px -12px;
}

.seg-col {
  font-size: var(--transcript-font-size, 16px);
  line-height: 1.65;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.seg-col .speaker-label {
  font-size: 0.72em;
  margin-bottom: 6px;
}

.seg-placeholder {
  color: var(--fg-tertiary);
  font-style: italic;
}

.seg-block {
  display: block;
  margin-bottom: 8px;
  animation: fadeInUp 0.32s var(--ease-out);
}

.seg-translated {
  display: block;
  color: var(--translation-color, var(--fg-primary));
  font-size: var(--translation-font-size, var(--transcript-font-size, 16px));
  font-weight: 500;
}

.seg-original {
  display: block;
  color: var(--original-color, var(--fg-tertiary));
  font-size: var(--original-font-size, 0.84em);
  font-weight: 400;
  margin-top: 8px;
  margin-bottom: 2px;
  letter-spacing: 0.005em;
}

.speaker-label {
  display: inline-block;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.72em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 14px;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--magenta-100), var(--berry-100));
  padding: 3px 10px;
  border-radius: var(--radius-circle);
}

.seg-provisional {
  display: block;
  color: transparent;
  background: linear-gradient(135deg, var(--cyan-100), var(--brand-80), var(--magenta-100));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
  font-style: normal;
}

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

.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--magenta-100);
  margin-left: 3px;
  vertical-align: -0.18em;
  border-radius: 1px;
  color: transparent;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  0%, 50%      { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

#resize-handle {
  height: 6px;
  cursor: ns-resize;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

#resize-handle::after {
  content: '';
  width: 44px;
  height: 4px;
  border-radius: 3px;
  background: var(--stroke-3);
  transition: background var(--transition-fast), width var(--transition-fast);
}

#resize-handle:hover::after {
  background: var(--brand-80);
  width: 60px;
}

/* ═══════════════════════════════════════════════════════════
   SETTINGS VIEW
   ═══════════════════════════════════════════════════════════ */

#settings-view {
  background:
    radial-gradient(ellipse 60% 50% at 0% 0%,    rgba(0, 120, 212, 0.10), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(227, 0, 140, 0.10), transparent 55%),
    rgba(255, 255, 255, 0.90);
  border-radius: var(--radius-xl);
  border: 1px solid var(--stroke-2);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow-28);
  overflow: hidden;
  min-height: 100vh;
}

#settings-drag {
  flex-shrink: 0;
  border-bottom: 1px solid var(--stroke-1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.25));
  backdrop-filter: blur(12px);
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  height: var(--control-bar-height);
}

.settings-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg-primary);
  letter-spacing: -0.02em;
}

.settings-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
}

/* ─── Fluent 2 Settings shell: sidebar + content panel ─── */
.settings-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Sidebar */
.settings-nav {
  position: relative;
  border-right: 1px solid var(--stroke-1);
  padding: 18px 12px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.15));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.settings-nav-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 18px;
  border-bottom: 1px solid var(--stroke-1);
  margin-bottom: 14px;
}

.settings-nav-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--cyan-100), var(--brand-80), var(--magenta-100));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.32);
  flex-shrink: 0;
}

.settings-nav-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg-primary);
  line-height: 1.2;
}

.settings-nav-header span {
  display: block;
  margin-top: 2px;
  color: var(--fg-tertiary);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

/* Nav-item style for .settings-tab in sidebar */
.settings-tab.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--fg-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: all var(--transition-fast);
  width: 100%;
}

.settings-tab.nav-item:hover {
  background: var(--mica-strong);
  color: var(--brand-80);
  border-color: var(--stroke-2);
  box-shadow: var(--shadow-2);
}

.settings-tab.nav-item:active { transform: scale(0.98); }

.settings-tab.nav-item.active {
  background: linear-gradient(90deg, rgba(0, 120, 212, 0.14), rgba(0, 183, 195, 0.04));
  color: var(--brand-70);
  font-weight: 700;
  border-color: transparent;
  box-shadow: none;
}

.settings-tab.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 22px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--cyan-100), var(--brand-80), var(--magenta-100));
}

.settings-tab.nav-item .nav-ico {
  flex-shrink: 0;
  color: currentColor;
}

.settings-tab.nav-item.active .nav-ico {
  color: var(--brand-80);
}

.settings-nav-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--stroke-1);
  text-align: center;
}

.settings-nav-version {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 11px;
  color: var(--fg-tertiary);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Content panel */
.settings-content {
  padding: 28px 36px 28px;
  overflow-y: auto;
  min-height: 0;
}

/* ─── Legacy fallback: horizontal tab bar (if shell not used) ─── */
.settings-tabs {
  display: flex;
  gap: 4px;
  background: var(--tint-1);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 22px;
}

.settings-tabs .settings-tab:not(.nav-item) {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--fg-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-tabs .settings-tab:not(.nav-item):hover { color: var(--brand-80); background: var(--mica-strong); }
.settings-tabs .settings-tab:not(.nav-item):active { transform: scale(0.97); }
.settings-tabs .settings-tab:not(.nav-item).active {
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
  color: var(--fg-on-accent);
  box-shadow: 0 2px 6px rgba(0, 120, 212, 0.32);
}

/* ═══════════════════════════════════════════════════════════
   MOBILE HAMBURGER MENU
   ═══════════════════════════════════════════════════════════ */
/* By default: hide mobile menu button + dropdown on desktop */
.mobile-only { display: none !important; }
.desktop-only { display: flex; }

.mobile-menu {
  position: absolute;
  top: calc(var(--control-bar-height) + 6px);
  right: 8px;
  background: var(--mica-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-28);
  padding: 8px;
  min-width: 240px;
  z-index: 1000;
  animation: mmIn 0.22s var(--ease-back);
}

.mobile-menu[hidden] { display: none !important; }

@keyframes mmIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--fg-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
  background: var(--brand-140);
  color: var(--brand-70);
  border-color: var(--brand-130);
}

.mobile-menu-item .mm-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--tint-1);
  color: var(--brand-80);
  flex-shrink: 0;
}

.mobile-menu-item:hover .mm-ico {
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
  color: #FFFFFF;
}

.mobile-menu-divider {
  height: 1px;
  background: var(--stroke-1);
  margin: 4px 6px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile / Tablet
   ═══════════════════════════════════════════════════════════ */

/* Tablet & small laptop (≤ 960px) — make control bar more compact */
@media (max-width: 960px) {
  :root {
    --control-bar-height: 52px;
  }

  /* Hide button labels (CLEAR/COPY/SAVE/etc text) — keep icons only */
  .btn-label,
  .tts-label {
    display: none;
  }

  /* Compact icons */
  .icon-btn {
    min-width: 36px;
    height: 36px;
    padding: 0;
  }

  /* TTS pill becomes square */
  .tts-action-btn {
    padding: 0 10px;
    gap: 0;
    min-width: 36px;
    height: 36px;
  }

  /* Action button (start/stop) */
  .action-btn {
    width: 42px;
    height: 36px;
  }

  /* Status text truncate */
  .status-subtext {
    display: none;
  }

  /* Compact control bar — allow wrap if needed */
  .control-bar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 6px 8px;
    min-height: var(--control-bar-height);
    height: auto;
  }

  /* Drag-region grows when wrapped */
  #drag-region {
    height: auto;
    min-height: var(--control-bar-height);
  }
}

/* Phone (≤ 600px) — fit single viewport, collapse to hamburger menu */
@media (max-width: 600px) {
  /* Swap desktop/mobile visibility */
  .desktop-only { display: none !important; }
  .mobile-only { display: flex !important; }

  /* Hide buttons that moved into hamburger menu */
  #btn-copy,
  #btn-download,
  #btn-settings,
  #btn-user {
    display: none !important;
  }

  /* Lock translator to single viewport — no scrolling on body */
  html, body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  #overlay-view {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    border: 0;
  }

  #settings-view {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  /* Control bar nowrap on phone, single row only */
  .control-bar {
    flex-wrap: nowrap;
    overflow: hidden;
    padding: 6px 8px;
    gap: 4px;
    height: var(--control-bar-height);
  }

  #drag-region {
    height: var(--control-bar-height);
    min-height: var(--control-bar-height);
  }

  .app-logo {
    height: 24px;
    margin-right: 2px;
    flex-shrink: 0;
  }

  /* Toolbar group: only Clear left visible */
  .toolbar-group {
    border-left: 0;
    border-right: 0;
    padding: 0;
    margin: 0;
    gap: 1px;
  }

  /* Status pill compact */
  .status-area {
    padding: 4px 10px;
    height: 30px;
    flex: 1;
    min-width: 0;
    max-width: none;
  }

  .status-text {
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .icon-btn {
    min-width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  /* Transcript fills remaining viewport — no scroll on overlay */
  #transcript-container {
    flex: 1;
    min-height: 0;
    padding: 12px 14px 14px;
    overflow-y: auto;
  }

  /* Empty state more compact */
  .hero-placeholder { padding: 16px 14px; }
  .hp-mic-ring { width: 88px; height: 88px; margin-bottom: 14px; }
  .hp-mic-ring-inner { width: 64px; height: 64px; }
  .hp-mic-ring-inner svg { width: 34px !important; height: 34px !important; }
  .hp-bars { height: 24px; margin-bottom: 16px; }
  .hp-bars span { width: 2px; }
  .hp-title { font-size: 22px; margin-bottom: 8px; }
  .hp-sub { font-size: 13px; margin-bottom: 14px; max-width: 320px; }
  .hp-shortcuts { margin-bottom: 14px; }
  .hp-tips { gap: 6px; }
  .hp-tip { padding: 5px 10px; font-size: 10px; }

  /* Mobile menu: shift right, full readable width */
  .mobile-menu {
    right: 6px;
    left: 6px;
    min-width: 0;
  }
}

/* ─── Settings panel: collapse sidebar to top on small screens ─── */
@media (max-width: 760px) {
  .settings-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100%;
  }
  .settings-nav {
    border-right: 0;
    border-bottom: 1px solid var(--stroke-1);
    padding: 12px;
  }
  .settings-nav-header {
    padding: 4px 8px 12px;
    margin-bottom: 10px;
  }
  .settings-nav-footer { display: none; }
  .settings-nav-list {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .settings-tab.nav-item {
    flex: 0 0 auto;
    justify-content: center;
    padding: 8px 14px;
    white-space: nowrap;
  }
  .settings-tab.nav-item.active::before { display: none; }
  .settings-tab.nav-item .nav-ico { display: inline-flex; }
  .settings-content {
    padding: 20px 16px 32px;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Field row stacks vertically on mobile */
  .field-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* Settings header tighter */
  .settings-header {
    padding: 8px 10px;
  }
  .settings-header h2 {
    font-size: 14px;
  }

  /* Color/slider fields wrap */
  .color-field {
    flex-wrap: wrap;
  }
}

/* ─── User panel: full-width sheet on phone ─── */
@media (max-width: 600px) {
  .user-panel {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px 18px 24px;
    animation: panelSlideUp 0.28s var(--ease-back);
  }

  @keyframes panelSlideUp {
    from { opacity: 0; transform: translateY(100%); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ─── Login: tighter padding on phone ─── */
@media (max-width: 600px) {
  .login-container {
    padding: 32px 22px;
    max-width: 100%;
    border-radius: var(--radius-xl);
    margin: 16px;
  }

  .login-logo {
    width: 72px;
    height: 72px;
  }

  .login-title {
    font-size: 1.5rem;
  }
}

/* ─── Modal: avoid overflow on phone ─── */
@media (max-width: 600px) {
  .modal-card,
  .modal-box {
    width: calc(100vw - 24px);
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal-header { padding: 18px 18px 4px; }
  .modal-body { padding: 14px 18px; }
  .modal-footer { padding: 12px 18px 16px; }
}

.settings-tab-content { display: none; }
.settings-tab-content.active { display: block; animation: fadeInUp 0.22s var(--ease-out); }

.terms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 8px;
}

.btn-icon-sm {
  width: 28px;
  height: 28px;
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  background: var(--mica-strong);
  color: var(--brand-80);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-2);
}

.btn-icon-sm:hover {
  background: var(--brand-80);
  color: #FFFFFF;
  border-color: transparent;
  transform: rotate(90deg);
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.32);
}

.btn-icon-sm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-icon-sm.spinning svg {
  animation: btnSpin 1s linear infinite;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

.term-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}
.term-row input { flex: 1; min-width: 0; }
.term-row .btn-remove-term {
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--fg-tertiary);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.term-row .btn-remove-term:hover {
  color: var(--color-danger);
  background: rgba(209, 52, 56, 0.10);
  border-color: rgba(209, 52, 56, 0.25);
}

.settings-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--stroke-1);
}
.settings-section:last-of-type {
  border-bottom: none;
  margin-bottom: 10px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-secondary);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 12px;
}

.optional-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--tint-1);
  border: 1px solid var(--stroke-2);
  padding: 2px 8px;
  border-radius: var(--radius-circle);
  margin-left: 6px;
}

.required-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-danger);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(209, 52, 56, 0.10);
  border: 1px solid rgba(209, 52, 56, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-circle);
  margin-left: 6px;
}

.save-btn-top { color: var(--mint-100) !important; }
.save-btn-top:hover {
  background: rgba(19, 161, 14, 0.12) !important;
  border-color: rgba(19, 161, 14, 0.30) !important;
  color: var(--mint-100) !important;
}

/* Form */
.input-group { display: flex; gap: 6px; }
.input-group input { flex: 1; }

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--fg-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-2);
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover {
  border-color: var(--stroke-3);
  background: var(--input-hover);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  border-color: var(--brand-80);
  background: var(--input-hover);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.18), var(--shadow-2);
}

input[type="password"] {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  letter-spacing: 0.06em;
}

input::placeholder { color: var(--fg-tertiary); font-weight: 400; }

select {
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  background-color: var(--input-bg);
  color: var(--fg-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%230078D4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-2);
}

select:hover {
  background-color: var(--input-hover);
  border-color: var(--stroke-3);
}

select:focus {
  border-color: var(--brand-80);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.18), var(--shadow-2);
}

select option {
  background: #FFFFFF;
  color: var(--fg-primary);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--fg-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.radio-group {
  display: flex;
  gap: 4px;
  background: var(--tint-1);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  padding: 4px;
}

.radio-option { flex: 1; text-align: center; cursor: pointer; }
.radio-option input[type="radio"] { display: none; }

.radio-label {
  display: block;
  padding: 8px 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--fg-secondary);
  transition: all var(--transition-fast);
}

.radio-option input[type="radio"]:checked + .radio-label {
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
  color: var(--fg-on-accent);
  box-shadow: 0 2px 6px rgba(0, 120, 212, 0.32);
}

.radio-option:hover .radio-label {
  color: var(--brand-80);
  background: var(--mica-strong);
}

.radio-option input[type="radio"]:checked + .radio-label:hover {
  color: var(--fg-on-accent);
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
}

/* Sliders */
.slider-field {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.slider-field .field-label { min-width: 76px; }

input[type="range"] {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--tint-2);
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--cyan-100), var(--brand-80), var(--magenta-100));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid var(--brand-80);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: var(--shadow-4);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  border-color: var(--brand-70);
  box-shadow: 0 0 0 6px rgba(0, 120, 212, 0.14), var(--shadow-4);
}

.range-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-80);
  min-width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

/* Checkbox */
.checkbox-option {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 0;
}

.checkbox-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--stroke-3);
  border-radius: 5px;
  background: var(--input-bg);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  box-shadow: var(--shadow-2);
}

.checkbox-option input[type="checkbox"]:hover {
  border-color: var(--brand-80);
  background: var(--input-hover);
}

.checkbox-option input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
  border-color: var(--brand-80);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.18), var(--shadow-2);
}

.checkbox-option input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 11px;
  border: solid #FFFFFF;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

.checkbox-label {
  font-size: 13px;
  color: var(--fg-primary);
  font-weight: 500;
}

.hint {
  font-size: 11px;
  color: var(--fg-tertiary);
  margin-top: 8px;
  line-height: 1.55;
}
.hint a {
  color: var(--brand-80);
  text-decoration: none;
  font-weight: 600;
}
.hint a:hover {
  text-decoration: underline;
  color: var(--brand-70);
}

.settings-actions { padding-top: 16px; }

.primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
  color: var(--fg-on-accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--transition-fast), box-shadow var(--transition-normal);
  box-shadow: 0 4px 12px rgba(0, 120, 212, 0.32), 0 1px 3px rgba(0, 120, 212, 0.18);
}

.primary-btn:hover {
  background: linear-gradient(135deg, var(--brand-90), var(--brand-80));
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 120, 212, 0.40), 0 2px 6px rgba(0, 120, 212, 0.24);
}

.primary-btn:active { transform: scale(0.98); }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  opacity: 0;
  transition: all 0.32s var(--ease-out);
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  line-height: 1.4;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-16);
}

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

.toast.success {
  background: rgba(19, 161, 14, 0.96);
  color: #FFFFFF;
  border: 1px solid rgba(19, 161, 14, 1);
}

.toast.error {
  background: rgba(209, 52, 56, 0.96);
  color: #FFFFFF;
  border: 1px solid rgba(209, 52, 56, 1);
}

/* ═══════════════════════════════════════════════════════════
   SETUP MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 247, 251, 0.62);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modalFadeIn 0.28s var(--ease-out);
}

.modal-card {
  background:
    radial-gradient(ellipse 60% 50% at 0% 0%, rgba(0, 120, 212, 0.14), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(227, 0, 140, 0.12), transparent 60%),
    var(--mica-strong);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-2xl);
  width: 480px;
  max-width: 92vw;
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow-64);
  overflow: hidden;
  animation: modalCardIn 0.32s var(--ease-back);
}

@keyframes modalCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 26px 4px;
}

.modal-header h3 {
  color: var(--fg-primary);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-body { padding: 18px 26px; }

.modal-desc {
  color: var(--fg-secondary);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 22px;
}

.modal-footer {
  padding: 16px 26px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--stroke-1);
  background: rgba(245, 247, 251, 0.5);
}

.secondary-btn {
  background: var(--mica-strong);
  color: var(--fg-secondary);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  padding: 10px 20px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-2);
}

.secondary-btn:hover {
  background: #FFFFFF;
  border-color: var(--stroke-3);
  color: var(--brand-80);
  box-shadow: var(--shadow-4);
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--tint-2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan-100), var(--brand-80), var(--magenta-100));
  border-radius: 4px;
  transition: width 0.5s var(--ease-out);
  position: relative;
  box-shadow: 0 0 12px rgba(0, 120, 212, 0.45);
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: progressShine 1.8s linear infinite;
}

.progress-pct {
  color: var(--brand-80);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  min-width: 42px;
  text-align: right;
}

.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.setup-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-normal);
}

.setup-step.active {
  background: var(--mica-strong);
  border-color: var(--stroke-2);
  box-shadow: var(--shadow-2);
}

.setup-step.done .step-icon { color: var(--mint-100); }
.setup-step.done .step-text { color: var(--fg-secondary); }

.step-icon {
  font-size: 14px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--tint-1);
  border: 1px solid var(--stroke-2);
  flex-shrink: 0;
}

.setup-step.active .step-icon {
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(0, 120, 212, 0.45);
}

.setup-step.done .step-icon {
  background: rgba(19, 161, 14, 0.16);
  border-color: rgba(19, 161, 14, 0.4);
}

.step-text {
  color: var(--fg-tertiary);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.setup-step.active .step-text {
  color: var(--fg-primary);
  font-weight: 600;
}

.setup-status {
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  min-height: 42px;
  display: flex;
  align-items: center;
}

#setup-status-text {
  color: var(--fg-secondary);
  font-size: 12px;
  font-family: 'JetBrains Mono', 'SF Mono', Cascadia Code, Consolas, monospace;
  word-break: break-all;
  letter-spacing: 0.02em;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes progressShine {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ═══════════════════════════════════════════════════════════
   LOGIN VIEW — Light Mica landing
   ═══════════════════════════════════════════════════════════ */

#login-view {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 50% at 15% 10%, rgba(0, 120, 212, 0.18), transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 90%, rgba(227, 0, 140, 0.14), transparent 55%),
    radial-gradient(ellipse 40% 30% at 50% 50%, rgba(0, 183, 195, 0.10), transparent 55%),
    var(--bg-body);
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 44px 36px;
  background: var(--mica-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-64);
  text-align: center;
  animation: modalCardIn 0.42s var(--ease-back);
}

.login-logo {
  width: 96px;
  height: 96px;
  margin-bottom: 20px;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 120, 212, 0.32));
}

.login-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.login-title-main {
  display: block;
  line-height: 1.05;
  background: linear-gradient(135deg, var(--cyan-100) 0%, var(--brand-80) 40%, var(--magenta-100) 80%, var(--magenta-120) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-title-sub {
  display: block;
  margin-top: 8px;
  font-size: 0.78em;
  font-weight: 600;
  color: var(--fg-secondary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 0.92rem;
  color: var(--fg-tertiary);
  margin-bottom: 32px;
  letter-spacing: 0.01em;
  font-weight: 500;
}

.login-error {
  background: rgba(209, 52, 56, 0.12);
  border: 1px solid rgba(209, 52, 56, 0.3);
  color: var(--color-danger);
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: left;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  color: var(--fg-primary);
  font-size: 0.92rem;
  font-family: inherit;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-2);
}

.login-form input:focus {
  border-color: var(--brand-80);
  background: var(--input-hover);
  box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.18), var(--shadow-2);
}

.login-btn {
  width: 100%;
  padding: 13px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  margin-top: 6px;
}

.login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--fg-tertiary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--stroke-3), transparent);
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: var(--mica-strong);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-md);
  color: var(--fg-primary);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-2);
}

.oauth-btn:hover {
  background: #FFFFFF;
  border-color: var(--stroke-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-8);
}

.oauth-btn:active { transform: scale(0.98); }

.login-toggle {
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--fg-secondary);
}

.link-btn {
  background: none;
  border: none;
  color: var(--brand-80);
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  text-decoration: none;
  position: relative;
  transition: color var(--transition-fast);
}

.link-btn::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transform: scaleX(0.6);
  transform-origin: left;
  transition: transform var(--transition-fast);
}

.link-btn:hover { color: var(--brand-70); }
.link-btn:hover::after { transform: scaleX(1); }

.login-success {
  background: rgba(19, 161, 14, 0.12);
  border: 1px solid rgba(19, 161, 14, 0.30);
  color: var(--mint-100);
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.forgot-link {
  display: block;
  text-align: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--brand-80);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.forgot-link:hover {
  color: var(--brand-70);
  text-decoration: underline;
}

/* Lang switcher */
.lang-switcher {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.lang-btn {
  padding: 6px 16px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--stroke-2);
  background: var(--mica-strong);
  color: var(--fg-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-2);
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--brand-80), var(--brand-70));
  color: var(--fg-on-accent);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 120, 212, 0.32);
}

.lang-btn:hover:not(.active) {
  border-color: var(--brand-80);
  color: var(--brand-80);
  background: #FFFFFF;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   USER PANEL (dropdown)
   ═══════════════════════════════════════════════════════════ */

.user-panel {
  position: fixed;
  top: 52px;
  right: 14px;
  width: 280px;
  background: var(--mica-strong);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-xl);
  padding: 18px;
  z-index: 1000;
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow-28);
  animation: panelIn 0.22s var(--ease-back);
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.user-panel-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--stroke-1);
}

.user-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg-primary);
  letter-spacing: -0.01em;
}

.user-email {
  font-size: 0.8rem;
  color: var(--fg-tertiary);
  word-break: break-all;
  font-weight: 500;
}

.user-panel-quota {
  margin-bottom: 14px;
}

.quota-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.quota-row:hover { background: var(--tint-1); }

.quota-label {
  font-size: 0.8rem;
  color: var(--fg-tertiary);
  font-weight: 500;
}

.quota-value {
  font-size: 0.84rem;
  color: var(--brand-80);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

.logout-btn {
  width: 100%;
  padding: 10px;
  background: rgba(209, 52, 56, 0.10);
  border: 1px solid rgba(209, 52, 56, 0.30);
  border-radius: var(--radius-md);
  color: var(--color-danger);
  font-size: 0.86rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(209, 52, 56, 0.18);
  border-color: rgba(209, 52, 56, 0.45);
  color: #B22227;
}

.user-panel-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--stroke-1);
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--fg-secondary);
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-menu-item:hover {
  background: var(--mica-strong);
  border-color: var(--stroke-2);
  color: var(--brand-80);
  box-shadow: var(--shadow-2);
}

.user-menu-item.admin-only {
  color: var(--peach-100);
  font-weight: 700;
}

.user-menu-item.admin-only:hover {
  background: rgba(247, 99, 12, 0.10);
  border-color: rgba(247, 99, 12, 0.3);
  color: #D8540A;
}

/* ═══════════════════════════════════════════════════════════
   Reset password modal (modal-box)
   ═══════════════════════════════════════════════════════════ */

.modal-box {
  background: var(--mica-strong);
  border: 1px solid var(--stroke-2);
  border-radius: var(--radius-2xl);
  padding: 36px 32px;
  width: 400px;
  max-width: 92vw;
  text-align: center;
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow: var(--shadow-64);
  animation: modalCardIn 0.32s var(--ease-back);
}

.modal-box h2 {
  margin: 0 0 20px;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg-primary);
}
