/* Make me Rich: game CSS. Tokens from /design/garden.css. Landscape and desktop: the page never scrolls, the panel does. Phones upright: the page scrolls (see the end). */
html, body { height: 100%; }
body {
  overflow: hidden; overscroll-behavior: none; background: var(--gg-cream);
  background-image: radial-gradient(color-mix(in srgb, var(--gg-ink) 8%, transparent) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
}
.mr-appbar { position: relative; z-index: 5; }
.mr-namechip { min-height: 30px; }
.mr-chip:empty { display: none; }
#o-gg { margin-top: 10px; }
/* phones upright: the trophy joins help + menu; the name chip and sound (also in the menu) step aside */
@media (max-width: 560px) { .mr-namechip, .mr-appbar .mr-chip, .mr-appbar #mute { display: none; } }

.mr-main {
  height: calc(100svh - 66px); width: 100%; max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px;
  padding: 10px max(12px, env(safe-area-inset-left)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
}
.mr-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
@media (orientation: landscape), (min-width: 900px) {
  .mr-main { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); }
  .mr-scene { flex: 1 1 0; }
}

/* ---------- HUD ---------- */
.mr-hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mr-money { min-width: 0; flex: 1 1 auto; }
.mr-cash { display: flex; align-items: center; gap: 8px; font-family: var(--gg-font-display); font-weight: 800; font-size: clamp(32px, 9vw, 46px); line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mr-coin { width: .8em; height: .8em; flex: none; }
.mr-flow { margin-top: 4px; font-size: var(--gg-text-sm); font-weight: 700; color: var(--gg-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-flow b { color: var(--gg-green-600); }
.mr-flow.is-neg b { color: #C2185B; }
.mr-hudright { display: flex; align-items: center; gap: 8px; }
.mr-month { background: var(--gg-butter); font-variant-numeric: tabular-nums; }
@media (max-width: 420px), (max-height: 430px) { .mr-hudright { flex-direction: column-reverse; align-items: flex-end; gap: 6px; } }

.mr-work {
  position: relative; display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 8px; row-gap: 4px;
  min-height: 56px; min-width: 132px; padding: 8px 16px 10px; border: var(--gg-border); border-radius: var(--gg-r-lg);
  background: var(--gg-lime); box-shadow: var(--gg-shadow); cursor: pointer; font: inherit; color: var(--gg-ink);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform var(--gg-dur-xs) var(--gg-ease-out), box-shadow var(--gg-dur-xs);
}
.mr-work:active, .mr-work.is-pressed { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--gg-ink); }
.mr-work:disabled { background: var(--gg-sand); cursor: default; }
.mr-work__t { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-md); white-space: nowrap; }
.mr-work__n { font-weight: 800; font-size: var(--gg-text-xs); color: var(--gg-green-800); font-variant-numeric: tabular-nums; }
.mr-work__bar { grid-column: 1 / -1; height: 7px; border: 1.5px solid var(--gg-ink); border-radius: 99px; background: var(--gg-paper); overflow: hidden; }
.mr-work__bar i { display: block; height: 100%; width: 100%; background: var(--gg-green-600); transform-origin: left; }

.mr-debt {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: var(--gg-border); border-radius: var(--gg-r-md);
  background: var(--gg-pink-100); font-weight: 700; font-size: var(--gg-text-sm); line-height: 1.25;
}
.mr-debt[hidden] { display: none; }
.mr-debt b { color: #B0124E; }

/* ---------- scene ---------- */
.mr-scene {
  position: relative; min-height: 0; height: clamp(160px, 27svh, 290px); flex: none;
  border: var(--gg-border); border-radius: var(--gg-r-lg); overflow: hidden; box-shadow: var(--gg-shadow); background: #F3EAD6;
}
@media (orientation: landscape), (min-width: 900px) { .mr-scene { height: auto; min-height: 80px; flex: 1 1 0; } }
.mr-scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.mr-daybar { position: absolute; left: 10px; right: 10px; bottom: 8px; height: 6px; border-radius: 99px; background: rgba(255, 254, 246, .7); border: 1.5px solid var(--gg-ink); overflow: hidden; }
.mr-daybar i { display: block; height: 100%; width: 0; background: var(--gg-butter); }
.mr-receipt {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  padding: 6px 12px; border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-paper); box-shadow: var(--gg-shadow-sm);
  font-size: var(--gg-text-xs); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.mr-receipt[hidden] { display: none; }
.mr-receipt .p { color: var(--gg-green-700); } .mr-receipt .m { color: #B0124E; }

.mr-goal {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 6px; align-items: center; text-align: left;
  min-height: 48px; padding: 8px 12px; border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-paper);
  font: inherit; color: var(--gg-ink); cursor: pointer;
}
.mr-goal__k { font-size: var(--gg-text-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gg-ink-3); }
.mr-goal__name { font-weight: 800; font-size: var(--gg-text-sm); line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mr-goal__bar { grid-column: 1 / -1; height: 8px; border: 1.5px solid var(--gg-ink); border-radius: 99px; overflow: hidden; background: var(--gg-sand); }
.mr-goal__bar i { display: block; height: 100%; width: 0; background: var(--gg-lime); transition: width var(--gg-dur-md); }

/* ---------- panel ---------- */
.mr-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: 0; border: var(--gg-border); border-radius: var(--gg-r-lg); background: var(--gg-paper); box-shadow: var(--gg-shadow); overflow: hidden; }
.mr-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: var(--gg-border); background: var(--gg-sand); }
.mr-tabs button {
  min-height: 46px; border: 0; background: transparent; font: inherit; font-family: var(--gg-font-display); font-weight: 700; font-size: var(--gg-text-sm);
  color: var(--gg-ink-2); cursor: pointer; position: relative;
}
.mr-tabs button + button { border-left: 2px solid var(--gg-ink); }
.mr-tabs button[aria-selected="true"] { background: var(--gg-paper); color: var(--gg-ink); }
.mr-tabs button .dot { position: absolute; top: 8px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--gg-pink); border: 1.5px solid var(--gg-ink); }
.mr-tabbody { overflow-y: auto; overscroll-behavior: contain; padding: 10px; display: grid; gap: 8px; align-content: start; -webkit-overflow-scrolling: touch; }

.mr-row {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 10px; border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-cream);
}
.mr-row.is-locked { background: var(--gg-sand); }
.mr-row.is-flash { animation: mr-flash .9s ease-out; }
@keyframes mr-flash { 0% { box-shadow: 0 0 0 4px var(--gg-lime); } 100% { box-shadow: 0 0 0 0 transparent; } }
.mr-ico { width: 44px; height: 44px; }
.mr-row__main { min-width: 0; display: grid; gap: 2px; }
.mr-row__name { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-md); line-height: 1.1; }
.mr-row__sub { font-size: var(--gg-text-xs); font-weight: 600; color: var(--gg-ink-2); line-height: 1.3; }
.mr-row__sub .up { color: var(--gg-green-700); font-weight: 800; } .mr-row__sub .down { color: #B0124E; font-weight: 800; }
.mr-tier { height: 6px; border: 1.5px solid var(--gg-ink); border-radius: 99px; background: var(--gg-paper); overflow: hidden; margin-top: 3px; }
.mr-tier i { display: block; height: 100%; background: var(--gg-butter); }
.mr-row__btns { display: grid; gap: 6px; justify-items: stretch; }
.mr-row__btns .gg-btn { min-height: 44px; padding: 6px 12px; font-size: var(--gg-text-sm); gap: 6px; box-shadow: var(--gg-shadow-sm); white-space: nowrap; }
.mr-row__btns .gg-btn--primary { min-width: 92px; }
.mr-row.is-current { background: var(--gg-lime-100); }
.mr-sec { font-size: var(--gg-text-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gg-ink-3); margin: 6px 2px 0; }
.mr-note { font-size: var(--gg-text-sm); color: var(--gg-ink-2); padding: 2px 4px; line-height: 1.4; }
.mr-bills { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 12px; border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-cream); font-size: var(--gg-text-sm); font-variant-numeric: tabular-nums; }
.mr-bills b { font-weight: 800; }
.mr-bills .tot { border-top: 2px solid var(--gg-ink); padding-top: 4px; font-weight: 800; }

/* ---------- modals ---------- */
.mr-title { font-family: var(--gg-font-display); font-size: var(--gg-text-4xl); line-height: .95; letter-spacing: -.03em; margin: 6px 0 10px; }
.mr-lede { font-size: var(--gg-text-md); color: var(--gg-ink-2); margin-bottom: 18px; }
.mr-titlebtns, .mr-overbtns { display: grid; gap: 12px; margin-top: 8px; }
.mr-small { font-size: var(--gg-text-sm); color: var(--gg-ink-3); margin-top: 10px; }
.mr-h2 { font-family: var(--gg-font-display); font-size: var(--gg-text-2xl); line-height: 1.05; margin: 4px 0 10px; }
.mr-line { font-size: var(--gg-text-md); color: var(--gg-ink-2); margin-bottom: 14px; line-height: 1.45; }
.mr-big { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-4xl); line-height: 1; margin: 6px 0 10px; }
.mr-howlist { text-align: left; display: grid; gap: 8px; margin: 0 0 18px; padding-left: 18px; font-size: var(--gg-text-sm); line-height: 1.45; }
.mr-choices { display: grid; gap: 10px; }
.mr-have { margin: -4px 0 14px; padding: 6px 10px; border-radius: var(--gg-r-sm); background: var(--gg-sand); font-size: var(--gg-text-sm); font-weight: 700; }
.mr-choice {
  display: grid; gap: 4px; text-align: left; min-height: 64px; padding: 12px 16px; border: var(--gg-border); border-radius: var(--gg-r-md);
  background: var(--gg-cream); box-shadow: var(--gg-shadow); font: inherit; color: var(--gg-ink); cursor: pointer;
  transition: transform var(--gg-dur-xs), box-shadow var(--gg-dur-xs);
}
.mr-choice:first-child { background: var(--gg-lime-100); }
.mr-choice:active { transform: translate(3px, 3px); box-shadow: none; }
.mr-choice b { font-family: var(--gg-font-display); font-size: var(--gg-text-lg); }
.mr-choice span { font-size: var(--gg-text-sm); color: var(--gg-ink-2); }
.mr-lessoncard { background: var(--gg-butter-100); }
.mr-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 8px; font-weight: 700; }
.mr-freecard { background: var(--gg-lime-100); }
.mr-lessons { display: grid; gap: 8px; }
.mr-lessons details { border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-butter-100); padding: 10px 12px; }
.mr-lessons summary { font-weight: 800; cursor: pointer; min-height: 28px; }
.mr-lessons p { margin-top: 6px; font-size: var(--gg-text-sm); line-height: 1.45; }
.mr-lessons .is-locked { background: var(--gg-sand); color: var(--gg-ink-3); }

