/* ═══════════════════════════════════════════════════════════
   WearCast — Mobile-first design system
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #f0f7ff;
  --bg2: #ffffff;
  --card: rgba(255,255,255,.75);
  --card-border: rgba(0,100,255,.08);
  --text: #0a1628;
  --text2: #3a4a6a;
  --text3: #8094b4;
  --accent: #2979ff;
  --accent-glow: rgba(41,121,255,.3);
  --accent2: #00e676;
  --accent3: #69f0ae;
  --good: #00c853;
  --good-bg: rgba(0,200,83,.1);
  --warn: #ffab00;
  --warn-bg: rgba(255,171,0,.1);
  --bad: #ff1744;
  --bad-bg: rgba(255,23,68,.08);
  --gradient-hero: linear-gradient(135deg, #2979ff, #00b0ff, #00e676);
  --gradient-nav: linear-gradient(180deg, #f5faff, #ffffff);
  --gradient-header: linear-gradient(135deg, #2979ff, #00b0ff);
  --glass: rgba(255,255,255,.6);
  --glass-border: rgba(255,255,255,.7);
  --radius: 20px;
  --radius-sm: 14px;
  --nav-h: 72px;
  --header-h: 74px;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --pad: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html, body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}
html { -webkit-tap-highlight-color: transparent; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: var(--bg);
  background-image: radial-gradient(circle at 20% 20%, rgba(41,121,255,.04) 0%, transparent 50%),
                    radial-gradient(circle at 80% 80%, rgba(0,230,118,.04) 0%, transparent 50%);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
@supports (height: 100dvh) {
  body { min-height: 100dvh; }
}
@supports (height: 100svh) {
  body { min-height: 100svh; }
}

/* ── Header ── */
header {
  flex-shrink: 0;
  z-index: 40;
  position: relative;
  min-height: calc(var(--header-h) + var(--safe-t));
  padding:
    calc(var(--safe-t) + 14px)
    calc(var(--pad) + var(--safe-r))
    14px
    calc(var(--pad) + var(--safe-l));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, #2f80ff, #1aa6ff, #2ad7b3);
  color: #fff;
  border-bottom: none;
  box-shadow: 0 8px 22px rgba(17,67,143,.08);
  overflow: visible;
}
header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 46%),
    radial-gradient(circle at 18% 0%, rgba(255,255,255,.1), transparent 30%);
  pointer-events: none;
}
header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 8px);
  height: 28px;
  background: linear-gradient(180deg, rgba(26,166,255,.24), rgba(26,166,255,0));
  pointer-events: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 10px;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
}
.logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}
.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.brand { position: relative; z-index: 1; }
.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
  border-radius: 50%; cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:active { background: rgba(255,255,255,.24); color: #fff; }

/* ── Bottom nav ── */
.bottom-nav {
  flex-shrink: 0;
  z-index: 40;
  min-height: calc(var(--nav-h) + var(--safe-b));
  padding:
    0
    calc(max(8px, var(--safe-r)))
    max(8px, var(--safe-b))
    calc(max(8px, var(--safe-l)));
  display: flex;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -4px 20px rgba(0,0,0,.04);
}
.nav-item {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  border: none; background: none;
  color: var(--text3);
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { transition: transform .15s; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { transform: scale(1.1); }
.nav-item:active { color: var(--text2); }

/* ── Main / tab pages ── */
main {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.tab-page {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding:
    var(--pad)
    calc(var(--pad) + var(--safe-r))
    calc(var(--nav-h) + var(--safe-b) + 24px)
    calc(var(--pad) + var(--safe-l));
  display: none;
}
.tab-page > * + * { margin-top: 14px; }
.tab-page.active { display: block; }

/* ── Cards ── */
.card {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.02);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
}
.card-header h2, .card-header h3 { font-size: 15px; font-weight: 600; }
.card-header-clickable { cursor: pointer; list-style: none; }
.card-header-clickable::-webkit-details-marker { display: none; }
.card-details[open] .chevron { transform: rotate(180deg); }
.chevron { color: var(--text3); transition: transform .2s; }

/* ── Pills / Badges ── */
.pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: .3px;
  background: rgba(0,0,0,.06);
  color: var(--text2);
}
.pill-ai {
  background: linear-gradient(135deg, #2979ff, #00e676);
  color: #fff;
}
.pill-soft {
  background: rgba(41,121,255,.1);
  color: var(--accent);
}

/* ── User button / Auth ── */
.user-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.14);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; overflow: hidden;
}
.user-btn:hover { border-color: #fff; }
.user-avatar { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

@supports (padding: max(0px)) {
  header {
    padding-top: max(calc(var(--safe-t) + 10px), 10px);
  }
}

.auth-subtitle { font-size: 14px; color: var(--text3); margin: -4px 0 16px; }
.auth-input { width: 100%; margin-bottom: 10px; box-sizing: border-box; }
.auth-error { color: #e53935; font-size: 13px; margin-bottom: 10px; }
.auth-info {
  color: var(--accent);
  background: rgba(41,121,255,.08);
  border: 1px solid rgba(41,121,255,.14);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}
.auth-submit { width: 100%; margin-top: 4px; }
.auth-toggle {
  display: block; width: 100%; margin-top: 12px;
  border: none; background: none; font-size: 13px;
  color: var(--text3); cursor: pointer; text-align: center;
}
.auth-toggle strong { color: var(--accent); }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text3); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--card-border);
}
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--card-border); background: #fff;
  font-size: 14px; font-weight: 600; color: var(--text);
  cursor: pointer; transition: background .15s;
}
.btn-google:hover { background: #f5f5f5; }
.auth-profile {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0; margin-bottom: 12px;
}
.auth-profile-avatar { width: 48px; height: 48px; border-radius: 50%; }
.auth-profile-name { font-weight: 600; font-size: 16px; }
.auth-profile-email { font-size: 13px; color: var(--text3); }
.auth-profile-badge {
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

/* ── Location bar ── */
.location-bar {
  display: flex; gap: 8px; align-items: center;
  max-width: 100%;
}
.location-input-wrap {
  flex: 1;
  display: flex; align-items: center;
  background: rgba(0,0,0,.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  gap: 8px;
  transition: border-color .15s;
  position: relative;
}
.location-input-wrap:focus-within {
  border-color: rgba(41,121,255,.35);
  box-shadow: 0 0 0 3px rgba(41,121,255,.1);
}
.location-icon { color: var(--text3); flex-shrink: 0; }
.location-input-wrap input {
  flex: 1; border: none; background: none; color: var(--text);
  padding: 12px 0; font-size: 16px; outline: none;
}
.location-input-wrap input::placeholder { color: var(--text3); }
.location-action {
  border: none; background: none; color: var(--text3);
  cursor: pointer; padding: 4px; display: flex;
}
.location-action:active { color: var(--accent); }
.geo-btn {
  width: 46px; height: 46px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--gradient-hero);
  color: #fff;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 12px rgba(41,121,255,.3);
}
.geo-btn:active { transform: scale(.95); box-shadow: 0 2px 6px rgba(41,121,255,.2); }
.geo-btn.loading { box-shadow: 0 0 0 4px rgba(41,121,255,.14), 0 4px 12px rgba(41,121,255,.25); }
.geo-btn.loading .geo-btn-icon { display: none; }
.geo-btn.loading .geo-btn-spinner { display: inline-block !important; border-color: rgba(255,255,255,.35); border-top-color: #fff; }

/* ── Autocomplete dropdown ── */
.ac-dropdown {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 100;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  backdrop-filter: blur(16px);
  max-height: 260px;
  overflow-y: auto;
}
.ac-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 12px 14px;
  border: none; background: none;
  font-size: 14px; color: var(--text);
  cursor: pointer; text-align: left;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item:focus { background: rgba(41,121,255,.08); }
.ac-flag { font-size: 20px; flex-shrink: 0; }
.ac-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Status ── */
.status-text {
  font-size: 13px; color: var(--text3);
  min-height: 0;
}
.status-text:empty { display: none; }
.status-text.is-busy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
}

/* ── Weather hero ── */
.weather-hero {
  background: var(--gradient-hero);
  border: none;
  border-radius: var(--radius);
  padding: 24px 20px 18px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(41,121,255,.25), 0 2px 8px rgba(41,121,255,.15);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.weather-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.15) 0%, transparent 50%);
  pointer-events: none;
}
.hero-main {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  position: relative; z-index: 1;
}
.hero-temp {
  font-size: 56px; font-weight: 800; letter-spacing: -2px;
  color: #fff;
  -webkit-text-fill-color: #fff;
  background: none;
  text-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.hero-meta {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative; z-index: 1;
  padding-bottom: 0;
}
.hero-condition-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-condition-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 14px;
  color: rgba(255,255,255,.95);
  background: rgba(255,255,255,.12);
}
.hero-condition { font-size: 20px; font-weight: 700; color: #fff; }
.hero-feels { font-size: 13px; color: rgba(255,255,255,.85); }
.hero-stats {
  display: flex; justify-content: center; gap: 14px;
  margin-top: 18px; flex-wrap: wrap;
  position: relative; z-index: 1;
}
.hero-stat {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; color: rgba(255,255,255,.92);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
}
.hero-stat svg { color: rgba(255,255,255,.7); }
.hero-updated {
  margin-top: 14px; font-size: 11px; color: rgba(255,255,255,.7);
  position: relative; z-index: 1;
  text-align: center;
}

/* ── Severity ── */
.severity-bar {
  display: flex; align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  gap: 14px;
}
.severity-bar.good { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); border: 1px solid rgba(0,200,83,.25); }
.severity-bar.warn { background: linear-gradient(135deg, #fff8e1, #ffecb3); border: 1px solid rgba(255,171,0,.25); }
.severity-bar.bad { background: linear-gradient(135deg, #fce4ec, #f8bbd0); border: 1px solid rgba(255,23,68,.2); }
.severity-icon { font-size: 28px; flex-shrink: 0; line-height: 1; }
.severity-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.severity-title { font-size: 15px; font-weight: 700; }
.severity-detail { font-size: 12px; color: var(--text2); }
.severity-meta { font-size: 11px; color: var(--text3); white-space: nowrap; align-self: flex-start; }

.today-rec-card {
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(246,250,255,.92));
  border: 1px solid rgba(41,121,255,.1);
  box-shadow: 0 12px 30px rgba(11,37,81,.08);
}
.today-rec-header {
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 8px;
}
.today-rec-header h2 {
  font-size: 15px;
  font-weight: 700;
}
.today-rec-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text3);
  line-height: 1.45;
}
.today-rec-content {
  padding: 0 16px 16px;
}
.today-rec-body {
  display: grid;
  gap: 14px;
}
.today-rec-hero {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(41,121,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.today-rec-outfit {
  display: flex;
  gap: 12px;
  align-items: center;
}
.today-rec-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  background: linear-gradient(135deg, rgba(41,121,255,.12), rgba(0,176,255,.1));
}
.today-rec-copy h3 {
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.today-rec-copy p {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text2);
  line-height: 1.45;
}
.today-chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.today-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(41,121,255,.08);
  color: #17448f;
  font-size: 13px;
  font-weight: 600;
}
.today-chip-toggle {
  border: 1px solid rgba(41,121,255,.1);
  cursor: pointer;
  background: rgba(41,121,255,.04);
}
.today-chip-toggle.is-active {
  background: linear-gradient(135deg, rgba(41,121,255,.96), rgba(0,176,255,.88));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 16px rgba(41,121,255,.18);
}
.today-chip-row-controls {
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  margin-right: -4px;
  padding-right: 24px;
  -ms-overflow-style: none;
  scrollbar-width: none;
  mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 82%, rgba(0,0,0,.2) 95%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 82%, rgba(0,0,0,.2) 95%, rgba(0,0,0,0) 100%);
}
.today-chip-row-controls::-webkit-scrollbar {
  display: none;
}
.today-control-groups {
  display: grid;
  gap: 12px;
}
.today-control-group {
  display: grid;
  gap: 8px;
}
.today-control-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text3);
}
.today-control-group {
  position: relative;
}
.today-control-group::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 22px;
  bottom: 4px;
  width: 24px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(246,250,255,0), rgba(246,250,255,.96));
  border-radius: 999px;
}
.today-update-btn {
  width: 100%;
  justify-content: center;
  margin-top: 2px;
}
.today-rec-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.today-rec-tile {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(243,248,255,.78));
  border: 1px solid rgba(41,121,255,.08);
  box-shadow: 0 10px 18px rgba(24,64,128,.05);
}
.today-rec-tile-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.today-rec-tile-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--accent);
  background: rgba(41,121,255,.1);
}
.today-rec-tile-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.35;
  font-weight: 600;
}
.today-rec-accessories {
  font-size: 13px;
  color: var(--text2);
}
.today-tune-section,
.today-why {
  border-radius: 16px;
  border: 1px solid rgba(41,121,255,.1);
  background: rgba(255,255,255,.68);
  padding: 6px 14px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.today-tune-section summary,
.today-why summary {
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.today-tune-section summary span,
.today-why summary span,
.today-alt-section summary span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.today-tune-section summary span::before,
.today-why summary span::before,
.today-alt-section summary span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(41,121,255,.95), rgba(0,176,255,.78));
  box-shadow: 0 0 0 4px rgba(41,121,255,.08);
  flex-shrink: 0;
}
.today-tune-section summary::-webkit-details-marker,
.today-why summary::-webkit-details-marker {
  display: none;
}
.today-tune-section[open] .today-expand-icon,
.today-why[open] .today-expand-icon {
  transform: rotate(180deg);
}
.today-tune-section .today-control-groups {
  margin-top: 4px;
}
.today-why ul {
  display: none;
}
.today-why-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}
.today-why-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 12px 12px 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(244,249,255,.72));
  border: 1px solid rgba(41,121,255,.08);
}
.today-why-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--accent);
  background: rgba(41,121,255,.1);
}
.today-why-text {
  color: var(--text2);
  font-size: 14px;
  line-height: 1.45;
}
.today-alt-section {
  border-radius: 16px;
  border: 1px solid rgba(41,121,255,.1);
  background: rgba(255,255,255,.68);
  padding: 6px 14px 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}
