/* ============================================================
   StyleForecast — Custom Design System
   Palette: off-white, charcoal, muted olive, slate, terracotta accent
   ============================================================ */

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

:root {
  --c-bg:        #F5F3EF;
  --c-surface:   #EDEAE4;
  --c-surface2:  #E3DFD7;
  --c-border:    #D4CFC6;
  --c-text:      #1E1E1E;
  --c-text-2:    #5A5650;
  --c-text-3:    #8C887F;
  --c-accent:    #C4622D;
  --c-accent-dk: #A3501F;
  --c-olive:     #6B7055;
  --c-slate:     #4A5568;
  --c-charcoal:  #2D2D2D;

  --ff-serif:  'DM Serif Display', Georgia, serif;
  --ff-sans:   'Plus Jakarta Sans', system-ui, sans-serif;
  --ff-mono:   'Space Mono', 'Courier New', monospace;

  --radius:    6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.08);

  --transition: 160ms ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--ff-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

em { font-family: var(--ff-serif); font-style: italic; font-weight: 400; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ── Typography helpers ─────────────────────────────────────── */
.label-overline {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-bottom: 4px;
}

/* ── Site Header ────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  padding: 0 32px;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 40px;
}

.wordmark {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.02em;
  flex-shrink: 0;
}
.wordmark-style   { color: var(--c-charcoal); }
.wordmark-forecast { color: var(--c-accent); }

.site-nav { display: flex; gap: 4px; flex: 1; }

.nav-link {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
  color: var(--c-text-2);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover  { background: var(--c-surface); color: var(--c-text); }
.nav-link.active { background: var(--c-charcoal); color: var(--c-bg); }

.menu-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; padding: 4px; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--c-text); border-radius: 2px; transition: var(--transition); }

/* ── Flash messages ─────────────────────────────────────────── */
.flash-container { padding: 0 32px; margin-top: 12px; max-width: 1280px; margin-left: auto; margin-right: auto; }
.flash {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 8px;
  border: 1px solid transparent;
}
.flash--success { background: #EFF6EC; border-color: #B7D9A8; color: #2D6A1F; }
.flash--error   { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; }
.flash-close    { background: none; border: none; font-size: 18px; line-height: 1; opacity: .6; padding: 0 4px; color: inherit; }
.flash-close:hover { opacity: 1; }

/* ── Main / Footer ──────────────────────────────────────────── */
.site-main {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 64px;
}

.site-footer {
  border-top: 1px solid var(--c-border);
  padding: 20px 32px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-brand { font-weight: 600; font-size: 13px; color: var(--c-charcoal); }
.footer-meta  { font-size: 12px; color: var(--c-text-3); font-family: var(--ff-mono); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 60ms;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }

.btn--accent {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.btn--accent:hover { background: var(--c-accent-dk); border-color: var(--c-accent-dk); }

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

.btn--sm { padding: 6px 14px; font-size: 12px; }
.btn--danger { color: #991B1B; border-color: #FCA5A5; }
.btn--danger:hover { background: #FEF2F2; }

/* ── Empty states ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 80px 24px;
  gap: 16px;
}
.empty-state--page { padding: 60px 24px; }
.empty-state--inline { padding: 32px 0; }
.empty-state-glyph { font-size: 40px; opacity: .4; line-height: 1; }
.empty-state h2 { font-family: var(--ff-serif); font-size: 26px; font-weight: 400; }
.empty-state p  { color: var(--c-text-2); max-width: 380px; font-size: 14px; }

/* ── Page header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--c-border);
}
.page-title {
  font-family: var(--ff-serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--c-charcoal);
}

/* ============================================================
   Dashboard Layout
   ============================================================ */
.dashboard {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 80px;
}

.weather-search-block { display: flex; flex-direction: column; gap: 8px; }

.city-form { width: 100%; }
.input-row { display: flex; gap: 8px; }

.city-input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  font-family: var(--ff-sans);
  font-size: 14px;
  color: var(--c-text);
  transition: border-color var(--transition);
  outline: none;
}
.city-input:focus { border-color: var(--c-accent); }
.city-input::placeholder { color: var(--c-text-3); }

/* Weather panel */
.weather-panel {
  background: var(--c-charcoal);
  color: var(--c-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.weather-city {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  opacity: .65;
}

.weather-temp {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}
.temp-big  { font-family: var(--ff-serif); font-size: 72px; font-weight: 400; letter-spacing: -.03em; }
.temp-unit { font-size: 22px; opacity: .7; }
.temp-alt  { font-size: 14px; opacity: .45; font-family: var(--ff-mono); }

.weather-condition { font-size: 14px; opacity: .7; text-transform: capitalize; }

/* Telemetry grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(255,255,255,.12);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 4px;
}
.telemetry-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  background: rgba(255,255,255,.06);
}
.telem-label { font-family: var(--ff-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; opacity: .5; }
.telem-value { font-family: var(--ff-mono); font-size: 16px; font-weight: 700; }

.weather-icon-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.weather-icon { width: 48px; height: 48px; object-fit: contain; }
.weather-icon-glyph { font-size: 40px; line-height: 1; }
.log-icon-glyph { font-size: 24px; line-height: 1; flex-shrink: 0; width: 36px; text-align: center; }
.weather-condition-badge {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,.12);
  padding: 4px 10px;
  border-radius: 20px;
}

.weather-empty {
  background: var(--c-surface);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  color: var(--c-text-2);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.weather-empty-icon { font-size: 28px; opacity: .4; }

.dress-advice {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  font-family: var(--ff-mono);
  letter-spacing: .03em;
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,.1);
}

/* Quick action cards */
.quick-actions { display: flex; flex-direction: column; gap: 8px; }
.quick-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.quick-action-card:hover {
  border-color: var(--c-accent);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}
.qa-icon { font-size: 20px; flex-shrink: 0; }
.qa-text { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.qa-title { font-size: 13px; font-weight: 600; color: var(--c-text); }
.qa-sub { font-size: 11px; color: var(--c-text-3); }
.qa-arrow { font-size: 14px; color: var(--c-accent); font-weight: 700; flex-shrink: 0; }

/* ── Dashboard main ─────────────────────────────────────────── */
.dashboard-main { min-width: 0; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
}
.section-title {
  font-family: var(--ff-serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--c-charcoal);
}
.section-sub {
  margin-top: 6px;
  font-size: 12px;
  font-family: var(--ff-mono);
  color: var(--c-text-3);
  letter-spacing: .03em;
}

/* ── Outfit cards ───────────────────────────────────────────── */
.outfit-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.outfit-card {
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}
.outfit-card:hover {
  border-color: var(--c-text-3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.outfit-card:nth-child(1) { border-left: 4px solid var(--c-accent); }

.outfit-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 0;
}

.outfit-rank {
  font-family: var(--ff-mono);
  font-size: 32px;
  font-weight: 700;
  color: var(--c-surface2);
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: -.04em;
}
.outfit-card:nth-child(1) .outfit-rank { color: var(--c-accent); opacity: .35; }

.outfit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
}

.outfit-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent);
  font-weight: 700;
}

.outfit-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text-2);
}

.score-bar {
  display: block;
  width: 48px;
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.score-bar::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: calc(var(--score) * 1%);
  background: var(--c-accent);
  border-radius: 2px;
}

/* Outfit color palette */
.outfit-palette {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--c-surface);
}
.palette-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.1);
  flex-shrink: 0;
}
.palette-label {
  font-size: 11px;
  font-family: var(--ff-mono);
  color: var(--c-text-3);
  margin-left: 4px;
}

.outfit-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 24px 0;
}

