/* CSS Reset & Variables */
:root {
  /* Default Theme: Neon Red */
  --accent-color: #FF3B30;
  --accent-color-rgb: 255, 59, 48;
  --accent-glow: 0 0 15px rgba(255, 59, 48, 0.6);
  --accent-glow-strong: 0 0 25px rgba(255, 59, 48, 0.8);
  
  /* Default Base Theme variables */
  --bg-color: #080C14;
  --container-bg: rgba(10, 14, 26, 0.6);
  --modal-bg: #0C1220;
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.07);
  --text-primary: #FFFFFF;
  --text-secondary: #8E8E93;
  --text-primary-fade: rgba(255, 255, 255, 0.6);
  
  --panel-bg-subtle: rgba(255, 255, 255, 0.02);
  --panel-bg-hover: rgba(255, 255, 255, 0.08);
  --panel-border-subtle: rgba(255, 255, 255, 0.15);
  --text-fade-subtle: rgba(255, 255, 255, 0.25);
  
  --bottom-nav-bg: rgba(10, 14, 26, 0.85);
  --bottom-nav-indicator-bg: rgba(255, 255, 255, 0.03);
  
  --card-radius: 20px;
  --transition-speed: 0.25s;
  --transition-bezier: cubic-bezier(0.16, 1, 0.3, 1);

  /* Safe area bottom fallback settings */
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Platform specific safe-area configurations */
body.platform-android {
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}
body.platform-ios {
  --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}


/* Base Themes */
[data-base-theme="deep-navy"] {
  --bg-color: #080C14;
  --container-bg: rgba(10, 14, 26, 0.6);
  --modal-bg: #0C1220;
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #FFFFFF;
  --text-secondary: #8E8E93;
  --text-primary-fade: rgba(255, 255, 255, 0.6);
  --panel-bg-subtle: rgba(255, 255, 255, 0.02);
  --panel-bg-hover: rgba(255, 255, 255, 0.08);
  --panel-border-subtle: rgba(255, 255, 255, 0.15);
  --text-fade-subtle: rgba(255, 255, 255, 0.25);
  --bottom-nav-bg: rgba(10, 14, 26, 0.85);
  --bottom-nav-indicator-bg: rgba(255, 255, 255, 0.03);
}

[data-base-theme="amoled"] {
  --bg-color: #000000;
  --container-bg: rgba(0, 0, 0, 0.85);
  --modal-bg: #0A0A0A;
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-primary: #FFFFFF;
  --text-secondary: #8E8E93;
  --text-primary-fade: rgba(255, 255, 255, 0.6);
  --panel-bg-subtle: rgba(255, 255, 255, 0.03);
  --panel-bg-hover: rgba(255, 255, 255, 0.09);
  --panel-border-subtle: rgba(255, 255, 255, 0.18);
  --text-fade-subtle: rgba(255, 255, 255, 0.25);
  --bottom-nav-bg: rgba(0, 0, 0, 0.92);
  --bottom-nav-indicator-bg: rgba(255, 255, 255, 0.04);
}

[data-base-theme="white"] {
  --bg-color: #F2F2F7;
  --container-bg: rgba(255, 255, 255, 0.95);
  --modal-bg: #FFFFFF;
  --panel-bg: #FFFFFF;
  --panel-border: rgba(0, 0, 0, 0.09);
  --text-primary: #1C1C1E;
  --text-secondary: #636366;
  --text-primary-fade: rgba(28, 28, 30, 0.6);
  --panel-bg-subtle: #F8F9FA;
  --panel-bg-hover: #ECECEF;
  --panel-border-subtle: rgba(0, 0, 0, 0.13);
  --text-fade-subtle: rgba(0, 0, 0, 0.35);
  --bottom-nav-bg: rgba(255, 255, 255, 0.92);
  --bottom-nav-indicator-bg: rgba(0, 0, 0, 0.04);
}

[data-base-theme="navy"] {
  --bg-color: #0A192F;
  --container-bg: rgba(17, 34, 64, 0.7);
  --modal-bg: #112240;
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text-primary: #ECEFF4;
  --text-secondary: #8892B0;
  --text-primary-fade: rgba(236, 239, 244, 0.6);
  --panel-bg-subtle: rgba(255, 255, 255, 0.02);
  --panel-bg-hover: rgba(255, 255, 255, 0.08);
  --panel-border-subtle: rgba(255, 255, 255, 0.15);
  --text-fade-subtle: rgba(255, 255, 255, 0.25);
  --bottom-nav-bg: rgba(10, 25, 47, 0.85);
  --bottom-nav-indicator-bg: rgba(255, 255, 255, 0.03);
}

[data-base-theme="gray"] {
  --bg-color: #1A1A20;
  --container-bg: rgba(30, 30, 38, 0.85);
  --modal-bg: #262630;
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.10);
  --text-primary: #E6E6EC;
  --text-secondary: #9898A4;
  --text-primary-fade: rgba(230, 230, 236, 0.6);
  --panel-bg-subtle: rgba(255, 255, 255, 0.02);
  --panel-bg-hover: rgba(255, 255, 255, 0.08);
  --panel-border-subtle: rgba(255, 255, 255, 0.16);
  --text-fade-subtle: rgba(255, 255, 255, 0.25);
  --bottom-nav-bg: rgba(26, 26, 32, 0.9);
  --bottom-nav-indicator-bg: rgba(255, 255, 255, 0.03);
}

/* Alternate Themes */
[data-theme="blue"] {
  --accent-color: #007AFF;
  --accent-color-rgb: 0, 122, 255;
  --accent-glow: 0 0 15px rgba(0, 122, 255, 0.6);
  --accent-glow-strong: 0 0 25px rgba(0, 122, 255, 0.8);
}
[data-theme="green"] {
  --accent-color: #34C759;
  --accent-color-rgb: 52, 199, 89;
  --accent-glow: 0 0 15px rgba(52, 199, 89, 0.6);
  --accent-glow-strong: 0 0 25px rgba(52, 199, 89, 0.8);
}
[data-theme="purple"] {
  --accent-color: #AF52DE;
  --accent-color-rgb: 175, 82, 222;
  --accent-glow: 0 0 15px rgba(175, 82, 222, 0.6);
  --accent-glow-strong: 0 0 25px rgba(175, 82, 222, 0.8);
}
[data-theme="orange"] {
  --accent-color: #FF9500;
  --accent-color-rgb: 255, 149, 0;
  --accent-glow: 0 0 15px rgba(255, 149, 0, 0.6);
  --accent-glow-strong: 0 0 25px rgba(255, 149, 0, 0.8);
}
[data-theme="cyan"] {
  --accent-color: #32ADE6;
  --accent-color-rgb: 50, 173, 230;
  --accent-glow: 0 0 15px rgba(50, 173, 230, 0.6);
  --accent-glow-strong: 0 0 25px rgba(50, 173, 230, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  height: 100%;
  width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* Glow Background Elements */
.glow-bg {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.15;
  transition: background-color var(--transition-speed) var(--transition-bezier), opacity var(--transition-speed);
}
[data-base-theme="white"] .glow-bg {
  opacity: 0.03;
}
.glow-1 {
  top: 10%;
  left: 10%;
  background-color: var(--accent-color);
}
.glow-2 {
  bottom: 15%;
  right: 10%;
  background-color: #007AFF;
}

/* App Wrapper Container */
.app-container {
  width: 100%;
  max-width: 440px;
  height: 100%;
  max-height: 900px;
  background: var(--container-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 1;
  overflow: hidden;
}

@media (max-width: 480px) {
  .app-container {
    height: 100%;
    max-height: 100%;
    border: none;
    box-shadow: none;
    border-radius: 0;
  }
}

/* App Header styling */
.app-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
}
.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.logo-wake {
  color: var(--text-primary);
}
.logo-it {
  color: var(--accent-color);
  text-shadow: var(--accent-glow);
}
.header-actions {
  display: flex;
  gap: 12px;
}
.icon-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--transition-bezier);
}
.icon-btn:hover {
  background: var(--panel-bg-hover);
  border-color: var(--accent-color);
  box-shadow: var(--accent-glow);
  transform: translateY(-2px);
}
.icon-btn:active {
  transform: translateY(0);
}

/* Views Management */
.app-view {
  flex: 1;
  display: none;
  flex-direction: column;
  padding: 20px 20px calc(64px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  will-change: transform, opacity;
}
.app-view.active {
  display: flex;
  animation: fadeIn 0.3s var(--transition-bezier);
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bottom-nav-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--panel-border);
  padding: 6px 12px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  max-width: 480px;
  margin: 0 auto;
}

.bottom-nav.collapsed {
  transform: translateY(calc(100% - 8px));
  opacity: 0.5;
}

.bottom-nav-indicator {
  display: none;
}

.indicator-segment {
  display: none;
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: all 0.2s ease;
  flex: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.nav-item:hover {
  color: var(--text-primary);
}

.nav-item.active {
  color: var(--accent-color);
  font-weight: 600;
}

.nav-item.active svg {
  stroke: var(--accent-color);
  transform: translateY(-1px);
}

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

/* Clock Display Styling */
.clock-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  border-bottom: 1px solid var(--panel-border);
}
.digital-clock {
  font-size: 80px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  background: linear-gradient(180deg, var(--text-primary) 60%, var(--text-primary-fade) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.seconds-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
}
.clock-seconds {
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-color);
  text-shadow: var(--accent-glow);
}
.clock-ampm {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
}
.clock-date {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 12px;
}

/* Alarms list styling */
.alarms-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.section-title-row h2 {
  font-size: 20px;
  font-weight: 600;
}
.add-btn {
  background: var(--accent-color);
  box-shadow: var(--accent-glow);
  color: #FFF;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  transition: all 0.2s var(--transition-bezier);
}
.add-btn:hover {
  box-shadow: var(--accent-glow-strong);
  transform: translateY(-2px) scale(1.03);
}
.add-btn:active {
  transform: translateY(0) scale(1);
}

.alarms-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 30px;
}

.empty-alarms {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-secondary);
}
.empty-icon {
  stroke: var(--text-secondary);
  opacity: 0.3;
  margin-bottom: 16px;
}