@media (max-height: 430px) {
  .mr-main { gap: 8px; padding-top: 8px; }
  .mr-left { gap: 12px; }
  .mr-cash { font-size: 28px; }
  .mr-month { min-height: 26px; padding: 2px 10px; }
  .mr-hud .mr-hudright { flex-direction: row; align-items: center; }
  .mr-flow { font-size: var(--gg-text-xs); }
  .mr-work { min-width: 0; grid-template-columns: auto; }
  .mr-work__n { display: none; }
  .mr-main { grid-template-columns: minmax(0, 1.1fr) minmax(300px, 1fr); }
  .gg-modal { padding: 10px; }
  .gg-modal__card { padding: 14px 18px 16px; width: min(640px, 100%); max-height: calc(100dvh - 20px); }
  .mr-h2 { font-size: 24px; margin: 2px 0 6px; }
  .mr-line { font-size: var(--gg-text-sm); margin-bottom: 8px; }
  .mr-have { margin: 0 0 10px; padding: 4px 10px; }
  .mr-choices, .mr-overbtns { grid-template-columns: 1fr 1fr; }
  .mr-choice { min-height: 56px; padding: 8px 12px; }
  .mr-choice b { font-size: var(--gg-text-md); }
  .mr-big { font-size: 44px; margin: 2px 0 6px; }
  .mr-title { font-size: 44px; }
  .mr-lede { margin-bottom: 8px; font-size: var(--gg-text-sm); }
  .mr-titlebtns { grid-template-columns: 1fr 1fr; }
  .mr-titlebtns .gg-btn--ghost { grid-column: 1 / -1; justify-self: center; min-height: 44px; }
  .mr-howlist { gap: 4px; margin-bottom: 10px; }
  .mr-work { min-height: 48px; padding: 6px 12px 8px; }
  .mr-goal { min-height: 44px; padding: 6px 10px; row-gap: 4px; }
  .gg-appbar__in { min-height: 54px; }
  .mr-main { height: calc(100svh - 56px); }
}
@media (prefers-reduced-motion: reduce) {
  .mr-row.is-flash { animation: none; outline: 3px solid var(--gg-lime); }
  .mr-goal__bar i { transition: none; }
}

