/* =========================================================
   Fragrance Folio — Stylesheet
   Refined Luxury Minimalism
   ========================================================= */

/* ---------- CSS Variables ---------- */
:root {
  --bg:           #F7F6F3;
  --surface:      #FFFFFF;
  --surface-alt:  #F0EDE8;
  --border:       #E2DED6;
  --border-light: #EBE8E2;

  --primary:      #7C6847;
  --primary-dark: #4E3D26;
  --primary-light:#9E8A6A;
  --primary-bg:   #FAF8F4;
  --primary-pale: #F3EDE2;

  --text:         #1A1816;
  --text-muted:   #70695F;
  --text-light:   #A09889;

  --gold:         #B69A6C;
  --gold-light:   #D4BE92;

  --success:      #4A7C45;
  --success-bg:   #EDF5EC;
  --danger:       #B83A2E;
  --danger-bg:    #FDEDEB;

  --shadow-xs:    0 1px 2px rgba(26, 24, 22, 0.04);
  --shadow-sm:    0 1px 4px rgba(26, 24, 22, 0.06), 0 1px 2px rgba(26, 24, 22, 0.04);
  --shadow-md:    0 4px 12px rgba(26, 24, 22, 0.07), 0 1px 4px rgba(26, 24, 22, 0.04);
  --shadow-lg:    0 12px 40px rgba(26, 24, 22, 0.10), 0 4px 12px rgba(26, 24, 22, 0.05);

  --radius-sm:    8px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    28px;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  --transition:   all 0.2s ease;
  --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height:   60px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, #ebe7f3 0%, #f5f5f7 100%) fixed;
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--text);
  font-weight: 600;
}

h1 { font-size: 1.8rem; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.1rem; }

p { color: var(--text-muted); }

.required { color: var(--primary); font-weight: 600; }
.hint { font-size: 0.78rem; color: var(--text-light); font-weight: 400; }

/* ---------- Header ---------- */
.demo-banner {
  display: none;
  position: sticky;
  top: var(--nav-height);
  z-index: 99;
  text-align: center;
  padding: 8px 16px;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-light);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
  letter-spacing: 0.04em;
}

body.ff-unauthed .demo-banner {
  display: block;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 247, 248, 0.911);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(155, 145, 175, 0.3);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Header text contrast overrides */