/* Alarm Card */
.alarm-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--card-radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.25s var(--transition-bezier);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.alarm-card:hover {
  background: var(--panel-bg-hover);
  border-color: var(--panel-border-subtle);
}
.alarm-card.active {
  border-color: rgba(var(--accent-color-rgb), 0.3);
}
.alarm-card-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.alarm-time-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.alarm-card-time {
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}
.alarm-card-ampm {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}
.alarm-card-label {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}
.alarm-card-days {
  font-size: 12px;
  color: var(--text-secondary);
}
.alarm-card-tasks {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.task-pill {
  background: rgba(var(--accent-color-rgb), 0.15);
  border: 1px solid rgba(var(--accent-color-rgb), 0.3);
  color: var(--accent-color);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Switches / Toggles */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--panel-bg-hover);
  border: 1px solid var(--panel-border-subtle);
  transition: all .3s var(--transition-bezier);
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #FFFFFF;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.28);
  transition: all .3s var(--transition-bezier);
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--accent-color);
  box-shadow: var(--accent-glow);
  border-color: transparent;
}
input:checked + .slider:before {
  transform: translateX(22px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

[data-base-theme="white"] .slider {
  background-color: #E2E2E8;
  border-color: rgba(0, 0, 0, 0.12);
}
[data-base-theme="white"] input:checked + .slider {
  background-color: var(--accent-color);
  border-color: transparent;
  box-shadow: var(--accent-glow);
}

/* Modal Overlay Styling */
.modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: flex-end;
}
.modal-overlay.active {
  display: flex;
  animation: modalOverlayFadeIn 0.3s cubic-bezier(0.32, 0.94, 0.6, 1);
}
.modal-overlay.closing {
  display: flex;
  pointer-events: none;
  animation: modalOverlayFadeOut 0.28s cubic-bezier(0.32, 0.94, 0.6, 1) forwards;
}
.modal-card {
  width: 100%;
  background: var(--modal-bg);
  border-top: 1px solid var(--panel-border);
  border-radius: 30px 30px 0 0;
  max-height: 85%;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.35s cubic-bezier(0.32, 0.94, 0.6, 1);
  will-change: transform;
  padding-bottom: calc(16px + var(--safe-area-bottom));
}
.modal-overlay.closing .modal-card {
  animation: slideDown 0.28s cubic-bezier(0.32, 0.94, 0.6, 1) forwards;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

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

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

.modal-header {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
}
.modal-header h3 {
  font-size: 20px;
  font-weight: 600;
}
.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s;
}
.close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-body.scrollable {
  max-height: 450px;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.form-group span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Custom Time Wheel Picker styling */
.time-wheel-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 160px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  margin: 10px 0;
}
.time-wheel-selection-indicator {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 48px;
  border-top: 1.5px solid rgba(var(--accent-color-rgb), 0.3);
  border-bottom: 1.5px solid rgba(var(--accent-color-rgb), 0.3);
  background: rgba(var(--accent-color-rgb), 0.04);
  border-radius: 12px;
  pointer-events: none;
  z-index: 1;
}
.time-wheel-column {
  flex: 1;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none; /* Firefox */
  padding: 56px 0; /* Align items precisely in center: 160px container, 48px item = (160-48)/2 = 56px padding */
  box-sizing: border-box;
  z-index: 2;
}
.time-wheel-column::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.time-wheel-item {
  height: 48px;
  line-height: 48px;
  text-align: center;
  font-size: 34px;
  font-weight: 800;
  color: var(--text-secondary);
  scroll-snap-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s var(--transition-bezier), opacity 0.25s var(--transition-bezier), color 0.25s var(--transition-bezier);
  transform: scale(0.765);
  opacity: 0.3;
  will-change: transform, opacity;
}
.time-wheel-item.selected {
  color: var(--text-primary);
  transform: scale(1);
  opacity: 1;
  text-shadow: var(--accent-glow);
}
.time-wheel-separator {
  font-size: 34px;
  font-weight: 800;
  color: var(--text-secondary);
  user-select: none;
  padding: 0 4px;
  z-index: 2;
}

/* Ringtone Picker Grid */
.ringtone-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.ringtone-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s var(--transition-bezier);
}
.ringtone-card:hover {
  border-color: rgba(var(--accent-color-rgb), 0.3);
  background: rgba(255,255,255,0.05);
}
.ringtone-card.selected {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.08);
  box-shadow: var(--accent-glow);
}
.ringtone-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ringtone-card-emoji {
  font-size: 20px;
}
.ringtone-card-info {
  display: flex;
  flex-direction: column;
}
.ringtone-card-name {
  font-size: 14px;
  font-weight: 600;
}
.ringtone-card-category {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-ringtone-card-preview {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-ringtone-card-preview:hover, .btn-ringtone-card-preview.playing {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.1);
}

/* Day Picker */
.day-picker {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.day-btn {
  flex: 1;
  height: 40px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--transition-bezier);
}
.day-btn:hover {
  border-color: var(--panel-border-subtle);
  color: var(--text-primary);
}
.day-btn.active {
  background: var(--accent-color);
  border-color: transparent;
  color: white;
  box-shadow: var(--accent-glow);
}

/* Input Fields */
.text-input, .select-input, .number-input {
  width: 100%;
  height: 48px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 0 16px;
  font-size: 15px;
  outline: none;
  transition: all 0.2s var(--transition-bezier);
}
.text-input:focus, .select-input:focus, .number-input:focus {
  border-color: var(--accent-color);
  box-shadow: var(--accent-glow);
}
.select-input option {
  background: var(--modal-bg);
  color: var(--text-primary);
}
.number-input {
  max-width: 120px;
}

/* Toggle Styles */
.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.toggle-group-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.toggle-label-desc {
  display: flex;
  flex-direction: column;
}
.sub-setting-panel {
  background: var(--panel-bg-subtle);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-height: 100px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.3s var(--transition-bezier),
              opacity 0.25s ease-out,
              padding 0.3s var(--transition-bezier),
              margin 0.3s var(--transition-bezier),
              border-color 0.3s var(--transition-bezier);
}
.sub-setting-panel.hidden {
  display: flex !important;
  max-height: 0 !important;
  opacity: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-top-width: 0 !important;
  border-bottom-width: 0 !important;
  border-color: transparent !important;
  pointer-events: none;
}
.sub-setting-panel label {
  margin-bottom: 0;
  font-weight: 500;
}
.sub-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
#consecutive-count-panel {
  flex-direction: column;
  align-items: stretch;
  max-height: 160px;
  gap: 12px;
}
#consecutive-count-panel.hidden {
  max-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  border-top-width: 0 !important;
  border-bottom-width: 0 !important;
}
.hidden {
  display: none !important;
}

/* Tasks setup styling */
.tasks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.badge {
  background: var(--panel-bg-hover);
  border: 1px solid var(--panel-border-subtle);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px !important;
  font-weight: 600;
}
.selected-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.selected-task-item {
  background: var(--panel-bg-subtle);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.task-item-name {
  font-size: 14px;
  font-weight: 500;
}
.remove-task-btn {
  background: none;
  border: none;
  color: #FF3B30;
  font-size: 18px;
  cursor: pointer;
  font-weight: bold;
}
.add-task-row {
  display: flex;
  gap: 10px;
}
.add-task-row select {
  flex: 1;
}
.outline-btn {
  background: none;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.outline-btn:hover {
  background: var(--accent-color);
  color: white;
  box-shadow: var(--accent-glow);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}
.btn {
  flex: 1;
  height: 52px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s var(--transition-bezier);
}
.btn-primary {
  background: var(--accent-color);
  color: white;
  box-shadow: var(--accent-glow);
}
.btn-primary:hover {
  box-shadow: var(--accent-glow-strong);
  transform: translateY(-2px);
}
.btn-danger {
  background: rgba(255, 59, 48, 0.15);
  border: 1px solid rgba(255, 59, 48, 0.3);
  color: #FF3B30;
}
.btn-danger:hover {
  background: #FF3B30;
  color: white;
}

/* Theme Color Picker */
.theme-color-picker {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}
.color-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s var(--transition-bezier), box-shadow 0.2s;
  box-sizing: border-box;
}
.color-dot:hover {
  transform: scale(1.1);
}
.color-dot.active {
  border-color: var(--bg-color);
  box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4.5px var(--text-primary);
  transform: scale(1.08);
}

/* Permissions items styling */
.permission-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-border);
}
.permission-item:last-child {
  border-bottom: none;
}
.permission-item span {
  font-size: 13px !important;
  color: var(--text-primary) !important;
}
.badge-btn {
  background: var(--panel-bg-hover) !important;
  border: 1px solid var(--panel-border) !important;
  color: var(--text-primary) !important;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.badge-btn:hover:not(.granted) {
  background: var(--panel-border-subtle) !important;
}
.badge-btn.granted {
  background: rgba(52, 199, 89, 0.2) !important;
  border-color: rgba(52, 199, 89, 0.4) !important;
  color: #34C759 !important;
  cursor: default !important;
}

/* Audio Download List Styles */
.audio-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* Category header in library */
.audio-category-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 10px 4px 4px;
  margin-top: 6px;
}

.audio-item {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.2s;
}
.audio-item:hover {
  border-color: rgba(var(--accent-color-rgb), 0.3);
}

/* Left side: emoji + text */
.audio-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.audio-emoji {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.audio-item-info {
  display: flex;
  flex-direction: column;
}
.audio-name {
  font-size: 15px;
  font-weight: 600;
}
.audio-size {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Right side actions */
.audio-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Library preview button */
.btn-lib-preview {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--panel-border-subtle);
  background: var(--panel-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-lib-preview:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.1);
}
.btn-lib-preview.playing {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.18);
  color: var(--accent-color);
  box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.3);
}

/* Sound Select Row (alarm form) */
.sound-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sound-select-row .select-input {
  flex: 1;
}

/* Form sound preview button */
.btn-sound-preview {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--panel-border-subtle);
  background: var(--panel-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-sound-preview:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.1);
}
.btn-sound-preview.playing {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.18);
  color: var(--accent-color);
  box-shadow: 0 0 12px rgba(var(--accent-color-rgb), 0.35);
  animation: pulse-preview 1.5s ease-in-out infinite;
}
@keyframes pulse-preview {
  0%, 100% { box-shadow: 0 0 12px rgba(var(--accent-color-rgb), 0.35); }
  50%       { box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.6); }
}

.btn-dl {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-dl.downloaded {
  background: var(--panel-bg-hover);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  cursor: default;
}

/* RINGING SCREEN (FULLSCREEN OVERLAY) */
.ringing-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #060913;
  z-index: 1000;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
  overflow: hidden;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  /* Force dark theme color variables in ringing view to keep text readable on dark background */
  --text-primary: #FFFFFF;
  --text-secondary: #8E8E93;
  --panel-border: rgba(255, 255, 255, 0.07);
  --panel-bg: rgba(255, 255, 255, 0.03);
  --container-bg: rgba(10, 14, 26, 0.6);
  --modal-bg: #0C1220;
  color: var(--text-primary);
}
.ringing-overlay.active {
  display: flex;
}

/* Advanced Aurora Mesh Gradient Backgrounds */
.ringing-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(130px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.28;
  mix-blend-mode: screen;
  will-change: transform;
}
.ringing-glow-1 {
  width: 480px;
  height: 480px;
  top: -10%;
  left: -15%;
  background: radial-gradient(circle, var(--accent-color) 0%, rgba(var(--accent-color-rgb), 0.2) 80%);
  animation: aurora-mesh-1 25s infinite alternate ease-in-out;
}
.ringing-glow-2 {
  width: 520px;
  height: 520px;
  bottom: -15%;
  right: -10%;
  background: radial-gradient(circle, rgba(var(--accent-color-rgb), 0.8) 0%, rgba(var(--accent-color-rgb), 0.15) 80%);
  animation: aurora-mesh-2 28s infinite alternate ease-in-out;
}
.ringing-glow-3 {
  width: 350px;
  height: 350px;
  top: 40%;
  left: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 70%);
  animation: aurora-mesh-3 20s infinite alternate ease-in-out;
}

@keyframes aurora-mesh-1 {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50% { transform: translate(120px, 80px) rotate(90deg) scale(1.15); }
  100% { transform: translate(-30px, 140px) rotate(180deg) scale(0.95); }
}
@keyframes aurora-mesh-2 {
  0% { transform: translate(0, 0) rotate(0deg) scale(1.05); }
  50% { transform: translate(-100px, -120px) rotate(-120deg) scale(0.85); }
  100% { transform: translate(80px, -60px) rotate(-240deg) scale(1.12); }
}
@keyframes aurora-mesh-3 {
  0% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-30%, -60%) scale(1.2); }
  100% { transform: translate(-70%, -40%) scale(0.85); }
}