.today-alt-section summary {
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.today-alt-section summary::-webkit-details-marker {
  display: none;
}
.today-alt-section[open] .today-expand-icon {
  transform: rotate(180deg);
}
.today-alt-list {
  display: grid;
  gap: 8px;
}
.today-expand-icon {
  color: var(--text3);
  flex-shrink: 0;
  transition: transform .18s ease;
}
.today-alt-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(10,22,40,.05);
}

@media (max-width: 430px) {
  .today-rec-breakdown-grid {
    grid-template-columns: 1fr;
  }
}
.today-alt-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text3);
}
.today-alt-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}
.today-rec-note {
  margin: 0 16px 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(41,121,255,.06);
  color: var(--text2);
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid rgba(41,121,255,.1);
}

/* ── Recommendation content ── */
.rec-content { padding: 0 16px 16px; }
.rec-block { display: grid; gap: 10px; }
.rec-section {
  background: rgba(0,0,0,.02);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.rec-section h3 { font-size: 12px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.rec-section ul { margin: 0; padding-left: 16px; }
.rec-section li { font-size: 14px; color: var(--text2); margin: 4px 0; }
.rec-tip { font-size: 13px; color: var(--text3); line-height: 1.5; }

/* ── AI outfit ── */
.ai-outfit { display: grid; gap: 8px; padding: 0 16px 16px; }
.ai-outfit-row {
  display: flex; gap: 10px; align-items: baseline;
  padding: 10px 14px;
  background: rgba(0,0,0,.02);
  border-radius: var(--radius-sm);
}
.ai-outfit-label { font-size: 12px; color: var(--text3); min-width: 70px; flex-shrink: 0; text-transform: uppercase; letter-spacing: .4px; }
.ai-outfit-value { font-size: 14px; color: var(--text2); }
.ai-reasoning {
  margin: 0 16px 16px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: rgba(41,121,255,.08);
  border: 1px solid rgba(41,121,255,.12);
  font-size: 14px; line-height: 1.5; color: var(--text2);
}
.ai-warnings { padding: 0 16px; display: grid; gap: 6px; }
.ai-warnings:empty { display: none; }
.ai-error {
  padding: 16px; text-align: center; font-size: 14px; color: var(--text2);
}
.ai-retry-btn {
  margin-top: 8px; display: inline-block; padding: 8px 20px;
  border: none; border-radius: var(--radius-sm);
  background: var(--gradient-hero); color: #fff;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.ai-warning {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  border: 1px solid rgba(255,171,0,.15);
  font-size: 13px; color: #5d4e00;
}
.ai-missing { padding: 0 16px 16px; display: grid; gap: 6px; }
.ai-missing:empty { display: none; }
.ai-missing-title { font-size: 12px; color: var(--text3); margin-bottom: 2px; }
.ai-missing-item {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(41,121,255,.06);
  border: 1px solid rgba(41,121,255,.1);
  font-size: 13px; color: var(--text2);
}

/* ── Detail grid ── */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--card-border);
  border-top: 1px solid var(--card-border);
}
.detail-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  background: var(--bg2);
  font-size: 13px;
}
.detail-label { color: var(--text3); }