.outfit-item-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.outfit-item-chip--sm { font-size: 12px; }

.chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,.1);
}

.chip-cat {
  font-family: var(--ff-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-text-3);
  background: var(--c-surface);
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.chip-name { color: var(--c-text); font-weight: 500; }

.outfit-reason {
  font-size: 13px;
  color: var(--c-text-2);
  line-height: 1.5;
  font-style: italic;
  border-left: 2px solid var(--c-border);
  padding-left: 12px;
  margin: 12px 24px 0;
}

.outfit-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 12px 24px;
  border-top: 1px solid var(--c-surface);
}

/* Star rating */
.star-rating { display: flex; gap: 2px; }
.star {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--c-border);
  padding: 0 1px;
  transition: color var(--transition), transform 80ms;
  line-height: 1;
}
.star:hover, .star.active { color: var(--c-accent); transform: scale(1.15); }
.star.filled { color: var(--c-accent); }

/* ============================================================
   Wardrobe Page
   ============================================================ */
.page-wardrobe {}

/* Drawer */
.drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
  align-items: flex-start;
  justify-content: flex-end;
}
.drawer.open { display: flex; }

.drawer-inner {
  background: var(--c-bg);
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 200ms ease;
}

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

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.drawer-title { font-family: var(--ff-serif); font-size: 28px; font-weight: 400; }
.drawer-close {
  background: var(--c-surface);
  border: none;
  font-size: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.drawer-close:hover { background: var(--c-surface2); }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-grid--compact { gap: 10px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--wide { grid-column: 1 / -1; }

.form-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-text-2); }