.ringing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 35px;
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 420px;
  animation: scaleInRingContent 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleInRingContent {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Pulsing Concentric Sound Waves Area */
.ringing-bell-glow-area {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
}
.ringing-bell-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  background: rgba(var(--accent-color-rgb), 0.15);
  border: 1px solid rgba(var(--accent-color-rgb), 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  z-index: 5;
  box-shadow: 0 10px 30px rgba(var(--accent-color-rgb), 0.25);
  animation: floatBell 4s infinite ease-in-out;
}
.ringing-bell-svg {
  width: 48px;
  height: 48px;
  will-change: transform;
}
.ringing-overlay.active .ringing-bell-svg {
  animation: wobble 0.6s infinite ease-in-out;
}

.ringing-pulse-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 110px;
  margin-top: -55px;
  margin-left: -55px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid rgba(var(--accent-color-rgb), 0.35);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
}
.ringing-overlay.active .c-1 {
  animation: ripple-pulse 3s infinite cubic-bezier(0.1, 0.8, 0.3, 1);
  animation-delay: 0s;
}
.ringing-overlay.active .c-2 {
  animation: ripple-pulse 3s infinite cubic-bezier(0.1, 0.8, 0.3, 1);
  animation-delay: 1s;
}
.ringing-overlay.active .c-3 {
  animation: ripple-pulse 3s infinite cubic-bezier(0.1, 0.8, 0.3, 1);
  animation-delay: 2s;
}

@keyframes ripple-pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
    border-color: rgba(var(--accent-color-rgb), 0.4);
  }
  50% {
    border-color: rgba(var(--accent-color-rgb), 0.2);
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
    border-color: rgba(var(--accent-color-rgb), 0);
  }
}

@keyframes floatBell {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(-14deg); }
  30% { transform: rotate(12deg); }
  45% { transform: rotate(-10deg); }
  60% { transform: rotate(8deg); }
  75% { transform: rotate(-4deg); }
}

/* Minimalist Clock and Alarm Info */
.ringing-clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.ringing-time {
  font-size: 86px;
  font-weight: 300;
  letter-spacing: -3px;
  text-shadow: 0 0 40px rgba(var(--accent-color-rgb), 0.45);
  color: #ffffff;
  line-height: 1.0;
  animation: clockGlowPulse 3s infinite ease-in-out;
}
@keyframes clockGlowPulse {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(var(--accent-color-rgb), 0.15)); }
  50% { filter: drop-shadow(0 0 20px rgba(var(--accent-color-rgb), 0.5)); }
}

.ringing-label {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Glassmorphic Actions Group */
.ringing-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 300px;
}

.btn-ringing-action {
  height: 56px;
  border-radius: 28px;
  font-size: 17px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: none;
}

.btn-ringing-snooze-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(5px);
}
.btn-ringing-snooze-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.btn-ringing-snooze-secondary:active {
  transform: translateY(0);
}

.btn-ringing-start-primary {
  background: var(--accent-color);
  color: #ffffff;
  box-shadow: var(--accent-glow);
  position: relative;
  overflow: hidden;
}
.btn-ringing-start-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: all 0.6s;
}
.btn-ringing-start-primary:hover {
  box-shadow: var(--accent-glow-strong);
  transform: translateY(-3px);
  filter: brightness(1.08);
}
.btn-ringing-start-primary:hover::after {
  left: 100%;
  transition: all 0.8s ease;
}
.btn-ringing-start-primary:active {
  transform: translateY(-1px);
}
.btn-arrow-icon {
  width: 18px;
  height: 18px;
  transition: transform 0.28s;
}
.btn-ringing-start-primary:hover .btn-arrow-icon {
  transform: translateX(4px);
}

/* Glassmorphic Task Solver Container */
.ringing-task-panel-modern {
  width: 100%;
  max-width: 350px;
  background: rgba(8, 12, 22, 0.6);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 22px;
  margin-top: 5px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  animation: slideUpTaskPanel 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.task-timer-section {
  margin-bottom: 18px;
}
.task-timer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.task-title-text {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}
.task-timer-seconds {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.1);
  padding: 2px 10px;
  border-radius: 12px;
}
.task-progress-track {
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.task-progress-fill {
  height: 100%;
  background: var(--accent-color);
  width: 100%;
  transition: width 1s linear;
  box-shadow: 0 0 8px var(--accent-color);
}

/* SUCCESS PANEL (ULTRA-MODERN VICTORY OVERLAY) */
.ringing-success-panel-modern {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 350px;
  box-sizing: border-box;
  padding: 20px;
  animation: fadeInVictory 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes fadeInVictory {
  from { opacity: 0; transform: scale(0.92) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.victory-crown-wrapper {
  position: relative;
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.victory-sunburst {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-color-rgb), 0.35) 0%, rgba(var(--accent-color-rgb), 0) 70%);
  animation: rotateGlow 15s infinite linear;
}

.victory-badge {
  position: relative;
  width: 100px;
  height: 100px;
  background: radial-gradient(135deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.03) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

/* SVG Checkmark draw animation */
.victory-checkmark-svg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: block;
  stroke-width: 3.5;
  stroke: var(--accent-color);
  stroke-miterlimit: 10;
  box-shadow: inset 0px 0px 0px var(--accent-color);
  animation: fillVictoryCheck .45s ease-in-out .4s forwards, bounceVictoryCheck .3s ease-in-out 1.0s both;
}

.victory-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3.5;
  stroke-miterlimit: 10;
  stroke: var(--accent-color);
  fill: none;
  animation: strokeVictoryCheck 0.65s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.victory-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-width: 3.5;
  stroke: #ffffff;
  animation: strokeVictoryCheck 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.65s forwards;
}

@keyframes strokeVictoryCheck {
  100% { stroke-dashoffset: 0; }
}

@keyframes fillVictoryCheck {
  100% { box-shadow: inset 0px 0px 0px 30px var(--accent-color); }
}

@keyframes bounceVictoryCheck {
  0%, 100% { transform: none; }
  50% { transform: scale3d(1.18, 1.18, 1); }
}

.victory-text-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.victory-title {
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.8px;
}
.victory-subtitle {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
}

/* Glassmorphic Motivational Quote Card */
.victory-card-glass {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.victory-card-shine {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.victory-card-emoji {
  font-size: 30px;
  animation: floatEmoji 3s infinite ease-in-out;
}

@keyframes floatEmoji {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(6deg); }
}

.victory-card-message {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
}

.btn-victory-cta {
  background: linear-gradient(135deg, var(--accent-color) 0%, rgba(var(--accent-color-rgb), 0.8) 100%);
  color: #ffffff;
  width: 100%;
  border-radius: 28px;
  box-shadow: 0 0 20px rgba(var(--accent-color-rgb), 0.4);
  font-size: 17px;
  letter-spacing: 0.5px;
  margin-top: 10px;
  animation: ctaPulse 2s infinite;
}

.btn-victory-cta:hover {
  box-shadow: 0 0 30px rgba(var(--accent-color-rgb), 0.65);
  transform: translateY(-2px);
  filter: brightness(1.08);
}
.btn-victory-cta:active {
  transform: translateY(0);
}

@keyframes ctaPulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0.5); }
  70% { box-shadow: 0 0 0 15px rgba(var(--accent-color-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0); }
}

/* Tasks specific styles inside ringing screen */
.task-work-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

/* Math task screen */
.math-expression {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}
.math-input {
  width: 140px;
  height: 52px;
  background: rgba(255,255,255,0.05);
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  color: white;
  font-size: 24px;
  text-align: center;
  outline: none;
  transition: all 0.2s;
}
.math-input:focus {
  border-color: var(--accent-color);
}

/* Typing Task */
.typing-target-phrase {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.4;
  user-select: none;
  width: 100%;
}
.typing-input {
  width: 100%;
  height: 48px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: white;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}
.typing-input:focus {
  border-color: var(--accent-color);
}

/* Shake / Steps target progress */
.shake-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--panel-border);
  border-top-color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  animation: spin 2s linear infinite;
  margin-bottom: 12px;
}
.shake-circle-val {
  animation: reverse-spin 2s linear infinite;
}
@keyframes spin {
  100% { transform: rotate(360deg); }
}
@keyframes reverse-spin {
  100% { transform: rotate(-360deg); }
}

/* Memory Match Grid */
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 280px;
}
.match-card {
  aspect-ratio: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: transparent;
  transition: background 0.2s, transform 0.2s;
}
.match-card.flipped {
  background: var(--accent-color);
  color: white;
  transform: rotateY(180deg);
}
.match-card.matched {
  background: rgba(52, 199, 89, 0.2);
  border-color: #34C759;
  color: #34C759;
  cursor: default;
}

/* Blow Task */
.blow-meter-container {
  width: 100%;
  height: 20px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}
.blow-meter-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-color), #FF9500, #34C759);
  transition: width 0.1s ease-out;
}
.blow-instructions {
  font-size: 13px;
  color: var(--text-secondary);
}

/* =============================================
   TASK SLOT SQUARES (3 big + squares in form)
   ============================================= */
.tasks-sub-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-left: 6px;
}

.task-slots-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.task-slot {
  cursor: pointer;
}

.task-slot-inner {
  aspect-ratio: 1;
  border-radius: 16px;
  border: 2px dashed var(--panel-border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  min-height: 90px;
  background: var(--panel-bg-subtle);
}

.task-slot-inner:hover {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(var(--accent-color-rgb), 0.2);
}

.task-slot-empty .task-slot-plus {
  font-size: 32px;
  font-weight: 300;
  color: var(--text-fade-subtle);
  line-height: 1;
  transition: all 0.3s;
}

.task-slot:hover .task-slot-empty .task-slot-plus {
  color: var(--accent-color);
  transform: scale(1.15);
  text-shadow: var(--accent-glow);
}

.task-slot-filled {
  border-style: solid;
  border-color: rgba(var(--accent-color-rgb), 0.4);
  background: rgba(var(--accent-color-rgb), 0.06);
  gap: 4px;
  padding: 8px 6px;
}

.task-slot-filled:hover {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.08);
  box-shadow: 0 8px 20px rgba(var(--accent-color-rgb), 0.15);
}

.task-slot-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-slot-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.task-slot-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-color);
  text-align: center;
  line-height: 1.2;
}

.task-slot-detail {
  font-size: 9px;
  color: var(--text-secondary);
  text-align: center;
}

.task-slot-number {
  position: absolute;
  top: 5px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-color);
  opacity: 0.6;
}

.task-slot-remove {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 14px;
  color: #FF3B30;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  display: none;
  z-index: 2;
}

.task-slot-filled:hover .task-slot-remove {
  display: block;
}

/* slot entrance animation */
@keyframes slotPop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.slot-pop {
  animation: slotPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============================================
   TASK PICKER MODAL
   ============================================= */
.task-picker-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 12, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  justify-content: flex-end;
  align-items: flex-end;
}

.task-picker-overlay.active {
  display: flex;
  animation: modalOverlayFadeIn 0.25s ease;
}

