/* Home (screens/home.js) and Settings (screens/settings.js).
   Scoped under [data-screen="home"] / .hm- and [data-screen="settings"] / .st- */

/* =========================================================
   HOME
   ========================================================= */
[data-screen='home'] { padding-top: calc(var(--safe-top) + 12px); }
[data-screen='home'] > .hm-slot:not(:empty) { margin-top: 16px; }
[data-screen='home'] a { -webkit-touch-callout: none; }

/* ---------- Header ---------- */
.hm-head { margin-bottom: 18px; }
.hm-bar { display: flex; align-items: center; gap: 12px; min-height: 46px; }
.hm-logo {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line), var(--shadow-1);
}
.hm-date { flex: 1; min-width: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-settings { width: 44px; height: 44px; }
.hm-greet { margin-top: 18px; font-size: 36px; }
.hm-greet em { font-style: italic; color: var(--rose-ink); }
.hm-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.hm-wx { min-height: 30px; padding: 5px 12px 5px 9px; font-size: 12.5px; gap: 6px; color: var(--ink-2); }
.hm-wx strong { color: var(--plum); font-weight: 600; }
.hm-wx .hm-wx-ic svg { width: 17px; height: 17px; color: var(--olive-700); }
.hm-wx.loading { color: var(--muted); }
.hm-wx.loading span { animation: hm-pulse 1.4s ease-in-out infinite; }
@keyframes hm-pulse { 50% { opacity: 0.45; } }

/* ---------- Install hint ---------- */
.hm-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 12px 16px;
  background: var(--olive-50);
  animation: hm-rise 0.4s var(--ease) both;
}
.hm-hint.closing { animation: hm-out 0.26s ease both; }
.hm-hint-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-hint-text strong { font-size: 14.5px; color: var(--plum); }
.hm-hint-text strong, .hm-hint-text > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-hint-text > span { font-size: 13px; color: var(--ink-2); }
.hm-hint-text > .hm-hint-warn { margin-top: 2px; white-space: normal; overflow: visible; line-height: 1.35; color: var(--olive-700); font-weight: 500; }
.hm-inline-ic { display: inline-block; vertical-align: -3px; }
.hm-inline-ic svg { width: 15px; height: 15px; color: var(--olive-700); }
.hm-hint-close { width: 44px; height: 44px; color: var(--ink-2); }
@keyframes hm-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes hm-out { to { opacity: 0; transform: scale(0.97); } }

/* ---------- Getting-started checklist ---------- */
.hm-check { padding-bottom: 8px; }
.hm-check-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hm-check-head .card-title { margin-top: 4px; }
.hm-check-count {
  flex: none;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--olive-50);
  color: var(--olive-700);
  font-size: 12px;
  font-weight: 600;
}
.hm-progress { height: 6px; margin: 14px 0 4px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.hm-progress span { display: block; height: 100%; border-radius: inherit; background: var(--olive); transition: width 0.6s var(--ease); }
.hm-steps { list-style: none; margin: 0; padding: 0; }
.hm-steps li + li .hm-step { border-top: 1px solid var(--line); }
.hm-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 0;
  color: inherit;
  text-decoration: none;
}
.hm-step:active { opacity: 0.7; }
.hm-step-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
}
.hm-step-mark svg { width: 17px; height: 17px; }
.hm-step.next .hm-step-mark { background: var(--olive-50); color: var(--olive-700); box-shadow: inset 0 0 0 1.5px var(--olive-100); }
.hm-step.done .hm-step-mark { background: var(--olive); color: var(--on-olive); }
.hm-step-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hm-step-text strong { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.hm-step-text span { font-size: 12.5px; color: var(--muted); }
.hm-step.done .hm-step-text strong { color: var(--muted); font-weight: 500; }
.hm-step.next .hm-step-text strong { color: var(--plum); }
.hm-step-go svg { width: 18px; height: 18px; color: var(--muted); }

/* ---------- Today ---------- */
.hm-today { padding: 18px; }
.hm-today-head { display: flex; align-items: center; justify-content: space-between; }
.hm-today-head .eyebrow { margin: 0; }
.hm-today .chips.scroll { margin: 10px -18px 0; padding: 4px 18px; scroll-padding-left: 18px; }
.hm-today .chip { position: relative; }
.hm-today .chip::after { content: ''; position: absolute; inset: -4px 0; } /* 44px tap height */
.hm-styles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.hm-styles-label { margin-right: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }
.hm-style, .hm-style-add {
  min-height: 34px;
  padding: 0 13px;
  font-size: 13px;
  background: transparent;
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  text-decoration: none;
}
/* Text darkened from --rose-ink (3.2:1) to about 5:1 on rose-50 for 13px labels */
.hm-style[aria-pressed='true'] { background: var(--rose-50); color: color-mix(in srgb, var(--rose-ink) 60%, var(--plum)); box-shadow: inset 0 0 0 1.5px var(--rose); }
.hm-style-add { position: relative; color: var(--olive-700); }
.hm-style-add::after { content: ''; position: absolute; inset: -5px 0; }
.hm-style-add svg { width: 14px; height: 14px; }

.hm-stage-slot { margin-top: 14px; }
.hm-stage {
  position: relative;
  height: 372px;
  border-radius: var(--r-md);
  overflow: hidden;
  background:
    radial-gradient(70% 55% at 50% 42%, rgba(252, 249, 244, 0.95), rgba(252, 249, 244, 0) 72%),
    linear-gradient(180deg, var(--surface-2), var(--khaki-50));
}
.hm-stage.skeleton { background: var(--surface-2); }
.hm-stage.skeleton::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(252, 249, 244, 0.6) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: hm-shimmer 1.3s linear infinite;
}
@keyframes hm-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.hm-badge {
  position: absolute;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--r-pill);
  background: rgba(252, 249, 244, 0.8);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 500;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hm-badge.left { left: 12px; }