/* ── Error / info states ── */
.ai-error {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text3);
  line-height: 1.5;
}

/* ── Reasons list ── */
.reasons-list {
  list-style: none; padding: 0 16px 16px; margin: 0;
}
.reasons-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--card-border);
  font-size: 13px; color: var(--text2);
}
.reasons-list li:last-child { border-bottom: none; }

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 48px 24px;
  min-height: 50vh;
}
.empty-icon { color: var(--text3); margin-bottom: 16px; opacity: .5; }
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { font-size: 14px; color: var(--text3); max-width: 280px; }

/* ── Tab top bar ── */
.tab-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0;
}
.tab-top-bar h2 { font-size: 22px; font-weight: 700; }

/* ── Buttons ── */
.btn-primary {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--gradient-hero);
  color: #fff;
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 4px 14px rgba(41,121,255,.3);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: scale(.97); box-shadow: 0 2px 6px rgba(41,121,255,.2); }
.btn-primary:hover, .btn-primary-sm:hover { filter: brightness(1.03); }
.btn-primary-sm {
  padding: 8px 14px;
  border-radius: 10px; border: none;
  background: var(--gradient-hero); color: #fff;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 3px 10px rgba(41,121,255,.25);
}
.btn-primary-sm:active { transform: scale(.97); }
.btn-ghost {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text2);
  font-size: 15px; font-weight: 500;
  cursor: pointer;
}
.btn-ghost:active { background: rgba(0,0,0,.03); }
.btn-ghost-sm {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: transparent;
  color: var(--text2);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.btn-ghost-sm:active { background: rgba(0,0,0,.03); }
.btn-outline {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--card-border);
  background: transparent;
  color: var(--text2);
  font-size: 13px; font-weight: 500;
  cursor: pointer; width: 100%;
  justify-content: center;
}
.btn-outline:active { background: rgba(0,0,0,.02); }
.btn-danger {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(240,112,112,.3);
  background: rgba(240,112,112,.1);
  color: var(--bad);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn-danger:active { background: rgba(240,112,112,.18); }

/* ── Inputs ── */
.input-label {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 6px;
}
.text-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,.02);
  color: var(--text);
  font-size: 16px; font-family: inherit;
  outline: none; transition: border-color .15s;
}
.text-input:focus {
  border-color: rgba(41,121,255,.35);
  box-shadow: 0 0 0 3px rgba(41,121,255,.1);
}
.text-input::placeholder { color: var(--text3); }
.select-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: rgba(0,0,0,.02);
  color: var(--text);
  font-size: 16px; font-family: inherit;
  outline: none;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237e7e9a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.select-input option { background: var(--bg2); color: var(--text); }