.task-picker-overlay.closing {
  display: flex;
  pointer-events: none;
  animation: modalOverlayFadeOut 0.28s cubic-bezier(0.32, 0.94, 0.6, 1) forwards;
}

.task-picker-card {
  width: 100%;
  background: var(--modal-bg);
  border-top: 1px solid var(--panel-border);
  border-radius: 30px 30px 0 0;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.35s cubic-bezier(0.32, 0.94, 0.6, 1);
  will-change: transform;
  padding-bottom: calc(16px + var(--safe-area-bottom));
}

.task-picker-overlay.closing .task-picker-card {
  animation: slideDown 0.28s cubic-bezier(0.32, 0.94, 0.6, 1) forwards;
}

.task-picker-header {
  padding: 20px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--panel-border);
  flex-shrink: 0;
}

.task-picker-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.task-picker-body {
  padding: 20px 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.task-picker-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
}

/* ---- Step management ---- */
.task-picker-step {
  display: flex;
  flex-direction: column;
}
.task-picker-step.hidden {
  display: none !important;
}

/* ---- Task type grid ---- */
.task-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.task-type-card {
  background: var(--panel-bg-subtle);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.task-type-card:hover, .task-type-card:active {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.1);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(var(--accent-color-rgb), 0.25);
}

.task-type-icon {
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}
.task-type-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}

.task-type-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.task-type-desc {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ---- Step 2 back button ---- */
.task-picker-back {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}
.task-picker-back:hover { color: var(--text-primary); }

/* ---- Selected task info header ---- */
.task-picker-selected-info {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(var(--accent-color-rgb), 0.07);
  border: 1px solid rgba(var(--accent-color-rgb), 0.2);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.task-picker-selected-info .sel-icon {
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}
.task-picker-selected-info .sel-icon svg {
  width: 28px;
  height: 28px;
  display: block;
}
.task-picker-selected-info .sel-name { font-size: 15px; font-weight: 700; }
.task-picker-selected-info .sel-desc { font-size: 11px; color: var(--text-secondary); }

/* ---- Difficulty section ---- */
.task-difficulty-section {
  margin-bottom: 16px;
}

.difficulty-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.difficulty-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.diff-dot {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--panel-border-subtle);
  background: var(--panel-bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.16,1,0.3,1);
}

.diff-dot:hover {
  border-color: var(--accent-color);
  color: var(--text-primary);
  transform: scale(1.1);
}

.diff-dot.active {
  background: var(--accent-color);
  border-color: transparent;
  color: white;
  box-shadow: var(--accent-glow);
  transform: scale(1.12);
}

.difficulty-desc {
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 18px;
  transition: opacity 0.2s;
}

/* ---- Animated Preview ---- */
.task-preview-container {
  background: var(--panel-bg-subtle);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px 14px 18px;
  margin-bottom: 18px;
  min-height: 140px;
}

.preview-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.task-preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  gap: 10px;
}

/* Math preview */
.preview-math-expr {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  animation: mathReveal 0.5s cubic-bezier(0.16,1,0.3,1);
}
@keyframes mathReveal {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.preview-math-input-mock {
  width: 100px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--panel-border);
  background: var(--panel-bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 13px;
  animation: fadeIn 0.6s 0.2s both;
}

/* Shake preview */
.preview-shake-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  animation: shakePreview 0.6s ease-in-out infinite;
}
.preview-shake-phone svg {
  width: 48px;
  height: 48px;
  display: block;
}
@keyframes shakePreview {
  0%,100% { transform: rotate(0); }
  20%      { transform: rotate(-18deg); }
  40%      { transform: rotate(14deg); }
  60%      { transform: rotate(-10deg); }
  80%      { transform: rotate(7deg); }
}

.preview-shake-count {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Typing preview */
.preview-typing-phrase {
  font-size: 12px;
  font-style: italic;
  color: var(--text-secondary);
  background: var(--panel-bg-hover);
  border: 1px solid var(--panel-border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
  text-align: center;
  line-height: 1.5;
  animation: fadeIn 0.4s both;
}

.preview-typing-cursor {
  width: 80%;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 2px;
  overflow: hidden;
}

.typing-cursor-blink {
  width: 2px;
  height: 16px;
  background: var(--accent-color);
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; }
  50%     { opacity: 0; }
}

.typing-typed-text {
  font-size: 13px;
  color: var(--text-primary);
}

/* Match preview */
.preview-match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  width: 100%;
  max-width: 200px;
}

.preview-match-card {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--panel-bg-hover);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.3s;
}

.preview-match-card.flip {
  background: var(--accent-color);
  color: white;
  transform: rotateY(180deg);
  box-shadow: 0 0 8px rgba(var(--accent-color-rgb),0.4);
}

.preview-match-card.matched {
  background: rgba(52,199,89,0.25);
  border-color: #34C759;
  color: #34C759;
}

/* Blow preview */
.preview-blow-meter {
  width: 90%;
  height: 16px;
  background: var(--panel-bg-hover);
  border: 1px solid var(--panel-border-subtle);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.preview-blow-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-color), #FF9500, #34C759);
  border-radius: 8px;
  animation: blowFill 2.5s cubic-bezier(0.25,0.46,0.45,0.94) infinite;
}
@keyframes blowFill {
  0%   { width: 0%; }
  60%  { width: 85%; }
  80%  { width: 95%; }
  90%  { width: 100%; }
  100% { width: 0%; }
}

.preview-blow-mic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  animation: micPulse 2.5s ease-in-out infinite;
}
.preview-blow-mic svg {
  width: 44px;
  height: 44px;
  display: block;
}
@keyframes micPulse {
  0%,100% { transform: scale(1); opacity: 0.7; }
  50%     { transform: scale(1.15); opacity: 1; }
}

/* Walk preview */
.preview-walk-steps {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

.preview-walk-foot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}
.preview-walk-foot svg {
  width: 28px;
  height: 28px;
  display: block;
}

.preview-walk-foot:nth-child(1) {
  animation: footStep 1s 0s ease-in-out infinite;
}
.preview-walk-foot:nth-child(2) {
  animation: footStep 1s 0.5s ease-in-out infinite;
}

@keyframes footStep {
  0%,100% { transform: translateY(0); opacity: 0.4; }
  50%      { transform: translateY(-8px); opacity: 1; }
}

.preview-walk-target {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Confirm button */
.task-picker-confirm {
  width: 100%;
  margin-top: 2px;
}

/* =============================================
   BARCODE PREVIEW (in task picker)
   ============================================= */
.preview-barcode-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.preview-barcode-box {
  width: 160px;
  height: 70px;
  background: #0a0e1a;
  border: 1.5px solid rgba(var(--accent-color-rgb), 0.4);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-barcode-svg {
  width: 100%;
  height: 100%;
}

.preview-barcode-laser {
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  background: rgba(var(--accent-color-rgb), 0.75);
  border-radius: 1px;
  top: 50%;
  box-shadow: 0 0 8px rgba(var(--accent-color-rgb), 0.6);
  animation: laserSweep 1.6s ease-in-out infinite;
}

@keyframes laserSweep {
  0%   { top: 15%; opacity: 0.5; }
  50%  { top: 85%; opacity: 1; }
  100% { top: 15%; opacity: 0.5; }
}

.preview-barcode-count {
  font-size: 22px;
  font-weight: 800;
}

.preview-barcode-num {
  color: var(--accent-color);
  transition: color 0.3s;
}

.preview-barcode-total {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 400;
}

.preview-barcode-hint {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

/* =============================================
   BARCODE TASK (in ringing screen)
   ============================================= */
.barcode-task-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.barcode-camera-box {
  width: 100%;
  max-width: 280px;
  height: 160px;
  background: #000;
  border: 2px solid rgba(var(--accent-color-rgb), 0.4);
  border-radius: 14px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.barcode-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.barcode-canvas {
  display: none;
}

.barcode-laser-line {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: rgba(var(--accent-color-rgb), 0.8);
  border-radius: 1px;
  top: 50%;
  box-shadow: 0 0 12px rgba(var(--accent-color-rgb), 0.7);
  animation: laserSweep 1.8s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
  transition: background 0.3s;
}

.barcode-no-api-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 12px;
}

.barcode-status-row {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.barcode-counter {
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.barcode-count-num {
  color: var(--accent-color);
  text-shadow: var(--accent-glow);
  transition: color 0.3s;
}

.barcode-count-sep {
  color: var(--text-secondary);
  font-size: 20px;
}

.barcode-count-total {
  color: var(--text-secondary);
  font-size: 20px;
}

.barcode-dots {
  display: flex;
  gap: 8px;
}

.barcode-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.2);
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}

.barcode-dot.scanned {
  background: #34C759;
  border-color: #34C759;
  box-shadow: 0 0 10px rgba(52,199,89,0.6);
  transform: scale(1.2);
}

.barcode-hint {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 500;
  min-height: 20px;
  transition: color 0.3s;
}

.barcode-fallback-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}

.barcode-fallback-row .text-input {
  flex: 1;
  height: 42px;
}

/* Disabled & Dimmed styling for elements like tasks setup during consecutive alarm mode */
.disabled-dim {
  opacity: 0.35 !important;
  pointer-events: none !important;
  filter: grayscale(0.8);
  cursor: not-allowed;
  transition: all 0.3s ease;
}

/* Audio Upload Section & Custom Audio Styling */
.audio-upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--panel-bg-subtle);
  border: 1px dashed var(--panel-border-subtle);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.audio-upload-section:hover {
  background: var(--panel-bg-hover);
  border-color: rgba(var(--accent-color-rgb), 0.4);
}

.upload-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-color);
  color: white;
  border-radius: 12px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--accent-glow);
  transition: all 0.2s ease;
}

.btn-upload:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-upload:active {
  transform: translateY(1px);
}

/* Feature Spotlight Card */
.audio-spotlight-card {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, rgba(var(--accent-color-rgb), 0.12), rgba(var(--accent-color-rgb), 0.04));
  border: 1px solid rgba(var(--accent-color-rgb), 0.28);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 4px;
  text-align: left;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.25s ease;
}

.audio-spotlight-card:hover {
  border-color: rgba(var(--accent-color-rgb), 0.45);
  box-shadow: 0 6px 20px rgba(var(--accent-color-rgb), 0.15);
}

.spotlight-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.spotlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(var(--accent-color-rgb), 0.2);
  color: var(--accent-color);
  border: 1px solid rgba(var(--accent-color-rgb), 0.35);
  border-radius: 16px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.spotlight-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.spotlight-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0 0 10px 0;
}

.spotlight-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(var(--accent-color-rgb), 0.15);
  border: 1px solid rgba(var(--accent-color-rgb), 0.25);
  color: var(--accent-color);
  border-radius: 8px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 600;
}

/* Custom Audio Empty Box */
.audio-custom-empty-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--panel-bg-subtle);
  border: 1px dashed var(--panel-border-subtle);
  border-radius: 14px;
  margin-bottom: 22px;
}

.empty-icon-wrap {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}

.empty-text-wrap strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.empty-text-wrap p {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.35;
}

.audio-item.custom-audio {
  border-color: rgba(var(--accent-color-rgb), 0.28);
  background: rgba(var(--accent-color-rgb), 0.04);
}

.audio-item.custom-audio:hover {
  border-color: rgba(var(--accent-color-rgb), 0.5);
  background: rgba(var(--accent-color-rgb), 0.08);
}