.hm-badge.right { right: 12px; }
.hm-badge svg { width: 14px; height: 14px; color: var(--olive-700); }

.hm-figure { position: absolute; left: 50%; top: 30px; width: 136px; height: 300px; transform: translateX(-50%); }
.hm-figure svg { position: relative; z-index: 1; width: 100%; height: 100%; animation: hm-fig-in 0.5s var(--ease) both; }
.hm-floor {
  position: absolute;
  left: 50%; bottom: 4px;
  width: 132px; height: 18px;
  margin-left: -66px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(58, 26, 51, 0.16), rgba(58, 26, 51, 0));
}
.hm-avatar-missing { display: grid; place-items: center; height: 100%; color: var(--muted); }
.hm-avatar-missing svg { width: 64px; height: 64px; }
@keyframes hm-fig-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }

/* Pieces floating around the avatar */
.hm-float {
  position: absolute;
  z-index: 3;
  display: block;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--surface), var(--shadow-2);
  animation: hm-pop 0.5s var(--ease) both, hm-bob 5s ease-in-out infinite;
  animation-delay: calc(0.08s * var(--i, 0)), calc(0.6s + 0.7s * var(--i, 0));
}
.hm-float img, .hm-float-swatch { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.hm-float.lt { left: 16px; top: 62px; }
.hm-float.rt { right: 16px; top: 74px; }
.hm-float.lm { left: 10px; top: 150px; }
.hm-float.rm { right: 10px; top: 160px; }
.hm-float.lb { left: 20px; top: 240px; }
.hm-float.rb { right: 20px; top: 246px; }
.hm-float:active { transform: scale(0.95); }
.hm-float-tick {
  position: absolute;
  right: -3px; bottom: -3px;
  display: grid; place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--olive);
  color: var(--on-olive);
  box-shadow: 0 0 0 2px var(--surface);
}
.hm-float-tick svg { width: 13px; height: 13px; }
.hm-float.ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  border: 1.5px dashed var(--olive);
  background: rgba(252, 249, 244, 0.7);
  box-shadow: none;
  color: var(--olive-700);
}
.hm-float.ph svg { width: 20px; height: 20px; }
.hm-float.ph small { font-size: 10.5px; font-weight: 600; line-height: 1; }
.hm-float.ph.soft { border-color: var(--line-strong); color: var(--muted); opacity: 0.85; }
@keyframes hm-pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes hm-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }

.hm-stage-foot {
  position: absolute;
  left: 14px; right: 10px; bottom: 10px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hm-palette { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); }