/* ── Toggle switch ── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.toggle-row + .toggle-row { border-top: 1px solid var(--card-border); }
.toggle-label { font-size: 15px; }
.toggle-input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  position: relative;
  width: 48px; height: 28px; flex-shrink: 0;
  border-radius: 14px;
  background: rgba(10,22,40,.14);
  border: 1px solid rgba(10,22,40,.14);
  transition: background .2s, border-color .2s;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.toggle-input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle-input:checked + .toggle-track::after { transform: translateX(20px); }
.pref-toggles { display: flex; flex-direction: column; }
.toggle-label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.toggle-label::before {
  content: attr(data-icon);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(41,121,255,.1);
  color: var(--accent);
  font-size: 14px;
}

/* ── Option rows (consent dialog) ── */
.option-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.option-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: rgba(0,0,0,.02);
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.option-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.option-text strong { font-size: 14px; }
.option-text span { font-size: 12px; color: var(--text3); }

/* ── Wardrobe grid ── */
.wardrobe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.today-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(41,121,255,.12), rgba(0,176,255,.08), rgba(0,230,118,.08));
  border: 1px solid rgba(41,121,255,.12);
}
.today-cta-compact {
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(234,243,255,.88));
  border: 1px solid rgba(41,121,255,.1);
}
.today-cta-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.today-cta-kicker,
.wardrobe-explainer-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.today-cta h3,
.wardrobe-explainer-body h3 {
  font-size: 15px;
  line-height: 1.25;
  color: var(--text);
}
.today-cta-btn,
.wardrobe-explainer-btn {
  flex-shrink: 0;
}
.wardrobe-explainer {
  margin-top: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.82), rgba(234,243,255,.9));
  border: 1px solid rgba(41,121,255,.14);
  box-shadow: 0 10px 28px rgba(41,121,255,.08);
}
.wardrobe-explainer-body {
  padding: 18px 16px;
  color: var(--text2);
  font-size: 14px;
  line-height: 1.55;
  display: grid;
  gap: 8px;
}
.wardrobe-explainer-body p { max-width: 34ch; }
.wardrobe-item {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.wardrobe-item:active { transform: scale(.97); border-color: rgba(41,121,255,.25); }
.wardrobe-item-photo {
  width: 100%; aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg2);
}
.wardrobe-item-placeholder {
  width: 100%; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg2);
  font-size: 32px;
}
.wardrobe-item-info { padding: 10px 12px; }
.wardrobe-item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wardrobe-item-meta { font-size: 12px; color: var(--text3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 430px) {
  .hero-main {
    align-items: center;
    flex-direction: column;
    gap: 6px;
  }
  .today-rec-copy h3 {
    font-size: 20px;
  }
}

/* ── Dialogs ── */
.dialog {
  width: min(480px, calc(100vw - var(--safe-l) - var(--safe-r) - 32px));
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 0;
  background: var(--bg2);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
}
.dialog[open] {
  margin: auto;
}
.dialog::backdrop { background: rgba(0,0,0,.6); }
.dialog-card { padding: 28px 24px; position: relative; margin: 0 auto; }
.dialog-title { font-size: 20px; font-weight: 700; margin: 0; }
.dialog-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.06);
  font-size: 20px; line-height: 1; color: var(--text3);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.dialog-close:hover { background: rgba(0,0,0,.12); color: var(--text); }