.custom-offset-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent-color);
  font-weight: 600;
}

.btn-edit-custom {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--accent-color-rgb), 0.35);
  background: rgba(var(--accent-color-rgb), 0.1);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-edit-custom:hover {
  background: var(--accent-color);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.4);
  transform: translateY(-1px);
}

.btn-delete-custom {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 59, 48, 0.2);
  background: rgba(255, 59, 48, 0.05);
  color: #FF3B30;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-delete-custom:hover {
  background: #FF3B30;
  color: white;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(255, 59, 48, 0.4);
}

.audio-category-header.builtin-header {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--panel-border-subtle);
  color: var(--text-secondary);
  opacity: 0.85;
}

/* Custom Audio Editor Panel */
.audio-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 0;
  animation: fadeIn 0.3s var(--transition-bezier);
}

.editor-sound-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--panel-border);
  padding-bottom: 10px;
}

.editor-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.editor-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.editor-slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.offset-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: var(--panel-border);
  outline: none;
  transition: background 0.3s;
}

.offset-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: var(--accent-glow);
  cursor: pointer;
  transition: transform 0.1s;
}

.offset-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.editor-time-badge {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  min-width: 65px;
  text-align: center;
}

.editor-numeric-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.numeric-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.numeric-input-wrap .number-input {
  width: 80px;
  text-align: center;
}

.numeric-input-wrap span {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.editor-duration-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.editor-preview-container {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.btn-editor-preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--panel-bg);
  border: 1.5px solid var(--panel-border);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 12px 24px;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-editor-preview-btn:hover {
  background: var(--panel-bg-hover);
  border-color: var(--accent-color);
  box-shadow: var(--accent-glow);
}

.btn-editor-preview-btn.playing {
  background: rgba(var(--accent-color-rgb), 0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: var(--accent-glow);
}

.editor-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.editor-actions .btn {
  flex: 1;
}

/* Edit custom button styling */
.btn-edit-custom {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--panel-border);
  background: var(--panel-bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-edit-custom:hover {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.08);
  color: var(--text-primary);
  box-shadow: var(--accent-glow);
}

/* Delete Mode & Multi-Select Panel */
.delete-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--modal-bg);
  border-top: 1.5px solid var(--panel-border);
  padding: 16px 24px calc(16px + var(--safe-area-bottom));
  display: none;
  justify-content: space-between;
  align-items: center;
  z-index: 105;
  transform: translateY(100%);
  transition: transform 0.3s var(--transition-bezier);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.delete-panel.active {
  display: flex;
  transform: translateY(0);
  pointer-events: auto;
}
.delete-panel-info {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.delete-panel-actions {
  display: flex;
  gap: 8px;
}
.delete-btn-action {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.delete-btn-action.btn-cancel {
  background: var(--panel-bg);
  color: var(--text-secondary);
  border: 1px solid var(--panel-border);
}
.delete-btn-action.btn-cancel:hover {
  background: var(--panel-bg-hover);
  color: var(--text-primary);
}
.delete-btn-action.btn-select-all {
  background: rgba(var(--accent-color-rgb), 0.1);
  color: var(--accent-color);
  border: 1px solid rgba(var(--accent-color-rgb), 0.2);
}
.delete-btn-action.btn-select-all:hover {
  background: rgba(var(--accent-color-rgb), 0.15);
}
.delete-btn-action.btn-delete {
  background: var(--accent-color);
  color: white;
  box-shadow: var(--accent-glow);
}
.delete-btn-action.btn-delete:hover {
  box-shadow: var(--accent-glow-strong);
  transform: scale(1.02);
}

/* Alarm Card Delete Selection Style */
.alarm-card.delete-mode-active {
  cursor: pointer;
  user-select: none;
}
.alarm-card.delete-selected {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.04);
}
.alarm-card-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  background: transparent;
  color: transparent;
}
.alarm-card.delete-selected .alarm-card-checkbox {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
  box-shadow: var(--accent-glow);
}
.alarm-card-checkbox svg {
  width: 14px;
  height: 14px;
  stroke: white;
  stroke-width: 3;
}

/* Swipeable Toast Notification */
.toast-container {
  position: absolute;
  bottom: 78px;
  left: 20px;
  right: 20px;
  z-index: 110;
  pointer-events: none;
}
.toast-message {
  pointer-events: auto;
  background: rgba(12, 18, 32, 0.9);
  backdrop-filter: blur(10px);
  border: 1.5px solid var(--panel-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border-radius: 16px;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  user-select: none;
  cursor: grab;
}
.toast-message:active {
  cursor: grabbing;
}
.toast-message.show {
  transform: translateY(0);
  opacity: 1;
}
.toast-message.dragging {
  transition: none;
}
.toast-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.toast-subtext {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary, #8e9bb4);
  margin-top: 4px;
  display: block;
}
.toast-undo-btn {
  background: transparent;
  border: none;
  color: var(--accent-color);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.toast-undo-btn:hover {
  background: rgba(var(--accent-color-rgb), 0.1);
  text-shadow: var(--accent-glow);
}






/* Settings Refactor Style Adjustments */
#view-settings .settings-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
#view-settings .view-header {
  margin-bottom: 20px;
}

/* Stopwatch UI Styling */
.stopwatch-display-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
}
.stopwatch-time {
  font-size: 64px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}
.stopwatch-controls, .timer-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 30px;
}
.stopwatch-controls button, .timer-controls button {
  min-width: 100px;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}
.stopwatch-laps-container {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--panel-border);
  padding-top: 16px;
  max-height: 250px;
}
.laps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lap-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}
.lap-item .lap-number {
  color: var(--text-primary);
  font-weight: 600;
}
.lap-item .lap-time {
  color: var(--text-primary);
  font-family: monospace;
}

/* Timer UI Styling */
.timer-setup-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 0;
  gap: 20px;
}
.timer-wheel-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 160px;
  width: 100%;
  max-width: 280px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--card-radius);
  overflow: hidden;
}
.timer-display-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 0;
}
.timer-progress-ring-container {
  position: relative;
  width: 200px;
  height: 200px;
}
.timer-progress-ring-container svg {
  transform: rotate(-90deg);
}
.ring-bg {
  stroke: var(--panel-border-subtle);
}
[data-base-theme="white"] .ring-bg {
  stroke: rgba(0, 0, 0, 0.08);
}
.ring-progress {
  stroke: var(--accent-color);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear, stroke var(--transition-speed);
  filter: drop-shadow(0 0 6px var(--accent-color));
  will-change: stroke-dashoffset;
}
.timer-time {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Base Theme Color Picker */
.base-theme-picker {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.theme-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--panel-border-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--transition-bezier);
  position: relative;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
  box-sizing: border-box;
}
.theme-dot:hover {
  transform: translateY(-2px);
  border-color: var(--text-secondary);
}
.theme-dot.active {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px var(--accent-color);
  transform: scale(1.06);
}
/* Dots backgrounds */
.theme-dot[data-base="deep-navy"] { background-color: #080C14; }
.theme-dot[data-base="amoled"] { background-color: #000000; border-color: rgba(255, 255, 255, 0.25); }
.theme-dot[data-base="white"] { background-color: #FFFFFF; border: 2px solid #C7C7CC; }
.theme-dot[data-base="navy"] { background-color: #0A192F; }
.theme-dot[data-base="gray"] { background-color: #1E1E24; }

.theme-dot::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: transparent;
  transition: all 0.2s;
}
.theme-dot.active::after {
  background-color: var(--accent-color);
  box-shadow: var(--accent-glow);
}

/* Category Sections in Settings */
.settings-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-color);
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--panel-border);
  padding-bottom: 8px;
}

/* Grid of secondary actions */
.settings-grid-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.settings-action-btn {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  transition: all 0.25s var(--transition-bezier);
}
.settings-action-btn:hover {
  background: var(--panel-bg-hover);
  border-color: var(--accent-color);
  transform: translateY(-2px);
}
.settings-action-btn:active {
  transform: translateY(0);
}
.settings-action-btn .btn-icon {
  font-size: 20px;
}
.settings-action-btn.danger-btn:hover {
  border-color: #FF3B30;
  background: rgba(255, 59, 48, 0.08);
  color: #FF3B30;
}
.settings-action-btn.full-width {
  grid-column: span 2;
}

/* FAQ Accordion Styling */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}
.faq-item {
  background: var(--panel-bg-subtle);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
}
.faq-question {
  width: 100%;
  padding: 16px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-question .arrow {
  transition: transform 0.25s;
  font-size: 10px;
  color: var(--text-secondary);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out, padding 0.25s ease;
  padding: 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.faq-item.active {
  border-color: rgba(var(--accent-color-rgb), 0.3);
  background: rgba(var(--accent-color-rgb), 0.02);
}
.faq-item.active .faq-answer {
  max-height: 200px;
  padding-bottom: 16px;
}
.faq-item.active .arrow {
  transform: rotate(180deg);
  color: var(--accent-color);
}

/* Donate Modal Premium Styling */
.donate-card-premium {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.donate-card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-color) 0%, rgba(var(--accent-color-rgb), 0.3) 100%);
}
.donate-badge {
  background: rgba(var(--accent-color-rgb), 0.15);
  color: var(--accent-color);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 6px 14px;
  border-radius: 20px;
  text-transform: uppercase;
}
.donate-illustration {
  font-size: 54px;
  margin: 10px 0;
  animation: floatHeart 3s ease-in-out infinite;
  display: inline-block;
}
.donate-message {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.btn-donate-cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px !important;
  font-weight: 700 !important;
  height: 54px !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 15px rgba(var(--accent-color-rgb), 0.3);
}
.donate-btn-icon {
  font-size: 18px;
  transition: transform 0.25s var(--transition-bezier);
}
.btn-donate-cta:hover .donate-btn-icon {
  transform: translateX(4px);
}
@keyframes floatHeart {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.08);
  }
}

/* Legal Toggles & Reader */
.legal-tabs {
  display: flex;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}
.legal-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}
.legal-tab.active {
  background: var(--accent-color);
  color: #FFF;
  box-shadow: var(--accent-glow);
}
.legal-content-container {
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(0,0,0,0.15);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.legal-content-panel {
  display: none;
}
.legal-content-panel.active {
  display: block;
}
.legal-content-panel h4 {
  color: var(--text-primary);
  margin-bottom: 8px;
  margin-top: 12px;
  font-size: 13px;
}
.legal-content-panel h4:first-child {
  margin-top: 0;
}

/* Clear Data Dialog */
.warning-box {
  background: rgba(255, 59, 48, 0.08);
  border: 1.5px solid rgba(255, 59, 48, 0.3);
  color: #FF3B30;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
}

/* Social and Share Area */
.share-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.share-btn {
  flex: 1;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.share-btn:hover {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.05);
}


/* Custom SVG Micro-animations */
.task-type-icon svg *, .sel-icon svg *, .task-slot-icon svg * {
  transition: transform 0.3s var(--transition-bezier), opacity 0.3s var(--transition-bezier), stroke-width 0.3s var(--transition-bezier);
}

/* 1. Matematik (Abacus): slide beads horizontally on hover */
.task-type-card:hover .task-type-icon svg circle:nth-of-type(odd),
.task-slot-inner:hover .task-slot-icon svg circle:nth-of-type(odd) {
  transform: translateX(3px);
}
.task-type-card:hover .task-type-icon svg circle:nth-of-type(even),
.task-slot-inner:hover .task-slot-icon svg circle:nth-of-type(even) {
  transform: translateX(-3px);
}

/* 2. Sallama (Shaking Phone): rotate/tilt the phone and pulse shake lines */
@keyframes shake-phone {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(8deg); }
  100% { transform: rotate(0deg); }
}
.task-type-card:hover .task-type-icon svg rect,
.task-slot-inner:hover .task-slot-icon svg rect {
  transform-origin: center;
}
.task-type-card:hover .task-type-icon svg rect:first-of-type,
.task-slot-inner:hover .task-slot-icon svg rect:first-of-type {
  animation: shake-phone 0.4s ease-in-out infinite;
}
.task-type-card:hover .task-type-icon svg path[d*="C 2 10"],
.task-type-card:hover .task-type-icon svg path[d*="C 22 10"] {
  opacity: 1;
  stroke-width: 2.2px;
}