.hm-dots { display: inline-flex; }
.hm-dots i, .hm-q-ic.swatches i {
  display: block;
  width: 14px; height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}
.hm-dots i + i { margin-left: -3px; }
.hm-shuffle { width: 44px; height: 44px; background: var(--surface); color: var(--plum); box-shadow: var(--shadow-1); }

.hm-look-name { margin: 14px 2px 0; font-size: 14px; line-height: 1.4; color: var(--ink); }
.hm-look-k { display: block; margin-bottom: 2px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hm-tip { margin-top: 12px; }
.hm-tip > span:last-child { flex: 1; }
.hm-actions { display: grid; grid-template-columns: 1.7fr 1fr; gap: 8px; margin-top: 14px; }
.hm-actions .btn { padding: 0 12px; font-size: 15px; white-space: nowrap; }
.hm-wear.worn { background: var(--olive-50); color: var(--olive-700); box-shadow: none; }

.hm-look.is-empty .hm-stage { height: 340px; }
.hm-empty-copy { margin: 16px 6px 14px; text-align: center; }
.hm-empty-copy p { margin: 6px auto 0; max-width: 280px; font-size: 14px; color: var(--ink-2); }

/* ---------- Impact ---------- */
.hm-impact { display: block; color: inherit; text-decoration: none; transition: transform 0.15s var(--ease); }
.hm-impact:active { transform: scale(0.99); }
.hm-impact-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hm-impact-head .card-title { margin-top: 4px; }
.hm-go svg { width: 20px; height: 20px; color: var(--muted); margin-top: 4px; }
.hm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.hm-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 12px 10px 12px 12px;
  border-radius: 16px;
  background: var(--surface-2);
}
.hm-stat-ic {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  margin-bottom: 6px;
  border-radius: 50%;
}
.hm-stat-ic svg { width: 17px; height: 17px; }
.hm-stat-ic { background: var(--surface); }
.hm-stat-ic.sage { color: var(--olive-700); }
.hm-stat-ic.rose { color: var(--rose-ink); }
.hm-stat-ic.khaki { color: var(--ink-2); }
.hm-stat.sage { background: var(--olive-50); }
.hm-stat.rose { background: var(--rose-50); }
.hm-stat.khaki { background: var(--khaki-50); }
.hm-stat strong { font-family: var(--font-serif); font-weight: 500; font-size: 23px; line-height: 1.1; color: var(--plum); white-space: nowrap; }
.hm-stat > span:last-child { font-size: 11.5px; color: var(--ink-2); line-height: 1.25; }
.hm-impact-foot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-2);
}
.hm-impact-foot svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--olive-700); }

/* ---------- Quick actions ---------- */
.hm-quick { margin-top: 26px; }
.hm-quick .section-head { margin-bottom: 10px; }
.hm-q-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hm-q {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 128px;
  padding: 16px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition: transform 0.15s var(--ease);
}
.hm-q:active { transform: scale(0.97); }
.hm-q-ic {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  margin-bottom: 10px;
  border-radius: 50%;
}
.hm-q-ic svg { width: 21px; height: 21px; }
.hm-q-ic.sage { background: var(--olive-50); color: var(--olive-700); }
.hm-q-ic.rose { background: var(--rose-50); color: var(--rose-ink); }
.hm-q-ic.swatches { display: flex; align-items: center; justify-content: center; width: auto; padding: 0 10px; border-radius: var(--r-pill); background: var(--khaki-50); }
.hm-q-ic.swatches i { width: 16px; height: 16px; }
.hm-q-ic.swatches i + i { margin-left: -5px; }
.hm-q strong { font-size: 15px; font-weight: 600; color: var(--plum); }
.hm-q > span:last-child { font-size: 12.5px; line-height: 1.35; color: var(--muted); }

/* ---------- Footer ---------- */
.hm-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 34px 0 4px;
  color: var(--muted);
}
.hm-foot img { width: 34px; height: 34px; border-radius: 50%; opacity: 0.9; box-shadow: 0 0 0 1px var(--line); }
.hm-foot span { font-family: var(--font-serif); font-style: italic; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  .hm-float, .hm-figure svg, .hm-hint, .hm-stage.skeleton::after, .hm-wx.loading span { animation: none !important; }
}