.dialog-inner { padding: 24px 20px; }
.dialog-inner h2 { font-size: 18px; font-weight: 700; }
.dialog-subtitle { font-size: 14px; color: var(--text3); margin-top: 4px; }
.dialog-body { font-size: 14px; color: var(--text2); margin-top: 8px; }
.dialog-steps { font-size: 14px; color: var(--text2); margin: 12px 0; padding-left: 20px; line-height: 1.8; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* Full-screen dialogs (item form) */
.dialog-full {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0; border: none;
  margin: 0;
}
@media (min-width: 600px) {
  .dialog-full {
    width: min(520px, 90vw);
    height: auto; max-height: 90vh;
    border-radius: 20px;
    margin: auto;
    border: 1px solid var(--card-border);
  }
}
.dialog-top-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding:
    calc(12px + var(--safe-t))
    calc(16px + var(--safe-r))
    12px
    calc(16px + var(--safe-l));
  border-bottom: 1px solid var(--card-border);
  position: sticky; top: 0;
  background: var(--bg2);
  z-index: 1;
}
.dialog-top-bar h2 { font-size: 16px; font-weight: 600; min-width: 0; }
.dialog-top-spacer { width: 72px; flex-shrink: 0; }
.dialog-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  max-height: 100%;
}

/* ── Forms ── */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding:
    20px
    calc(16px + var(--safe-r))
    calc(108px + var(--safe-b))
    calc(16px + var(--safe-l));
}
.form-group { display: flex; flex-direction: column; }
.form-row { display: flex; gap: 12px; }
.form-row > .form-group { flex: 1; }

