/* Home screen - design/screens/{Before,After,Empty,AfterPro,EmptyPro}.html */

.hm {
  --hm-ink: #0f172a;
  --hm-muted: #5b6878;
  --hm-body: #334155;
  --hm-soft: #94a3b8;
  --hm-blue: #1d6fc4;
  --hm-blue-rgb: 29, 111, 196;
  --hm-sky: #0369a1;
  --hm-sky-deep: #075985;
  --hm-sky-rgb: 2, 132, 199;
  --hm-green: #15803d;
  --hm-line: rgba(15, 23, 42, 0.07);
  --hm-card: #ffffff;
  --hm-glass: rgba(255, 255, 255, 0.72);
  --hm-glass-line: rgba(255, 255, 255, 0.85);
  --hm-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  --hm-badge: linear-gradient(135deg, #f59e0b, #d97706);
  color: var(--hm-ink);
}

.hm [hidden] { display: none !important; }
.hm a { text-decoration: none; color: inherit; }
.hm svg.hm-i {
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.hm-chev { width: 16px; height: 16px; color: var(--hm-soft); stroke-width: 2.5 !important; }

/* ── Topbar identity ─────────────────────────────────────── */
.hm-brand-ava {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  border: 2px solid #fff; box-sizing: border-box; background: #dbeafe; color: #1e40af;
  font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(51, 144, 236, 0.16);
}
.hm-brand-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-brand-sub { display: flex; align-items: center; gap: 5px; min-width: 0; }
.hm-brand-sub > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-brand-dot { color: #cbd5e1; flex-shrink: 0; }
.hm-rating { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; text-decoration: none; }
.hm-rating svg { width: 11px; height: 11px; fill: #f59e0b; stroke: none; }
.hm-rating b { font-size: 12px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.hm-rating span { font-size: 11px; font-weight: 500; color: #5b6878; font-variant-numeric: tabular-nums; }

/* ── Shared blocks ───────────────────────────────────────── */
.hm-section { margin-bottom: 14px; }
.hm-eyebrow {
  font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--hm-muted);
}
.hm-glass {
  background: var(--hm-glass); border: 1px solid var(--hm-glass-line);
  border-radius: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.hm-divider { height: 1px; background: var(--hm-line); margin-right: 8px; }
.hm-badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; box-sizing: border-box;
  background: var(--hm-badge); color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35); font-variant-numeric: tabular-nums;
}
.hm-face {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box;
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.hm-face + .hm-face { margin-left: -8px; }
.hm-face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-face--lg { width: 30px; height: 30px; font-size: 12px; }
.hm-tone-0 { background: #dbeafe; color: #1e40af; }
.hm-tone-1 { background: #fee7c7; color: #92400e; }
.hm-tone-2 { background: #e4e0fb; color: #3730a3; }
.hm-tone-3 { background: #d1fae5; color: #065f46; }
.hm-tone-4 { background: #fce7f3; color: #9d174d; }

/* ── New user (Before) ───────────────────────────────────── */
.hm-hero { margin: 4px 0 18px; }
.hm-hero h1 {
  margin: 0; font-size: 21px; font-weight: 800; line-height: 1.2; letter-spacing: -0.03em;
  color: var(--hm-ink); text-wrap: balance;
}
.hm-hero p { margin: 7px 0 0; font-size: 13px; line-height: 1.45; font-weight: 500; color: #475569; }

.hm-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.hm-action {
  min-height: 128px; box-sizing: border-box; border-radius: 20px; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--hm-card); border: 1px solid rgba(var(--hm-blue-rgb), 0.16); box-shadow: var(--hm-shadow);
  transition: transform .15s ease;
}
.hm-action:active { transform: scale(0.98); }
.hm-action__icon {
  width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(var(--hm-blue-rgb), 0.1); color: var(--hm-blue);
}
.hm-action__icon svg { width: 20px; height: 20px; stroke-width: 2.25; }
.hm-action__title { display: block; font-size: 16px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; color: var(--hm-ink); }
.hm-action__desc { display: block; margin-top: 4px; font-size: 12px; line-height: 1.3; font-weight: 500; color: var(--hm-muted); }
.hm-action--primary { background: var(--hm-blue); border-color: transparent; box-shadow: 0 8px 22px rgba(var(--hm-blue-rgb), 0.3); }
.hm-action--primary .hm-action__icon { background: rgba(255, 255, 255, 0.2); color: #fff; }
.hm-action--primary .hm-action__title { color: #fff; }
.hm-action--primary .hm-action__desc { color: rgba(255, 255, 255, 0.92); }

.hm-smart {
  display: block; position: relative; overflow: hidden; border-radius: 20px; padding: 15px 16px; margin-bottom: 14px;
  background: linear-gradient(135deg, rgba(var(--hm-sky-rgb), 0.10), rgba(var(--hm-sky-rgb), 0.02) 62%), rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(var(--hm-sky-rgb), 0.20); box-shadow: 0 8px 24px rgba(var(--hm-sky-rgb), 0.12);
}
.hm-smart::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(280px 110px at 92% 0%, rgba(var(--hm-sky-rgb), 0.16), transparent 70%);
}
.hm-smart > * { position: relative; }
.hm-smart__head { display: flex; align-items: center; gap: 10px; }
.hm-smart__title { flex: 1; min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.22; }
.hm-smart__title span { color: var(--hm-sky-deep); }
.hm-smart__head svg { width: 20px; height: 20px; color: var(--hm-sky); stroke-width: 2.5; }
.hm-smart__desc { margin-top: 6px; font-size: 12.5px; line-height: 1.45; font-weight: 500; color: var(--hm-muted); }
.hm-smart__middle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; margin-bottom: 4px;
}
.hm-smart__stats {
  display: flex; flex-direction: column; gap: 3.5px; min-width: 0; flex: 1;
}
.hm-smart__stat-row {
  display: flex; align-items: baseline; gap: 5px;
  font-size: 12.5px; font-weight: 500; color: var(--hm-muted); line-height: 1.25;
  white-space: nowrap;
}
.hm-smart__stat-row b {
  color: var(--hm-ink); font-weight: 800; display: inline-block;
  font-variant-numeric: tabular-nums; transform-origin: left center;
}
.hm-smart__stat-row--today {
  color: #047857; font-weight: 600;
}
.hm-smart__stat-row--today b {
  color: #059669; font-weight: 800;
}
.hm-stack { display: flex; align-items: center; min-height: 32px; flex-shrink: 0; }
.hm-stack > * {
  width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid #fff; box-sizing: border-box; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(var(--hm-sky-rgb), 0.18); background: #e2e8f0; object-fit: cover;
}
.hm-stack > * + * { margin-left: -8px; }
.hm-stack__more {
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11.5px; font-weight: 800;
  background: var(--hm-sky-deep) !important;
}
.hm-stack__count {
  display: flex; align-items: center; justify-content: center;
  color: #0369a1; font-size: 11.5px; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%) !important;
  border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(var(--hm-sky-rgb), 0.18);
}

.hm-feed { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.hm-feed__row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px; border-radius: 9px; margin: 0 -6px;
  transition: background-color 2.5s ease;
}
.hm-feed__row--new {
  animation: hmFeedIn .45s cubic-bezier(0.16, 1, 0.3, 1), hmHighlightFade 4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hm-feed__ava { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: #e2e8f0; }
.hm-feed__text {
  flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 12px; line-height: 1.2; color: var(--hm-body);
}
.hm-feed__text b { font-weight: 700; color: var(--hm-ink); }
.hm-feed__text span { color: var(--hm-soft); font-weight: 500; }
.hm-feed__tag { flex-shrink: 0; font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 6px; letter-spacing: .02em; }
.hm-feed__tag--carry { color: var(--hm-sky-deep); background: rgba(var(--hm-sky-rgb), 0.10); }
.hm-feed__tag--seek { color: #4f46e5; background: rgba(79, 70, 229, 0.10); }
.hm-feed__age {
  flex-shrink: 0; min-width: 52px; text-align: right; font-size: 10.5px; font-weight: 600;
  color: var(--hm-soft); font-variant-numeric: tabular-nums;
}
@keyframes hmFeedIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes hmHighlightFade {
  0% { background-color: rgba(254, 240, 138, 0.75); }
  25% { background-color: rgba(254, 240, 138, 0.65); }
  100% { background-color: transparent; }
}

.hm-how { padding: 13px 16px 14px; }
.hm-how .hm-eyebrow { margin-bottom: 10px; }
.hm-how ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.hm-how li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; font-weight: 500; color: var(--hm-body); line-height: 1.3; }
.hm-how li::before {
  counter-increment: hm-step; content: counter(hm-step);
  width: 20px; height: 20px; border-radius: 10px; flex-shrink: 0;
  background: rgba(var(--hm-blue-rgb), 0.12); color: var(--hm-blue);
  font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.hm-how ol { counter-reset: hm-step; }

.hm-community {
  background: var(--hm-glass); border: 1px solid rgba(51, 144, 236, 0.12); border-radius: 18px;
  padding: 12px 14px; box-shadow: var(--hm-shadow);
}
.hm-community__head { display: flex; align-items: center; gap: 10px; }
.hm-community__icon {
  width: 30px; height: 30px; border-radius: 10px; flex-shrink: 0; color: #fff;
  background: linear-gradient(135deg, #3390ec 0%, #1d7cd8 100%);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 10px rgba(51, 144, 236, 0.28);
}
.hm-community__icon svg { width: 15px; height: 15px; }
.hm-community__val { display: block; font-size: 19px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hm-community__lbl { display: block; margin-top: 1px; font-size: 10.5px; font-weight: 600; color: #64748b; }
.hm-community__line { height: 1px; background: rgba(51, 144, 236, 0.12); margin: 10px 0; }
.hm-community__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hm-community__grid b {
  display: block; font-size: 14px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.hm-community__grid span { display: block; margin-top: 1px; font-size: 10px; font-weight: 600; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-skel { border-radius: 8px; }

/* ── Request card (After / Empty / Pro) ──────────────────── */
.hm-req {
  background: var(--hm-card); border: 1px solid rgba(var(--hm-blue-rgb), 0.12); border-radius: 20px;
  padding: 13px 8px 4px 16px; box-shadow: var(--hm-shadow); margin-bottom: 14px;
}
.hm-req__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-right: 8px; }
.hm-chip { padding: 3px 9px; border-radius: 9px; font-size: 10.5px; font-weight: 800; letter-spacing: 0.02em; white-space: nowrap; }
.hm-chip--replies { background: rgba(22, 163, 74, 0.12); color: var(--hm-green); }
.hm-chip--searching { background: rgba(var(--hm-blue-rgb), 0.12); color: var(--hm-blue); }
.hm-route { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 17px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.hm-route > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-route svg { width: 15px; height: 15px; color: var(--hm-soft); stroke-width: 2.5; }
.hm-req__main { display: block; padding: 7px 8px 11px 0; }
.hm-req__meta { display: block; margin-top: 5px; font-size: 12px; font-weight: 500; color: var(--hm-muted); }
.hm-row { display: flex; align-items: center; gap: 10px; padding-right: 8px; }
.hm-row--count { height: 44px; }
.hm-row--count .hm-row__label { flex-grow: 1; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.hm-faces { display: flex; align-items: center; flex-shrink: 0; margin-right: 2px; }
.hm-row--none { height: 42px; font-size: 13.5px; font-weight: 500; color: var(--hm-muted); }
.hm-row--none svg { width: 17px; height: 17px; color: var(--hm-soft); }
.hm-row--reply { min-height: 52px; padding: 5px 8px 5px 0; }
.hm-reply__body { flex-grow: 1; min-width: 0; }
.hm-reply__name, .hm-reply__msg { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-reply__name { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.hm-reply__msg { margin-top: 2px; font-size: 12px; font-weight: 500; color: #475569; }
.hm-reply__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hm-blue); flex-shrink: 0; }

/* multi-request list (AfterPro) */
.hm-row--req { padding: 9px 8px 9px 0; }
.hm-row--req .hm-route { font-size: 15px; gap: 6px; }
.hm-row--req .hm-route svg { width: 13px; height: 13px; }
.hm-row--req .hm-req__meta { margin-top: 3px; font-size: 11.5px; }
.hm-row__grow { flex-grow: 1; min-width: 0; }
.hm-row--new { height: 46px; color: var(--hm-blue); font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.hm-row--new .hm-row__plus {
  width: 22px; height: 22px; border-radius: 11px; flex-shrink: 0;
  background: rgba(var(--hm-blue-rgb), 0.12); color: var(--hm-blue);
  display: flex; align-items: center; justify-content: center;
}
.hm-row--new .hm-row__plus svg { width: 13px; height: 13px; stroke-width: 3; }
.hm-row--new .hm-row__grow { flex-grow: 1; }

/* ── Pro utilities ───────────────────────────────────────── */
.hm-utils { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.hm-util {
  min-height: 60px; box-sizing: border-box; padding: 8px 6px; border-radius: 16px;
  background: var(--hm-glass); border: 1px solid var(--hm-glass-line); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.hm-util svg { width: 18px; height: 18px; color: var(--hm-blue); }
.hm-util span { font-size: 11.5px; font-weight: 700; line-height: 1.15; text-align: center; }

/* Contextual Pro banner and donate card keep their shared identity,
   only the rhythm follows the home grid (14px between blocks). */
.hm .home-pro-banner { margin-bottom: 14px; }
.hm .home-donate-card { margin: 0; }

/* ── Footer stats line ───────────────────────────────────── */
.hm-statline {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; margin-top: 14px;
  font-size: 11.5px; font-weight: 600; color: #475569; text-align: center;
}
.hm-statline svg { width: 12px; height: 12px; color: var(--hm-soft); stroke-width: 3; }

@media (prefers-reduced-motion: reduce) {
  .hm-feed__row--new { animation: none; }
}