/* =========================================================
   SETTINGS
   ========================================================= */
.st-group { margin-top: 26px; }
.st-group > .eyebrow { display: block; margin: 0 4px 8px; }
.st-card { padding: 16px; }
.st-card + .st-card { margin-top: 10px; }
.st-hint { margin: 8px 2px 0; font-size: 12.5px; color: var(--muted); }
.st-hint.st-install-warn { margin-top: 10px; color: var(--olive-700); font-weight: 500; line-height: 1.4; }
.st-saved { display: inline-flex; align-items: center; gap: 4px; color: var(--olive-700); font-weight: 600; opacity: 0; transition: opacity 0.2s; }
.st-saved.show { opacity: 1; }
.st-saved svg { width: 14px; height: 14px; }
.st-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.st-label-row .label { margin-bottom: 8px; }
.st-chips .chip { position: relative; min-height: 40px; }
.st-chips .chip::after { content: ''; position: absolute; inset: -2px 0; }

.st-loc { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-top: 12px; }
.st-loc .btn { min-height: 46px; padding: 0 12px; font-size: 14.5px; white-space: nowrap; }
.st-loc .btn[aria-pressed='true'] { background: var(--olive-50); color: var(--olive-700); box-shadow: inset 0 0 0 1.5px var(--olive); }
.st-now { display: flex; align-items: center; gap: 12px; }
.st-now-ic {
  display: grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: var(--olive-50);
  color: var(--olive-700);
}
.st-now-ic svg { width: 22px; height: 22px; }
.st-now strong { display: block; font-size: 15px; color: var(--plum); }
.st-now span { display: block; font-size: 13px; color: var(--ink-2); }
.st-msg { margin: 10px 2px 0; font-size: 13px; color: var(--ink-2); }
.st-msg.bad { color: var(--danger); }
.st-msg:empty { display: none; }

.st-steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.st-steps li { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; font-size: 14px; color: var(--ink); }
.st-steps li + li { border-top: 1px solid var(--line); }
.st-steps li::before {
  counter-increment: st;
  content: counter(st);
  display: grid; place-items: center;
  width: 28px; height: 28px; flex: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--plum);
  font-size: 13px;
  font-weight: 600;
}
.st-steps .st-ic { display: inline-block; vertical-align: -4px; color: var(--olive-700); }
.st-steps .st-ic svg { width: 18px; height: 18px; }
.st-installed { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--olive-700); font-weight: 500; }
.st-installed svg { width: 20px; height: 20px; }

.st-text { display: flex; gap: 12px; align-items: flex-start; }
.st-text p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.st-text .st-now-ic { width: 40px; height: 40px; }
.st-sources { margin: 0; padding: 0; list-style: none; }
.st-sources li { position: relative; padding: 8px 0 8px 18px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.st-sources li + li { border-top: 1px solid var(--line); }
.st-sources li::before { content: ''; position: absolute; left: 2px; top: 15px; width: 6px; height: 6px; border-radius: 50%; background: var(--olive); }
.st-sources .st-est { color: var(--muted); font-style: italic; }

.st-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  color: inherit;
  text-align: left;
  text-decoration: none;
}
.st-row:active { transform: scale(0.99); background: var(--surface-2); }
.st-row + .st-row { margin-top: 10px; }
.st-row .st-row-text { flex: 1; min-width: 0; }
.st-row strong { display: block; font-size: 15px; font-weight: 600; color: var(--plum); }
.st-row small { display: block; font-size: 12.5px; color: var(--muted); }
.st-row .st-chev svg { width: 18px; height: 18px; color: var(--muted); }
.st-row.danger strong { color: var(--danger); }
.st-row.danger .st-now-ic { background: rgba(168, 70, 75, 0.1); color: var(--danger); }

.st-about { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 34px 0 6px; }
.st-about img { width: 92px; height: 92px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line), var(--shadow-2); }
.st-about h2 { margin: 14px 0 0; font-family: var(--font-serif); font-weight: 500; font-size: 22px; color: var(--plum); }
.st-about p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-2); }
.st-about .st-tag { font-family: var(--font-serif); font-style: italic; font-size: 16px; color: var(--rose-ink); }
.st-about .st-ver { margin-top: 10px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