.form-input, .form-select {
  padding: 9px 12px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  font-family: var(--ff-sans);
  font-size: 14px;
  color: var(--c-text);
  transition: border-color var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus, .form-select:focus { border-color: var(--c-accent); }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238C887F' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.checkbox-group { display: flex; gap: 16px; flex-wrap: wrap; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-text-2); cursor: pointer; }
.checkbox-label input { accent-color: var(--c-accent); width: 14px; height: 14px; }

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

/* Wardrobe sections */
.wardrobe-section { margin-bottom: 40px; }
.wardrobe-section-title {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-badge {
  background: var(--c-surface2);
  color: var(--c-text-2);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
}

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

.wardrobe-tile {
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.wardrobe-tile:hover { border-color: var(--c-text-3); box-shadow: var(--shadow-sm); }

.tile-color-strip { height: 4px; }

.tile-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }

.tile-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tile-name { font-weight: 600; font-size: 14px; line-height: 1.3; }

.tile-menu { position: relative; flex-shrink: 0; }
.tile-menu-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--c-text-3);
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
}
.tile-menu-btn:hover { background: var(--c-surface); color: var(--c-text); }

.tile-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 110px;
  overflow: hidden;
  z-index: 50;
}
.tile-menu-dropdown.open { display: block; }
.tile-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 13px;
  background: none;
  border: none;
  color: var(--c-text);
  transition: background var(--transition);
}
.tile-menu-item:hover { background: var(--c-surface); }
.tile-menu-item--danger { color: #991B1B; }
.tile-menu-item--danger:hover { background: #FEF2F2; }

.tile-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.tile-weather-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.tile-tag {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
}
.tile-tag--warmth  { background: #F0EBE3; color: #7A5C44; }
.tile-tag--formal  { background: #E8ECF0; color: var(--c-slate); }
.tile-tag--season  { background: #EBF0E8; color: var(--c-olive); }
.tile-tag--weather { background: #F5F0E8; color: #8A6A3A; border: 1px solid #E0D0B8; }

.tile-edit-panel {
  padding: 16px;
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}

/* ============================================================
   Wardrobe Stats Strip
   ============================================================ */
.wardrobe-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
.wstat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  font-size: 13px;
}
.wstat--gap { opacity: .45; border-style: dashed; }
.wstat-icon { font-size: 14px; }
.wstat-count { font-family: var(--ff-mono); font-weight: 700; color: var(--c-text); }
.wstat-label { color: var(--c-text-2); }
.wstat-gap-hint {
  font-size: 12px;
  color: var(--c-accent);
  font-family: var(--ff-mono);
  padding: 4px 10px;
  background: #FDF0E9;
  border-radius: 99px;
}
.wstat-favorites {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.wstat-fav-label {
  font-size: 11px;
  font-family: var(--ff-mono);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--c-text-3);
}
.wstat-fav-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--c-text-2);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  padding: 3px 10px;
}

/* ============================================================
   Favorites Page
   ============================================================ */
.favorites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.fav-card {
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}
.fav-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.fav-palette {
  display: flex;
  height: 8px;
}
.fav-palette-swatch {
  flex: 1;
  min-width: 8px;
}

.fav-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  flex: 1;
}

.fav-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.fav-date { font-size: 12px; color: var(--c-text-3); font-family: var(--ff-mono); margin-top: 4px; }

.fav-score-badge {
  font-family: var(--ff-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-accent);
  background: #FDF0E9;
  border: 1.5px solid #F2CBBA;
  border-radius: var(--radius);
  padding: 3px 8px;
  flex-shrink: 0;
}

.fav-items { display: flex; flex-direction: column; gap: 6px; }
.fav-missing { font-size: 12px; color: var(--c-text-3); font-style: italic; }
.fav-card-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--c-surface); }