/* ---------- round 2 ---------- */
.mr-wb { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: var(--gg-text-xs); font-variant-numeric: tabular-nums; }
.mr-wb svg { width: 20px; height: 20px; flex: none; }
.mr-wb__bar { width: 60px; height: 8px; border: 1.5px solid var(--gg-ink); border-radius: 99px; background: var(--gg-paper); overflow: hidden; }
.mr-wb__bar i { display: block; height: 100%; background: #FF8FB3; transition: width var(--gg-dur-md); }
.mr-wb.is-low .mr-wb__bar i { background: var(--gg-pink); }
.mr-wb.is-low b { color: #B0124E; }
.mr-ot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 48px; padding: 6px 14px;
  border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-paper); box-shadow: var(--gg-shadow-sm);
  font: inherit; color: var(--gg-ink); cursor: pointer; text-align: left; touch-action: manipulation;
}
.mr-ot.is-on { background: var(--gg-lime); }
.mr-ot:disabled { background: var(--gg-sand); cursor: default; }
.mr-ot:active { transform: translate(2px, 2px); box-shadow: none; }
.mr-ot__t { font-family: var(--gg-font-display); font-weight: 800; font-size: var(--gg-text-md); white-space: nowrap; }
.mr-ot__s { font-size: var(--gg-text-xs); font-weight: 700; color: var(--gg-ink-2); text-align: right; }
.mr-debt.is-loan { background: var(--gg-butter-100); }
.mr-receipt { font: inherit; font-size: var(--gg-text-xs); font-weight: 700; cursor: pointer; min-height: 44px; max-width: min(62%, 300px); white-space: normal; text-align: center; color: var(--gg-ink); }
.mr-receipt.is-big { background: var(--gg-butter); font-size: var(--gg-text-sm); min-height: 44px; }
.mr-receipt u { margin-left: 6px; }
.mr-crash { position: absolute; left: 10px; bottom: 22px; z-index: 2; padding: 4px 10px; border: 2px solid var(--gg-ink); border-radius: 99px; background: #E8412C; color: #fff; font-weight: 800; font-size: var(--gg-text-xs); animation: mr-pulse 1.2s ease-in-out infinite; }
.mr-crash[hidden] { display: none; }
@keyframes mr-pulse { 50% { transform: scale(1.06); } }
.mr-histbtn { position: absolute; right: 10px; bottom: 20px; z-index: 2; min-height: 44px; min-width: 44px; padding: 4px 14px; border: 2px solid var(--gg-ink); border-radius: 99px; background: var(--gg-paper); box-shadow: var(--gg-shadow-sm); font: inherit; font-weight: 800; font-size: var(--gg-text-xs); cursor: pointer; }
.mr-sheet .gg-modal__card { text-align: left; }
.mr-sheet .gg-eyebrow, .mr-sheet .mr-h2 { text-align: left; }
.mr-eventcard.is-bad, #card.is-bad .gg-modal__card { background: #FFF1EE; }
.mr-say { font-weight: 800; color: var(--gg-ink); }
.mr-lessonbox { display: grid; gap: 4px; margin: 4px 0 16px; padding: 10px 12px; border: 2px solid var(--gg-ink); border-radius: var(--gg-r-md); background: var(--gg-butter-100); font-size: var(--gg-text-sm); line-height: 1.4; }
.mr-lessonbox[hidden] { display: none; }
.mr-coach { margin: 12px 0 16px; padding: 10px 12px; border: 2px solid var(--gg-ink); border-radius: var(--gg-r-md); background: var(--gg-lime-100); font-size: var(--gg-text-sm); }
.mr-coach ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; line-height: 1.4; }
.mr-ckline { margin: 10px 0 0; font-weight: 800; color: var(--gg-green-700); }
.mr-ckline[hidden] { display: none; }
.mr-bills .up { color: var(--gg-green-700); } .mr-bills .m { color: #B0124E; }
.mr-small2 { font-size: var(--gg-text-xs); }
.mr-warn { color: #B0124E; font-weight: 700; }
.mr-row__btns { grid-auto-flow: row; }
.mr-histcard { width: min(760px, 100%); padding: 16px; text-align: left; }
.mr-histhead { display: flex; align-items: center; justify-content: space-between; }
.mr-histhead .mr-h2 { margin: 0; }
.mr-histwrap { position: relative; height: min(52svh, 380px); margin: 10px 0; border: 2px solid var(--gg-ink); border-radius: var(--gg-r-md); overflow: hidden; touch-action: none; }
.mr-histwrap canvas { width: 100%; height: 100%; display: block; cursor: pointer; }
.mr-histbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mr-histbar .gg-btn { width: 52px; font-size: 22px; }
.mr-histrange { font-weight: 800; font-size: var(--gg-text-sm); }
.mr-story { margin-top: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--gg-r-md); background: var(--gg-sand); font-size: var(--gg-text-sm); line-height: 1.4; }
.mr-oldnote { background: var(--gg-butter-100); border-radius: var(--gg-r-sm); padding: 8px 10px; margin-bottom: 12px; }
.mr-oldnote[hidden] { display: none; }
@media (max-height: 430px) {
  .mr-ot { min-height: 44px; padding: 4px 12px; }
  .mr-ot__s { display: none; }
  .mr-debt { padding: 4px 10px; font-size: var(--gg-text-xs); }
  .mr-left { gap: 12px; }
  .mr-wb__bar { width: 40px; }
  .mr-histwrap { height: 46svh; }
  .mr-histcard { padding: 10px 14px; }
  .mr-story { margin-top: 6px; }
}

.mr-story__lesson { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 8px; background: #FFF1C2; }
.mr-story__nw { display: inline-block; margin-top: 4px; color: var(--gg-ink-soft, #5E584C); }
.mr-hlegend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; font-size: var(--gg-text-xs); line-height: 1.5; color: var(--gg-ink); }
.mr-hlegend span { display: inline-flex; align-items: center; gap: 5px; }
.mr-hlegend i { width: 10px; height: 10px; border: 1.5px solid var(--gg-ink); border-radius: 50%; flex: none; }
.mr-hlegend .band { width: 12px; height: 14px; border: 1.5px solid var(--gg-ink); border-radius: 2px; opacity: .75; flex: none; }
.mr-hlegend .zero { width: 18px; height: 0; border-top: 2px solid #FF1E73; flex: none; }

/* time controls (Ariel 10-30): always visible, pause lets you look around */
.mr-clockrow { display: flex; gap: 8px; align-items: stretch; }
.mr-clockrow .mr-ot { flex: 1; min-width: 0; }
.mr-clockbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 52px; min-height: 48px; padding: 0 12px; border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-paper); color: var(--gg-ink); font: inherit; font-weight: 800; box-shadow: 3px 3px 0 var(--gg-ink); cursor: pointer; }
.mr-clockbtn svg { width: 18px; height: 18px; flex: none; }
.mr-clockbtn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--gg-ink); }
.mr-clockbtn[aria-pressed="true"] { background: var(--gg-lime, #9CFF1E); }
.mr-speed { font-variant-numeric: tabular-nums; }
.mr-speed.is-slow { background: var(--gg-sky, #CDEBFF); }
.mr-pausednote { margin: 6px 0 0; padding: 6px 10px; border: 2px dashed var(--gg-ink); border-radius: var(--gg-r-md); background: #E9FFC8; font-size: var(--gg-text-xs); font-weight: 700; }
.mr-pausednote[hidden] { display: none; }
@media (max-width: 420px) { .mr-clockbtn span { display: none; } .mr-clockbtn { min-width: 48px; padding: 0 10px; } }
#c-c:not([hidden]) { grid-column: 1 / -1; }
.mr-tip { position: absolute; z-index: 2; max-width: 220px; padding: 4px 8px; border: 2px solid var(--gg-ink); border-radius: 8px; background: var(--gg-paper); color: var(--gg-ink); font-size: var(--gg-text-xs); font-weight: 700; line-height: 1.3; pointer-events: none; white-space: normal; }
.mr-tip[hidden] { display: none; }
/* the story box keeps its size so the sheet never jumps */
@media (hover: hover) { .mr-story { min-height: 10.4em; } }
.mr-choice[hidden] { display: none; }

/* Life tab: the month's traffic light and what covers your costs (Ariel 10-30) */
.mr-bal { padding: 10px 14px; border: var(--gg-border); border-left-width: 10px; border-radius: var(--gg-r-md); background: var(--gg-paper); }
.mr-bal p { margin: 4px 0 0; font-size: var(--gg-text-sm); }
.mr-bal__head { display: flex; align-items: center; gap: 8px; font-size: var(--gg-text-lg, 20px); }
.mr-light { width: 16px; height: 16px; border: 2px solid var(--gg-ink); border-radius: 50%; flex: none; }
.mr-bal.is-green { border-left-color: #379155; } .mr-bal.is-green .mr-light { background: #379155; }
.mr-bal.is-amber { border-left-color: #F5A623; background: #FFF6DC; } .mr-bal.is-amber .mr-light { background: #F5A623; }
.mr-bal.is-red { border-left-color: #E8412C; background: #FFE9E5; } .mr-bal.is-red .mr-light { background: #E8412C; }
.mr-srcs { display: grid; gap: 8px; }
.mr-src { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 12px; border: 2px solid var(--gg-ink); border-radius: var(--gg-r-md); background: var(--gg-paper); font-size: var(--gg-text-sm); }
.mr-src b { text-align: right; font-variant-numeric: tabular-nums; }
.mr-src em { grid-column: 2; grid-row: 2; font-style: normal; font-size: var(--gg-text-xs); color: #5E584C; text-align: right; }
.mr-cover { grid-column: 1; grid-row: 2; height: 10px; border: 1.5px solid var(--gg-ink); border-radius: 99px; background: var(--gg-sand); overflow: hidden; }
.mr-cover i { display: block; height: 100%; background: #9CFF1E; border-right: 1.5px solid var(--gg-ink); }
.mr-src.is-inv .mr-cover i { background: #3FA9F5; }

/* ---------- 2.9: long-run path, your mix, About sheet, Max sheet ---------- */
.mr-mix { display: grid; gap: 6px; padding: 10px 12px; border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-paper); }
.mr-mix__head { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--gg-text-sm); }
.mr-mix__head b { font-family: var(--gg-font-display); font-size: var(--gg-text-md); }
.mr-mix__head span { font-weight: 800; font-variant-numeric: tabular-nums; }
.mr-mix__bar { display: flex; height: 16px; border: 2px solid var(--gg-ink); border-radius: 99px; overflow: hidden; background: var(--gg-sand); }
.mr-mix__bar i { display: block; height: 100%; }
.mr-mix__bar i + i { border-left: 1.5px solid var(--gg-ink); }
.mr-mix__bar i.is-empty { background: var(--gg-sand); }
.mr-mix__legend { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: var(--gg-text-xs); font-weight: 700; color: var(--gg-ink-2); }
.mr-mix__legend span { display: inline-flex; align-items: center; gap: 4px; }
.mr-mix__legend i { width: 10px; height: 10px; border-radius: 3px; border: 1.5px solid var(--gg-ink); }
.mr-mix__rates { font-size: var(--gg-text-sm); }
.mr-mix__rates .up { color: var(--gg-green-700); } .mr-mix__rates .down { color: #B0124E; }
.mr-mix__coach { font-size: var(--gg-text-sm); line-height: 1.35; padding: 6px 10px; border-radius: var(--gg-r-sm); background: var(--gg-lime-100); }
.mr-tile { display: grid; gap: 8px; padding: 8px 10px 10px; border: var(--gg-border); border-radius: var(--gg-r-md); background: var(--gg-cream); }
.mr-tile.is-locked { background: var(--gg-sand); }
.mr-tile__head { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 44px; padding: 2px; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: var(--gg-r-sm); }
.mr-tile__head:hover { background: color-mix(in srgb, var(--gg-sand) 60%, transparent); }
.mr-tile__head .mr-row__sub b { font-weight: 800; }
.mr-tile__small { font-size: var(--gg-text-xs); font-weight: 600; color: var(--gg-ink-3); }
.mr-info { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 4px; border: 1.5px solid var(--gg-ink); border-radius: 50%; font-family: var(--gg-font-body); font-size: 12px; font-weight: 800; vertical-align: 2px; background: var(--gg-paper); }
.mr-tile__btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mr-tile__btns .gg-btn { min-height: 44px; padding: 6px 8px; font-size: var(--gg-text-sm); box-shadow: var(--gg-shadow-sm); white-space: nowrap; }
.mr-aboutcard { width: min(560px, 100%); text-align: left; }
.mr-aboutcard .mr-histhead { margin-bottom: 6px; }
.mr-grow small { font-weight: 600; color: var(--gg-ink-3); font-size: var(--gg-text-xs); }
.mr-aboutchart { height: 170px; border: 2px solid var(--gg-ink); border-radius: var(--gg-r-md); overflow: hidden; margin-top: 6px; }
.mr-aboutchart canvas { width: 100%; height: 100%; display: block; }
.mr-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 6px 0 2px; font-size: var(--gg-text-xs); font-weight: 700; color: var(--gg-ink-2); }
.mr-legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mr-legend i { display: inline-block; width: 22px; height: 4px; border-radius: 2px; background: #6FCF00; }
.mr-legend i.l-path { height: 0; background: none; border-top: 3px dashed #D4A800; }
.mr-goodfor { display: grid; gap: 6px; margin-top: 10px; padding: 10px 12px; border: 2px solid var(--gg-ink); border-radius: var(--gg-r-md); background: var(--gg-lime-100); font-size: var(--gg-text-sm); line-height: 1.4; }
.mr-buycard { text-align: left; }
.mr-buyopts { display: grid; gap: 10px; margin-bottom: 10px; }
.mr-buyopts .mr-choice:disabled { opacity: .5; cursor: not-allowed; }
.mr-buycard > .gg-btn { width: 100%; }
.mr-invline { margin: 10px 0 0; font-size: var(--gg-text-sm); line-height: 1.4; }
.mr-invline .up { color: var(--gg-green-700); } .mr-invline .down { color: #B0124E; }
@media (max-height: 430px) {
  .mr-aboutchart { height: 120px; }
  .mr-buyopts { grid-template-columns: 1fr 1fr; }
}
.mr-aboutcard .mr-bills { grid-template-columns: max-content minmax(0, 1fr); column-gap: 14px; }
.mr-aboutcard .mr-bills b { text-align: right; }

.mr-grow small { display: block; }

/* Phones held upright (Ariel 10-31). A real iPhone shows ~664 px, not 844, so the PAGE scrolls instead of a squeezed panel.
   Round 2 of the same day ("I scroll down to buy and can't see how much money I have"): the money, age, pause and speed share
   ONE compact row that sticks to the top (ui.js moves pause + speed into it), the tab row sticks right under it, and the top
   is trimmed so the tabs show without scrolling: smaller room, goal and overtime side by side, long notes folded. */
@media (orientation: portrait) and (max-width: 899px) {
  html, body { height: auto; }
  body { overflow-x: hidden; overflow-y: auto; overscroll-behavior: auto; }
  .gg-appbar__in { min-height: 54px; }
  .mr-main { height: auto; min-height: calc(100svh - 54px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: auto; grid-auto-flow: row dense; gap: 12px; padding-top: 0; }
  .mr-left { display: contents; }
  .mr-left > *, .mr-panel { grid-column: 1 / -1; }
  /* the sticky money row */
  .mr-hud {
    order: 0; position: sticky; top: 0; z-index: 4; gap: 8px;
    padding: 8px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
    margin: 0 calc(-1 * max(12px, env(safe-area-inset-left))); background: var(--gg-cream);
  }
  .mr-hud .mr-cash { font-size: 30px; gap: 6px; }
  .mr-hud .mr-flow { margin-top: 2px; font-size: var(--gg-text-xs); }
  .mr-flow__inv { display: none; }
  .mr-hud .mr-hudright { flex-direction: column; align-items: flex-end; gap: 5px; }
  .mr-hud .mr-month { min-height: 26px; padding: 2px 10px; font-size: var(--gg-text-xs); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .mr-hud .mr-hudright { min-width: 0; }
  .mr-hud .mr-wb__bar { width: 44px; }
  .mr-hud .mr-clockbtn { order: 3; min-width: 44px; min-height: 44px; padding: 0 8px; box-shadow: 2px 2px 0 var(--gg-ink); }
  .mr-hud .mr-clockbtn span { display: none; }
  .mr-hud .mr-speed { font-size: var(--gg-text-sm); }
  .mr-pausednote, .mr-debt { order: 1; }
  .mr-pausednote { margin: 0; }
  .mr-scene { order: 2; height: clamp(130px, 21svh, 230px); }
  /* goal and overtime share a row under the room */
  .mr-left > .mr-goal { order: 3; grid-column: 1; }
  .mr-left > .mr-clockrow { order: 3; grid-column: 2; }
  .mr-goal { min-height: 52px; padding: 6px 10px; row-gap: 4px; grid-template-columns: 1fr; }
  .mr-goal__k { font-size: 10px; }
  .mr-goal__name { font-size: var(--gg-text-xs); -webkit-line-clamp: 1; white-space: nowrap; text-overflow: ellipsis; display: block; }
  .mr-goal__bar { grid-column: 1; height: 7px; }
  .mr-ot { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-height: 52px; padding: 4px 10px; }
  .mr-ot__t { font-size: var(--gg-text-sm); }
  .mr-ot__s { font-size: 10px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  /* the panel: tabs stick under the money row */
  .mr-panel { order: 4; overflow: visible; grid-template-rows: auto auto; scroll-margin-top: var(--mr-hudh, 62px); }
  .mr-tabs { position: sticky; top: var(--mr-hudh, 62px); z-index: 3; border-radius: calc(var(--gg-r-lg) - 3px) calc(var(--gg-r-lg) - 3px) 0 0; }
  .mr-tabs button { min-height: 44px; }
  .mr-tabbody { overflow: visible; min-height: 50svh; }
}
/* small phones (iPhone SE, 320 px): the money row gets two lines, cash + pause + speed, then age + wellbeing;
   the wordmark drops its text so the menu button stays on screen */
@media (orientation: portrait) and (max-width: 360px) {
  .mr-appbar .gg-wordmark span { display: none; }
  .mr-hud { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 4px; }
  .mr-hud .mr-cash { font-size: 26px; }
  .mr-hud .mr-hudright { grid-column: 1 / -1; grid-row: 2; flex-direction: row; justify-content: space-between; align-items: center; }
  .mr-hud .mr-money { grid-column: 1; grid-row: 1; }
  .mr-hud #playbtn { grid-column: 2; grid-row: 1; }
  .mr-hud #speedbtn { grid-column: 3; grid-row: 1; }
  .mr-main { gap: 6px; }
  .mr-scene { height: 105px; }
  .mr-goal, .mr-ot { min-height: 48px; }
}
/* folded explanations ("How is this worked out?") */
.mr-more { border: 2px solid var(--gg-ink); border-radius: var(--gg-r-md); background: var(--gg-cream); padding: 0 12px; font-size: var(--gg-text-sm); }
.mr-more summary { min-height: 44px; display: flex; align-items: center; font-weight: 800; cursor: pointer; }
.mr-more p { margin: 0 0 10px; line-height: 1.45; color: var(--gg-ink-2); }