.file-upload {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px;
  border: 1px dashed var(--card-border);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,.01);
  color: var(--text3);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s;
}
.file-upload:active { border-color: var(--accent); }
.file-upload input[type="file"] { position: absolute; opacity: 0; pointer-events: none; width: 0; }
.file-upload-primary {
  border-style: solid;
  border-color: rgba(41,121,255,.16);
  background: linear-gradient(135deg, rgba(41,121,255,.08), rgba(0,176,255,.05));
  color: var(--accent);
  font-weight: 700;
}

.item-hero-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(41,121,255,.08);
  background: linear-gradient(180deg, rgba(41,121,255,.06), rgba(255,255,255,.7));
}
.item-visual {
  position: relative;
  width: 100%;
  min-height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(41,121,255,.12), rgba(0,230,118,.12));
}
.item-visual img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}
.item-visual-placeholder {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 10px;
}
.item-visual-emoji { font-size: 48px; }
.item-visual-name { font-size: 18px; font-weight: 700; color: var(--text); }
.item-visual-meta { font-size: 14px; color: var(--text2); max-width: 260px; }
.img-remove {
  position: absolute; top: -6px; right: -6px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--bad);
  color: #fff;
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  line-height: 1;
}
.item-photo-status { min-height: 18px; }
.item-manual-card { overflow: hidden; }
.item-manual-body {
  display: grid;
  gap: 16px;
  padding: 0 16px 16px;
}
.item-save-bar {
  position: sticky;
  bottom: calc(12px + var(--safe-b));
  z-index: 2;
  padding-top: 8px;
  display: grid;
  gap: 10px;
}
.item-save-btn {
  width: 100%;
  min-height: 52px;
  box-shadow: 0 12px 30px rgba(41,121,255,.28);
}
.item-delete-btn { min-height: 48px; }
.btn-danger-primary {
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, #ff6b6b, #e53935);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(229,57,53,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.btn-danger-primary:active { transform: scale(.98); }

/* ── Loading state ── */
.loading-state {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  font-size: 14px; color: var(--text3);
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(0,0,0,.06);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Install banner ── */
.install-banner {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-b) + 8px);
  left: var(--pad); right: var(--pad);
  z-index: 35;
}
.install-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  background: linear-gradient(135deg, #eaf3ff, #f8fbff);
  border: 1px solid rgba(41,121,255,.14);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
}
.install-inner .btn-primary-sm {
  background: #0a1628;
  color: #fff;
  box-shadow: 0 8px 18px rgba(10,22,40,.18);
}
.install-inner .btn-ghost-sm {
  background: rgba(255,255,255,.9);
}