/* ============================================================
   Planner Page
   ============================================================ */
.page-planner {}

.planner-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.planner-card {
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--transition);
}
.planner-card:hover { box-shadow: var(--shadow-md); }
.planner-card--today { border-color: var(--c-accent); border-width: 2px; }

.planner-day-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.planner-day-label { display: flex; flex-direction: column; gap: 2px; }
.planner-today-badge {
  font-family: var(--ff-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #fff;
  background: var(--c-accent);
  padding: 2px 6px;
  border-radius: 99px;
  width: fit-content;
}
.planner-date { font-family: var(--ff-mono); font-size: 12px; color: var(--c-text-2); }
.planner-weather-icon { font-size: 28px; line-height: 1; }

.planner-temps {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.planner-temp-max { font-family: var(--ff-serif); font-size: 28px; color: var(--c-text); line-height: 1; }
.planner-temp-min { font-size: 14px; color: var(--c-text-3); font-family: var(--ff-mono); }
.planner-condition { font-size: 12px; color: var(--c-text-2); text-transform: capitalize; }

.planner-telem { display: flex; flex-wrap: wrap; gap: 4px; }
.planner-pill {
  font-size: 11px;
  font-family: var(--ff-mono);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-2);
}
.planner-pill--rain { background: #EBF3FB; border-color: #BDD9EF; }
.planner-pill--wind { background: #EDF5EE; border-color: #BDD8BF; }
.planner-pill--uv   { background: #FDF6E3; border-color: #EDD99A; }

.planner-outfit {
  border-top: 1px solid var(--c-border);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.planner-outfit-palette { display: flex; gap: 4px; flex-wrap: wrap; }
.planner-outfit-items { display: flex; flex-direction: column; gap: 4px; }
.planner-outfit-row { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.planner-score { font-size: 11px; color: var(--c-text-3); font-family: var(--ff-mono); margin-top: auto; }
.planner-no-outfit { font-size: 12px; color: var(--c-text-3); font-style: italic; }
.planner-cta { margin-top: 32px; text-align: center; }

/* ============================================================
   History Page
   ============================================================ */
.history-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.history-section {}
.history-section-title {
  font-family: var(--ff-serif);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
}

.log-list { display: flex; flex-direction: column; gap: 0; }

.log-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-border);
  gap: 16px;
}
.log-entry:last-child { border-bottom: none; }

.log-entry-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.log-icon { width: 36px; height: 36px; flex-shrink: 0; }
.log-details { min-width: 0; }
.log-city { font-weight: 600; font-size: 14px; display: block; }
.log-desc { font-size: 12px; color: var(--c-text-2); text-transform: capitalize; }

.log-entry-right { text-align: right; flex-shrink: 0; }
.log-temps { display: flex; align-items: baseline; gap: 6px; justify-content: flex-end; }
.log-temp-main { font-family: var(--ff-mono); font-size: 18px; font-weight: 700; }
.log-temp-alt  { font-size: 12px; color: var(--c-text-3); font-family: var(--ff-mono); }
.log-telemetry { display: flex; gap: 8px; font-size: 11px; color: var(--c-text-3); font-family: var(--ff-mono); margin-top: 2px; }
.log-time { font-size: 11px; color: var(--c-text-3); font-family: var(--ff-mono); display: block; margin-top: 4px; }

.ratings-list { display: flex; flex-direction: column; gap: 0; }

.rating-entry {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-border);
}
.rating-entry:last-child { border-bottom: none; }

.rating-stars { display: flex; gap: 2px; flex-shrink: 0; }
.rating-star { font-size: 14px; color: var(--c-border); }
.rating-star--filled { color: var(--c-accent); }

.rating-items { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.rating-date { font-size: 11px; color: var(--c-text-3); font-family: var(--ff-mono); flex-shrink: 0; }
.rating-chip { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--c-text-2); }

.log-icon-bubble {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--c-surface);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .dashboard { grid-template-columns: 1fr; }
  .dashboard-sidebar { position: static; }
  .history-layout { grid-template-columns: 1fr; }
  .planner-grid { grid-template-columns: repeat(3, 1fr); }
  .wstat-favorites { margin-left: 0; }
}

@media (max-width: 640px) {
  .site-header { padding: 0 16px; }
  .site-main { padding: 24px 16px 48px; }
  .site-nav { display: none; }
  .site-nav.open { display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--c-bg); border-bottom: 1px solid var(--c-border); padding: 12px 16px; gap: 2px; z-index: 99; }
  .menu-toggle { display: flex; }
  .page-title { font-size: 32px; }
  .section-title { font-size: 36px; }
  .outfit-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .planner-grid { grid-template-columns: repeat(2, 1fr); }
  .favorites-grid { grid-template-columns: 1fr; }
  .drawer-inner { width: 100vw; }
  .page-header { flex-wrap: wrap; gap: 16px; }
  .log-entry { flex-wrap: wrap; }
  .log-entry-right { text-align: left; }
}

/* ============================================================
   Wardrobe Preset Picker
   ============================================================ */
.picker-drawer { display: flex; flex-direction: column; height: 100%; }

.picker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  min-height: 36px;
}
.picker-back-btn {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-accent);
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
  flex-shrink: 0;
}
.picker-back-btn:hover { text-decoration: underline; }
.picker-breadcrumb {
  flex: 1;
  font-size: 12px;
  color: var(--c-text-3);
  font-family: var(--ff-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-step { display: none; flex-direction: column; gap: 20px; flex: 1; overflow-y: auto; }
.picker-step.active { display: flex; }

.picker-title {
  font-family: var(--ff-serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--c-charcoal);
}

/* Gender cards */
.gender-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gender-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-bg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 80ms;
}
.gender-card:hover  { border-color: var(--c-accent); background: #FDF0E9; }
.gender-card:active { transform: scale(.97); }
.gender-icon  { font-size: 40px; line-height: 1; }
.gender-label { font-size: 15px; font-weight: 600; color: var(--c-text); }

/* Category grid */
.category-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.category-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 10px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-bg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 80ms;
}
.category-tile:hover  { border-color: var(--c-accent); background: #FDF0E9; }
.category-tile:active { transform: scale(.97); }
.cat-icon  { font-size: 28px; line-height: 1; }
.cat-label { font-size: 13px; font-weight: 600; color: var(--c-text); text-align: center; }

/* Type list */
.type-list { display: flex; flex-direction: column; gap: 0; overflow-y: auto; }
.type-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border: none;
  border-bottom: 1px solid var(--c-border);
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), padding-left var(--transition);
  border-radius: 0;
}
.type-item:first-child { border-top: 1px solid var(--c-border); }
.type-item:hover { background: var(--c-surface); padding-left: 8px; }
.type-item-name { font-size: 14px; font-weight: 500; color: var(--c-text); }
.type-item-meta { display: flex; gap: 4px; flex-shrink: 0; }
.type-item--custom .type-item-name { color: var(--c-accent); font-style: italic; }