.app-header .logo-text { color: #1e1828; }
.app-header .logo-icon { color: #5b3fa0; }
.app-header .nav-btn { color: #3b2f55; }
.app-header .nav-btn:hover { color: #1e1828; background: rgba(255, 255, 255, 0.25); }
.app-header .nav-btn.active { color: #3b1f7a; background: rgba(229, 215, 255, 0.35); outline: 1.5px solid rgba(59, 31, 122, 0.5); outline-offset: -1.5px; }
.app-header .menu-toggle span { background: #3b2f55; }

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.nav-btn {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
  position: relative;
}

.nav-btn:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.nav-btn.active {
  color: var(--primary);
  background: var(--primary-pale);
  font-weight: 600;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ---------- Particles ---------- */
.particles-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  top: -20px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(ellipse at 40% 35%, #d8b4fe 0%, #c084fc 55%, #a855f7 100%);
  opacity: var(--opacity, 0.35);
  transform: rotate(var(--rot-start, 0deg));
  animation: particle-fall var(--dur, 16s) var(--delay, 0s) linear infinite;
  filter: blur(0.4px);
}

@keyframes particle-fall {
  0% {
    transform: translateY(0) translateX(0) rotate(var(--rot-start, 0deg));
    opacity: 0;
  }
  5% {
    opacity: var(--opacity, 0.35);
  }
  25% {
    transform: translateY(25vh) translateX(calc(var(--sway, 30px) * 1)) rotate(calc(var(--rot-start, 0deg) + 40deg));
  }
  50% {
    transform: translateY(50vh) translateX(calc(var(--sway, 30px) * -0.5)) rotate(calc(var(--rot-start, 0deg) + 100deg));
  }
  75% {
    transform: translateY(75vh) translateX(calc(var(--sway, 30px) * 1.2)) rotate(calc(var(--rot-start, 0deg) + 160deg));
    opacity: var(--opacity, 0.35);
  }
  100% {
    transform: translateY(110vh) translateX(calc(var(--sway, 30px) * -0.3)) rotate(calc(var(--rot-start, 0deg) + 220deg));
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .particles-container { display: none; }
}

/* ---------- Main / Views ---------- */
.app-main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 28px 80px;
}

.view { display: none; }
.view.active { display: block; }

.view-content {
  max-width: 800px;
  margin: 0 auto;
  background: rgba(247, 246, 248, 0.849);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}

/* ---------- Page Header ---------- */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.6rem;
  padding: 12px 28px;
  letter-spacing: -0.01em;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-family: var(--font-body);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-light);
  box-shadow: var(--shadow-xs);
}

/* ---------- TODAY VIEW ---------- */
.today-hero {
  background: linear-gradient(145deg, #2A2118 0%, #4E3D26 40%, #7C6847 75%, #B69A6C 100%);
  border-radius: var(--radius-xl);
  padding: 44px 44px 40px;
  color: white;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.today-hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -60px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(182, 154, 108, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.today-hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: 30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  border-radius: 50%;
}

.today-date {
  font-size: 0.82rem;
  opacity: 0.6;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 500;
}

.today-day {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}

.today-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.today-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Today's entry card */
.today-entry-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 32px 36px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  transition: var(--transition-slow);
}

.today-entry-card:hover {
  box-shadow: var(--shadow-md);
}

.today-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}

.today-fragrance-name {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.today-fragrance-brand {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 4px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
  font-size: 0.82rem;
}

.entry-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.today-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.detail-item {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.detail-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 5px;
}

.detail-value {
  font-size: 0.92rem;
  color: var(--text);
  font-weight: 500;
}

.today-notes {
  background: var(--primary-bg);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 18px;
  line-height: 1.7;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  padding: 4px 14px;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Empty today state */
.today-empty {
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1.5px dashed var(--border);
  padding: 56px 36px;
  text-align: center;
  margin-bottom: 28px;
}

.today-empty-icon {
  font-size: 3rem;
  margin-bottom: 18px;
  opacity: 0.5;
}

.fragrance-bottle-icon {
  width: 96px;
  height: 96px;
}

.today-empty h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text);
}

.today-empty p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* Recent entries strip */
.recent-section {
  margin-top: 40px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text);
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.recent-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: var(--transition-slow);
  box-shadow: var(--shadow-xs);
}

.recent-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.recent-card-date {
  font-size: 0.72rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  font-weight: 500;
}

.recent-card-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.recent-card-brand {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.recent-card-meta {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.mini-badge {
  font-size: 0.72rem;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  padding: 3px 10px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-weight: 500;
}

/* Stars */
.stars-display {
  color: var(--gold);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.stars-display .empty { opacity: 0.18; }

/* ---------- LOG FORM ---------- */
.log-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  box-shadow: var(--shadow-xs);
}

.form-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-card-icon {
  font-size: 1.05rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
}

.frag-name-wrap {
  position: relative;
}

.frag-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  max-height: 220px;
  overflow-y: auto;
}

.frag-dropdown.open {
  display: block;
}

.frag-dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.15s ease;
}

.frag-dropdown-item:hover,
.frag-dropdown-item.highlighted {
  background: var(--surface-alt);
}

.frag-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.frag-item-brand {
  font-size: 0.75rem;
  color: var(--text-light);
}

.frag-dropdown-add {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--primary);
  border-top: 1px solid var(--border-light);
  font-weight: 500;
  transition: background 0.15s ease;
}

.frag-dropdown-add:hover,
.frag-dropdown-add.highlighted {
  background: var(--primary-bg);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row:last-child { margin-bottom: 0; }
.form-group:last-child { margin-bottom: 0; }

label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23A09889' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(124, 104, 71, 0.08);
}

input::placeholder, textarea::placeholder {
  color: var(--text-light);
}

input:disabled, select:disabled {
  opacity: 0.55;
  cursor: default;
  background: var(--bg);
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* Star Rating */
.star-rating {
  display: flex;
  gap: 3px;
}

.star {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--border);
  cursor: pointer;
  padding: 0 2px;
  transition: var(--transition);
  line-height: 1;
}

.star:hover,
.star.active {
  color: var(--gold);
  transform: scale(1.08);
}

.star.half {
  background: linear-gradient(to right, var(--gold) 50%, var(--border) 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: scale(1.08);
}

.stars-display .half {
  background: linear-gradient(to right, var(--gold) 50%, var(--border) 50%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Weather auto-detect */
.weather-auto-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.weather-status {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.weather-status.loading { color: var(--primary); }
.weather-status.success { color: var(--success); }
.weather-status.error { color: var(--danger); }

/* Temperature input */
.temp-input-wrap {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.temp-input-wrap:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(124, 104, 71, 0.08);
}

.temp-input-wrap input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: 0;
  box-shadow: none !important;
}

.temp-input-wrap input:focus {
  box-shadow: none;
}

.temp-unit-toggle {
  display: flex;
  border-left: 1.5px solid var(--border);
  flex-shrink: 0;
}

.unit-btn {
  background: var(--bg);
  border: none;
  padding: 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.unit-btn:first-child {
  border-right: 1px solid var(--border);
}

.unit-btn.active {
  background: var(--primary);
  color: white;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 12px;
  padding-top: 4px;
}

/* ---------- BUTTONS ---------- */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 12px 32px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(124, 104, 71, 0.2);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(124, 104, 71, 0.28);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  border-radius: 100px;
  padding: 9px 22px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.btn-ghost {
  background: none;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 11px 24px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-light);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 100px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover { background: #9B2D22; }

.btn-icon {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-family: var(--font-body);
}

.btn-icon:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.btn-icon.danger:hover {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

/* ---------- HISTORY VIEW ---------- */
.history-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  align-items: center;
}

.history-toolbar .search-wrap {
  flex: 1;
  min-width: 200px;
}

.search-wrap {
  position: relative;
}

.search-wrap input {
  padding-left: 38px;
  padding-right: 32px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 0.88rem;
  pointer-events: none;
}

.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--text-light);
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 4px;
}

.search-clear-btn:hover {
  color: var(--text);
  background: var(--surface-alt);
}

.filter-select {
  min-width: 140px;
  max-width: 180px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-entry {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-slow);
  cursor: default;
}

.history-entry:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.history-date-col {
  flex-shrink: 0;
  width: 54px;
  text-align: center;
  background: var(--primary-pale);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
}

.history-date-day {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.history-date-month {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
}

.history-body {
  flex: 1;
  min-width: 0;
}

.history-fragrance {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
}

.history-brand {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.history-notes {
  font-size: 0.84rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  align-self: center;
}

.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 14px;
  opacity: 0.45;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ---------- INSIGHTS VIEW ---------- */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.insights-grid-9 {
  grid-template-columns: repeat(9, 1fr);
}

.insights-section-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 14px;
}

.insights-wide {
  grid-column: 1 / -1;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 24px 26px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-slow);
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
}

.stat-card-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 14px;
}

.stat-big {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.chart-wrap {
  position: relative;
  height: 240px;
}

.chart-wrap-tall {
  position: relative;
  height: 320px;
}

.insights-top-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 0.73rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-rank.gold { background: var(--gold-light); color: var(--primary-dark); }

.top-bar-wrap { flex: 1; }

.top-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.top-bar {
  height: 5px;
  background: var(--surface-alt);
  border-radius: 3px;
  overflow: hidden;
}

.top-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 3px;
  transition: width 0.6s ease;
}

.top-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 40px;
  text-align: right;
}

/* Season color chips */
.season-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 100px;
  font-size: 0.76rem;
  font-weight: 600;
}

.season-Spring { background: #FDE8F0; color: #A0305A; }
.season-Summer { background: #FEF3C7; color: #92400E; }
.season-Autumn { background: #FDE6D3; color: #9A3412; }
.season-Winter { background: #DBEAFE; color: #1E40AF; }

/* ---------- COLLECTION VIEW ---------- */
.collection-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  align-items: center;
  flex-wrap: wrap;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.collection-house-heading {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text);
  padding: 8px 0 6px;
  border-bottom: 1.5px solid var(--border);
  margin-top: 8px;
  letter-spacing: -0.01em;
}

.collection-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-slow);
  position: relative;
}

.collection-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.collection-card-name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  padding-right: 56px;
}

.collection-card-brand {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.collection-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.collection-card-notes {
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
  line-height: 1.5;
}

.collection-card-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 4px;
}

.collection-wear-count {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
}

.collection-card-metrics {
  margin-top: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 58px;
}

/* Concentration badge */
.concentration-badge {
  background: var(--primary-pale);
  color: var(--primary);
  border-radius: 100px;
  padding: 2px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------- MODAL ---------- */
/* --- Emoji picker --- */
.emoji-picker-btn {
  width: 100%;
  height: 44px;
  font-size: 1.5rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}
.emoji-picker-btn:hover { border-color: var(--primary); }

.emoji-picker-grid {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 240px;
}
.emoji-picker-inner {
  padding: 10px;
  max-height: 260px;
  overflow-y: auto;
}
.emoji-group-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 8px 0 4px;
}
.emoji-none-btn {
  width: 100%;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 0;
  margin-bottom: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.emoji-none-btn:hover { background: var(--surface-alt); color: var(--text); }

.emoji-group-label:first-child { margin-top: 0; }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}
.emoji-grid button {
  background: none;
  border: none;
  font-size: 1.25rem;
  padding: 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}
.emoji-grid button:hover { background: var(--surface-alt); }

/* --- Modal overlay --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 22, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

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

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal-lg {
  max-width: 580px;
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--text);
}

.modal p {
  font-size: 0.92rem;
  margin-bottom: 24px;
  line-height: 1.6;
}

.modal .form-row { margin-bottom: 14px; }
.modal .form-group { margin-bottom: 0; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: white;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

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

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ---------- UTILITIES ---------- */
.flex { display: flex; }
.gap-2 { gap: 8px; }
.mt-1 { margin-top: 4px; }
.mb-1 { margin-bottom: 8px; }

.text-muted { color: var(--text-muted); font-size: 0.88rem; }

.divider {
  height: 1px;
  background: var(--border-light);
  margin: 24px 0;
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border-light) 50%, var(--surface-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ---------- RANKINGS VIEW ---------- */

/* Season tabs */
.season-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}

.season-tab {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 100px;
  padding: 7px 18px;
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.season-tab:hover {
  border-color: var(--text-light);
  color: var(--text);
}

.season-tab.active[data-season="overall"] { background: var(--primary-pale);  border-color: var(--primary-light); color: var(--primary);  font-weight: 600; }
.season-tab.active[data-season="Spring"]  { background: #FDE8F0; border-color: #E8A0C0; color: #A0305A; font-weight: 600; }
.season-tab.active[data-season="Summer"]  { background: #FEF3C7; border-color: #F0C060; color: #92400E; font-weight: 600; }
.season-tab.active[data-season="Autumn"]  { background: #FDE6D3; border-color: #E8A080; color: #9A3412; font-weight: 600; }
.season-tab.active[data-season="Winter"]  { background: #DBEAFE; border-color: #93C5FD; color: #1E40AF; font-weight: 600; }

/* Custom / deletable tab active state */
.season-tab.active.tab-custom { background: var(--surface-alt); border-color: var(--text-light); color: var(--text); font-weight: 600; }

/* Delete button inside a tab */
.tab-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 5px;
  border-radius: 50%;
  background: transparent;
  font-size: 0.65rem;
  line-height: 1;
  color: currentColor;
  opacity: 0.35;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.15s, background 0.15s;
  vertical-align: middle;
  flex-shrink: 0;
}

.season-tab:hover .tab-close { opacity: 0.65; }
.tab-close:hover              { opacity: 1 !important; background: rgba(0,0,0,0.1); }

/* Add-category tab button */
.season-tab-add {
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 100px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.season-tab-add:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--primary-bg);
}

.rankings-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.rankings-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

/* Ranked list */
.ranked-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ranked-list-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ranked-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 36px;
}

.ranked-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
  transition: var(--transition-slow);
}

.ranked-item:hover { box-shadow: var(--shadow-md); }

.rank-medal {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.rank-medal.gold   { background: #FEF3C7; color: #92400E; border: 2px solid #F59E0B; }
.rank-medal.silver { background: #F1F5F9; color: #475569; border: 2px solid #94A3B8; }
.rank-medal.bronze { background: #FEF0E6; color: #9A3412; border: 2px solid #CD7C4F; }
.rank-medal.plain  { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); font-size: 0.82rem; }

.ranked-item-body { flex: 1; min-width: 0; }

.ranked-item-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.ranked-item-brand {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ranked-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Score badge */
.score-badge {
  padding: 4px 13px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.score-high   { background: #FEF9E7; color: #92400E; border: 1px solid #F59E0B; }
.score-mid    { background: var(--primary-pale); color: var(--primary); border: 1px solid var(--primary-light); }
.score-low    { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* Unranked section */
.unranked-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.unranked-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unranked-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.unranked-item:hover { opacity: 1; }

.unranked-item-body { flex: 1; min-width: 0; }

.unranked-item-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.unranked-item-brand {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- RANKING MODAL ---------- */

.modal-ranking {
  max-width: 520px;
  width: 100%;
}

.ranking-step-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 8px;
}

.ranking-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 6px;
  color: var(--text);
}

.ranking-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Tier buttons */
.tier-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.tier-btn {
  width: 100%;
  padding: 16px 22px;
  border-radius: var(--radius-lg);
  border: 1.5px solid transparent;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tier-love {
  background: #FEF9E7;
  border-color: #F59E0B;
  color: #92400E;
}
.tier-love:hover { background: #FEF3C7; transform: translateX(4px); }

.tier-ok {
  background: var(--primary-pale);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}
.tier-ok:hover { background: #F0E8D8; transform: translateX(4px); }

.tier-meh {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-muted);
}
.tier-meh:hover { background: var(--surface-alt); transform: translateX(4px); }

/* Progress */
.ranking-progress-wrap {
  margin-bottom: 20px;
}

.ranking-progress-text {
  font-size: 0.76rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 6px;
}

.ranking-progress-bar {
  height: 3px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}

.ranking-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}

/* Comparison */
.ranking-question {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 20px;
}

.ranking-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.ranking-choice {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 18px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 100px;
  justify-content: center;
}

.ranking-choice:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.ranking-choice:active {
  transform: scale(0.98);
}

.ranking-choice-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 4px;
}

.ranking-choice-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.ranking-choice-brand {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ranking-vs {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-light);
  text-align: center;
  flex-shrink: 0;
}

.ranking-footer {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.ranking-tie-btn {
  font-size: 0.85rem;
  padding: 8px 16px;
}

.ranking-cancel-btn {
  font-size: 0.85rem;
  padding: 8px 16px;
  color: var(--text-light);
  border-color: transparent;
}

.ranking-cancel-btn:hover {
  color: var(--danger);
  border-color: transparent;
  background: none;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    padding: 8px 16px 16px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-md);
    z-index: 99;
  }

  .main-nav.open { display: flex; }

  .nav-btn {
    padding: 12px 16px;
    text-align: left;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  .app-header { position: sticky; }

  .app-main { padding: 20px 16px 60px; }

  .view-content { padding: 20px 18px; background: transparent; border-radius: 0; }

  /* Today hero */
  .today-hero { padding: 28px 24px; }
  .today-day { font-size: 1.9rem; }

  /* Today entry card */
  .today-entry-card { padding: 22px; }
  .today-fragrance-name { font-size: 1.5rem; }
  .today-entry-header { margin-bottom: 18px; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 20px 18px; }
  .form-card-title { font-size: 0.9rem; margin-bottom: 16px; }

  /* History */
  .history-entry { flex-wrap: wrap; padding: 16px 18px; gap: 12px; }
  .history-date-col { width: auto; display: flex; gap: 6px; align-items: baseline; padding: 4px 8px; }
  .history-date-day { font-size: 1rem; }
  .history-actions { align-self: flex-start; }

  /* History toolbar */
  .history-toolbar { gap: 8px; }
  .history-toolbar .search-wrap { flex: 1 1 100%; min-width: 0; }
  .filter-select { flex: 1; min-width: 0; max-width: none; }

  /* Insights */
  .insights-grid { grid-template-columns: 1fr; }
  .insights-grid-9 { grid-template-columns: 1fr; }
  .insights-grid-9 .stat-card[style] { grid-column: span 1; }
  .stat-card { padding: 20px; }
  .stat-big { font-size: 2rem; }
  .chart-wrap { height: 200px; }
  .chart-wrap-tall { height: 260px; }

  /* Rankings */
  .season-tabs { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 14px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .season-tabs::-webkit-scrollbar { display: none; }
  .season-tab { flex-shrink: 0; padding: 7px 14px; font-size: 0.8rem; }
  .season-tab-add { flex-shrink: 0; }
  .ranked-item { padding: 14px 16px; gap: 10px; }
  .rank-medal { width: 32px; height: 32px; font-size: 0.88rem; }
  .ranked-item-name { font-size: 0.92rem; }
  .unranked-item { padding: 12px 14px; }
  .rankings-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  /* Ranking comparison modal */
  .ranking-comparison { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .ranking-choice { padding: 16px 12px; min-height: 80px; }
  .ranking-choice-name { font-size: 0.9rem; }
  .ranking-question { font-size: 1rem; }
  .tier-btn { padding: 14px 18px; font-size: 0.9rem; }

  /* Collection */
  .collection-grid { grid-template-columns: 1fr; }
  .collection-toolbar { gap: 8px; }
  .collection-card { padding: 18px 20px; }
  .collection-card-name { font-size: 1rem; padding-right: 50px; }
  .collection-house-heading { font-size: 1.35rem; }

  /* Page header */
  .page-title { font-size: 1.35rem; padding: 10px 20px; }
  .page-header { margin-bottom: 24px; gap: 12px; }

  /* Today details */
  .today-details { grid-template-columns: repeat(2, 1fr); }

  /* Modals */
  .modal { padding: 28px 22px; max-height: calc(100svh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-ranking { max-width: 100%; }
  .modal h3 { font-size: 1.15rem; }
  .modal-actions { flex-wrap: wrap; }

  /* Settings */
  .settings-section { padding: 22px 18px; }
  .settings-avatar-row { gap: 12px; }
  .settings-btn-row { gap: 8px; }

  /* Onboarding */
  .onboarding-card { padding: 36px 28px 32px; }
  .onboard-title { font-size: 1.3rem; }
  .onboard-add-form { flex-direction: column; }
  .onboard-add-form input { flex: 1 1 100%; }

  /* Login card */
  .login-card { padding: 40px 28px 32px; }

  /* Toast */
  .toast { white-space: normal; max-width: calc(100vw - 40px); text-align: center; font-size: 0.84rem; padding: 10px 22px; }

  /* Crop modal */
  .crop-canvas-wrap { height: 280px; }

  /* Demo banner */
  .demo-banner { font-size: 0.7rem; padding: 6px 12px; }
}

@media (max-width: 480px) {
  .app-main { padding: 16px 12px 60px; }

  .view-content { padding: 8px 0; background: transparent; border-radius: 0; }

  /* Header */
  .header-inner { padding: 0 14px; gap: 12px; }
  .logo-text { font-size: 1.05rem; }

  /* Today hero */
  .today-hero { padding: 24px 20px; border-radius: var(--radius-lg); }
  .today-day { font-size: 1.6rem; }
  .today-date { font-size: 0.75rem; }
  .today-badge { padding: 5px 12px; font-size: 0.76rem; }

  /* Today entry card */
  .today-entry-card { padding: 18px; border-radius: var(--radius-lg); }
  .today-fragrance-name { font-size: 1.3rem; }
  .today-fragrance-brand { font-size: 0.76rem; }
  .today-entry-header { flex-direction: column; gap: 10px; }
  .entry-actions { align-self: flex-start; }
  .today-details { grid-template-columns: 1fr 1fr; gap: 8px; }
  .detail-item { padding: 10px 12px; }
  .detail-label { font-size: 0.66rem; }
  .detail-value { font-size: 0.84rem; }
  .today-notes { padding: 12px 14px; font-size: 0.84rem; }

  /* Today empty */
  .today-empty { padding: 40px 24px; }
  .today-empty h2 { font-size: 1.2rem; }
  .fragrance-bottle-icon { width: 72px; height: 72px; }

  /* Recent grid */
  .recent-grid { grid-template-columns: 1fr; }
  .recent-card { padding: 14px 16px; }
  .section-title { font-size: 1.05rem; margin-bottom: 14px; }

  /* Forms */
  .form-card { padding: 18px 16px; border-radius: var(--radius-lg); }
  .form-actions { flex-direction: column; }
  .btn-primary, .btn-ghost { width: 100%; text-align: center; justify-content: center; }
  label { font-size: 0.74rem; }
  input[type="text"], input[type="date"], input[type="number"],
  input[type="email"], input[type="url"], input[type="password"],
  textarea, select { font-size: 16px; padding: 10px 12px; }

  /* History */
  .history-entry { padding: 14px 16px; }
  .history-fragrance { font-size: 1rem; }
  .history-notes { font-size: 0.8rem; }
  .history-toolbar .search-wrap { flex: 1 1 100%; }

  /* Insights */
  .stat-card { padding: 18px 16px; border-radius: var(--radius-lg); }
  .stat-big { font-size: 1.8rem; }
  .stat-sub { font-size: 0.8rem; }
  .stat-card-title { font-size: 0.7rem; margin-bottom: 10px; }
  .chart-wrap { height: 180px; }
  .chart-wrap-tall { height: 220px; }

  /* Rankings */
  .ranked-item { padding: 12px 14px; gap: 8px; border-radius: var(--radius-md); }
  .rank-medal { width: 28px; height: 28px; font-size: 0.8rem; }
  .ranked-item-name { font-size: 0.88rem; }
  .ranked-item-brand { font-size: 0.76rem; }
  .score-badge { font-size: 0.74rem; padding: 3px 10px; }
  .rankings-stats { grid-template-columns: 1fr 1fr; }
  .ranking-comparison { grid-template-columns: 1fr; gap: 10px; }
  .ranking-vs { display: none; }
  .ranking-choice { min-height: auto; padding: 14px 16px; flex-direction: row; gap: 8px; }
  .ranking-choice-label { margin-bottom: 0; }

  /* Collection */
  .collection-card { padding: 16px 18px; border-radius: var(--radius-lg); }
  .collection-card-name { font-size: 0.95rem; }
  .collection-house-heading { font-size: 1.2rem; }

  /* Page header */
  .page-title { font-size: 1.2rem; padding: 8px 16px; }

  /* Modals */
  .modal { padding: 24px 18px; border-radius: var(--radius-lg); max-height: calc(100svh - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal h3 { font-size: 1.1rem; }
  .modal-overlay { padding: 12px; }
  .modal-actions { gap: 8px; }

  /* Settings */
  .settings-section { padding: 20px 16px; border-radius: var(--radius-lg); }
  .settings-section-title { font-size: 0.7rem; margin-bottom: 14px; }

  /* Onboarding */
  .onboarding-overlay { padding: 12px; }
  .onboarding-card { padding: 28px 20px 24px; }
  .onboard-title { font-size: 1.2rem; }
  .onboard-subtitle { font-size: 0.84rem; }
  .onboard-icon { font-size: 2rem; }
  .onboard-avatar-row { flex-direction: column; text-align: center; }
  .onboard-avatar-preview { margin: 0 auto; }

  /* Login */
  .login-card { padding: 36px 20px 28px; }
  .login-title { font-size: 1.35rem; }
  .login-subtitle { font-size: 0.84rem; margin-bottom: 24px; }
  .oauth-btn { padding: 11px 16px; font-size: 0.84rem; }

  /* Toast */
  .toast { bottom: 16px; max-width: calc(100vw - 32px); }

  /* Crop modal */
  .crop-modal-overlay { padding: 12px; }
  .crop-canvas-wrap { height: 240px; }
  .crop-modal-actions { padding: 14px 18px; }

  /* Tags */
  .tag { padding: 3px 10px; font-size: 0.72rem; }
  .mini-badge { font-size: 0.68rem; padding: 2px 8px; }

  /* Empty states */
  .empty-state { padding: 48px 18px; }
  .empty-state-icon { font-size: 2rem; }
  .empty-state h3 { font-size: 1.05rem; }
}

/* ---------- AUTH SLOT (header) ---------- */
.auth-slot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-right: 4px;
  position: relative;
  flex-shrink: 0;
  min-width: 78px;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.82rem;
}

.auth-slot-inner {
  position: relative;
}

.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  background: var(--bg);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-btn:hover {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(124, 104, 71, 0.08);
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-avatar-initial {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

/* User menu dropdown */
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 200;
  overflow: hidden;
}

.user-menu[hidden] { display: none; }

.user-menu-header {
  padding: 14px 16px 12px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-menu-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-email {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-divider {
  margin: 0;
  border: none;
  border-top: 1px solid var(--border-light);
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 11px 16px;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
}

.user-menu-item:hover {
  background: var(--bg);
  color: var(--danger);
}

/* ---------- LOGIN OVERLAY ---------- */
.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 22, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.login-overlay.visible {
  display: flex;
}

.login-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 48px 44px 40px;
  max-width: 420px;
  width: calc(100% - 40px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 20px 60px rgba(26, 24, 22, 0.16);
  animation: loginCardIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.login-card::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.login-card::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.login-card::-webkit-scrollbar-track {
  background: transparent;
}

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

.login-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: none;
  font-size: 0.95rem;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.login-close-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.login-logo {
  margin: 0 auto 18px;
  width: 56px;
  height: 56px;
  color: var(--primary);
}

.login-logo-icon {
  width: 52px;
  height: 52px;
}

.login-logo-bottle {
  width: 56px;
  height: 56px;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.55;
}

.login-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.oauth-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: var(--transition);
}

.oauth-btn:hover {
  background: var(--bg);
  border-color: var(--text-light);
}

.oauth-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.oauth-apple { color: #000; }
.oauth-apple:hover { background: #f7f7f5; }

.oauth-discord { color: #5865F2; }
.oauth-discord:hover { background: #f0f0ff; border-color: #8389f5; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px 0 14px;
  color: var(--text-light);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* Email auth form */
.email-auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.email-auth-form .form-group {
  margin: 0;
}

.email-auth-form input[type="email"],
.email-auth-form input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.email-auth-form input:focus {
  outline: none;
  border-color: var(--primary-light);
}

.email-auth-password-row {
  position: relative;
}

.forgot-password-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.76rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
}

.forgot-password-btn:hover { color: var(--primary); }

.email-auth-error {
  font-size: 0.82rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  text-align: left;
  line-height: 1.4;
}

.email-auth-error--error {
  color: var(--danger);
  background: var(--danger-bg);
}

.email-auth-error--info {
  color: var(--success);
  background: var(--success-bg);
}

.email-auth-submit {
  width: 100%;
  justify-content: center;
}

.email-auth-toggle {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  text-align: center;
}

.email-auth-toggle span { color: var(--primary); font-weight: 600; }
.email-auth-toggle:hover span { text-decoration: underline; }

.login-guest-btn {
  width: 100%;
  padding: 10px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 100px;
  transition: var(--transition);
}

.login-guest-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.login-guest-note {
  font-size: 0.74rem;
  color: var(--text-light);
  margin-top: 8px;
  line-height: 1.4;
}

/* -- Onboarding wizard -- */
.onboarding-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 22, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.onboarding-overlay.visible { display: flex; }

.onboarding-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 44px 40px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 60px rgba(26, 24, 22, 0.16);
  position: relative;
}

.onboard-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}
.onboard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: var(--transition);
}
.onboard-dot.active  { background: var(--primary); transform: scale(1.3); }
.onboard-dot.filled  { background: var(--primary); opacity: 0.4; }

.onboard-step { display: none; }
.onboard-step.active { display: block; }

.onboard-icon {
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 12px;
}
.onboard-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  text-align: center;
  margin: 0 0 8px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.onboard-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.55;
  margin: 0 0 24px;
}
.onboard-note {
  text-align: center;
  color: var(--text-light);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: -12px 0 24px;
}

.onboard-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 0;
}
.onboard-avatar-preview {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--border-light);
  background-size: cover;
  background-position: center;
}

.onboard-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}
.onboard-actions .btn-primary,
.onboard-actions .btn-ghost {
  width: 100%;
  justify-content: center;
}

.onboard-collection-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 160px;
  overflow-y: auto;
}
.onboard-frag-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.88rem;
}
.onboard-frag-name { flex: 1; }
.onboard-frag-brand { color: var(--text-muted); }

.onboard-add-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.onboard-add-form input {
  flex: 1;
  min-width: 0;
}

/* -- Settings page -- */
.settings-page {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 16px;
}
.settings-section:last-child { margin-bottom: 0; }

.settings-section-title {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-light);
  margin: 0 0 18px;
}
.settings-section-title--danger { color: var(--danger); }

.settings-section--danger { background: color-mix(in srgb, var(--danger) 3%, var(--surface)); }

.settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.settings-avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  border-radius: 50%;
  display: block;
}
.settings-avatar-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

.settings-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}
.settings-avatar-btn:hover .settings-avatar-overlay,
.settings-avatar-btn:focus-visible .settings-avatar-overlay { opacity: 1; }

.settings-avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
  padding: 4px;
}
.settings-avatar-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 14px;
  font-size: 0.86rem;
  font-family: var(--font-body);
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.settings-avatar-menu button:hover { background: var(--bg); }
.settings-avatar-menu-danger { color: var(--danger) !important; }

/* -- Crop modal -- */
.crop-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crop-modal-overlay.visible { display: flex; }

.crop-modal-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.24);
}
.crop-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
}
.crop-modal-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0;
  color: var(--text);
}
.crop-modal-body { background: #111; }
.crop-canvas-wrap {
  width: 100%;
  height: 340px;
  overflow: hidden;
  line-height: 0;
}
#cropCanvas { display: block; width: 100%; height: 100%; }
.crop-zoom-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  background: #1a1a1a;
  color: rgba(255,255,255,0.4);
}

.crop-zoom-row input[type=range] {
  width: 60%;
  flex: none;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  outline: none;
}
.crop-zoom-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
}
.crop-zoom-row input[type=range]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.crop-zoom-row input[type=range]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
  cursor: grab;
}
.crop-zoom-row input[type=range]::-moz-range-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
}
.crop-modal-actions {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

.settings-note {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.55;
}

.settings-status {
  font-size: 0.84rem;
  margin: 0 0 12px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.settings-status--ok   { background: color-mix(in srgb, var(--success) 10%, transparent); color: var(--success); }
.settings-status--none { background: var(--bg); color: var(--text-light); }

.settings-btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.settings-unit-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 100px;
  overflow: hidden;
  width: fit-content;
}
.settings-unit-btn {
  background: none;
  border: none;
  padding: 8px 22px;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}
.settings-unit-btn + .settings-unit-btn { border-left: 1px solid var(--border); }
.settings-unit-btn:not(.active):hover {
  background: var(--bg);
  color: var(--text);
}
.settings-unit-btn.active {
  background: var(--primary);
  color: #fff;
}
.settings-unit-btn.active:hover {
  background: var(--primary-dark);
  color: #fff;
}

.settings-error {
  font-size: 0.83rem;
  color: var(--danger);
  margin: 8px 0;
}

/* ---------- CONNECTED ACCOUNTS ---------- */
.connected-accounts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.connected-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface);
}

.connected-account-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connected-account-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.connected-account-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.connected-account-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 7px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--success) 12%, transparent);
  color: var(--success);
}

.user-menu-item--danger { color: var(--danger); }

@media (max-width: 480px) {
  .login-card { padding: 36px 20px 28px; }
  .auth-slot { margin-right: 2px; min-width: 40px; }
  .user-avatar-btn { width: 32px; height: 32px; }
  .user-avatar-initial { font-size: 0.8rem; }
  .user-menu { min-width: 180px; }
  .user-menu-header { padding: 12px 14px 10px; }
  .user-menu-item { padding: 10px 14px; font-size: 0.84rem; }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
