/* Home (V1.1 Lane F) — web/app/pages/home.js. Every class and id here starts `hm-` (contract §8);
   shared classes (.page, .psheet, .sec, .btn, .inp, .segctl, .decline) are only adjusted under
   `.hm-page`. Tokens only, no new colour, radius 2px, no shadow. Teal is data, red is a bad-news
   figure (and the stretch of the cash line below zero), plum never colours a chart. */

.hm-neg { color: var(--red); }
.hm-page .sec > .mg .sum { font-variant-numeric: tabular-nums; }
.hm-page .sec > .bd { max-width: 680px; }

/* the warning */
.hm-head { font-family: var(--serif); font-size: 24px; line-height: 1.3; margin: 14px 0 4px; }
.hm-when { font-size: 14px; color: var(--ink-mid); margin: 0 0 14px; }
.hm-figure { font-family: var(--serif); font-size: 28px; margin: 0 0 10px; }
.hm-figure span { font-family: var(--sans); font-size: 14px; color: var(--ink-mid); }
.hm-big { font-family: var(--serif); font-size: 24px; }
.hm-line-t { margin: 0 0 8px; font-size: 15px; }
.hm-note { font-size: 13px; color: var(--ink-mid); margin: 6px 0 0; line-height: 1.45; }
.hm-label { font-size: 13px; font-weight: 500; margin: 6px 0 4px; }
.hm-decline { margin-top: 4px; }

/* the cash line: shapes stretch, labels are HTML on top */
.hm-line { margin: 22px 0 4px; }
.hm-plot { position: relative; height: 180px; }
.hm-line svg { display: block; width: calc(100% - 92px); height: 180px; overflow: visible; }
.hm-band { fill: var(--data-band); }
.hm-band-neg { fill: var(--red); opacity: .55; }
.hm-mid { fill: none; stroke: var(--data); stroke-width: 2; }
.hm-zero { stroke: var(--ink); stroke-width: 1; }
.hm-zero-l, .hm-start-l, .hm-end-l { position: absolute; font-size: 12px; line-height: 1; transform: translateY(-50%); white-space: nowrap; }
.hm-zero-l { left: 0; transform: translateY(-130%); color: var(--ink-mid); }
.hm-start-l { left: 0; transform: translateY(-150%); font-weight: 500; background: var(--paper); padding-right: 4px; }
.hm-end-l { right: 0; font-weight: 600; max-width: 90px; white-space: normal; text-align: right; }
.hm-bills { position: relative; margin-right: 92px; height: 30px; }
.hm-bill { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-size: 12px; white-space: nowrap; }
.hm-bill i { display: block; width: 2px; height: 7px; background: var(--ink); }
.hm-bill b { font-weight: 500; margin-top: 2px; }
.hm-bill-quiet i { background: var(--ink-mid); height: 5px; }
.hm-axis { margin-right: 92px; display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-mid); }

/* the ways to close the gap: switches */
.hm-moves { margin: 4px 0 10px; border-top: 1px solid var(--rule-soft); }
.hm-sw { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 52px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--rule-soft); background: none; color: var(--ink); text-align: left; font: inherit; font-size: 15px; cursor: pointer; }
.hm-sw-l small { display: block; font-size: 13px; color: var(--ink-mid); margin-top: 2px; }
.hm-sw-k { flex: none; position: relative; width: 40px; height: 22px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--paper); }
.hm-sw-k::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--ink-mid); border-radius: 1px; transition: transform 160ms var(--ease-in, ease); }
.hm-sw[aria-checked="true"] .hm-sw-k { background: var(--ink); }
.hm-sw[aria-checked="true"] .hm-sw-k::after { transform: translateX(18px); background: var(--paper); }
.hm-sw-off { cursor: default; }
.hm-sw-off .hm-sw-l { color: var(--ink-mid); }
.hm-moved { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 8px 0 10px; border-bottom: 1px solid var(--rule-soft); }
.hm-moved-fld { display: grid; gap: 4px; font-size: 13px; }
.hm-moved .err { flex-basis: 100%; }

/* See the working: the waterfall, then the mono */
.hm-working { margin-top: 6px; }
.hm-working > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.hm-wf { list-style: none; margin: 6px 0 12px; padding: 0; display: grid; gap: 10px; }
.hm-wf-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13.5px; }
.hm-wf-amt { text-align: right; font-weight: 500; white-space: nowrap; }
.hm-wf-track { grid-column: 1 / -1; position: relative; height: 12px; background: var(--paper-3); border-radius: 1px; }
.hm-wf-track i { position: absolute; top: 0; bottom: 0; background: var(--data); border-radius: 1px; }
.hm-wf-subtract .hm-wf-track i { background: var(--data-lite); }
.hm-wf-track i.hm-wf-negbar { background: var(--red); }
.hm-wf-zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--ink); }
.hm-mono { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; margin: 0; padding: 10px 12px; background: var(--paper-2); border-radius: var(--radius); }