/* Pill buttons (custom item step) */
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-btn {
  padding: 7px 16px;
  border-radius: 99px;
  border: 1.5px solid var(--c-border);
  background: var(--c-bg);
  color: var(--c-text-2);
  font-family: var(--ff-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.pill-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.pill-btn.selected { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }

/* Color swatches */
.color-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.color-swatch {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 120ms, border-color 120ms, box-shadow 120ms;
  overflow: visible;
}
.color-swatch:hover  { transform: scale(1.12); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.color-swatch.selected {
  border-color: var(--c-accent) !important;
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(196,98,45,.2);
}
.swatch-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-family: var(--ff-mono);
  color: var(--c-text-3);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms;
}
.color-swatch:hover .swatch-label,
.color-swatch.selected .swatch-label { opacity: 1; }

/* Confirm bar */
.picker-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  margin-top: 28px;
  border: 1.5px solid var(--c-border);
}
.confirm-preview { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }

/* ── Utility ─────────────────────────────────────────────────── */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Profile button ─────────────────────────────────────────── */
.header-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.profile-btn  { background: none; border: none; padding: 0; cursor: pointer; }
.profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-charcoal);
  color: var(--c-bg);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: background var(--transition);
}
.profile-btn:hover .profile-avatar { background: var(--c-accent); }

