/* ═══════════════════════════════════════════════
   css/style.css  —  Global Styles & Utilities
   ═══════════════════════════════════════════════ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-normal);
  color: var(--text-primary);
  background-color: var(--bg-base);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

img, svg { display: block; max-width: 100%; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; border: none; background: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { line-height: 1.25; font-weight: var(--font-semibold); }

input[type="search"]::-webkit-search-cancel-button { display: none; }

/* ── UTILITY — HIDDEN ────────────────────────── */
.hidden { display: none !important; }

/* ── UTILITY — GLASS MORPHISM ────────────────── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* ── BACKGROUND ──────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 10% 10%, hsla(var(--accent-h), 70%, 60%, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 80%, hsla(calc(var(--accent-h) + 30), 70%, 60%, 0.05) 0%, transparent 60%),
    var(--bg-base);
  pointer-events: none;
}

/* ── SCROLLBAR ───────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── LOADING SCREEN ──────────────────────────── */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: var(--bg-base);
  z-index: 9999;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  animation: pulse-scale 2s ease-in-out infinite;
}

.loading-text {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── APP LAYOUT ──────────────────────────────── */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

.app-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  padding-top: var(--navbar-h);
}

/* ── NAVBAR ──────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-h);
  z-index: var(--z-navbar);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 0 0 var(--sidebar-w);
  min-width: 0;
}

.navbar-center { flex: 1; min-width: 0; }

.navbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.navbar-right .btn-icon {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.navbar-right .btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.2);
}

/* Micro-interaction: sun/moon rotation */
.navbar-right #btn-theme-toggle svg {
  transition: transform var(--transition-base);
}
.navbar-right #btn-theme-toggle:hover svg {
  transform: rotate(20deg) scale(1.1);
}

/* Micro-interaction: settings gear spin */
.navbar-right #btn-settings-open svg {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.navbar-right #btn-settings-open:hover svg {
  transform: rotate(90deg);
}

/* Premium Lock Button Styling */
.navbar-right .btn-lock {
  height: 36px;
  background: hsla(0, 79%, 63%, 0.08);
  color: var(--color-danger);
  border: 1px solid hsla(0, 79%, 63%, 0.3);
  padding: 0 var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar-right .btn-lock svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-base);
}

.navbar-right .btn-lock:hover {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 14px hsla(0, 79%, 63%, 0.35);
}

.navbar-right .btn-lock:hover svg {
  transform: scale(1.1) rotate(-8deg);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-logo-text {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

/* ── SIDEBAR ──────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--navbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  z-index: var(--z-sidebar);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-slow);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-3);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  text-align: left;
  width: 100%;
}

.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: var(--font-semibold);
}

.sidebar-item.active svg { stroke: var(--accent); }

.sidebar-badge {
  margin-left: auto;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.sidebar-categories {
  padding: 0 var(--space-3) var(--space-4);
  border-top: 1px solid var(--glass-border);
  margin-top: var(--space-2);
  padding-top: var(--space-4);
}

.sidebar-section-title {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.categories-list { display: flex; flex-direction: column; gap: 2px; }

.category-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  width: 100%;
  text-align: left;
}

.category-pill:hover { background: var(--bg-hover); color: var(--text-primary); }
.category-pill.active { background: var(--accent-muted); color: var(--accent); }

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-count {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--glass-border);
}

.auto-lock-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.auto-lock-indicator svg { width: 14px; height: 14px; }

/* ── MAIN CONTENT ────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: var(--space-8) var(--space-8);
  min-width: 0;
  overflow-y: auto;
  transition: margin-left var(--transition-slow);
}

/* ── VIEWS ───────────────────────────────────── */
.view { display: none; animation: fade-in-up 0.3s ease both; }
.view.active { display: block; }

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.view-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-extrabold);
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.view-subtitle {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.view-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ── SEARCH BAR ──────────────────────────────── */
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 520px;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: var(--space-4);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-10) 0 calc(var(--space-4) + 20px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.search-shortcut {
  position: absolute;
  right: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  pointer-events: none;
}

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: all var(--transition-fast);
  white-space: nowrap;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}
.btn:hover::after { opacity: 0.04; }
.btn:active::after { opacity: 0.08; }

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 12px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5);
}

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

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg-hover); border-color: var(--accent); color: var(--accent); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid hsla(0, 79%, 63%, 0.3);
}

.btn-danger:hover { background: var(--color-danger); color: white; }

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.btn-icon svg { width: 18px; height: 18px; }

.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-icon.active { background: var(--accent-muted); color: var(--accent); }

.btn-full { width: 100%; }



.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.btn-link:hover { opacity: 0.8; }

.danger-link {
  color: var(--color-danger);
  margin-top: var(--space-4);
  display: block;
  text-align: center;
}