/* 3. Yazı Yazma (Keyboard): light up keys on hover */
.task-type-card:hover .task-type-icon svg rect[fill="var(--text-primary)"],
.task-slot-inner:hover .task-slot-icon svg rect[fill="var(--text-primary)"] {
  fill: var(--accent-color);
}

/* 4. Eşleştirme (Puzzle): slide puzzle pieces together */
.task-type-card:hover .task-type-icon svg path:nth-of-type(1),
.task-slot-inner:hover .task-slot-icon svg path:nth-of-type(1) {
  transform: translate(1.5px, 1.5px);
}
.task-type-card:hover .task-type-icon svg path:nth-of-type(2),
.task-slot-inner:hover .task-slot-icon svg path:nth-of-type(2) {
  transform: translate(-1.5px, -1.5px);
}

/* 5. Üfleme (Microphone): pulse soundwaves */
@keyframes pulse-wave {
  0% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.5; }
}
.task-type-card:hover .task-type-icon svg path[d*="C 20.5"],
.task-type-card:hover .task-type-icon svg path[d*="C 23"] {
  animation: pulse-wave 1s ease-in-out infinite;
  transform-origin: 15.5px 8.5px;
}

/* 6. Yürüme (Walking Legs): bob legs slightly */
@keyframes walk-legs {
  0% { transform: translateY(0); }
  50% { transform: translateY(-1.5px); }
  100% { transform: translateY(0); }
}
.task-type-card:hover .task-type-icon svg path[d*="M 12,13 L 15.5"],
.task-type-card:hover .task-type-icon svg path[d*="M 12,13 L 9.5"] {
  animation: walk-legs 0.5s ease-in-out infinite;
  transform-origin: 12px 13px;
}

/* 7. Barkod (Box): glow top tape */
.task-type-card:hover .task-type-icon svg path[d*="M 9.5,5.5 L 16.5,9.5"] {
  stroke-width: 1.8px;
  stroke: var(--accent-color);
}

/* 8. Belirli Barkod (Price Tag): swing the tag */
@keyframes swing-tag {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}
.task-type-card:hover .task-type-icon svg path[d*="M 8.5,9.5 L 12,6"],
.task-slot-inner:hover .task-slot-icon svg path[d*="M 8.5,9.5 L 12,6"] {
  animation: swing-tag 0.8s ease-in-out infinite;
  transform-origin: 12px 6px;
}

/* Custom Language Picker Styles */
.custom-select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  margin-top: 6px;
  transition: all 0.25s var(--transition-bezier);
  box-sizing: border-box;
}
.custom-select-trigger:hover {
  background: var(--panel-bg-hover);
  border-color: var(--panel-border-subtle);
}
.select-arrow-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: transform 0.25s var(--transition-bezier);
}
.custom-select-trigger:active .select-arrow-icon {
  transform: translateY(2px);
}

.language-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.language-option-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  padding: 16px 20px;
  border-radius: var(--card-radius);
  cursor: pointer;
  transition: all 0.25s var(--transition-bezier);
}
.language-option-item:hover {
  background: var(--panel-bg-hover);
  border-color: var(--panel-border-subtle);
}
.language-option-item.selected {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.05);
}
.language-option-item span {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
}
.option-check-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--panel-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--transition-bezier);
}
.language-option-item.selected .option-check-circle {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: var(--accent-glow);
}
.option-check-circle svg {
  width: 12px;
  height: 12px;
  color: transparent;
  transition: color 0.25s var(--transition-bezier);
}
.language-option-item.selected .option-check-circle svg {
  color: #FFFFFF;
}

/* --- SUDOKU & ZIP PUZZLES --- */

/* Preview Styles */
.preview-sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 160px;
  height: 160px;
  border: 1.5px solid var(--text-primary);
  background: var(--panel-bg-subtle);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto;
}
.preview-sudoku-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  border: 0.5px solid var(--panel-border-subtle);
  user-select: none;
}
.preview-sudoku-cell.clue {
  font-weight: 700;
  color: var(--text-primary);
  background: var(--panel-bg);
}
.preview-sudoku-cell.thick-r {
  border-right: 1.5px solid var(--text-primary);
}
.preview-sudoku-cell.thick-b {
  border-bottom: 1.5px solid var(--text-primary);
}
.preview-sudoku-cell.selected {
  background: rgba(var(--accent-color-rgb), 0.25);
  box-shadow: inset 0 0 4px var(--accent-color);
}
.preview-sudoku-cell.entered {
  color: var(--accent-color);
  font-weight: 700;
}

.preview-zip-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  width: 160px;
  height: 160px;
  gap: 4px;
  background: var(--panel-bg-subtle);
  border-radius: 8px;
  margin: 0 auto;
  padding: 4px;
}
.preview-zip-cell {
  position: relative;
  border-radius: 6px;
  background: var(--panel-bg-hover);
  border: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.preview-zip-cell.visited {
  background: rgba(var(--accent-color-rgb), 0.2);
  border-color: rgba(var(--accent-color-rgb), 0.4);
}
.preview-zip-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.zip-cp-num {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-color);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Active Game Styles */
.sudoku-grid-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}
.sudoku-board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  border: 2px solid var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.sudoku-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  cursor: pointer;
  transition: background 0.15s;
}
.sudoku-cell.clue {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04);
}
.sudoku-cell.user-input {
  color: var(--accent-color);
  font-weight: 600;
}
.sudoku-cell.thick-r {
  border-right: 2px solid var(--text-primary);
}
.sudoku-cell.thick-b {
  border-bottom: 2px solid var(--text-primary);
}
.sudoku-cell.selected {
  background: rgba(var(--accent-color-rgb), 0.25) !important;
  box-shadow: inset 0 0 6px var(--accent-color);
}
.sudoku-cell.same-number {
  background: rgba(var(--accent-color-rgb), 0.12);
}
.sudoku-cell.conflict {
  background: rgba(255, 59, 48, 0.15) !important;
  color: #ff3b30 !important;
  animation: shakeCell 0.4s ease-in-out;
}
.sudoku-cell.success {
  background: rgba(52, 199, 89, 0.2) !important;
  color: #34c759 !important;
  border-color: rgba(52, 199, 89, 0.4) !important;
}

@keyframes shakeCell {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.sudoku-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 320px;
}
.sudoku-key {
  height: 48px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.sudoku-key:active {
  background: var(--accent-color);
  color: #000;
  transform: scale(0.95);
  box-shadow: var(--accent-glow);
}
.sudoku-key.clear-key {
  background: rgba(255, 59, 48, 0.1);
  border-color: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
}
.sudoku-key.clear-key:active {
  background: #ff3b30;
  color: #fff;
  box-shadow: 0 0 10px rgba(255,59,48,0.5);
}

/* Zip Game Styles */
.zip-game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.zip-board {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 290px;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.01);
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  touch-action: none;
  user-select: none;
}
.zip-cell {
  position: relative;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  z-index: 2;
}
.zip-cell.visited {
  background: rgba(var(--accent-color-rgb), 0.15);
  border-color: rgba(var(--accent-color-rgb), 0.3);
}
.zip-cell.path-head {
  background: rgba(var(--accent-color-rgb), 0.35);
  box-shadow: 0 0 12px var(--accent-color);
  animation: headGlow 1.5s infinite alternate;
}
.zip-cell.success {
  background: rgba(52, 199, 89, 0.15) !important;
  border-color: rgba(52, 199, 89, 0.4) !important;
}

@keyframes headGlow {
  0% { box-shadow: 0 0 6px var(--accent-color); }
  100% { box-shadow: 0 0 16px var(--accent-color); }
}

.zip-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.zip-line {
  filter: drop-shadow(0 0 4px var(--accent-color));
  opacity: 0.95;
}

/* Walls / Borders */
.zip-cell.wall-r {
  border-right: 4px solid #ff4757 !important;
}
.zip-cell.wall-b {
  border-bottom: 4px solid #ff4757 !important;
}

/* Alarm Preview & Exit Functionality */
.btn-preview {
  background: rgba(var(--accent-color-rgb), 0.1);
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  margin-top: 10px;
  box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.15);
}
.btn-preview:hover {
  background: var(--accent-color);
  color: white;
  box-shadow: var(--accent-glow-strong);
  transform: translateY(-2px);
}
.btn-preview:active {
  transform: translateY(0);
}

.ringing-back-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary, #ffffff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1005;
  transition: all 0.2s var(--transition-bezier);
}
.ringing-back-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}
.ringing-back-btn:active {
  transform: scale(0.95);
}

/* ==========================================
   THEME ACCESSIBILITY OVERRIDES (LIGHT THEME)
   ========================================== */
[data-base-theme="white"] .alarm-card {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

[data-base-theme="white"] .alarm-card:hover {
  background: #FAFAFC;
  border-color: rgba(0, 0, 0, 0.14);
}

[data-base-theme="white"] .badge-btn {
  background: rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #1C1C1E !important;
}

[data-base-theme="white"] .badge-btn:hover:not(.granted) {
  background: rgba(0, 0, 0, 0.1) !important;
}

[data-base-theme="white"] .badge-btn.granted {
  background: rgba(52, 199, 89, 0.15) !important;
  border-color: rgba(52, 199, 89, 0.3) !important;
  color: #248A3D !important;
}

[data-base-theme="white"] .delete-btn-action.btn-cancel {
  background: rgba(0, 0, 0, 0.04) !important;
  color: #636366 !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

[data-base-theme="white"] .delete-btn-action.btn-cancel:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #1C1C1E !important;
}

[data-base-theme="white"] .btn-editor-preview-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1.5px solid rgba(0, 0, 0, 0.1) !important;
  color: #1C1C1E !important;
}

[data-base-theme="white"] .btn-editor-preview-btn:hover {
  background: rgba(0, 0, 0, 0.08) !important;
}

[data-base-theme="white"] .btn-edit-custom {
  border: 1.5px solid rgba(0, 0, 0, 0.1) !important;
  background: rgba(0, 0, 0, 0.03) !important;
  color: #636366 !important;
}