/* ── About ── */
.settings-list {
  display: grid;
}
.settings-row {
  width: 100%;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: background .18s ease, opacity .18s ease;
}
.settings-row:hover {
  background: rgba(41,121,255,.04);
}
.settings-row + .settings-row {
  border-top: 1px solid rgba(10,22,40,.05);
}
.settings-row-static {
  cursor: default;
}
.settings-row-static:hover {
  background: none;
}
.settings-row:disabled {
  cursor: wait;
  opacity: .72;
}
.settings-row.is-busy .settings-chevron {
  opacity: .55;
}
.settings-copy {
  display: grid;
  gap: 3px;
}
.settings-copy strong {
  font-size: 14px;
}
.settings-copy span {
  font-size: 13px;
  color: var(--text3);
  line-height: 1.45;
}
.settings-chevron {
  color: var(--text3);
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.settings-row-danger .settings-copy strong {
  color: #c62828;
}
.settings-feedback {
  margin: -2px 0 14px;
  padding: 0 2px;
}
.settings-feedback[data-tone="success"] {
  color: #1f7a1f;
}
.settings-feedback[data-tone="error"] {
  color: #b3261e;
}
.settings-feedback[data-tone="busy"] {
  color: var(--accent);
}
.about-content {
  padding: 0 16px 16px;
  font-size: 13px; line-height: 1.6;
  color: var(--text3);
}
.about-content a { color: var(--accent); text-decoration: none; }
.about-content p + p { margin-top: 8px; }

/* ── Desktop enhancements ── */
@media (min-width: 768px) {
  :root { --pad: 24px; }
  .wardrobe-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  body { max-width: 600px; margin: 0 auto; border-left: 1px solid var(--card-border); border-right: 1px solid var(--card-border); }
  .wardrobe-grid { grid-template-columns: repeat(4, 1fr); }
}