/* the question when there is no cash on hand yet */
.hm-ask { display: grid; gap: 8px; max-width: 420px; }
.hm-q { font-family: var(--serif); font-size: 22px; line-height: 1.3; }
.hm-money { display: flex; align-items: center; gap: 8px; }
.hm-sym { font-size: 22px; }
.hm-page .hm-amt { font-size: 24px; text-align: right; min-height: 52px; width: 100%; }
.hm-hint { font-size: 13px; color: var(--ink-mid); margin: 0; }
.hm-primary { justify-self: start; min-width: 140px; }

/* yesterday */
.hm-bullet { position: relative; display: block; height: 12px; margin: 4px 0 2px; background: var(--paper-3); border-radius: 1px; }
.hm-bullet i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--data); border-radius: 1px; }
.hm-bullet b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.hm-closes { list-style: none; margin: 14px 0 0; padding: 0; }
.hm-closes li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule-soft); font-size: 14px; }
.hm-go { margin-top: 14px; min-height: 44px; }

/* rows with a size bar (Pay now, Set aside, Due this week) */
.hm-rows { list-style: none; margin: 0; padding: 0; }
.hm-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, auto); gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.hm-row:last-child { border-bottom: 0; }
.hm-row-l b { display: block; font-size: 15px; font-weight: 500; }
.hm-row-l small { display: block; font-size: 13px; color: var(--ink-mid); }
.hm-row-r { font-size: 15px; font-weight: 500; text-align: right; white-space: nowrap; }
.hm-size { display: block; height: 4px; margin-top: 5px; max-width: 220px; background: var(--paper-3); border-radius: 1px; overflow: hidden; }
.hm-size i { display: block; height: 100%; background: var(--data); }
.hm-aside { position: relative; display: block; height: 8px; margin-top: 6px; max-width: 260px; background: var(--paper-3); border-radius: 1px; overflow: hidden; }
.hm-aside i { position: absolute; top: 0; bottom: 0; }
.hm-aside-paid { left: 0; background: var(--data-lite); }
.hm-aside-today { background: var(--data); }
.hm-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--ink); }

/* Close the day: the one primary, at the bottom */
.hm-dock { padding: 18px 0 8px; }
@media (min-width: 1024px) { .hm-dock { margin-left: 196px; max-width: 420px; } }
.hm-close { width: 100%; min-height: 48px; }
@media (max-width: 1023px) {
  .hm-dock { position: sticky; bottom: calc(var(--hm-bar, 0px) + 8px); padding: 12px 0; background: var(--paper); }
  .hm-head { font-size: 22px; }
}

.hm-undo { position: fixed; left: 50%; bottom: calc(var(--hm-bar, 0px) + 20px); transform: translateX(-50%); z-index: 45; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 16px; min-height: 44px; background: var(--ink); color: var(--paper); border-radius: var(--radius); font-size: 14px; white-space: nowrap; }
.hm-undo[hidden] { display: none; }
.hm-undo .link.undo { color: var(--paper); text-decoration: underline; font-weight: 500; min-height: 44px; }

/* loading: the Star Walk mark */
.hm-working-mark { padding: 28px 0 0 196px; }
.hm-working-mark .mark { display: inline-block; width: 28px; height: 28px; color: var(--plum); }
.hm-working-mark .mark svg { width: 100%; height: 100%; display: block; }
.hm-working-mark .mark .petal { opacity: .55; animation: starwalk 2s ease-in-out infinite; }
.hm-working-mark .mark .petal[data-i="1"] { animation-delay: 1.2s; }
.hm-working-mark .mark .petal[data-i="2"] { animation-delay: .4s; }
.hm-working-mark .mark .petal[data-i="3"] { animation-delay: 1.6s; }
.hm-working-mark .mark .petal[data-i="4"] { animation-delay: .8s; }
.hm-failed { padding: 20px 0 0 196px; }
@media (max-width: 1023px) { .hm-working-mark, .hm-failed { padding-left: 0; } }
html.motion-light .hm-working-mark .mark .petal { animation: none; }
.hm-ask-btn { min-height: 44px; }
.hm-setaside { margin-top: 10px; max-width: 520px; font-family: var(--sans); }
.hm-setaside > summary { min-height: 44px; display: flex; align-items: center; gap: 4px; cursor: pointer; font-size: 15px; }