[data-base-theme="white"] .settings-action-btn {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

[data-base-theme="white"] .settings-action-btn:hover {
  background: #F8F9FA !important;
  border-color: var(--accent-color);
}

[data-base-theme="white"] .faq-item {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-base-theme="white"] .ringtone-card {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-base-theme="white"] .ringtone-card:hover {
  background: #F8F9FA;
  border-color: rgba(var(--accent-color-rgb), 0.35);
}

[data-base-theme="white"] .lap-item {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-base-theme="white"] .task-type-card {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

[data-base-theme="white"] .task-type-card:hover,
[data-base-theme="white"] .task-type-card:active {
  background: #FFFFFF;
  border-color: var(--accent-color);
}

[data-base-theme="white"] .time-wheel-container,
[data-base-theme="white"] .timer-wheel-container {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-base-theme="white"] .custom-select-trigger,
[data-base-theme="white"] .language-option-item {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-base-theme="white"] .legal-tabs {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
}

[data-base-theme="white"] .donate-card-premium {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

[data-base-theme="white"] .stopwatch-time,
[data-base-theme="white"] .timer-time {
  text-shadow: none;
}

[data-base-theme="white"] .offset-slider {
  background: rgba(0, 0, 0, 0.1) !important;
}

/* ==========================================
   CUSTOM DIALOG OVERLAY (ALERT / CONFIRM)
   ========================================== */
.custom-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12000; /* Ensure it stays above everything, even other modals */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--transition-bezier), visibility 0.2s var(--transition-bezier);
}

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

.custom-dialog-card {
  width: 90%;
  max-width: 340px;
  background: var(--modal-bg);
  border: 1px solid var(--panel-border);
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.25s var(--transition-bezier);
}

.custom-dialog-overlay.active .custom-dialog-card {
  transform: scale(1);
}

.custom-dialog-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.custom-dialog-icon {
  font-size: 32px;
  line-height: 1;
}

.custom-dialog-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.3px;
}

.custom-dialog-message {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 24px 0;
  word-break: break-word;
}

.custom-dialog-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.custom-dialog-action {
  flex: 1;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.custom-dialog-action:active {
  transform: scale(0.97);
}

.custom-dialog-action.btn-cancel {
  background: var(--panel-bg);
  color: var(--text-secondary);
  border: 1px solid var(--panel-border);
}

.custom-dialog-action.btn-cancel:hover {
  background: var(--panel-bg-hover);
  color: var(--text-primary);
}

.custom-dialog-action.btn-ok {
  background: var(--accent-color);
  color: #FFFFFF;
  box-shadow: var(--accent-glow);
}

.custom-dialog-action.btn-ok:hover {
  background: rgba(var(--accent-color-rgb), 0.85);
  box-shadow: var(--accent-glow-strong);
}

/* Light Theme Accessibility Overrides for Custom Dialog */
[data-base-theme="white"] .custom-dialog-card {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

[data-base-theme="white"] .custom-dialog-title {
  color: #1C1C1E;
}

[data-base-theme="white"] .custom-dialog-message {
  color: #636366;
}

[data-base-theme="white"] .custom-dialog-action.btn-cancel {
  background: rgba(0, 0, 0, 0.04);
  color: #636366;
  border-color: rgba(0, 0, 0, 0.1);
}

[data-base-theme="white"] .custom-dialog-action.btn-cancel:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1C1C1E;
}

/* =============================================
   SPECIFIC BARCODE SELECTOR & REGISTRATION MODALS
   ============================================= */
.barcode-modal-overlay {
  z-index: 250 !important;
}

.barcode-picker-modal-card,
.add-barcode-modal-card {
  max-height: 85%;
  border-radius: 28px 28px 0 0;
}

.spec-modal-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(var(--accent-color-rgb), 0.12);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Trigger Card in Task Picker Step 2 */
.spec-barcode-trigger-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-border);
  border-radius: var(--card-radius);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s var(--transition-bezier);
  color: var(--text-primary);
  font-family: inherit;
}

.spec-barcode-trigger-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(var(--accent-color-rgb), 0.4);
}

.spec-barcode-trigger-card:active {
  transform: scale(0.985);
}

.spec-barcode-trigger-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(var(--accent-color-rgb), 0.12);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.spec-barcode-trigger-icon svg {
  width: 22px;
  height: 22px;
}

.spec-barcode-trigger-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.spec-barcode-trigger-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spec-barcode-trigger-value {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spec-barcode-trigger-arrow {
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.spec-barcode-trigger-card:hover .spec-barcode-trigger-arrow {
  transform: translateX(2px);
  color: var(--accent-color);
}

/* Banner Action in Selector Modal */
.spec-barcode-top-action {
  margin-bottom: 14px;
}

.btn-new-barcode-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(var(--accent-color-rgb), 0.08);
  border: 1.5px dashed rgba(var(--accent-color-rgb), 0.35);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s var(--transition-bezier);
  text-align: left;
  font-family: inherit;
}

.btn-new-barcode-banner:hover {
  background: rgba(var(--accent-color-rgb), 0.14);
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

.btn-new-barcode-banner:active {
  transform: scale(0.985);
}

.btn-new-barcode-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-color);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--accent-glow);
  flex-shrink: 0;
}

.btn-new-barcode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-new-barcode-primary-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-color);
}

.btn-new-barcode-subtext {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Barcode List in Picker Modal */
.spec-barcode-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spec-barcode-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s var(--transition-bezier);
  position: relative;
  overflow: hidden;
}

.spec-barcode-item-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(var(--accent-color-rgb), 0.3);
  transform: translateY(-1px);
}

.spec-barcode-item-card.selected {
  background: rgba(var(--accent-color-rgb), 0.1);
  border-color: var(--accent-color);
  box-shadow: 0 4px 16px rgba(var(--accent-color-rgb), 0.15);
}

.spec-barcode-item-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.spec-barcode-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.spec-barcode-item-card.selected .spec-barcode-item-icon {
  background: rgba(var(--accent-color-rgb), 0.2);
  color: var(--accent-color);
}

.spec-barcode-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.spec-barcode-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spec-barcode-item-val {
  font-size: 12px;
  font-family: monospace;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spec-barcode-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  flex-shrink: 0;
}

.spec-barcode-check-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-color);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(var(--accent-color-rgb), 0.3);
}

.btn-delete-barcode-item {
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.2);
  color: #FF453A;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.btn-delete-barcode-item:hover {
  background: rgba(255, 59, 48, 0.2);
  border-color: rgba(255, 59, 48, 0.4);
  transform: scale(1.08);
}

.btn-delete-barcode-item:active {
  transform: scale(0.95);
}

/* Empty State */
.spec-barcode-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 16px 20px 16px;
  gap: 6px;
}

.spec-barcode-empty-state .empty-state-icon {
  margin-bottom: 8px;
  opacity: 0.85;
}

.spec-barcode-empty-state h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.spec-barcode-empty-state p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 260px;
  line-height: 1.4;
}

/* Add Barcode Modal Form & Camera Viewfinder */
.btn-camera-scan {
  background: rgba(var(--accent-color-rgb), 0.12);
  border: 1px solid rgba(var(--accent-color-rgb), 0.3);
  color: var(--accent-color);
  border-radius: var(--card-radius);
  padding: 0 14px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn-camera-scan:hover {
  background: var(--accent-color);
  color: #FFFFFF;
  box-shadow: var(--accent-glow);
}

.btn-camera-scan:active {
  transform: scale(0.96);
}

.barcode-camera-viewfinder {
  position: relative;
  width: 100%;
  margin-top: 12px;
  background: #080C14;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalOverlayFadeIn 0.2s ease;
}

.camera-video-wrapper {
  position: relative;
  width: 100%;
  height: 190px;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-viewfinder-frame {
  position: absolute;
  width: 78%;
  height: 68%;
  pointer-events: none;
}

.viewfinder-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--accent-color);
  border-style: solid;
}

.viewfinder-corner.top-left {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 6px;
}

.viewfinder-corner.top-right {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 6px;
}

.viewfinder-corner.bottom-left {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 6px;
}

.viewfinder-corner.bottom-right {
  bottom: 0;
  right: 0;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 6px;
}

.camera-laser-line {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 2.5px;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-color), 0 0 20px var(--accent-color);
  animation: barcodeLaserScanAnim 2s cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite alternate;
}

@keyframes barcodeLaserScanAnim {
  0% { top: 6%; }
  100% { top: 92%; }
}

.camera-viewfinder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.65);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.camera-hint-text {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 0;
}

.btn-close-scanner {
  background: var(--panel-bg-hover);
  border: 1px solid var(--panel-border-subtle);
  color: var(--text-primary);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-close-scanner:hover {
  background: var(--panel-border);
}

/* Light Mode Overrides for Specific Barcode Modals */
[data-base-theme="white"] .spec-barcode-trigger-card {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-base-theme="white"] .spec-barcode-trigger-card:hover {
  background: #F8F9FA;
  border-color: rgba(var(--accent-color-rgb), 0.4);
}

[data-base-theme="white"] .spec-barcode-item-card {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

[data-base-theme="white"] .spec-barcode-item-card:hover {
  background: #F8F9FA;
  border-color: rgba(var(--accent-color-rgb), 0.3);
}

[data-base-theme="white"] .spec-barcode-item-card.selected {
  background: rgba(var(--accent-color-rgb), 0.08);
  border-color: var(--accent-color);
}

[data-base-theme="white"] .spec-barcode-item-icon {
  background: rgba(0, 0, 0, 0.04);
}

[data-base-theme="white"] .btn-new-barcode-banner {
  background: rgba(var(--accent-color-rgb), 0.06);
  border-color: rgba(var(--accent-color-rgb), 0.3);
}

[data-base-theme="white"] .btn-new-barcode-banner:hover {
  background: rgba(var(--accent-color-rgb), 0.1);
}

/* ==========================================================================
   16. POSE EXERCISE TASKS (PUSH-UP & SQUAT) - CAMERA HUD & REP COUNTER
   ========================================================================== */

.pose-task-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  animation: fadeInPose 0.35s ease-out;
}

@keyframes fadeInPose {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.pose-viewfinder-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 250px;
  border-radius: 18px;
  overflow: hidden;
  background: #060913;
  border: 2px solid rgba(var(--accent-color-rgb), 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(var(--accent-color-rgb), 0.2);
}

.pose-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
}

.pose-video.is-mirrored {
  transform: scaleX(-1);
}

.pose-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.pose-canvas.is-mirrored {
  transform: scaleX(-1);
}

.pose-hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 12px;
  box-sizing: border-box;
  z-index: 4;
}

.pose-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: auto;
}

.pose-flip-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.pose-flip-btn:hover {
  background: rgba(var(--accent-color-rgb), 0.35);
  border-color: var(--accent-color);
  transform: scale(1.08);
}

.pose-flip-btn:active {
  transform: scale(0.92);
}

.pose-tracking-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.pose-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffcc00;
  box-shadow: 0 0 6px #ffcc00;
  transition: all 0.3s;
}

.pose-status-dot.active {
  background: #00F5D4;
  box-shadow: 0 0 8px #00F5D4;
}

.pose-status-dot.error {
  background: #ff3b30;
  box-shadow: 0 0 8px #ff3b30;
}

/* Side Live Depth Gauge */
.pose-depth-gauge {
  position: absolute;
  right: 10px;
  top: 48px;
  bottom: 48px;
  width: 5px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.pose-depth-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to top, var(--accent-color), #00F5D4);
  border-radius: 3px;
  transition: height 0.08s ease-out;
  box-shadow: 0 0 8px var(--accent-color);
}