/* ── Greeting line ──────────────────────────────────────────── */
.greeting-line {
  font-size: 13px;
  color: var(--c-text-3);
  font-family: var(--ff-mono);
  letter-spacing: .04em;
  margin-bottom: 6px;
  min-height: 18px;
}

/* ── Form hint ──────────────────────────────────────────────── */
.form-hint { font-size: 12px; color: var(--c-text-3); margin-top: 4px; }

/* ============================================================
   Onboarding Modal
   ============================================================ */
.onboarding-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(20, 18, 15, .72);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.onboarding-overlay.open { display: flex; }

.onboarding-modal {
  background: var(--c-bg);
  border-radius: 20px;
  padding: 48px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalIn 280ms cubic-bezier(.16,1,.3,1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.ob-step { display: none; flex-direction: column; gap: 20px; }
.ob-step.active { display: flex; }

.ob-brand {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.ob-title {
  font-family: var(--ff-serif);
  font-size: 44px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--c-charcoal);
}
.ob-title--sm { font-size: 36px; }

.ob-subtitle { font-size: 15px; color: var(--c-text-2); line-height: 1.6; max-width: 380px; }

.ob-form { display: flex; flex-direction: column; gap: 16px; }

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

.ob-steps-indicator {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.ob-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-border);
  transition: background var(--transition), transform var(--transition);
}
.ob-dot.active { background: var(--c-accent); transform: scale(1.3); }

/* Style selection cards */
.style-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-bg);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform 80ms;
}
.style-card:hover { border-color: var(--c-text-3); background: var(--c-surface); }
.style-card.selected { border-color: var(--c-accent); background: #FDF0E9; }
.style-card:active { transform: scale(.97); }

.style-card-icon  { font-size: 28px; line-height: 1; }
.style-card-label { font-size: 13px; font-weight: 600; color: var(--c-text); }
.style-card-desc  { font-size: 11px; color: var(--c-text-3); text-align: center; line-height: 1.3; }

/* ── Profile modal ──────────────────────────────────────────── */
.profile-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(20, 18, 15, .5);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.profile-modal-overlay.open { display: flex; }

.profile-modal {
  background: var(--c-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 240ms cubic-bezier(.16,1,.3,1);
}

/* ============================================================
   Tour Overlay
   ============================================================ */
.tour-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}
.tour-overlay.active { display: block; }

.tour-spotlight {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(20, 18, 15, .6);
  transition: all 300ms cubic-bezier(.16,1,.3,1);
  pointer-events: none;
}

.tour-card {
  position: absolute;
  background: var(--c-bg);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  width: 300px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: fadeUp 200ms ease;
}

.tour-step-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 6px;
}
.tour-card-title {
  font-family: var(--ff-serif);
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 8px;
  color: var(--c-charcoal);
}
.tour-card-text { font-size: 13px; color: var(--c-text-2); line-height: 1.55; margin-bottom: 16px; }
.tour-card-actions { display: flex; justify-content: space-between; align-items: center; }