/* ── FORMS ───────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.label-required { color: var(--color-danger); }
.label-optional { color: var(--text-muted); font-weight: var(--font-normal); }

.input-wrapper { position: relative; display: flex; align-items: center; }

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 var(--space-4);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
  background: var(--bg-surface);
}

.form-input.error { border-color: var(--border-error); box-shadow: 0 0 0 3px var(--color-danger-bg); }

.input-wrapper .form-input { padding-right: calc(var(--space-4) + 36px); }
.input-wrapper .btn-icon { position: absolute; right: var(--space-2); }
.input-wrapper .btn-icon + .btn-icon { right: calc(var(--space-2) + 36px); }

.input-wrapper .form-input:has(~ .btn-icon ~ .btn-icon) { padding-right: calc(var(--space-4) + 72px); }

.form-select {
  height: 44px;
  padding: 0 var(--space-10) 0 var(--space-4);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  resize: vertical;
  min-height: 80px;
  transition: border-color var(--transition-fast);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.form-error {
  padding: var(--space-3) var(--space-4);
  background: var(--color-danger-bg);
  border: 1px solid hsla(0, 79%, 63%, 0.25);
  border-radius: var(--radius-md);
  color: var(--color-danger);
  font-size: var(--text-sm);
  animation: shake 0.4s ease;
}

.form-warning {
  padding: var(--space-3) var(--space-4);
  background: var(--color-warning-bg);
  border: 1px solid hsla(38, 92%, 55%, 0.25);
  border-radius: var(--radius-md);
  color: var(--color-warning);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.form-warning svg { width: 16px; height: 16px; flex-shrink: 0; }

.form-hint {
  padding: var(--space-3) var(--space-4);
  background: var(--color-info-bg);
  border: 1px solid hsla(199, 89%, 55%, 0.2);
  border-radius: var(--radius-md);
  color: var(--color-info);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.form-hint svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── STRENGTH METER ──────────────────────────── */
.strength-meter {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.strength-bar {
  height: 4px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow), background-color var(--transition-slow);
}

.strength-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: var(--font-medium);
}

.gen-strength-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.entropy-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── TOGGLE PASSWORD EYE ─────────────────────── */
.icon-eye-off { display: none; }
.toggle-password.revealed .icon-eye { display: none; }
.toggle-password.revealed .icon-eye-off { display: block; }

/* ── FAB ─────────────────────────────────────── */
.fab {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  z-index: var(--z-fab);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.5);
  transition: transform var(--transition-spring), box-shadow var(--transition-fast);
}

.fab svg { width: 24px; height: 24px; }
.fab:hover { transform: scale(1.1) rotate(90deg); box-shadow: 0 8px 32px hsla(var(--accent-h), var(--accent-s), var(--accent-l), 0.65); }
.fab:active { transform: scale(0.96); }

/* ── SECTION HEADER ──────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

/* ── EMPTY STATE ─────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-16) var(--space-8);
  text-align: center;
  color: var(--text-secondary);
}

.empty-state svg { width: 64px; height: 64px; opacity: 0.3; }
.empty-state h3 { font-size: var(--text-xl); color: var(--text-primary); }
.empty-state p { max-width: 320px; color: var(--text-secondary); }

/* ── CLIPBOARD COUNTDOWN ─────────────────────── */
.clipboard-countdown {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border: 1px solid hsla(38, 92%, 55%, 0.2);
  border-radius: var(--radius-full);
  padding: var(--space-1) var(--space-3);
}

.clipboard-countdown svg { width: 12px; height: 12px; }

/* ── TOAST ───────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column-reverse;
  gap: var(--space-2);
  pointer-events: none;
  width: max-content;
  max-width: min(480px, calc(100vw - var(--space-8)));
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  box-shadow: var(--shadow-xl);
  pointer-events: auto;
  animation: toast-in 0.3s var(--transition-spring) both;
  color: var(--text-primary);
}

.toast svg { width: 18px; height: 18px; flex-shrink: 0; }

.toast.toast-success { border-color: hsla(152, 69%, 45%, 0.3); }
.toast.toast-success svg { color: var(--color-success); }
.toast.toast-error { border-color: hsla(0, 79%, 63%, 0.3); }
.toast.toast-error svg { color: var(--color-danger); }
.toast.toast-warning { border-color: hsla(38, 92%, 55%, 0.3); }
.toast.toast-warning svg { color: var(--color-warning); }
.toast.toast-info { border-color: hsla(199, 89%, 55%, 0.3); }
.toast.toast-info svg { color: var(--color-info); }

.toast.toast-out { animation: toast-out 0.2s ease both; }

/* ── FILTER BAR ──────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.view-toggle {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-toggle .btn-icon { border-radius: 0; }

/* ── RANGE SLIDER ────────────────────────────── */
.range-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--accent-muted);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px var(--accent-muted);
  transform: scale(1.1);
}

/* ── TOGGLE SWITCH ───────────────────────────── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider { background: var(--accent-muted); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--accent); }

/* ── MODAL ───────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsla(0, 0%, 0%, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: var(--space-4);
  animation: fade-in 0.2s ease both;
}

.modal-container {
  width: 100%;
  max-width: 640px;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  animation: slide-up 0.3s var(--transition-spring) both;
  overflow: hidden;
}

.modal-sm { max-width: 420px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.modal-title { font-size: var(--text-xl); font-weight: var(--font-bold); }
.modal-title.centered { text-align: center; width: 100%; }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.modal-footer.centered { justify-content: center; }

.modal-desc { color: var(--text-secondary); font-size: var(--text-sm); }
.modal-desc.centered { text-align: center; }

.confirm-icon {
  display: flex;
  justify-content: center;
  padding: var(--space-6) 0 var(--space-2);
}

.confirm-icon svg { width: 48px; height: 48px; }

.form-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

/* ── SKELETON LOADER ─────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}

/* ── NAV HAMBURGER ───────────────────────────── */
.nav-hamburger { display: none; }

/* ── ANIMATIONS ──────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

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

@keyframes pulse-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(0.95); }
}

@keyframes score-ring-anim {
  from { stroke-dashoffset: 314; }
}

/* ── FOCUS VISIBLE ───────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