/* Bottom Toast / Form Guidance Pill */
.pose-form-guide {
  align-self: center;
  background: rgba(8, 12, 24, 0.85);
  border: 1px solid rgba(var(--accent-color-rgb), 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  max-width: 90%;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.2px;
}

.pose-form-guide.success-highlight {
  background: rgba(0, 245, 212, 0.25);
  border-color: #00F5D4;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(0, 245, 212, 0.5);
  transform: scale(1.05);
}

/* Master Rep Counter Card */
.pose-rep-card {
  width: 100%;
  max-width: 320px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.pose-rep-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.pose-rep-big {
  font-size: 26px;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: #fff;
  display: flex;
  align-items: baseline;
  gap: 5px;
  line-height: 1;
}

.pose-rep-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent-color);
  text-shadow: 0 0 14px rgba(var(--accent-color-rgb), 0.6);
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s;
  display: inline-block;
}

.pose-rep-num.rep-bump {
  transform: scale(1.35);
  color: #00F5D4;
  text-shadow: 0 0 20px #00F5D4;
}

.pose-rep-target {
  font-size: 18px;
  color: var(--text-secondary);
  font-weight: 600;
}

.pose-rep-remaining {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--panel-bg-hover);
  border: 1px solid var(--panel-border-subtle);
  padding: 4px 10px;
  border-radius: 12px;
}

.pose-rep-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--panel-border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.pose-rep-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), #00F5D4);
  width: 0%;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px var(--accent-color);
}

/* Preset Pills for Custom Target Selection in Step 2 */
.task-preset-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  justify-content: center;
}

.task-preset-pill {
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--panel-bg);
  border: 1.5px solid var(--panel-border-subtle);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.task-preset-pill:hover {
  background: rgba(var(--accent-color-rgb), 0.15);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-1px);
}

.task-preset-pill.active {
  background: rgba(var(--accent-color-rgb), 0.25);
  border-color: var(--accent-color);
  color: #fff;
  box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.4);
}

.pose-fallback-btn {
  margin-top: 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.pose-fallback-btn:hover {
  opacity: 1;
  color: #fff;
}

/* ==========================================================================
   ONBOARDING TOUR & DRIVER.JS STYLING
   ========================================================================== */

/* Settings Prominent Tour Banner */
.settings-tour-banner {
  width: 100%;
  margin-top: 4px;
  margin-bottom: 8px;
}

.settings-tour-banner-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(var(--accent-color-rgb), 0.12) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1.5px solid rgba(var(--accent-color-rgb), 0.35);
  border-radius: 18px;
  padding: 16px 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(var(--accent-color-rgb), 0.12);
  transition: all 0.25s var(--transition-bezier);
}

.settings-tour-banner-btn:hover {
  background: linear-gradient(135deg, rgba(var(--accent-color-rgb), 0.22) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: var(--accent-color);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4), 0 0 25px rgba(var(--accent-color-rgb), 0.3);
  transform: translateY(-2px);
}

.settings-tour-banner-btn:active {
  transform: translateY(0);
}

.tour-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.tour-banner-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(var(--accent-color-rgb), 0.2);
  border: 1px solid rgba(var(--accent-color-rgb), 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(var(--accent-color-rgb), 0.2);
}

.tour-banner-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tour-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.tour-banner-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.tour-banner-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-color);
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(var(--accent-color-rgb), 0.4);
  transition: all 0.2s ease;
}

.settings-tour-banner-btn:hover .tour-banner-badge {
  filter: brightness(1.15);
}

.tour-banner-badge .arrow {
  font-size: 14px;
  transition: transform 0.2s ease;
}

.settings-tour-banner-btn:hover .tour-banner-badge .arrow {
  transform: translateX(3px);
}

/* Welcome Modal Styling */
.onboarding-welcome-card {
  position: relative;
  background: var(--modal-bg);
  border: 1px solid var(--panel-border-subtle);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(var(--accent-color-rgb), 0.25);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.onboarding-welcome-icon-wrapper {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 18px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-welcome-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-color-rgb), 0.45) 0%, rgba(var(--accent-color-rgb), 0) 70%);
  animation: welcomePulseAnim 2.4s infinite ease-in-out;
}

.onboarding-welcome-icon {
  font-size: 38px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 4px 12px rgba(var(--accent-color-rgb), 0.5));
}

@keyframes welcomePulseAnim {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.95;
  }
}

/* Body Tour Mode Performance Optimization: Disable expensive nested blurs */
body.tour-mode .app-container,
body.tour-mode .modal-overlay,
body.tour-mode .driver-popover,
body.tour-mode .tour-celebration-overlay {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Hardware accelerated transitions for modals and cards */
.modal-card,
.task-picker-card,
.alarm-card-cascade {
  will-change: transform, opacity;
  transform: translateZ(0);
}

body.tour-mode .driver-active .driver-overlay {
  pointer-events: auto !important;
}

/* Driver Transitioning State: hide stage and popover during dynamic modal animations & smooth scroll */
body.driver-transitioning .driver-popover,
body.driver-transitioning .driver-stage {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease !important;
}

body .driver-popover,
body .driver-stage {
  transition: opacity 0.25s ease !important;
}

.driver-no-interaction,
.driver-no-interaction * {
  pointer-events: none !important;
  user-select: none !important;
}

/* Driver.js Custom Popover Theme Override - Performance Tuned */
.driver-popover {
  background: rgba(18, 26, 44, 0.97) !important;
  color: var(--text-primary) !important;
  border: 1.5px solid var(--panel-border-subtle) !important;
  border-radius: 20px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7) !important;
  padding: 18px 20px !important;
  max-width: min(340px, calc(100vw - 32px)) !important;
  box-sizing: border-box !important;
  z-index: 1000000000 !important;
}

/* Floating Success Banner for Demo Consecutive Alarms */
.tour-alarms-banner {
  margin: 10px 0 16px 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(var(--accent-color-rgb), 0.22), rgba(var(--accent-color-rgb), 0.08));
  border: 1.5px solid var(--accent-color);
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 25px rgba(var(--accent-color-rgb), 0.35);
  animation: bannerSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 10;
}

@keyframes bannerSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tour-alarms-banner-icon {
  font-size: 28px;
}

.tour-alarms-banner-info {
  display: flex;
  flex-direction: column;
}

.tour-alarms-banner-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.tour-alarms-banner-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.driver-popover-title {
  font-family: 'Outfit', sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin-bottom: 6px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.driver-popover-description {
  font-family: 'Outfit', sans-serif !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: var(--text-secondary) !important;
  margin-bottom: 14px !important;
}

.driver-popover-footer {
  margin-top: 14px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}

.driver-popover-progress-text {
  font-family: 'Outfit', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--accent-color) !important;
  letter-spacing: 0.5px !important;
}

.driver-popover-navigation-btns {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.driver-popover-next-btn,
.driver-popover-prev-btn,
.driver-popover-close-btn {
  font-family: 'Outfit', sans-serif !important;
  cursor: pointer !important;
  text-shadow: none !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.driver-popover-next-btn {
  background: var(--accent-color) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 8px 16px !important;
  border-radius: 12px !important;
  border: none !important;
  box-shadow: 0 0 14px rgba(var(--accent-color-rgb), 0.5) !important;
}

.driver-popover-next-btn:hover {
  filter: brightness(1.15) !important;
  transform: translateY(-1px) !important;
}

.driver-popover-prev-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-primary) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  padding: 8px 12px !important;
  border-radius: 12px !important;
  border: 1px solid var(--panel-border) !important;
}

.driver-popover-prev-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

.driver-popover-close-btn {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  width: 26px !important;
  height: 26px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--text-secondary) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 16px !important;
  border: 1px solid var(--panel-border) !important;
}

.driver-popover-close-btn:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.15) !important;
}

.driver-popover-arrow-side-left.driver-popover-arrow {
  border-right-color: var(--modal-bg) !important;
}
.driver-popover-arrow-side-right.driver-popover-arrow {
  border-left-color: var(--modal-bg) !important;
}
.driver-popover-arrow-side-top.driver-popover-arrow {
  border-bottom-color: var(--modal-bg) !important;
}
.driver-popover-arrow-side-bottom.driver-popover-arrow {
  border-top-color: var(--modal-bg) !important;
}

/* Driver Highlight Stage - Optimized GPU Shadow */
.driver-stage {
  border-radius: 16px !important;
  box-shadow: 0 0 0 2px var(--accent-color), 0 0 12px rgba(var(--accent-color-rgb), 0.4) !important;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Enhanced Waterfall Cascade Animation for Consecutive Alarms Tour Demo */
@keyframes alarmCascadeWaterfall {
  0% {
    opacity: 0;
    transform: translateY(-40px) scale(0.85);
    filter: blur(4px);
  }
  60% {
    opacity: 1;
    transform: translateY(4px) scale(1.03);
    filter: blur(0);
    box-shadow: 0 0 30px rgba(var(--accent-color-rgb), 0.75);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(var(--accent-color-rgb), 0.3);
  }
}

.alarm-card-cascade {
  animation: alarmCascadeWaterfall 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--cascade-index, 0) * 90ms);
  position: relative;
  z-index: 1000000001 !important;
  border: 1.5px solid rgba(var(--accent-color-rgb), 0.5) !important;
}

/* Tour Completion Celebration Overlay & Confetti Burst */
.tour-celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000000005;
  background: rgba(4, 7, 14, 0.88);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  animation: celebrationOverlayIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tour-celebration-overlay.fade-out {
  animation: celebrationOverlayOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

@keyframes celebrationOverlayOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.05); }
}

.tour-celebration-card {
  position: relative;
  z-index: 10;
  background: var(--modal-bg);
  border: 1.5px solid var(--panel-border-subtle);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(var(--accent-color-rgb), 0.35);
  border-radius: 28px;
  padding: 32px 24px;
  text-align: center;
  max-width: 330px;
  width: 100%;
  animation: celebrationCardPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes celebrationCardPop {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(30px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.celebration-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.12);
  border: 1px solid rgba(var(--accent-color-rgb), 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.celebration-icon {
  font-size: 48px;
  margin-bottom: 10px;
  animation: celebrationIconBounce 0.8s infinite alternate ease-in-out;
}

@keyframes celebrationIconBounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-8px) scale(1.1); }
}

.celebration-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.celebration-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tour-confetti-particle {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 16px;
  border-radius: 3px;
  pointer-events: none;
  z-index: 5;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    top: -20px;
    transform: translateY(0) rotateZ(0deg) rotateX(0deg);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    top: 105vh;
    transform: translateY(0) rotateZ(720deg) rotateX(360deg);
    opacity: 0;
  }
}

/* ================================================================
   NETLIFY BADGE & HUD AGGRESSIVE SUPPRESSION
   ================================================================ */
#nl-badge-frame,
iframe#nl-badge-frame,
iframe[title*="Netlify"],
iframe[title*="Powered by Netlify"],
iframe[src*="netlify"],
[data-netlify-deploy],
#netlify-notification-root,
.netlify-badge,
[class*="netlify-badge"],
[id*="netlify-badge"],
[class*="netlify"],
[id*="netlify"],
a[href*="netlify.com"],
a[href*="netlify.app"],
img[src*="netlify"],
img[alt*="Netlify"],
img[alt*="Powered by Netlify"],
svg[aria-label*="Netlify"],
div[data-testid*="netlify"] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  left: -9999px !important;
  z-index: -99999 !important;
}
