/* V5: home screen (pages/home.js) — "calm and simple".
   One memorable thing: the teal notebook card with the amber ribbon and ONE big number. Everything around it is
   quiet: white cards, 60px rows, 28px between sections, amber only for "late / Pro", red only for money owed.
   Tokens only. (Moved here from app.css: hero card, nudges, getting-started checklist, 7-day chart, business mini.) */

.home-v5 { padding-top: var(--sp-2); padding-bottom: var(--sp-7); }
.home-v5 > * + *, .home-col > * + * { margin-top: var(--sp-3); }
.home-v5 > .home-sec, .home-col > .home-sec { margin-top: var(--section-gap); }
.home-v5 .section-title { margin: 0 var(--sp-1) var(--sp-3); }
.home-v5 .section-title h2 { font-size: var(--fs-lg); }
.home-more { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--sp-3); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 800; color: var(--brand); text-decoration: none; }
.home-more:hover { background: var(--brand-softer); text-decoration: none; }

/* ---------- header: shop name + plan pill (→ subscription) ---------- */
.home-sub { display: inline-flex; align-items: center; gap: var(--sp-2); max-width: 100%; min-width: 0; vertical-align: top; }
.home-sub > .truncate { min-width: 0; }
.home-plan { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 28px; padding: 2px; border-radius: var(--r-pill); text-decoration: none; }
.home-plan:hover { text-decoration: none; }
.home-plan .plan-pill { font-size: 11.5px; padding: 1px 9px; }

/* ---------- balance card ---------- */
.hero-card {
  position: relative; overflow: hidden; padding: var(--sp-6) var(--sp-5) var(--sp-5); border-radius: var(--r-xl); color: #fff;
  background: linear-gradient(150deg, #128A80 0%, #0F766E 45%, #0B5E57 100%);
  box-shadow: 0 18px 34px -20px rgba(11, 94, 87, .8), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.hero-card::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 31px, rgba(255, 255, 255, .055) 31px 32px); pointer-events: none; }