/* ── Mobile onboarding tweaks ───────────────────────────────── */
@media (max-width: 640px) {
  .onboarding-modal { padding: 32px 24px; }
  .ob-title { font-size: 34px; }
  .ob-title--sm { font-size: 28px; }
  .style-cards { grid-template-columns: 1fr; }
  .tour-card { width: calc(100vw - 48px); }
}

/* ── Dark Mode ──────────────────────────────────────────────── */
html.dark {
  --c-bg:        #111113;
  --c-surface:   #1a1a1e;
  --c-surface2:  #222228;
  --c-border:    #303038;
  --c-text:      #f2f2f4;
  --c-text-2:    #9898a8;
  --c-text-3:    #606070;
  --c-charcoal:  #222228;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:   0 4px 16px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.35);
}

/* Surface overrides */
html.dark .weather-panel        { background: var(--c-surface2); }
html.dark .tour-card            { background: var(--c-surface); border-color: var(--c-border); }
html.dark .tour-card-title      { color: var(--c-text); }
html.dark .ob-dot               { background: var(--c-border); }
html.dark .ob-dot.active        { background: var(--c-accent); }

/* Flash messages */
html.dark .flash--success { background: #1a2e1a; border-color: #2d5a2d; color: #7ecf7e; }
html.dark .flash--error   { background: #2e1a1a; border-color: #5a2d2d; color: #cf7e7e; }

/* Wardrobe tags */
html.dark .tile-tag--warmth  { background: #2a2220; color: #c8a882; }
html.dark .tile-tag--weather { background: #232320; color: #b0a070; border-color: #403830; }

/* Wardrobe stats */
html.dark .wstat             { background: var(--c-surface2); }
html.dark .wstat--gap        { background: #2a2020; border-color: #4a3030; color: #c07070; }
html.dark .wstat-favorites   { background: var(--c-surface); }
html.dark .wstat-fav-chip    { background: var(--c-surface2); }

/* Planner pills */
html.dark .planner-pill--rain { background: #1a2430; border-color: #2a4060; color: #88b8d8; }
html.dark .planner-pill--wind { background: #1a2a1e; border-color: #2a4830; color: #80c890; }
html.dark .planner-pill--uv   { background: #2a2410; border-color: #4a3e18; color: #d0b860; }

/* Danger buttons/items */
html.dark .btn--danger            { color: #cf7e7e; border-color: #5a2d2d; }
html.dark .btn--danger:hover      { background: #2e1a1a; }
html.dark .tile-menu-item--danger { color: #cf7e7e; }
html.dark .tile-menu-item--danger:hover { background: #2e1a1a; }

/* ── Settings button ────────────────────────────────────────── */
.settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  background: var(--c-surface);
  color: var(--c-text-2);
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.settings-btn:hover { background: var(--c-surface2); color: var(--c-text); }

/* ── Settings modal sections ────────────────────────────────── */
.settings-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--c-border);
}
.settings-section:last-child { border-bottom: none; }
.settings-label {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--c-text-3);
  margin-bottom: 14px;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.settings-row-title { display: block; font-size: 14px; font-weight: 500; color: var(--c-text); }
.settings-row-sub   { display: block; font-size: 12px; color: var(--c-text-3); margin-top: 2px; }

/* ── Toggle switch ──────────────────────────────────────────── */
.toggle-switch {
  flex-shrink: 0;
  position: relative;
  width: 44px;
  height: 26px;
  background: var(--c-border);
  border: none;
  border-radius: 13px;
  cursor: pointer;
  transition: background 200ms;
  padding: 0;
}
.toggle-switch[aria-checked="true"] { background: var(--c-accent); }
.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 200ms;
  pointer-events: none;
}
.toggle-switch[aria-checked="true"] .toggle-thumb { transform: translateX(18px); }

/* ── Unit toggle ────────────────────────────────────────────── */
.unit-toggle {
  display: flex;
  flex-shrink: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.unit-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--c-text-2);
  font-family: var(--ff-mono);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.unit-btn.active { background: var(--c-accent); color: #fff; }
