/* ==========================================================================
   IRONITT v2 — Home (js/dashboard.js)
   --------------------------------------------------------------------------
   One reading column. The page scrolls; nothing is fitted to the viewport.
   Shared pieces (.v2-card, .v2-eyebrow, .v2-person, .v2-btn, .side-meter,
   .hex-badge, .streak-days) come from css/v2/shell.css.
   ========================================================================== */

.home {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px var(--space-sm) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---- Greeting + the one next step ------------------------------------- */
.home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
}
.home-head-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.home-greet {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: var(--font-size-xl);
  line-height: 34px;
  letter-spacing: -0.02em;
  font-weight: var(--font-weight-bold);
}
/* The name is identity, and identity is the brand: green into AURA cyan. */
.home-name {
  background: linear-gradient(90deg, var(--accent-color) 0%, var(--aura-core) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.light-mode .home-name {
  background-image: linear-gradient(90deg, var(--accent-solid) 0%, var(--aura-deep) 100%);
}
.home-finding { margin: 0; color: var(--text-secondary); font-size: var(--font-size-sub); }
.home-head .v2-btn { flex: none; }

/* ---- Today's hearth ---------------------------------------------------- */
.hearth { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.hearth-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); }
.hearth-total { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hearth-total b {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-size: var(--font-size-title);
  line-height: 28px;
  color: var(--iron-gold);
}
.light-mode .hearth-total b { color: var(--iron-gold-deep); }

/* 100% stacked: each segment's flex-grow is its IRON. */
.hearth-bar {
  display: flex;
  gap: 2px;
  height: 14px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--bg-tertiary);
}
.hearth-seg { flex: 1 1 0; min-width: 4px; }
.hearth-seg-1 { background: var(--iron-gold); }
.hearth-seg-2 { background: var(--iron-gold-deep); }
.hearth-seg-3 { background: color-mix(in srgb, var(--iron-gold-deep) 60%, var(--bg-tertiary)); }
.hearth-seg-4 { background: var(--text-muted); }
.light-mode .hearth-seg-1 { background: var(--iron-gold-deep); }
.light-mode .hearth-seg-2 { background: color-mix(in srgb, var(--iron-gold-deep) 70%, var(--text-primary)); }
.light-mode .hearth-seg-3 { background: var(--iron-gold); }

.hearth-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  color: var(--text-secondary);
  font-size: 13px;
}
.hearth-key { display: inline-flex; align-items: center; gap: 6px; }
.hearth-key b { color: var(--text-primary); font-weight: var(--font-weight-semibold); font-variant-numeric: tabular-nums; }
.hearth-swatch { width: 8px; height: 8px; border-radius: 2px; }
.hearth-link {
  margin-left: auto;
  padding: 0;
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
  transition: color var(--transition-fast);
}
.hearth-link:hover { color: var(--accent-color); }

/* Quiet empty state: an icon and a sentence. */
.home-quiet {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.home-quiet .hearth-link { margin-left: 0; }

/* ---- Rows: requests + feed -------------------------------------------- */
.home-section { display: flex; flex-direction: column; }
.home-section > .v2-eyebrow { margin-bottom: 4px; }
.home-row,
.feed-row {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}
.home-row:last-child,
.feed-row:last-child { border-bottom: 0; }
.home-row,
.feed-row--inline { align-items: center; }
.home-row-text { flex: 1; min-width: 0; }
.home-muted { color: var(--text-secondary); }
.home-iron { color: var(--iron-gold); }
.light-mode .home-iron { color: var(--iron-gold-deep); }

.feed-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.feed-row-body {
  margin: 0;
  font-size: var(--font-size-md);
  line-height: 24px;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-row-actions { display: flex; gap: var(--space-md); margin-top: 2px; }
.feed-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--text-secondary);
  font-size: 13px;
  transition: color var(--transition-fast);
}
.feed-act:hover { color: var(--text-primary); }
.feed-act.is-active { color: var(--accent-color); }

/* ---- Streak + quests --------------------------------------------------- */
.home-pair {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 14px;
}
.home-mini { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
/* Where the side column shows the streak, Home shows only the quests. */
@media (min-width: 1241px) {
  .home-pair { grid-template-columns: minmax(0, 1fr); }
  .home-streak { display: none; }
}

.quest-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  color: var(--text-primary);
}
.quest-row:last-child { border-bottom: 0; padding-bottom: 0; }
.quest-row-top { display: flex; justify-content: space-between; gap: var(--space-sm); }
.quest-row-title { font-weight: var(--font-weight-semibold); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.quest-row-count { flex: none; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.quest-row-reward { font-size: var(--font-size-xs); color: var(--text-muted); }
.quest-meter .side-meter-fill { background: var(--iron-gold); }
.light-mode .quest-meter .side-meter-fill { background: var(--iron-gold-deep); }
.quest-row.is-claimed { color: var(--text-muted); }
.quest-row.is-claimed .quest-meter .side-meter-fill { background: var(--text-muted); }

/* ---- Phones ------------------------------------------------------------ */
@media (max-width: 768px) {
  .home { padding: 4px var(--space-xs) var(--space-lg); gap: 22px; }
  .home-greet { font-size: var(--font-size-title); line-height: 30px; }
  .home-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .home-head .v2-btn { align-self: flex-start; }
  .home-pair { grid-template-columns: minmax(0, 1fr); }
  .hearth { padding: 16px; }
}