.hero-card::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .12), transparent 70%); inset-inline-start: -90px; bottom: -130px; pointer-events: none; }
.hero-card > * { position: relative; z-index: 1; }
.hero-ribbon { position: absolute; top: 0; inset-inline-end: 22px; width: 20px; height: 32px; background: linear-gradient(180deg, #F59E0B, #FBBF24); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); z-index: 1; }
:root[data-theme='dark'] .hero-card { background: linear-gradient(150deg, #11655E 0%, #0D524C 50%, #0A4440 100%); box-shadow: 0 0 0 1px rgba(94, 234, 212, .14), 0 18px 34px -20px rgba(0, 0, 0, .8); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .hero-card { background: linear-gradient(150deg, #11655E 0%, #0D524C 50%, #0A4440 100%); box-shadow: 0 0 0 1px rgba(94, 234, 212, .14), 0 18px 34px -20px rgba(0, 0, 0, .8); } }
.hero-label { font-size: var(--fs-md); font-weight: 700; color: rgba(255, 255, 255, .88); padding-inline-end: 40px; }
.hero-amount { margin-top: var(--sp-1); font-size: clamp(34px, 10vw, 46px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; white-space: normal; }
.home-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-5); }
.home-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .9);
  font-size: var(--fs-sm); font-weight: 700; transition: background var(--dur), transform 90ms var(--ease);
}
.home-chip:hover { background: rgba(255, 255, 255, .2); }
.home-chip:active { transform: scale(.97); }
.home-chip i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.home-chip.is-late i { background: #FDA29B; box-shadow: 0 0 0 3px rgba(253, 162, 155, .22); }
.home-chip.is-soon i { background: #FCD34D; box-shadow: 0 0 0 3px rgba(252, 211, 77, .22); }
.home-chip b { font-size: var(--fs-md); font-weight: 800; color: #fff; }

/* ---------- one nudge ---------- */
.nudge-line { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: var(--row-min); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); padding-inline: var(--sp-4) var(--sp-2); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: var(--fs-md); text-align: start; box-shadow: var(--card-shadow); }
.nudge-main { display: flex; align-items: center; gap: var(--sp-3); flex: 1 1 auto; min-width: 0; min-height: 44px; text-align: start; }
.nudge-line .nudge-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--brand-softer); color: var(--brand); flex: 0 0 auto; }
.nudge-line.tone-accent .nudge-icon { background: var(--accent-soft); color: var(--accent-strong); }
.nudge-line.tone-accent { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.nudge-main > span.grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.4; }
.nudge-line .nudge-sub { font-weight: 500; color: var(--text-3); font-size: var(--fs-xs); }
.nudge-close { display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 50%; color: var(--text-3); flex: 0 0 auto; }
.nudge-close:hover { background: var(--surface-2); }

/* ---------- getting started (lighter) ---------- */
.onboard { padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--card-shadow); }
.onboard-head { display: flex; align-items: flex-start; gap: var(--sp-2); }
.onboard-title { font-size: var(--fs-md); font-weight: 800; line-height: 1.4; }
.onboard-count { font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; }
.onboard-head .nudge-close { margin: -6px -6px 0 0; margin-inline: 0 -6px; }
.onboard-progress { height: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; margin: var(--sp-3) 0 var(--sp-1); }
.onboard-progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand); transition: width 300ms var(--ease); }
.onboard-step { display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: 56px; padding: var(--sp-2) 0; text-align: start; font-weight: 700; border-top: 1px solid var(--border); }
.onboard-progress + .onboard-step { border-top: 0; }
.onboard-step .step-dot { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border-strong); color: var(--text-3); font-size: var(--fs-sm); flex: 0 0 auto; }
.onboard-step.done .step-dot { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.onboard-step.done .step-label { color: var(--text-3); }
.onboard-step .step-label { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.4; }
.onboard-step .step-sub { font-size: var(--fs-xs); font-weight: 500; color: var(--text-3); }
.onboard-step:not(.done) .step-go { color: var(--brand); display: inline-flex; }
.onboard-step:disabled { cursor: default; opacity: 1; }

/* ---------- lists (needs attention, recent) ---------- */
.home-list .list-row { min-height: var(--row-min); padding: var(--sp-3) var(--sp-4); }
.home-list .list-trailing .btn-icon { width: 40px; min-height: 40px; border-radius: var(--r-md); }
.home-late { color: var(--accent-strong); font-weight: 700; }
.home-v5 .all-clear { display: flex; align-items: center; gap: var(--sp-3); min-height: var(--row-min); padding: var(--sp-3) var(--sp-4); font-weight: 700; color: var(--text-2); }

/* ---------- the last 7 days ---------- */
.week-chart { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-4); }
.week-chart .card-title { font-size: var(--fs-md); }
.wc-legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); font-size: var(--fs-sm); color: var(--text-2); }
.wc-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.wc-legend b { color: var(--text); font-weight: 800; }
.week-svg { width: 100%; height: auto; overflow: visible; margin-top: var(--sp-3); }
.wc-axis { stroke: var(--border-strong); stroke-width: 1; }
.wc-pay { fill: var(--payment); }
.wc-debt { fill: var(--debt); opacity: .85; }
.wc-today { fill: var(--brand-softer); }
.wc-label { fill: var(--text-3); font-size: 12.5px; font-family: var(--font); font-weight: 600; }
.wc-label.on { fill: var(--brand-strong); font-weight: 800; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.lg-pay { background: var(--payment); } .lg-debt { background: var(--debt); }

/* ---------- Pro: this month (one card) / Free: locked line ---------- */
.biz-mini { display: flex; flex-direction: column; gap: var(--sp-3); width: 100%; padding: var(--sp-4); text-align: start; transition: background var(--dur); }
.biz-mini:hover { background: var(--surface-2); }
.biz-mini .card-title { font-size: var(--fs-md); }
.biz-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.biz-mini-grid > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.biz-mini-grid > span + span { padding-inline-start: var(--sp-3); border-inline-start: 1px solid var(--border); }
.biz-mini-label { font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); }
.biz-mini-grid .money { font-size: var(--fs-md); white-space: normal; line-height: 1.3; }
.home-v5 .pro-teaser { margin-top: var(--section-gap); min-height: var(--row-min); padding: var(--sp-2) var(--sp-4); border-radius: var(--r-lg); background: var(--surface); border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--border)); }
.home-v5 .pro-teaser-icon { width: 36px; height: 36px; border-radius: var(--r-md); background: var(--surface-2); color: var(--text-3); }
.home-pro-chip { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; padding: 3px 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 800; }

/* ---------- new shops: the guide ---------- */
.home-guide { display: flex; align-items: center; gap: var(--sp-2); padding-inline: var(--sp-4) var(--sp-2); min-height: 72px; border-radius: var(--r-lg); background: var(--brand-softer); border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent); }
.home-guide-main { display: flex; align-items: center; gap: var(--sp-3); flex: 1 1 auto; min-width: 0; min-height: 56px; color: var(--text); text-decoration: none; }
.home-guide-main:hover { text-decoration: none; }
.home-guide-main .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.4; }
.home-guide-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; background: var(--brand); color: var(--brand-ink); }
.home-guide-title { font-weight: 800; }
.home-guide-sub { font-size: var(--fs-sm); color: var(--text-2); }

/* ---------- Pro insights, folded ---------- */
.home-insights .acc-head { min-height: var(--row-min); }
.home-insights .acc-body { padding: var(--sp-3); }
.home-insights .insights { margin-top: 0; }

/* ---------- wide screens: the day's work | the overview ---------- */
.home-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.home-col > :first-child { margin-top: 0; }
.home-v5.is-wide { padding-top: var(--sp-4); }

@media (prefers-reduced-motion: reduce) { .home-chip, .onboard-progress span { transition: none; } }
