/* Money Health design system (documents/DESIGN.md).
   Placeholder tokens until the brand identity lands: use only these --mh-* variables, never loose
   colours or fonts. Light is the default theme; dark is opt-in via <html data-theme="dark">. */

/* 1. Tokens ===================================================================================== */
/* Brand v1 (documents/Money Health — Apresentação da Marca.pdf; static/brand/tokens-v1.css).
   Fonts are self-hosted (static/fonts, OFL): loading them from Google would hand every visitor's IP
   to a third party (LGPD). */
@font-face { font-family: "Sora"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/sora-latin-wght-normal.0d0e5e4d2f9f.woff2") format("woff2-variations"), url("../fonts/sora-latin-wght-normal.0d0e5e4d2f9f.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("../fonts/sora-latin-ext-wght-normal.adf7c421da62.woff2") format("woff2-variations"), url("../fonts/sora-latin-ext-wght-normal.adf7c421da62.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("../fonts/dm-sans-latin-wght-normal.7c87a648293f.woff2") format("woff2-variations"), url("../fonts/dm-sans-latin-wght-normal.7c87a648293f.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("../fonts/dm-sans-latin-ext-wght-normal.49935c4b6235.woff2") format("woff2-variations"), url("../fonts/dm-sans-latin-ext-wght-normal.49935c4b6235.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  /* Brand palette (primitives). Proportion: Névoa dominates, Floresta structures, greens mark,
     Âmbar only punctuates. Use the semantic tokens below in components, not these. */
  --mh-floresta: #0b2e2a;
  --mh-verde-vital: #0c7f5b;
  --mh-verde-broto: #3ddc97;
  --mh-nevoa: #f3f6f1;
  --mh-ambar: #f2b33d;
  --mh-superficie: #fbfcfa;
  /* Data colours: every value also carries a sign and a label; colour never speaks alone. */
  --mh-receita: #0c7f5b;
  --mh-despesa: #e4684e;
  --mh-investimento: #3b6fd8;
  --mh-patrimonio: #f2b33d;
  --mh-neutro: #8a9a94;

  /* Surfaces and text */
  --mh-bg: var(--mh-nevoa);
  --mh-surface: var(--mh-superficie);
  --mh-surface-2: #f6f8f5;
  --mh-surface-3: #eaf0ec;
  --mh-text: var(--mh-floresta);
  --mh-muted: #4a5d57;
  --mh-subtle: #5c6d67; /* the brand's #6B7C76 is below 4.5:1 for small text */
  --mh-border: #dce5e0;
  --mh-border-strong: #c3d1ca;
  /* Brand roles */
  --mh-primary: var(--mh-verde-vital);
  --mh-primary-hover: #0a6a4c;
  --mh-primary-soft: #e1f1e9;
  --mh-primary-text: #ffffff;
  --mh-accent: var(--mh-floresta);
  --mh-highlight: var(--mh-verde-broto);
  /* Semantic. Coral and âmbar are for fills and icons; their text tones are darker for AA. */
  --mh-success: var(--mh-verde-vital);
  --mh-success-soft: #e1f1e9;
  --mh-warning: #8a5a00;
  --mh-warning-soft: #fdf0d6;
  --mh-danger: #b6442c;
  --mh-danger-soft: #fce9e4;
  --mh-info: #2f5fc4;
  --mh-info-soft: #e6edfb;
  --mh-income: var(--mh-receita);
  --mh-expense: var(--mh-despesa);
  --mh-invest: var(--mh-investimento);
  --mh-goal: var(--mh-ambar);
  /* Shape and depth */
  --mh-radius-sm: 10px;
  --mh-radius: 16px;
  --mh-radius-lg: 24px;
  --mh-radius-pill: 999px;
  /* Reading width: long text stops here even when the panel fills a 4K screen */
  --mh-measure: 75ch;
  --mh-shadow-sm: 0 1px 2px rgb(11 46 42 / 6%);
  --mh-shadow: 0 1px 2px rgb(11 46 42 / 5%), 0 6px 18px rgb(11 46 42 / 5%);
  --mh-shadow-md: 0 2px 4px rgb(11 46 42 / 6%), 0 14px 32px rgb(11 46 42 / 10%);
  --mh-shadow-lg: -12px 0 48px rgb(11 46 42 / 20%);
  --mh-overlay: rgb(11 46 42 / 50%);
  --mh-ring: 0 0 0 3px color-mix(in srgb, var(--mh-primary) 28%, transparent);
  /* Type: Sora for titles and numbers, DM Sans for text and interface */
  --mh-font-display: "Sora", "DM Sans", Arial, sans-serif;
  --mh-font: "DM Sans", Arial, sans-serif;
  --mh-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --mh-fs-xs: .8125rem; /* 13px: legenda */
  --mh-fs-sm: .875rem;
  --mh-fs-md: 1rem;     /* 16px: corpo */
  --mh-fs-lg: 1.125rem;
  --mh-fs-xl: 1.375rem;
  --mh-fs-2xl: 2rem;    /* 32px: título */
  --mh-fs-3xl: 2.25rem;
  --mh-fs-display: 3.5rem; /* 56px: display */
  /* QR codes stay dark on light in both themes, so every authenticator app can scan them. */
  --mh-qr-bg: #ffffff;
  --mh-qr-fg: #000000;
  /* Category colours (apps/categories/styles.py); chips tint them over the surface. */
  --mh-cat-green: #0c7f5b;
  --mh-cat-teal: #0f766e;
  --mh-cat-blue: #2f5fc4;
  --mh-cat-indigo: #4a48c9;
  --mh-cat-purple: #7e22ce;
  --mh-cat-pink: #be185d;
  --mh-cat-red: #b6442c;
  --mh-cat-orange: #b8541c;
  --mh-cat-amber: #8a5a00;
  --mh-cat-brown: #8a5a3b;
  --mh-cat-slate: #4a5d57;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  /* Dark follows the brand's negative version: Floresta background, Verde Broto as highlight with
     Floresta text on top. */
  --mh-bg: #082421;
  --mh-surface: var(--mh-floresta);
  --mh-surface-2: #0f3833;
  --mh-surface-3: #14423c;
  --mh-text: var(--mh-nevoa);
  --mh-muted: #a9bdb5;
  --mh-subtle: #87a097;
  --mh-border: #1c4a43;
  --mh-border-strong: #2a5d55;
  --mh-primary: var(--mh-verde-broto);
  --mh-primary-hover: #6ae6b0;
  --mh-primary-soft: #12463a;
  --mh-primary-text: var(--mh-floresta);
  --mh-accent: #061c19;
  --mh-success: var(--mh-verde-broto);
  --mh-success-soft: #12463a;
  --mh-warning: var(--mh-ambar);
  --mh-warning-soft: #3a3016;
  --mh-danger: #f08a73;
  --mh-danger-soft: #42261f;
  --mh-info: #7fa6f2;
  --mh-info-soft: #18304f;
  --mh-income: var(--mh-verde-broto);
  --mh-expense: #f08a73;
  --mh-invest: #7fa6f2;
  --mh-shadow-sm: 0 1px 2px rgb(0 0 0 / 30%);
  --mh-shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 6px 18px rgb(0 0 0 / 22%);
  --mh-shadow-md: 0 2px 4px rgb(0 0 0 / 30%), 0 14px 32px rgb(0 0 0 / 35%);
  --mh-shadow-lg: -12px 0 48px rgb(0 0 0 / 50%);
  --mh-overlay: rgb(0 0 0 / 62%);
  --mh-cat-green: #3ddc97;
  --mh-cat-teal: #4fd1c5;
  --mh-cat-blue: #7fa6f2;
  --mh-cat-indigo: #a5b4fc;
  --mh-cat-purple: #d2a8ff;
  --mh-cat-pink: #f9a8d4;
  --mh-cat-red: #f08a73;
  --mh-cat-orange: #fdba74;
  --mh-cat-amber: #f2b33d;
  --mh-cat-brown: #d6a77a;
  --mh-cat-slate: #a9bdb5;
}

/* 2. Base ======================================================================================= */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mh-bg); color: var(--mh-text); font-family: var(--mh-font); font-size: var(--mh-fs-md); line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { font-family: var(--mh-font-display); line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: var(--mh-fs-2xl); font-weight: 650; }
h2 { font-size: var(--mh-fs-lg); font-weight: 600; }
h3 { font-size: var(--mh-fs-md); font-weight: 600; }
a { color: var(--mh-primary); text-underline-offset: 3px; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
a, button, summary, label { touch-action: manipulation; }
::selection { background: color-mix(in srgb, var(--mh-primary) 25%, transparent); }
.mh-muted { color: var(--mh-muted); }
.mh-error { color: var(--mh-danger); }
.mh-ok { color: var(--mh-success); }
.mh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mh-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mh-stack > * + * { margin-top: 20px; }
.mh-code { font-family: var(--mh-font-mono); letter-spacing: .05em; word-break: break-all; }
[hidden] { display: none !important; }

/* 3. Cards and sections ========================================================================= */
.mh-container { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.mh-card { background: var(--mh-surface); border: 1px solid var(--mh-border); border-radius: var(--mh-radius-lg); padding: 24px; box-shadow: var(--mh-shadow); }
.mh-card > h2:first-child { margin-top: 0; }
.mh-card + .mh-card { margin-top: 16px; }
/* Stacking margin only: inside a grid the gap spaces the cards, or the first one sits higher. */
:is(.mh-summaries, .mh-goal-grid, .mh-ccard-grid, .mh-portfolio-grid, .mh-member-grid, .mh-dash, .mh-dash-side, .mh-settings-grid, .lp-grid, .lp-roles) > .mh-card, .mh-member-grid .mh-card { margin-top: 0; }
.mh-narrow { max-width: min(440px, calc(100% - 32px)); margin: 48px auto; }
/* A card header: icon chip, title and a short description, with an optional action on the right. */
.mh-card-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.mh-card-head > div { flex: 1; min-width: 0; }
.mh-card-head:not(:has(p)) { align-items: center; } /* title only: centred on its icon */
.mh-card-head h2, .mh-card-head h3 { margin: 0; }
.mh-card-head p { margin: 4px 0 0; max-width: var(--mh-measure); color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-section + .mh-section, .mh-list + .mh-section, .mh-summaries + .mh-section { margin-top: 36px; }
/* A grid of cards after a section card (or before one) keeps the same breathing room. */
.mh-section + .mh-portfolio-grid, .mh-portfolio-grid + .mh-section { margin-top: 36px; }
.mh-section-card + .mh-dash, .mh-dash + .mh-section-card, .mh-dash + .mh-dash { margin-top: 20px; }
.mh-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.mh-section-head .mh-section-title { margin: 0; }
.mh-section-title { margin: 0 0 12px; font-size: var(--mh-fs-lg); }
.mh-divider { height: 1px; margin: 20px 0; background: var(--mh-border); border: 0; }

/* 4. Buttons ==================================================================================== */
.mh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; background: var(--mh-primary); color: var(--mh-primary-text); border: 1px solid transparent; border-radius: var(--mh-radius-sm); padding: 9px 18px; font: inherit; font-size: var(--mh-fs-sm); font-weight: 650; letter-spacing: .005em; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--mh-shadow-sm); transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s; }
.mh-btn:hover { background: var(--mh-primary-hover); }
.mh-btn:active { transform: translateY(1px); }
.mh-btn .mh-icon { width: 18px; height: 18px; }
.mh-btn-secondary { background: var(--mh-surface); color: var(--mh-text); border-color: var(--mh-border-strong); }
.mh-btn-secondary:hover { background: var(--mh-surface-2); border-color: var(--mh-muted); }
.mh-btn-ghost { background: transparent; color: var(--mh-muted); box-shadow: none; }
.mh-btn-ghost:hover { background: var(--mh-surface-3); color: var(--mh-text); }
.mh-btn-danger { background: var(--mh-danger); color: var(--mh-surface); }
.mh-btn-danger:hover { background: var(--mh-danger); filter: brightness(.92); }
.mh-btn-danger-soft { background: var(--mh-danger-soft); color: var(--mh-danger); box-shadow: none; }
.mh-btn-danger-soft:hover { background: var(--mh-danger-soft); border-color: var(--mh-danger); }
.mh-btn-sm { min-height: 34px; padding: 6px 12px; font-size: var(--mh-fs-xs); }
.mh-btn-sm .mh-icon { width: 16px; height: 16px; }
.mh-btn-block { width: 100%; }
@media (max-width: 599px) { .mh-btn-sm { min-height: 40px; } } /* DESIGN.md: 40px touch targets */
.mh-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; background: none; border: 1px solid transparent; border-radius: var(--mh-radius-sm); color: var(--mh-muted); cursor: pointer; text-decoration: none; }
.mh-icon-btn:hover { background: var(--mh-surface-3); color: var(--mh-text); }
.mh-link-danger { color: var(--mh-danger); font-weight: 600; }
.mh-link-button { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 8px 0; font: inherit; font-weight: 600; cursor: pointer; }
.mh-flip .mh-icon { transform: scaleX(-1); }

/* 5. Badges, chips and tags ===================================================================== */
.mh-chip { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--mh-primary-soft); color: var(--mh-primary); }
.mh-chip--sm { width: 30px; height: 30px; border-radius: 9px; }
.mh-chip--sm .mh-icon { width: 17px; height: 17px; }
.mh-chip--lg { width: 52px; height: 52px; border-radius: 16px; }
.mh-chip--lg .mh-icon { width: 26px; height: 26px; }
.mh-chip--danger { background: var(--mh-danger-soft); color: var(--mh-danger); }
.mh-chip--warning { background: var(--mh-warning-soft); color: var(--mh-warning); }
.mh-chip--info { background: var(--mh-info-soft); color: var(--mh-info); }
.mh-chip--neutral { background: var(--mh-surface-3); color: var(--mh-muted); }
.mh-chip--income { background: color-mix(in srgb, var(--mh-income) 14%, var(--mh-surface)); color: var(--mh-income); }
.mh-chip--expense { background: color-mix(in srgb, var(--mh-expense) 16%, var(--mh-surface)); color: var(--mh-danger); }
.mh-chip--invest { background: color-mix(in srgb, var(--mh-invest) 14%, var(--mh-surface)); color: var(--mh-info); }
.mh-chip--goal { background: color-mix(in srgb, var(--mh-goal) 22%, var(--mh-surface)); color: var(--mh-warning); }
.mh-eyebrow { margin: 0 0 8px; font-size: var(--mh-fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mh-primary); }
/* Status pill: short state labels (On, Owner, Over the limit...). */
.mh-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 650; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.mh-status .mh-icon { width: 14px; height: 14px; stroke-width: 2.2; }
.mh-status--primary { background: var(--mh-primary-soft); color: var(--mh-primary); }
.mh-status--success { background: var(--mh-success-soft); color: var(--mh-success); }
.mh-status--warning { background: var(--mh-warning-soft); color: var(--mh-warning); }
.mh-status--danger { background: var(--mh-danger-soft); color: var(--mh-danger); }
.mh-status--info { background: var(--mh-info-soft); color: var(--mh-info); }
.mh-tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.mh-tag { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px 6px 10px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-pill); background: var(--mh-surface); color: var(--mh-text); font-weight: 500; text-decoration: none; }
.mh-tag .mh-icon { width: 16px; height: 16px; color: var(--mh-muted); }
a.mh-tag:hover { border-color: var(--mh-muted); background: var(--mh-surface-2); }
.mh-tag--sm { min-height: 0; padding: 1px 10px; font-size: var(--mh-fs-xs); }
/* Brand badges (apps/core/brands.py): colours come from the brand catalog, not the theme. */
.mh-badge { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--badge-bg); color: var(--badge-fg); font-size: .72rem; font-weight: 800; letter-spacing: -.01em; line-height: 1; text-align: center; overflow: hidden; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 8%); }
.mh-badge--logo { background: var(--mh-surface); object-fit: contain; padding: 4px; border: 1px solid var(--mh-border); box-shadow: none; }
/* Category tint */
.mh-cat { --cat: var(--mh-cat-slate); background: color-mix(in srgb, var(--cat) 14%, var(--mh-surface)); color: var(--cat); }
.mh-cat--green { --cat: var(--mh-cat-green); } .mh-cat--teal { --cat: var(--mh-cat-teal); } .mh-cat--blue { --cat: var(--mh-cat-blue); } .mh-cat--indigo { --cat: var(--mh-cat-indigo); } .mh-cat--purple { --cat: var(--mh-cat-purple); } .mh-cat--pink { --cat: var(--mh-cat-pink); } .mh-cat--red { --cat: var(--mh-cat-red); } .mh-cat--orange { --cat: var(--mh-cat-orange); } .mh-cat--amber { --cat: var(--mh-cat-amber); } .mh-cat--brown { --cat: var(--mh-cat-brown); } .mh-cat--slate { --cat: var(--mh-cat-slate); }

/* 6. Forms ====================================================================================== */
.mh-form { max-width: 600px; }
.mh-field { display: block; margin-bottom: 18px; }
.mh-field > label, .mh-field-label { display: block; margin-bottom: 6px; font-weight: 600; font-size: var(--mh-fs-sm); }
.mh-field input:not([type="checkbox"], [type="radio"]), .mh-field select, .mh-field textarea { display: block; width: 100%; min-height: 46px; margin-top: 6px; padding: 10px 13px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; transition: border-color .15s, box-shadow .15s; }
.mh-field > label + input, .mh-field > label + select, .mh-field > label + textarea, .mh-field > label + .mh-input-group { margin-top: 0; }
.mh-field input:hover, .mh-field select:hover { border-color: var(--mh-muted); }
.mh-field input:focus, .mh-field select:focus, .mh-field textarea:focus { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-field input:focus-visible, .mh-field select:focus-visible { outline: none; }
.mh-field input[aria-invalid="true"], .mh-field select[aria-invalid="true"], .mh-field:has(.mh-error) input, .mh-field:has(.mh-error) select { border-color: var(--mh-danger); }
.mh-field input[type="file"] { padding: 8px; min-height: 0; }
.mh-help { display: block; margin-top: 6px; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-field .mh-error { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: var(--mh-fs-sm); font-weight: 550; }
.mh-optional { color: var(--mh-subtle); font-weight: 500; }
.mh-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; }
.mh-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 8px; }
.mh-form-actions form { margin: 0; }
.mh-drawer .mh-form > .mh-form-actions:last-child { position: sticky; bottom: 0; margin: 8px -32px 0; padding: 14px 32px max(14px, env(safe-area-inset-bottom)); background: var(--mh-surface); border-top: 1px solid var(--mh-border); }
/* Input with a prefix, like "R$" before amounts */
.mh-input-group { position: relative; display: flex; align-items: stretch; }
.mh-input-group .mh-input-prefix { position: absolute; left: 1px; top: 1px; bottom: 1px; display: flex; align-items: center; padding: 0 10px 0 13px; color: var(--mh-muted); font-weight: 600; font-size: var(--mh-fs-sm); pointer-events: none; }
.mh-field .mh-input-group input { margin-top: 0; padding-left: 44px; font-variant-numeric: tabular-nums; }
/* Password with a show/hide button */
.mh-password { position: relative; }
.mh-password input { padding-right: 48px !important; }
.mh-password button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.mh-check, .mh-field > label.mh-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; cursor: pointer; }
.mh-check input { width: 18px; height: 18px; flex: none; margin: 2px 0 0; accent-color: var(--mh-primary); }
.mh-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.mh-fieldset > legend { margin-bottom: 8px; padding: 0; font-weight: 600; font-size: var(--mh-fs-sm); }
.mh-fieldset.mh-field { margin-bottom: 18px; }
/* Segmented control (radios or links) */
.mh-segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(110px, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--mh-border); border-radius: calc(var(--mh-radius-sm) + 4px); background: var(--mh-surface-3); }
.mh-segmented label, .mh-segmented a { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: var(--mh-radius-sm); color: var(--mh-muted); font-weight: 600; font-size: var(--mh-fs-sm); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s, color .15s; }
.mh-segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mh-segmented label:hover, .mh-segmented a:hover { color: var(--mh-text); }
.mh-segmented label:has(input:checked), .mh-segmented a[aria-current="page"] { background: var(--mh-surface); color: var(--mh-primary); box-shadow: var(--mh-shadow-sm); }
.mh-segmented label:has(input:focus-visible) { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-segmented .mh-icon { width: 18px; height: 18px; }
.mh-segmented--3 { display: grid; grid-auto-columns: minmax(0, 1fr); width: 100%; max-width: 600px; margin-bottom: 22px; } /* lines up with .mh-form */
.mh-drawer .mh-segmented--3 { max-width: none; } /* the drawer's form fills the drawer */
@media (max-width: 599px) {
  .mh-segmented--3 a, .mh-segmented--3 label { padding-inline: 6px; font-size: var(--mh-fs-xs); }
  .mh-segmented--3 .mh-icon { display: none; }
}
/* Pills (radio or checkbox chips) */
.mh-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.mh-pill { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-pill); background: var(--mh-surface); color: var(--mh-text); font-weight: 500; font-size: var(--mh-fs-sm); cursor: pointer; transition: border-color .15s, background-color .15s; }
.mh-pill input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mh-pill:hover { border-color: var(--mh-muted); }
.mh-pill:has(input:checked) { border-color: var(--mh-primary); background: var(--mh-primary-soft); color: var(--mh-primary); font-weight: 650; }
.mh-pill:has(input:checked)::before { content: ""; width: 14px; height: 14px; margin-left: -4px; background: currentColor; -webkit-mask: var(--mh-check-mask) center / contain no-repeat; mask: var(--mh-check-mask) center / contain no-repeat; }
.mh-pill:has(input:focus-visible) { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
:root { --mh-check-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); --mh-chevron-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E"); }

/* 7. Alerts and flash messages ================================================================== */
.mh-messages { max-width: 960px; margin: 16px auto 0; padding: 0 16px; display: grid; gap: 8px; }
.mh-message { display: flex; align-items: flex-start; gap: 12px; margin: 0; padding: 12px 14px; border-radius: var(--mh-radius); border: 1px solid color-mix(in srgb, var(--mh-success) 30%, transparent); background: var(--mh-success-soft); color: var(--mh-text); box-shadow: var(--mh-shadow-sm); animation: mh-fade-in .25s ease-out; }
.mh-message > .mh-icon { margin-top: 1px; color: var(--mh-success); }
.mh-message-text { flex: 1; margin: 0; font-weight: 500; }
.mh-message p { margin: 0; }
.mh-message .mh-icon-btn { width: 28px; height: 28px; margin: -3px -4px -3px 0; }
.mh-message--error { border-color: color-mix(in srgb, var(--mh-danger) 35%, transparent); background: var(--mh-danger-soft); }
.mh-message--error > .mh-icon { color: var(--mh-danger); }
.mh-message--warning { border-color: color-mix(in srgb, var(--mh-warning) 35%, transparent); background: var(--mh-warning-soft); }
.mh-message--warning > .mh-icon { color: var(--mh-warning); }
.mh-message--info { border-color: color-mix(in srgb, var(--mh-info) 30%, transparent); background: var(--mh-info-soft); }
.mh-message--info > .mh-icon { color: var(--mh-info); }
.mh-message.is-leaving { opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s; }
@keyframes mh-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* Inline notice inside cards and forms */
.mh-notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--mh-radius); background: var(--mh-info-soft); color: var(--mh-text); font-size: var(--mh-fs-sm); }
.mh-notice > .mh-icon { color: var(--mh-info); margin-top: 1px; }
.mh-notice p { margin: 0; max-width: var(--mh-measure); }
.mh-notice--warning { background: var(--mh-warning-soft); }
.mh-notice--warning > .mh-icon { color: var(--mh-warning); }

/* 8. Panel shell: sidebar on wide screens, drawer menu and tab bar on phones (static/js/panel.js) = */
.mh-skip { position: absolute; left: 16px; top: -48px; z-index: 30; padding: 8px 16px; background: var(--mh-surface); color: var(--mh-text); border-radius: var(--mh-radius-sm); box-shadow: var(--mh-shadow); }
.mh-skip:focus { top: 8px; }
.mh-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 264px minmax(0, 1fr); grid-template-areas: "nav main"; }
.mh-appbar { display: none; }
.mh-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--mh-text); font-weight: 750; font-size: 1.05rem; letter-spacing: -.01em; text-decoration: none; }
.mh-symbol { flex: none; }
.mh-brand .mh-symbol { width: 34px; height: 34px; }
/* Wordmark: "money" light, "health" bold in Verde Vital (Verde Broto on dark backgrounds). */
.mh-wordmark { font-family: var(--mh-font-display); font-size: 1.3rem; letter-spacing: -.035em; line-height: 1; color: var(--mh-text); }
.mh-wordmark span { font-weight: 300; }
.mh-wordmark strong { font-weight: 700; color: var(--mh-verde-vital); }
:root[data-theme="dark"] .mh-wordmark strong, .mh-auth-aside .mh-wordmark strong { color: var(--mh-verde-broto); }
.mh-brand-endorse { display: block; margin-top: 2px; font-size: var(--mh-fs-xs); color: var(--mh-subtle); letter-spacing: 0; }
.mh-sidebar { grid-area: nav; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 20px 14px; background: var(--mh-surface); border-right: 1px solid var(--mh-border); }
.mh-sidebar-brand { padding: 4px 10px; }
.mh-sidebar-cta { width: 100%; }
.mh-space-name, .mh-space-switcher { margin: 0; padding: 10px 12px; background: var(--mh-surface-2); border: 1px solid var(--mh-border); border-radius: var(--mh-radius); }
.mh-space-name, .mh-space-switcher summary { display: flex; align-items: center; gap: 10px; }
.mh-space-name > span:last-child, .mh-space-switcher summary > span:last-of-type { min-width: 0; }
.mh-space-label { display: block; font-size: var(--mh-fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--mh-muted); }
.mh-space-name strong, .mh-space-switcher summary strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-space-switcher summary { cursor: pointer; list-style: none; }
.mh-space-switcher summary::-webkit-details-marker { display: none; }
.mh-space-switcher summary .mh-caret { margin-left: auto; color: var(--mh-muted); transition: transform .15s; }
.mh-space-switcher[open] summary .mh-caret { transform: rotate(90deg); }
.mh-space-switcher ul { list-style: none; margin: 8px 0 0; padding: 0; }
.mh-space-switcher button { width: 100%; text-align: left; padding: 8px; background: none; border: 0; border-radius: var(--mh-radius-sm); color: var(--mh-text); font: inherit; cursor: pointer; }
.mh-space-switcher button:hover:not(:disabled) { background: var(--mh-bg); }
.mh-space-switcher button:disabled { font-weight: 650; cursor: default; color: var(--mh-primary); }
.mh-nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mh-nav-group + .mh-nav-group { margin-top: 14px; }
.mh-nav-label { margin: 0 0 6px; padding: 0 12px; font-size: var(--mh-fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--mh-subtle); }
.mh-nav a, .mh-nav button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: var(--mh-radius-sm); background: none; color: var(--mh-muted); font: inherit; font-size: .95rem; font-weight: 550; text-align: left; text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s; }
.mh-nav a:hover, .mh-nav button:hover { background: var(--mh-surface-3); color: var(--mh-text); }
.mh-nav a[aria-current="page"] { background: var(--mh-primary-soft); color: var(--mh-primary); font-weight: 650; }
.mh-nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: var(--mh-radius-pill); background: var(--mh-primary); }
.mh-nav form { margin: 0; }
.mh-sidebar-footer { margin-top: auto; display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--mh-border); }
.mh-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-width: 0; border-radius: var(--mh-radius); color: var(--mh-text); text-decoration: none; transition: background-color .15s; }
.mh-user:hover { background: var(--mh-surface-3); }
.mh-user[aria-current="page"] { background: var(--mh-primary-soft); }
.mh-user .mh-caret { margin-left: auto; color: var(--mh-subtle); }
.mh-user-text { min-width: 0; font-size: var(--mh-fs-sm); line-height: 1.3; }
.mh-user-text strong, .mh-user-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--mh-primary-soft); color: var(--mh-primary); font-weight: 750; text-transform: uppercase; }
.mh-avatar--img { object-fit: cover; background: var(--mh-border); }
.mh-avatar--lg { width: 56px; height: 56px; font-size: 1.3rem; }
.mh-avatar--xl { width: 96px; height: 96px; font-size: 2.2rem; box-shadow: 0 0 0 4px var(--mh-surface), var(--mh-shadow); }
.mh-main { grid-area: main; min-width: 0; width: 100%; padding: 32px clamp(24px, 2.5vw, 64px) 64px; } /* fluid: grids fill the screen, text keeps --mh-measure */
.mh-main:focus { outline: none; }
.mh-main .mh-messages { margin: 0 0 20px; padding: 0; max-width: none; }
.mh-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px 16px; margin-bottom: 26px; }
.mh-page-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mh-page-title > div { min-width: 0; }
.mh-page-head h1 { margin: 0; }
.mh-page-head p { margin: 4px 0 0; max-width: var(--mh-measure); }
.mh-page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mh-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--mh-muted); text-decoration: none; font-weight: 550; font-size: var(--mh-fs-sm); }
.mh-back:hover { color: var(--mh-text); }
/* The "+" for recording (one per page): a round button that opens a short menu above it. */
.mh-main { padding-bottom: 112px; } /* room so the button never covers the end of a page */
.mh-fab { position: fixed; right: clamp(20px, 2.5vw, 40px); bottom: 28px; z-index: 15; }
.mh-fab summary { display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; background: var(--mh-primary); color: var(--mh-primary-text); box-shadow: var(--mh-shadow-md); cursor: pointer; list-style: none; transition: background-color .15s, transform .15s; -webkit-tap-highlight-color: transparent; }
.mh-fab summary::-webkit-details-marker { display: none; }
.mh-fab summary:hover { background: var(--mh-primary-hover); }
.mh-fab summary:focus-visible { outline-offset: 3px; }
.mh-fab-icon { display: inline-flex; transition: transform .2s; }
.mh-fab-icon .mh-icon { width: 28px; height: 28px; stroke-width: 2.2; }
.mh-fab[open] .mh-fab-icon { transform: rotate(45deg); }
.mh-fab-menu { position: absolute; right: 0; bottom: calc(100% + 12px); display: grid; gap: 2px; width: max-content; min-width: 220px; max-width: calc(100vw - 32px); margin: 0; padding: 8px; list-style: none; background: var(--mh-surface); border: 1px solid var(--mh-border); border-radius: var(--mh-radius); box-shadow: var(--mh-shadow-md); }
.mh-fab[open] .mh-fab-menu { animation: mh-fab-in .15s ease-out; }
.mh-fab-menu a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px 6px 6px; border-radius: var(--mh-radius-sm); color: var(--mh-text); font-weight: 650; font-size: var(--mh-fs-sm); text-decoration: none; transition: background-color .15s; }
.mh-fab-menu a:hover { background: var(--mh-surface-3); }
.mh-fab-menu .mh-chip { width: 36px; height: 36px; border-radius: 10px; }
@keyframes mh-fab-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes mh-fab-in-centered { from { opacity: 0; transform: translate(-50%, 6px); } }
@media (prefers-reduced-motion: reduce) { .mh-fab-icon { transition: none; } .mh-fab[open] .mh-fab-menu { animation: none; } }
.mh-tabbar, .mh-appbar-user { display: none; }

@media (max-width: 899px) {
  :root { --mh-appbar-h: 56px; --mh-tabbar-h: 64px; }
  .mh-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "bar" "main"; }
  .mh-appbar { grid-area: bar; display: flex; align-items: center; gap: 8px; height: calc(var(--mh-appbar-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; background: color-mix(in srgb, var(--mh-surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--mh-border); position: sticky; top: 0; z-index: 15; }
  .mh-appbar .mh-brand { font-size: 1rem; }
  .mh-appbar .mh-brand .mh-symbol { width: 30px; height: 30px; }
  .mh-appbar .mh-wordmark { font-size: 1.15rem; }
  .mh-appbar-user { display: inline-flex; margin-left: auto; border-radius: 50%; text-decoration: none; }
  .mh-sidebar { position: static; height: auto; grid-area: main; border-right: 0; border-bottom: 1px solid var(--mh-border); }
  .mh-sidebar-brand { display: none; }
  .mh-nav a[aria-current="page"]::before { display: none; }
  .js .mh-sidebar { display: none; position: fixed; top: calc(var(--mh-appbar-h) + env(safe-area-inset-top)); right: 0; bottom: 0; left: 0; z-index: 16; height: auto; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .js .mh-sidebar.is-open { display: flex; }
  html:not(.js) .mh-shell { grid-template-rows: auto auto 1fr; grid-template-areas: "bar" "nav" "main"; }
  html:not(.js) .mh-sidebar { grid-area: nav; }
  html:not(.js) .mh-menu-btn { display: none; }
  .mh-main { padding: 20px 16px calc(var(--mh-tabbar-h) + 36px + env(safe-area-inset-bottom)); }
  h1 { font-size: var(--mh-fs-xl); }
  .mh-tabbar { position: fixed; right: 0; bottom: 0; left: 0; z-index: 14; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: stretch; height: calc(var(--mh-tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--mh-surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--mh-border); box-shadow: 0 -2px 12px rgb(0 0 0 / 5%); }
  .mh-tabbar a, .mh-tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; padding: 4px 2px 2px; background: none; border: 0; color: var(--mh-muted); font: inherit; font-size: var(--mh-fs-xs); font-weight: 650; line-height: 1.15; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mh-tabbar a span, .mh-tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mh-tabbar .mh-icon { width: 22px; height: 22px; padding: 6px; border-radius: 14px; box-sizing: content-box; }
  .mh-tabbar a[aria-current="page"], .mh-tabbar button[aria-expanded="true"] { color: var(--mh-primary); }
  .mh-tabbar a[aria-current="page"] .mh-icon, .mh-tabbar button[aria-expanded="true"] .mh-icon { stroke-width: 2.2; background: var(--mh-primary-soft); }
  html.mh-nav-open, html.mh-nav-open body { overflow: hidden; }
  .mh-skip:focus { top: calc(var(--mh-appbar-h) + env(safe-area-inset-top) + 8px); }
  .mh-main .mh-toolbar { top: calc(var(--mh-appbar-h) + env(safe-area-inset-top)); }
  .mh-page-head { align-items: flex-start; }
  .mh-page-actions { width: 100%; }
  .mh-page-actions > .mh-btn, .mh-page-actions > a.mh-btn { flex: 1 1 auto; }
  /* Phones: the "+" sits in the middle slot of the tab bar, a little raised, and the menu opens centred above it. */
  .mh-fab { right: auto; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); }
  .mh-fab summary { width: 50px; height: 50px; box-shadow: 0 0 0 4px var(--mh-surface), var(--mh-shadow-md); }
  .mh-fab-icon .mh-icon { width: 26px; height: 26px; }
  .mh-fab-menu { right: auto; left: 50%; bottom: calc(100% + 16px); min-width: min(260px, calc(100vw - 32px)); transform: translateX(-50%); }
  .mh-fab[open] .mh-fab-menu { animation-name: mh-fab-in-centered; }
  .mh-page-head .mh-btn { min-height: 44px; padding: 8px 14px; }
  .mh-page-head .mh-page-title .mh-chip { display: none; }
  .mh-card { padding: 18px; border-radius: var(--mh-radius); }
  .mh-list > .mh-list-item { min-height: 64px; }
  .mh-cat-children .mh-list-item, .mh-pockets .mh-list-item { min-height: 0; }
}

/* 9. Summaries, lists and amounts =============================================================== */
.mh-summaries { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 28px; }
.mh-summaries--fill { display: flex; flex-wrap: wrap; }
.mh-summaries--fill > .mh-tile { flex: 1 1 210px; } /* each row stretches: no empty slot */
.mh-worth-split { font-size: var(--mh-fs-sm); }
.mh-summaries--3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.mh-tile { display: grid; gap: 6px; align-content: start; min-width: 0; container-type: inline-size; }
.mh-tile p { margin: 0; }
.mh-tile-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mh-tile-title { margin: 0; min-width: 0; font-size: var(--mh-fs-sm); font-weight: 600; color: var(--mh-muted); overflow-wrap: anywhere; }
.mh-tile-link { margin-top: 6px !important; font-weight: 650; font-size: var(--mh-fs-sm); }
.mh-tile-link a { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }
.mh-tile-link a:hover { text-decoration: underline; }
.mh-tile-link .mh-icon { width: 16px; height: 16px; }
.mh-amount { margin: 0; max-width: 100%; font-family: var(--mh-font-display); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; letter-spacing: -.02em; }
/* The figure follows the card: a long balance stays inside a half-width tile and a short one stays large. */
.mh-summaries .mh-amount--big { font-size: clamp(0.875rem, 8cqi, var(--mh-fs-3xl)); }
.mh-amount--big { font-size: var(--mh-fs-3xl); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.mh-amount--negative { color: var(--mh-danger); }
.mh-amount--positive { color: var(--mh-income); }
.mh-meter { height: 8px; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); overflow: hidden; }
.mh-meter span { display: block; height: 100%; border-radius: inherit; background: var(--mh-primary); transition: width .4s ease-out; }
.mh-meter--lg { height: 10px; }
.mh-list { list-style: none; margin: 0; padding: 0; background: var(--mh-surface); border: 1px solid var(--mh-border); border-radius: var(--mh-radius-lg); box-shadow: var(--mh-shadow); overflow: hidden; }
.mh-list-item { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; transition: background-color .15s; }
.mh-list-item + .mh-list-item { border-top: 1px solid var(--mh-border); }
.mh-list-item:has(a.mh-list-title):hover { background: var(--mh-surface-2); }
/* Clickable rows get a chevron (rows with actions keep their buttons instead). */
.mh-list-item:has(> .mh-list-main a.mh-list-title):not(:has(.mh-list-actions))::after { content: ""; flex: none; width: 18px; height: 18px; margin-left: -6px; background: var(--mh-subtle); -webkit-mask: var(--mh-chevron-mask) center / contain no-repeat; mask: var(--mh-chevron-mask) center / contain no-repeat; }
.mh-list-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mh-list-main > div { min-width: 0; }
.mh-list-title { font-weight: 650; color: var(--mh-text); overflow-wrap: anywhere; }
a.mh-list-title { text-decoration: none; }
a.mh-list-title::after { content: ""; position: absolute; inset: 0; }
a.mh-list-title:focus-visible { outline: none; }
a.mh-list-title:focus-visible::after { outline: 3px solid var(--mh-primary); outline-offset: -3px; border-radius: var(--mh-radius-sm); }
.mh-list-meta { margin: 2px 0 0; font-size: var(--mh-fs-sm); overflow-wrap: anywhere; }
.mh-list-figure, .mh-list-item > .mh-amount { margin-left: auto; text-align: right; }
.mh-list-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; }
.mh-list-actions form { margin: 0; }
.mh-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 52px 24px; }
.mh-empty h2, .mh-empty h3 { margin: 10px 0 0; }
.mh-empty p { max-width: 48ch; margin: 0 0 10px; }
.mh-empty .mh-chip { width: 60px; height: 60px; border-radius: 18px; }
.mh-empty .mh-chip .mh-icon { width: 28px; height: 28px; }
/* Investments -------------------------------------------------------------------------------- */
.mh-alloc--stocks { --alloc: var(--mh-cat-blue); }
.mh-alloc--fiis { --alloc: var(--mh-cat-teal); }
.mh-alloc--etfs { --alloc: var(--mh-cat-purple); }
.mh-alloc--fixed_income { --alloc: var(--mh-cat-green); }
.mh-alloc--crypto { --alloc: var(--mh-cat-amber); }
.mh-portfolio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.mh-portfolio-card { display: grid; gap: 6px; align-content: start; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.mh-portfolio-card:hover { border-color: var(--mh-primary); }
.mh-portfolio-card:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-portfolio-card .mh-card-head { margin-bottom: 6px; }
.mh-portfolio-card h2 { font-size: var(--mh-fs-lg); }
.mh-portfolio-card p { margin: 0; }
.mh-portfolio-result { font-weight: 650; font-size: var(--mh-fs-sm); }
.mh-alloc-bar { display: flex; height: 8px; margin-top: 10px; border-radius: var(--mh-radius-pill); overflow: hidden; background: var(--mh-surface-3); }
.mh-chart-split { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: center; }
.mh-chart-split > .mh-donut { width: 160px; justify-self: center; }
.mh-share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mh-share-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.mh-share-row:not(:has(.mh-share-swatch)) { grid-template-columns: minmax(0, 1fr) auto; }
.mh-share-swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--alloc, var(--cat, var(--mh-cat-slate))); }
.mh-share-main { display: grid; gap: 4px; min-width: 0; }
.mh-share-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-share-track { display: block; height: 8px; border-radius: var(--mh-radius-pill); overflow: hidden; background: var(--mh-surface-3); }
.mh-share-track span { display: block; height: 100%; border-radius: inherit; background: var(--alloc, var(--cat, var(--mh-primary))); }
.mh-share-fill { background: var(--mh-primary); }
.mh-share-figure { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mh-mini-cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 140px; margin: 8px 0 0; padding: 0; list-style: none; align-items: end; }
.mh-mini-cols li { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.mh-mini-bar { display: block; width: min(100%, 18px); border-radius: 4px 4px 0 0; background: var(--mh-income); }
.mh-mini-cols small { color: var(--mh-subtle); font-size: 10px; line-height: 1; }
.mh-exposure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.mh-exposure-grid h3 { margin: 0 0 10px; }
.mh-radar-list { list-style: none; margin: 0; padding: 0; }
.mh-radar-card { display: grid; gap: 14px; padding: 16px 0; }
.mh-radar-card + .mh-radar-card { border-top: 1px solid var(--mh-border); }
.mh-radar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mh-radar-head h3 { margin: 0; font-family: var(--mh-font-display); font-size: var(--mh-fs-lg); font-weight: 650; }
.mh-radar-head p { margin: 2px 0 0; }
.mh-radar-head form { flex: none; }
.mh-radar-score { display: grid; gap: 8px; }
.mh-radar-figure { margin: 0; font-family: var(--mh-font-display); font-size: var(--mh-fs-2xl); font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1; }
.mh-radar-figure.mh-score-high { color: var(--mh-success); }
.mh-radar-figure.mh-score-mid { color: var(--mh-warning); }
.mh-radar-figure.mh-score-low { color: var(--mh-danger); }
.mh-radar-intent { margin: 0; max-width: var(--mh-measure); }
.mh-radar-card .mh-meter { height: 10px; }
.mh-radar-scale { display: flex; justify-content: space-between; gap: 12px; color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-radar-scale span { white-space: nowrap; }
.mh-radar-methods { list-style: none; margin: 0; padding: 0; }
.mh-radar-methods li { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--mh-border); }
.mh-radar-method-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mh-radar-method-head strong { min-width: 0; }
.mh-radar-methods p { margin: 0; color: var(--mh-muted); font-size: var(--mh-fs-sm); }

/* Radar cards (1.19.0): one card per asset, the person's criteria with a check each, the card opens
   the asset's radar page. Equal heights in a row: the list item stretches and the foot sits last. */
.mh-radar-rules { padding: 18px 24px; }
.mh-radar-rules-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.mh-radar-rules-head .mh-section-title { margin: 0; font-size: var(--mh-fs-md); }
.mh-rule-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.mh-rule-chips li { padding: 4px 12px; border-radius: var(--mh-radius-pill); background: var(--mh-primary-soft); color: var(--mh-primary); font-size: var(--mh-fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.mh-radar-add { padding: 0; }
.mh-radar-add > summary { display: flex; align-items: center; gap: 12px; padding: 16px 24px; cursor: pointer; list-style: none; font-weight: 650; }
.mh-radar-add > summary::-webkit-details-marker { display: none; }
.mh-radar-add > summary > span:nth-child(2) { flex: 1; }
.mh-radar-add > summary > .mh-icon { color: var(--mh-muted); transition: transform .15s; }
.mh-radar-add[open] > summary > .mh-icon { transform: rotate(180deg); }
.mh-radar-add > summary:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: -3px; border-radius: var(--mh-radius-lg); }
.mh-radar-add > form { padding: 0 24px 24px; }
.mh-radar-rules + .mh-section { margin-top: 20px; }
.mh-radar-count { margin: 0; font-size: var(--mh-fs-sm); }
.mh-asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.mh-asset-grid > li { display: flex; min-width: 0; }
.mh-asset-card { display: flex; flex-direction: column; gap: 14px; width: 100%; padding: 20px; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.mh-asset-card:hover { border-color: var(--mh-primary); transform: translateY(-2px); box-shadow: var(--mh-shadow-md); }
.mh-asset-card:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-asset-card-head { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.mh-asset-avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--mh-primary-soft); color: var(--mh-primary); font-family: var(--mh-font-display); font-weight: 650; font-size: var(--mh-fs-sm); text-transform: uppercase; object-fit: contain; }
img.mh-asset-avatar { padding: 3px; background: var(--mh-surface); border: 1px solid var(--mh-border); }
.mh-asset-avatar--lg { width: 56px; height: 56px; font-size: var(--mh-fs-md); }
.mh-asset-card-title { display: grid; min-width: 0; }
.mh-asset-card-title strong { font-family: var(--mh-font-display); font-size: var(--mh-fs-lg); font-weight: 650; line-height: 1.2; }
.mh-asset-card-title span { overflow: hidden; color: var(--mh-muted); font-size: var(--mh-fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.mh-asset-card-head .mh-status { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.mh-asset-card-quote { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 12px 14px; border-radius: var(--mh-radius); background: var(--mh-surface-2); font-variant-numeric: tabular-nums; }
.mh-asset-card-quote > span:first-child { margin-right: auto; font-size: var(--mh-fs-sm); }
.mh-asset-card-quote strong { font-family: var(--mh-font-display); font-size: var(--mh-fs-xl); font-weight: 650; }
.mh-asset-card-quote .mh-ok, .mh-asset-card-quote .mh-error { font-size: var(--mh-fs-sm); font-weight: 650; }
.mh-asset-card-facts { display: grid; gap: 0; margin: 0; }
.mh-asset-card-facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--mh-border); }
.mh-asset-card-facts > div:last-child { border-bottom: 0; }
.mh-asset-card-facts dt { color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-asset-card-facts dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.mh-asset-card-facts dd.mh-score-high { color: var(--mh-success); }
.mh-asset-card-facts dd.mh-score-mid { color: var(--mh-warning); }
.mh-asset-card-facts dd.mh-score-low { color: var(--mh-danger); }
.mh-asset-key { margin-top: 16px; }
.mh-criteria { display: grid; gap: 2px; margin: 0; padding: 10px 12px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); list-style: none; }
.mh-criteria li { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: 10px; padding: 5px 0; font-size: var(--mh-fs-sm); }
.mh-criteria-name { min-width: 0; }
.mh-criteria-name small { color: var(--mh-muted); font-size: var(--mh-fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mh-criteria-value { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.mh-criteria .mh-icon { width: 20px; height: 20px; }
.mh-criteria--met .mh-icon { color: var(--mh-success); stroke-width: 2.2; }
.mh-criteria--unmet .mh-icon { color: var(--mh-border-strong); }
.mh-criteria--no_data .mh-icon, .mh-criteria--no_data .mh-criteria-value { color: var(--mh-muted); }
.mh-criteria--wide { margin: 14px 0 8px; padding: 4px 14px; }
.mh-criteria--wide li { padding: 9px 0; font-size: var(--mh-fs-md); }
.mh-criteria--wide li + li { border-top: 1px solid var(--mh-border); }
.mh-asset-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--mh-border); }
.mh-asset-verdict { display: grid; gap: 6px; flex: 1; min-width: 0; }
.mh-asset-verdict strong { font-size: var(--mh-fs-sm); }
.mh-asset-verdict--lg strong { font-family: var(--mh-font-display); font-size: var(--mh-fs-lg); }
.mh-verdict-track { display: block; height: 6px; overflow: hidden; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); }
.mh-verdict-track span { display: block; height: 100%; border-radius: inherit; background: var(--mh-muted); }
.mh-verdict-high strong { color: var(--mh-success); }
.mh-verdict-high .mh-verdict-track span { background: var(--mh-success); }
.mh-verdict-mid strong { color: var(--mh-warning); }
.mh-verdict-mid .mh-verdict-track span { background: var(--mh-goal); }
.mh-verdict-low strong, .mh-verdict-none strong { color: var(--mh-muted); }
.mh-asset-card-more { display: inline-flex; align-items: center; gap: 2px; color: var(--mh-primary); font-size: var(--mh-fs-sm); font-weight: 650; white-space: nowrap; }
.mh-asset-card-more .mh-icon { width: 16px; height: 16px; }
.mh-indicator-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 10px; margin: 0; }
.mh-indicator-grid > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--mh-radius); background: var(--mh-surface-2); }
.mh-indicator-grid dt { color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-indicator-grid dd { margin: 0; font-family: var(--mh-font-display); font-size: var(--mh-fs-lg); font-weight: 650; font-variant-numeric: tabular-nums; }
.mh-year-cols { grid-template-columns: repeat(6, minmax(0, 1fr)); height: 180px; }
.mh-year-cols small { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mh-year-cols .mh-mini-bar { width: min(100%, 36px); }
.mh-mini-bar--partial { background: repeating-linear-gradient(135deg, var(--mh-income) 0 4px, transparent 4px 8px); border: 1px solid var(--mh-income); }
.mh-criteria-form { max-width: 820px; }
.mh-crit-rows { display: grid; gap: 12px; margin: 0 0 14px; padding: 0; list-style: none; }
.mh-crit-row { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 0 12px; padding: 12px 14px 0; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); background: var(--mh-surface-2); }
.mh-crit-row .mh-field { margin-bottom: 12px; }
.mh-input-group--suffix input { padding-left: 13px !important; padding-right: 52px; }
.mh-input-suffix { position: absolute; right: 1px; top: 1px; bottom: 1px; display: flex; align-items: center; padding: 0 12px; color: var(--mh-muted); font-weight: 600; font-size: var(--mh-fs-sm); pointer-events: none; }
.mh-crit-remove { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 12px; padding: 0 10px; border-radius: var(--mh-radius); color: var(--mh-danger); font-size: var(--mh-fs-sm); font-weight: 600; cursor: pointer; }
.mh-crit-remove:hover { background: var(--mh-danger-soft); }
.mh-criteria-js .mh-crit-remove input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mh-crit-remove:focus-within { outline: 3px solid var(--mh-primary); outline-offset: 1px; }
.mh-indicator-help { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px 24px; margin: 0; }
.mh-indicator-help dt { font-weight: 650; }
.mh-indicator-help dd { margin: 2px 0 0; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
@media (max-width: 640px) {
  .mh-crit-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mh-crit-metric { grid-column: 1 / -1; }
  .mh-crit-remove { grid-column: 1 / -1; justify-content: center; }
  .mh-asset-card { padding: 16px; }
  .mh-radar-add > summary, .mh-radar-rules { padding-left: 16px; padding-right: 16px; }
  .mh-radar-add > form { padding: 0 16px 16px; }
}
.mh-meter span.mh-score-high { background: var(--mh-success); }
.mh-meter span.mh-score-mid { background: var(--mh-goal); }
.mh-meter span.mh-score-low { background: var(--mh-danger); }
@media (max-width: 640px) {
  .mh-chart-split { grid-template-columns: 1fr; justify-items: center; }
  .mh-exposure-grid { grid-template-columns: 1fr; }
}
.mh-alloc-bar span { background: var(--alloc); }
.mh-alloc-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--mh-fs-xs); }
.mh-alloc-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mh-alloc-legend i, .mh-alloc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--alloc); }
.mh-alloc-dot { margin-right: 7px; vertical-align: 1px; }
.mh-alloc-meter { position: relative; overflow: visible; margin: 8px 0 6px; }
.mh-alloc-meter span { background: var(--alloc); }
.mh-alloc-meter b { position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; border-radius: 1px; background: var(--mh-text); }
.mh-alloc-list .mh-compact-text strong { white-space: normal; }
.mh-section-card + .mh-section-card { margin-top: 20px; }
.mh-section-card { padding: 20px; }
.mh-alloc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 24px; margin: 0; }
.mh-compact.mh-alloc-list li + li { border-top: 0; }
/* Portfolio by type and liquidity; the type line under each position (investments/_terms.html). */
.mh-breakdown-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; }
.mh-breakdown-title { margin: 12px 0 4px; font-size: var(--mh-fs-sm); color: var(--mh-muted); font-weight: 600; }
.mh-table tbody th .mh-asset-terms { color: var(--mh-text); font-weight: 500; }
.mh-bench { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 2px 0 0; padding: 0; }
.mh-bench li { display: grid; gap: 2px; }
.mh-bench span { font-size: var(--mh-fs-xs); color: var(--mh-muted); font-weight: 600; }
.mh-bench strong { font-family: var(--mh-font-display, inherit); font-size: var(--mh-fs-lg); }
.mh-bench-since { font-size: var(--mh-fs-xs); }
.mh-table-wrap { overflow-x: auto; }
.mh-table { width: 100%; border-collapse: collapse; font-size: var(--mh-fs-sm); }
.mh-table th, .mh-table td { padding: 10px 8px; text-align: left; border-top: 1px solid var(--mh-border); vertical-align: top; white-space: nowrap; }
.mh-table thead th { border-top: 0; color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.mh-table tbody th { font-weight: 400; }
.mh-table tbody th a { text-decoration: none; }
.mh-table tbody th span, .mh-table td span { display: block; font-size: var(--mh-fs-xs); }
.mh-table td > a { display: block; font-size: var(--mh-fs-xs); }
/* Income tax support: one row per item, the description wraps and can be copied. */
.mh-tax-list { margin: 0; padding: 0; list-style: none; }
.mh-tax-list > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 24px; padding: 14px 0; border-top: 1px solid var(--mh-border); }
.mh-tax-list > li:first-child { border-top: 0; }
.mh-tax-list--plain > li { flex-wrap: nowrap; align-items: center; padding: 10px 0; }
.mh-tax-main { flex: 1 1 320px; min-width: 0; }
.mh-tax-main p { margin: 0; overflow-wrap: anywhere; }
.mh-tax-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mh-tax-code { margin-top: 2px !important; color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-tax-copy { margin: 6px 0 8px !important; color: var(--mh-text); font-size: var(--mh-fs-sm); line-height: 1.45; }
.mh-tax-values { display: flex; gap: 20px; margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.mh-tax-values dt { color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-tax-values dd { margin: 2px 0 0; white-space: nowrap; }
.mh-tax-figure { margin: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mh-tax-note { margin: 12px 0 0; color: var(--mh-muted); font-size: var(--mh-fs-xs); }
@media (max-width: 560px) { .mh-tax-values { width: 100%; justify-content: space-between; text-align: left; } }
.mh-table .mh-num { text-align: right; font-variant-numeric: tabular-nums; }
.mh-target-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; align-items: end; } /* labels of 1 to 3 lines, controls on one line */
/* Portfolio form (UX): label, control, help and error of each field share rows with the fields
   beside it, so the boxes line up even when only some fields have help under them. */
@supports (grid-template-rows: subgrid) {
  .mh-target-grid { align-items: stretch; }
  .mh-target-grid > .mh-field { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
  .mh-target-grid > .mh-field > label { align-self: end; }
  .mh-target-grid > .mh-field > * { min-width: 0; }
  .mh-target-grid > .mh-field > .mh-input-group, .mh-target-grid > .mh-field > input, .mh-target-grid > .mh-field > select { align-self: start; }
  .mh-target-grid > .mh-field input:not([type="checkbox"], [type="radio"]), .mh-target-grid > .mh-field select { margin-top: 0; } /* the label's margin is the gap */
  .mh-target-grid > .mh-field > .mh-help { margin-top: 6px; }
}
.mh-plan-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.mh-form-section { margin: 0 0 24px; padding: 22px 0 0; border-top: 1px solid var(--mh-border); }
.mh-form-section:first-of-type { padding-top: 0; border-top: 0; }
.mh-form-section > legend { float: left; width: 100%; margin: 0 0 6px; padding: 0; font-family: var(--mh-font-display); font-size: var(--mh-fs-md); font-weight: 650; }
.mh-form-section > legend + * { clear: both; }
.mh-section-intro { margin: 0 0 14px; max-width: var(--mh-measure); color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-methods { container-type: inline-size; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); background: var(--mh-surface); }
.mh-method { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); gap: 2px 20px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--mh-border); }
.mh-method:first-child { border-top: 0; }
.mh-method-name { grid-column: 1; font-weight: 650; }
.mh-method-text { grid-column: 1; margin: 0; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-method-weight { grid-column: 2; grid-row: 1 / span 2; display: grid; grid-auto-columns: minmax(0, 1fr); }
.mh-method-weight label { padding-inline: 6px; }
.mh-method .mh-error { grid-column: 1 / -1; }
.mh-method:has(input[value="0"]:checked) .mh-method-name { color: var(--mh-muted); } /* not used */
@container (max-width: 640px) {
  .mh-method { grid-template-columns: minmax(0, 1fr); }
  .mh-method-weight { grid-column: 1; grid-row: auto; margin-top: 10px; }
}
@container (max-width: 360px) {
  .mh-method-weight label { font-size: var(--mh-fs-xs); }
}
.mh-weights-help { margin-top: 14px; padding: 14px 16px; border-radius: var(--mh-radius); background: var(--mh-surface-2); font-size: var(--mh-fs-sm); }
.mh-weights-help p { margin: 0 0 8px; max-width: var(--mh-measure); }
.mh-weights-help p:last-child { margin-bottom: 0; }
.mh-chart { margin: 4px 0 0; }
.mh-chart svg { display: block; width: 100%; height: 180px; overflow: visible; }
.mh-chart polyline { stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.mh-chart-up { stroke: var(--mh-income); }
.mh-chart-down { stroke: var(--mh-danger); }
.mh-chart figcaption { margin-top: 8px; font-size: var(--mh-fs-xs); }
.mh-asset-price p { margin: 0 0 6px; }
.mh-asset-logo { width: 56px; height: 56px; border-radius: 16px; }
.mh-disclaimer { margin: 28px 0 0; font-size: var(--mh-fs-xs); color: var(--mh-muted); }
.mh-op-delete { margin-top: 12px; }
/* Mastermind and method verdicts */
.mh-verdict { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--mh-surface-3); box-shadow: inset 0 0 0 1px var(--mh-border); }
.mh-verdict--within { background: var(--mh-success); box-shadow: none; }
.mh-verdict--neutral { background: var(--mh-warning); box-shadow: none; }
.mh-verdict--outside { background: var(--mh-danger); box-shadow: none; }
.mh-mind { list-style: none; margin: 0 -8px; padding: 0; }
.mh-mind > li + li { border-top: 1px solid var(--mh-border); }
.mh-mind summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 8px; cursor: pointer; list-style: none; border-radius: var(--mh-radius-sm); }
.mh-mind summary::-webkit-details-marker { display: none; }
.mh-mind summary:hover { background: var(--mh-surface-2); }
.mh-mind summary:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: -3px; }
.mh-mind summary strong { min-width: 70px; }
.mh-mind summary > .mh-icon { margin-left: auto; width: 18px; height: 18px; color: var(--mh-subtle); transition: transform .15s; }
.mh-mind details[open] summary > .mh-icon { transform: rotate(90deg); }
.mh-mind-chips { display: inline-flex; gap: 4px; }
.mh-mind-text { font-size: var(--mh-fs-sm); }
.mh-mind .mh-compact { margin: 0 0 8px; padding-left: 8px; }
.mh-mind .mh-compact li { align-items: flex-start; }
.mh-mind .mh-compact-text strong, .mh-alloc-list .mh-compact-text span { white-space: normal; }
.mh-compact .mh-status { flex: none; min-width: 74px; justify-content: center; }
.mh-method-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 24px; margin: 0; }
.mh-compact.mh-method-list li { flex-direction: column; align-items: flex-start; gap: 6px; }
.mh-compact.mh-method-list li + li { border-top: 0; }
.mh-method-list .mh-status { align-self: flex-start; }
.mh-method-list .mh-compact-text strong, .mh-method-list .mh-compact-text span { white-space: normal; }
.mh-mind-note { margin: 10px 0 0; font-size: var(--mh-fs-xs); }
.mh-inline-form .mh-input-group { flex: 1 1 160px; }
.mh-inline-form .mh-input-group input { width: 100%; padding-left: 40px; }
.mh-review-text p { margin: 0 0 10px; max-width: var(--mh-measure); }
.mh-review-text p:first-line { font-weight: 650; }
.mh-review-wait { display: flex; align-items: center; gap: 10px; margin: 0; }
.mh-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--mh-border); border-top-color: var(--mh-primary); animation: mh-spin .8s linear infinite; }
@keyframes mh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mh-spinner { animation-duration: 3s; } }
.mh-ai-wait { display: flex; align-items: center; gap: 10px; }
.mh-review form { margin-top: 12px; }

/* Operation form: each field shows only for the kinds it applies to. */
.mh-op-form .mh-field[data-kinds] { display: none; }
.mh-op-form:has(select[name="kind"] option[value="buy"]:checked) .mh-field[data-kinds~="buy"],
.mh-op-form:has(select[name="kind"] option[value="sell"]:checked) .mh-field[data-kinds~="sell"],
.mh-op-form:has(select[name="kind"] option[value="dividend"]:checked) .mh-field[data-kinds~="dividend"],
.mh-op-form:has(select[name="kind"] option[value="jcp"]:checked) .mh-field[data-kinds~="jcp"],
.mh-op-form:has(select[name="kind"] option[value="income"]:checked) .mh-field[data-kinds~="income"],
.mh-op-form:has(select[name="kind"] option[value="split"]:checked) .mh-field[data-kinds~="split"],
.mh-op-form:has(select[name="kind"] option[value="reverse_split"]:checked) .mh-field[data-kinds~="reverse_split"],
.mh-op-form:has(select[name="kind"] option[value="bonus"]:checked) .mh-field[data-kinds~="bonus"] { display: block; }
/* Fixed income (CDB, LCI, LCA) goes by value: quantity and price give way to the amount, and a
   partial redemption asks how much of the invested amount it took out. Same specificity as the
   rules above, so these win by coming after them. */
.mh-op-form:not(:has(select[name="asset_kind"] option[value="fixed_income"]:checked)) .mh-field[data-fixed="only"],
.mh-op-form:has(select[name="asset_kind"] option[value="fixed_income"]:checked) .mh-field[data-fixed="never"] { display: none; }
.mh-op-form.mh-op-form:has(select[name="redemption"] option[value="all"]:checked) .mh-field[data-partial][data-kinds] { display: none; }
/* Product, liquidity and maturity (apps/investments/terms.py): fixed income, Treasury and funds;
   a Treasury bond's product is already in its name. */
.mh-op-form:not(:has(select[name="asset_kind"] option[value="fixed_income"]:checked)):not(:has(select[name="asset_kind"] option[value="treasury"]:checked)):not(:has(select[name="asset_kind"] option[value="fund"]:checked)) .mh-field[data-term],
.mh-op-form:has(select[name="asset_kind"] option[value="treasury"]:checked) .mh-field[data-term="product"] { display: none; }
.mh-op-form:not(:has(select[name="asset_kind"] option[value="fund"]:checked)) .mh-field[data-cnpj] { display: none; }
.mh-return { margin: 4px 0 0; }
.mh-return-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; }
.mh-return-legend span { display: inline-flex; align-items: center; gap: 8px; color: var(--mh-text); font-size: var(--mh-fs-sm); }
.mh-return-legend strong { font-variant-numeric: tabular-nums; }
.mh-return-plot { position: relative; height: 240px; margin: 0 4px 4px 46px; }
.mh-return-axis { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.mh-return-axis li { position: absolute; left: 0; right: 0; border-top: 1px solid var(--mh-border); }
.mh-return-axis span { position: absolute; right: calc(100% + 8px); transform: translateY(-50%); color: var(--mh-subtle); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mh-return-axis li:first-child span { transform: none; }
.mh-return-axis li:last-child span { transform: translateY(-100%); }
.mh-return-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mh-return-dot { position: absolute; width: 9px; height: 9px; margin: -5px 0 0 -5px; border-radius: 50%; box-shadow: 0 0 0 2px var(--mh-surface); }
.mh-return-dates { display: flex; justify-content: space-between; gap: 8px; margin: 8px 0 0 46px; padding: 0; list-style: none; color: var(--mh-subtle); font-size: 11px; font-variant-numeric: tabular-nums; }
.mh-return-dates li:nth-child(2) { text-align: center; }
.mh-return-dates li:last-child { text-align: right; }
.mh-curve { fill: none; stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.mh-curve-area { fill: color-mix(in srgb, var(--mh-invest) 16%, transparent); stroke: none; }
.mh-curve--you { stroke: var(--mh-invest); }
.mh-curve--cdi { stroke: var(--mh-income); }
.mh-curve--ibov { stroke: var(--mh-goal); }
.mh-curve--ipca { stroke: var(--mh-subtle); }
.mh-curve-key--you { background: var(--mh-invest); }
.mh-curve-key--cdi { background: var(--mh-income); }
.mh-curve-key--ibov { background: var(--mh-goal); }
.mh-curve-key--ipca { background: var(--mh-subtle); }
@media (max-width: 599px) {
  .mh-return-plot { height: 200px; margin-left: 0; }
  .mh-return-axis span { left: 2px; right: auto; padding: 0 4px; background: color-mix(in srgb, var(--mh-surface) 88%, transparent); }
  .mh-return-dates { margin-left: 0; }
}

/* Benefit card: recharge dates skipped for vacation, each with "Bring it back". */
.mh-recharge-skips { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.mh-recharge-skips li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mh-recharge-skips .mh-link-button { padding: 4px 0; color: var(--mh-primary); }
.mh-list-meta .mh-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }

/* Account form: the recharge fields only show for a meal or food voucher. */
.mh-account-form .mh-field[data-kinds] { display: none; }
.mh-account-form:has(input[name="kind"][value="benefit"]:checked) .mh-field[data-kinds~="benefit"] { display: block; }
@media (max-width: 599px) {
  .mh-bench strong { font-size: var(--mh-fs-md, 1rem); }
  .mh-table-wrap { margin: 0 -14px; padding: 0 14px; }
}

/* Legal pages */
.mh-legal-wrap { width: min(100% - 32px, 760px); margin-inline: auto; }
.mh-legal-header { border-bottom: 1px solid var(--mh-border); background: var(--mh-surface); }
.mh-legal-header .mh-legal-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; }
.mh-legal-header nav { display: flex; flex-wrap: wrap; gap: 16px; font-weight: 600; font-size: var(--mh-fs-sm); }
.mh-legal-header nav a { text-decoration: none; color: var(--mh-muted); }
.mh-legal-header nav a[aria-current="page"] { color: var(--mh-primary); }
.mh-legal { padding: 40px 0 24px; line-height: 1.65; }
.mh-legal h1 { margin: 0 0 16px; font-family: var(--mh-font-display); font-size: var(--mh-fs-3xl); }
.mh-legal h2 { margin: 32px 0 8px; font-family: var(--mh-font-display); font-size: var(--mh-fs-xl); }
.mh-legal li { margin-bottom: 8px; }
.mh-legal-meta { margin-top: 40px; font-size: var(--mh-fs-sm); color: var(--mh-muted); }
.mh-legal-footer { padding: 24px 0 40px; font-size: var(--mh-fs-xs); color: var(--mh-muted); }
.mh-auth-legal { margin-top: 24px; font-size: var(--mh-fs-xs); color: var(--mh-muted); text-align: center; }
.mh-auth-legal a { color: inherit; }
.mh-forgot { margin: 6px 0 0; text-align: right; }
/* App version (version.yaml): login screen and the panel menu footer. */
.mh-version { margin: 4px 10px 0; font-size: var(--mh-fs-xs); color: var(--mh-muted); font-variant-numeric: tabular-nums; }
.mh-version--center { margin: 8px 0 0; text-align: center; }

/* WhatsApp */
.mh-wa-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 20px; padding: 12px 16px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-lg); background: var(--mh-primary-soft); }
.mh-wa-banner p { flex: 1; margin: 0; font-size: var(--mh-fs-sm); font-weight: 600; }
.mh-wa-confirm { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--mh-border); }
.mh-wa-confirm h3 { margin: 0 0 6px; font-size: var(--mh-fs-md); }
.mh-wa-code { display: inline-block; margin: 4px 0 12px; padding: 8px 14px; border-radius: var(--mh-radius-sm); background: var(--mh-surface-3); font-family: ui-monospace, monospace; font-size: var(--mh-fs-lg); font-weight: 700; letter-spacing: .08em; user-select: all; }
.mh-wa-groups { list-style: none; margin: 0 0 12px; padding: 0; }
.mh-steps + form, .mh-wa-confirm form { margin-top: 16px; }
.mh-compact li.mh-wa-invite { display: block; }
.mh-steps + .mh-page-actions { margin-top: 20px; justify-content: flex-start; }
.mh-invite-answer { display: grid; gap: 12px; }
.mh-wa-existing { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--mh-border); }
.mh-wa-existing > summary { cursor: pointer; color: var(--mh-primary); font-weight: 600; }
.mh-wa-existing[open] > summary { margin-bottom: 16px; }

@media (max-width: 599px) { .mh-wa-banner { flex-wrap: wrap; } }

/* Savings pockets, folded under the account that keeps them. */
.mh-pocket-group { border-top: 1px solid var(--mh-border); background: var(--mh-surface-2); }
.mh-pocket-group summary { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 72px; cursor: pointer; list-style: none; font-size: var(--mh-fs-sm); }
.mh-pocket-group summary::-webkit-details-marker { display: none; }
.mh-pocket-group summary:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: -3px; }
.mh-pocket-group summary > .mh-icon { margin-left: auto; width: 18px; height: 18px; color: var(--mh-subtle); transition: transform .15s; }
.mh-pocket-group details[open] summary > .mh-icon { transform: rotate(90deg); }
.mh-pocket-sum-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--mh-text); }
.mh-pocket-sum-label .mh-icon { width: 18px; height: 18px; color: var(--mh-warning); }
.mh-pockets { list-style: none; margin: 0; padding: 0 0 6px 54px; }
.mh-pockets .mh-list-item { padding: 10px 18px; border-top: 1px solid var(--mh-border); }
.mh-pockets .mh-list-item:hover { background: var(--mh-surface); }
.mh-pocket-amount { margin-left: auto; }
.mh-pocket-add a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; font-weight: 650; font-size: var(--mh-fs-sm); text-decoration: none; }
.mh-pocket-add .mh-icon { width: 16px; height: 16px; }
.mh-form-intro { margin: -6px 0 16px; }
/* Account and pocket rows: the name block takes the free space and wraps by word; balance and
   buttons never squeeze it. When the row is too narrow, balance and buttons drop to a line below. */
.mh-account-list .mh-list-item { flex-wrap: wrap; row-gap: 10px; }
.mh-account-list .mh-list-main { flex: 1 1 16rem; }
.mh-account-list .mh-list-title { overflow-wrap: anywhere; }
.mh-account-list .mh-list-item > .mh-amount { flex: none; }
.mh-account-list .mh-list-actions { flex: none; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
@media (max-width: 599px) {
  .mh-pocket-group summary { padding-left: 18px; flex-wrap: wrap; row-gap: 2px; }
  .mh-pocket-sum-total { order: 3; flex-basis: 100%; }
  .mh-pockets { padding-left: 0; }
  /* Phone: name and details on the first line, balance (under the name) and buttons below. */
  .mh-account-list .mh-list-main { flex-basis: 100%; }
  .mh-account-list .mh-list-item > .mh-amount { margin-left: 46px; text-align: left; }
  .mh-account-list .mh-list-actions { flex: 1 1 auto; }
  .mh-pockets .mh-list-actions { flex-basis: 100%; }
  .mh-pockets .mh-list-actions { gap: 6px; }
  .mh-pockets .mh-list-actions .mh-btn { flex: 1 1 auto; justify-content: center; padding-inline: 10px; }
}
.mh-archived { margin-top: 24px; }
.mh-archived summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 12px; color: var(--mh-muted); font-weight: 600; font-size: var(--mh-fs-sm); }
.mh-archived summary .mh-icon { width: 18px; height: 18px; }
.mh-danger-zone .mh-card-head .mh-chip { background: var(--mh-danger-soft); color: var(--mh-danger); }
.mh-danger-zone h2 { margin-top: 0; font-size: var(--mh-fs-md); }
@media (max-width: 599px) {
  .mh-list-item { padding: 12px 14px; gap: 12px; }
  .mh-form-actions > .mh-btn, .mh-form-actions > button { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .mh-list-main .mh-chip:not(.mh-cat), .mh-list-main .mh-badge { width: 34px; height: 34px; }
  .mh-amount--big { font-size: var(--mh-fs-2xl); }
}

/* 10. Side drawer for forms: opens from the right over half the screen (full width on phones) == */
.mh-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: max(50vw, 480px); max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; padding: 0; border: 0; border-left: 1px solid var(--mh-border); background: var(--mh-surface); color: var(--mh-text); box-shadow: var(--mh-shadow-lg); }
.mh-drawer::backdrop { background: var(--mh-overlay); backdrop-filter: blur(2px); }
.mh-drawer[open] { animation: mh-drawer-in .24s cubic-bezier(.2, .8, .2, 1); }
@keyframes mh-drawer-in { from { transform: translateX(100%); } to { transform: none; } }
/* No bottom padding on the scroller: it would keep the sticky form footer that far above the edge,
   with the form showing underneath it. The ::after makes the same room at the end of the scroll. */
.mh-drawer-body { height: 100%; overflow-y: auto; padding: 0 32px; }
.mh-drawer-body::after { content: ""; display: block; height: max(40px, env(safe-area-inset-bottom)); }
.mh-drawer-bar { position: sticky; top: 0; z-index: 2; display: flex; justify-content: flex-end; margin: 0 -32px 4px; padding: 10px 20px; background: var(--mh-surface); }
.mh-drawer .mh-page-head { margin-bottom: 20px; }
.mh-drawer .mh-card { padding: 0; border: 0; box-shadow: none; border-radius: 0; }
.mh-drawer .mh-form { max-width: none; }
.mh-drawer .mh-danger-zone { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--mh-border); }
.mh-drawer-loading .mh-drawer-body { opacity: .6; pointer-events: none; }
@media (max-width: 899px) {
  .mh-drawer { width: 100vw; border-left: 0; }
  .mh-drawer-body { padding: 0 16px; }
  .mh-drawer-bar { margin: 0 -16px 4px; padding: max(8px, env(safe-area-inset-top)) 8px 8px; }
  .mh-drawer .mh-form > .mh-form-actions:last-child { margin: 8px -16px 0; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .mh-drawer[open], .mh-message { animation: none; }
  * { transition: none !important; }
}

/* 11. Tabs, toolbar, filters ==================================================================== */
.mh-tabs { display: flex; gap: 4px; margin: -8px 0 22px; border-bottom: 1px solid var(--mh-border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.mh-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--mh-muted); font-weight: 550; text-decoration: none; white-space: nowrap; }
.mh-tabs a .mh-icon { width: 18px; height: 18px; }
.mh-tabs a:hover { color: var(--mh-text); }
.mh-tabs a[aria-current="page"] { color: var(--mh-primary); border-bottom-color: var(--mh-primary); font-weight: 650; }
.mh-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin: 0 0 16px; padding: 6px 0; position: sticky; top: 0; z-index: 4; background: color-mix(in srgb, var(--mh-bg) 88%, transparent); backdrop-filter: blur(10px); }
.mh-month { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--mh-border); border-radius: calc(var(--mh-radius-sm) + 4px); background: var(--mh-surface); }
.mh-month strong { min-width: 150px; text-align: center; font-size: var(--mh-fs-md); }
.mh-month .mh-icon-btn { width: 36px; height: 36px; }
.mh-scope .mh-icon { width: 18px; height: 18px; }
.mh-filters { margin-bottom: 20px; }
.mh-filters summary { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 14px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-pill); background: var(--mh-surface); cursor: pointer; color: var(--mh-muted); font-weight: 600; font-size: var(--mh-fs-sm); list-style: none; }
.mh-filters summary::-webkit-details-marker { display: none; }
.mh-filters[open] summary, .mh-filters summary:hover { color: var(--mh-text); border-color: var(--mh-border-strong); }
.mh-filters summary .mh-icon { width: 18px; height: 18px; }
.mh-filters-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; gap: 12px 16px; margin-top: 12px; padding: 16px; background: var(--mh-surface); border: 1px solid var(--mh-border); border-radius: var(--mh-radius); box-shadow: var(--mh-shadow-sm); }
.mh-filters-form label { display: grid; gap: 6px; font-size: var(--mh-fs-sm); font-weight: 600; }
.mh-filters-form select { min-height: 42px; padding: 8px 10px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; font-weight: 400; }
.mh-filters-form .mh-form-actions { margin: 0; }
@media (max-width: 599px) {
  .mh-toolbar { flex-direction: column; align-items: stretch; }
  .mh-month { justify-content: space-between; }
  .mh-scope { width: 100%; }
}

/* 12. Pickers =================================================================================== */
.mh-picker { margin: 0; padding: 0; border: 0; min-width: 0; }
.mh-picker legend { margin-bottom: 8px; padding: 0; font-weight: 600; font-size: var(--mh-fs-sm); }
.mh-picker-search { display: block; width: 100%; min-height: 42px; margin-bottom: 10px; padding: 9px 12px 9px 38px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface) no-repeat 12px center / 18px; color: var(--mh-text); font: inherit; }
.mh-picker-search:focus { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-field input.mh-picker-search { margin-top: 0; padding-left: 40px; } /* keeps the text clear of the icon */
.mh-picker-search-wrap { position: relative; }
.mh-picker-search-wrap > .mh-icon { position: absolute; left: 13px; top: 14px; width: 18px; height: 18px; color: var(--mh-muted); pointer-events: none; }
.mh-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
.mh-picker-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); background: var(--mh-surface); cursor: pointer; text-align: center; transition: border-color .15s, background-color .15s; }
.mh-picker-option:hover { border-color: var(--mh-muted); background: var(--mh-surface-2); }
.mh-picker-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mh-picker-option:has(input:checked) { border-color: var(--mh-primary); background: var(--mh-primary-soft); box-shadow: inset 0 0 0 1px var(--mh-primary); }
.mh-picker-option:has(input:focus-visible) { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-picker-label { font-size: .8rem; font-weight: 600; line-height: 1.2; color: var(--mh-text); overflow-wrap: anywhere; }
.mh-picker--compact .mh-picker-grid { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); max-height: none; }
.mh-picker--compact .mh-picker-option { padding: 6px; }
.mh-picker[aria-invalid="true"] .mh-picker-grid { outline: 1px solid var(--mh-danger); border-radius: var(--mh-radius-sm); }
/* "Other" fields appear only when "other" is chosen; without :has support they always show. */
@supports selector(:has(*)) {
  .mh-field[data-other-of] { display: none; }
  form:has(input[name="institution_code"][value="other"]:checked) .mh-field[data-other-of="institution_code"],
  form:has(input[name="network"][value="other"]:checked) .mh-field[data-other-of="network"] { display: block; }
}

/* 13. Account pages: profile, security, two-factor ============================================== */
.mh-profile-hero { position: relative; display: flex; align-items: center; gap: 20px; padding: 24px; margin-bottom: 22px; overflow: hidden; background: linear-gradient(135deg, var(--mh-primary-soft), var(--mh-surface) 70%); }
.mh-profile-hero h1 { margin: 0; font-size: var(--mh-fs-xl); }
.mh-profile-hero p { margin: 2px 0 0; }
.mh-profile-hero .mh-status { margin-top: 8px; }
.mh-avatar-edit { position: relative; flex: none; }
.mh-avatar-edit .mh-avatar-camera { position: absolute; right: -2px; bottom: -2px; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--mh-primary); color: var(--mh-primary-text); box-shadow: 0 0 0 3px var(--mh-surface); cursor: pointer; }
.mh-avatar-edit .mh-avatar-camera .mh-icon { width: 17px; height: 17px; }
.mh-avatar-edit input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.mh-avatar-edit:has(input:focus-visible) .mh-avatar-camera { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-settings-grid { display: grid; gap: 16px; }
.mh-settings-grid .mh-form { max-width: none; }
.mh-setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.mh-setting + .mh-setting { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--mh-border); }
.mh-setting-text { flex: 1 1 260px; min-width: 0; }
.mh-setting-text h3 { margin: 0; font-size: var(--mh-fs-md); }
.mh-setting-text p { margin: 4px 0 0; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-qr { display: inline-block; padding: 10px; background: var(--mh-qr-bg); border: 1px solid var(--mh-border); border-radius: var(--mh-radius); line-height: 0; }
.mh-qr svg { width: 200px; height: 200px; }
.mh-qr svg path { fill: var(--mh-qr-fg); }
.mh-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; list-style: none; padding: 16px; margin: 16px 0; background: var(--mh-surface-2); border: 1px dashed var(--mh-border-strong); border-radius: var(--mh-radius); }
.mh-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 22px; }
.mh-steps > li { position: relative; padding-left: 44px; counter-increment: step; }
.mh-steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--mh-primary-soft); color: var(--mh-primary); font-weight: 750; font-size: var(--mh-fs-sm); }
.mh-steps p { margin: 0 0 10px; }

/* 14. Sign-in, sign-up, invitations and other standalone pages ================================== */
.mh-auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.mh-auth-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 44px 52px; overflow: hidden; background: var(--mh-floresta); color: var(--mh-nevoa); isolation: isolate; }
/* The brand's pulse line crossing the dark panel, as in the presentation cover. */
.mh-auth-aside::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 400' preserveAspectRatio='none'%3E%3Cpath d='M0 300H190L220 230L250 330L285 150L340 260L410 120H600' fill='none' stroke='%23F3F6F1' stroke-opacity='.07' stroke-width='14' stroke-linejoin='round'/%3E%3C/svg%3E") center 55% / 100% 60% no-repeat; }
:root[data-theme="dark"] .mh-auth-aside { background-color: var(--mh-accent); }
.mh-auth-aside .mh-brand, .mh-auth-aside .mh-wordmark { color: var(--mh-nevoa); }
.mh-auth-pitch .mh-eyebrow { color: var(--mh-verde-broto); }
.mh-auth-pitch h2 { margin: 0 0 14px; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.15; letter-spacing: -.02em; max-width: 18ch; }
.mh-auth-pitch ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mh-auth-pitch li { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.mh-auth-pitch li .mh-icon { flex: none; padding: 7px; width: 34px; height: 34px; border-radius: 10px; background: rgb(61 220 151 / 14%); color: var(--mh-verde-broto); }
.mh-auth-pitch h2 { font-size: clamp(2rem, 3.4vw, var(--mh-fs-display)); font-weight: 600; letter-spacing: -.03em; max-width: 14ch; color: var(--mh-nevoa); }
.mh-auth-pitch p { max-width: 42ch; color: color-mix(in srgb, var(--mh-nevoa) 78%, transparent); margin: 0 0 22px; }
.mh-auth-pitch li { color: color-mix(in srgb, var(--mh-nevoa) 92%, transparent); }
.mh-auth-foot { margin: 0; font-size: var(--mh-fs-sm); color: color-mix(in srgb, var(--mh-nevoa) 70%, transparent); }
.mh-auth-foot strong { color: var(--mh-nevoa); }
.mh-auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px max(40px, env(safe-area-inset-bottom)); }
.mh-auth-card { width: 100%; max-width: 420px; }
.mh-auth-card > .mh-chip { margin-bottom: 8px; }
.mh-auth-card h1 { margin: 0 0 6px; font-size: var(--mh-fs-2xl); }
.mh-auth-card > p { margin: 0 0 24px; }
.mh-auth-card .mh-btn-block { min-height: 48px; font-size: var(--mh-fs-md); margin-top: 6px; }
.mh-auth-alt { margin: 22px 0 0; text-align: center; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-auth-alt a { font-weight: 650; }
/* Fingerprint sign-in in the installed app (static/js/passkey.js) */
.mh-passkey { margin: 18px 0 4px; }
.mh-passkey-status:empty { display: none; }
.mh-passkey-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 2px; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-passkey-or::before, .mh-passkey-or::after { content: ""; flex: 1; border-top: 1px solid var(--mh-border); }
[data-passkey-offer] .mh-btn-secondary { margin-top: 10px; }
[data-passkey-offer-body] > .mh-chip { margin-bottom: 8px; }
[data-passkey-offer-body] > .mh-muted { margin: 0 0 24px; }
.mh-auth-mobile-brand { display: none; margin-bottom: 28px; }
.mh-auth .mh-messages { margin: 0 0 18px; padding: 0; max-width: 420px; width: 100%; }
@media (max-width: 899px) {
  .mh-auth { grid-template-columns: 1fr; }
  .mh-auth-aside { display: none; }
  .mh-auth-main { justify-content: flex-start; padding-top: max(40px, env(safe-area-inset-top)); }
  .mh-auth-mobile-brand { display: inline-flex; }
}

/* 15. Categories ================================================================================ */
.mh-listbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 16px; }
.mh-listbar-actions { display: flex; gap: 4px; }
.mh-search { position: relative; flex: 1 1 320px; max-width: 520px; }
.mh-search > .mh-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mh-muted); pointer-events: none; }
.mh-search input { width: 100%; min-height: 46px; padding: 10px 14px 10px 44px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-pill); background: var(--mh-surface); color: var(--mh-text); font: inherit; }
.mh-search input:focus { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; align-items: start; }
.mh-cat-card { padding: 0; overflow: hidden; }
.mh-cat-card + .mh-cat-card { margin-top: 0; }
.mh-cat-card summary { display: flex; align-items: center; gap: 14px; padding: 16px 18px; cursor: pointer; list-style: none; transition: background-color .15s; }
.mh-cat-card summary::-webkit-details-marker { display: none; }
.mh-cat-card summary:hover { background: var(--mh-surface-2); }
.mh-cat-card summary:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: -3px; border-radius: var(--mh-radius-lg); }
.mh-cat-card-text { flex: 1; min-width: 0; }
.mh-cat-card-text strong { display: block; font-family: var(--mh-font-display); font-weight: 600; letter-spacing: -.01em; }
.mh-cat-card-text .mh-muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--mh-fs-sm); }
.mh-cat-card-figure { text-align: right; line-height: 1.25; }
.mh-cat-card-figure .mh-amount { display: block; font-size: var(--mh-fs-md); }
.mh-cat-card-figure .mh-muted { font-size: var(--mh-fs-xs); }
.mh-cat-card .mh-caret { display: inline-flex; color: var(--mh-subtle); transition: transform .2s; }
.mh-cat-card[open] .mh-caret { transform: rotate(180deg); }
.mh-cat-card[open] summary { border-bottom: 1px solid var(--mh-border); }
.mh-cat-card-body { padding: 8px 10px 14px; }
.mh-cat-subs { list-style: none; margin: 0; padding: 0; }
.mh-cat-subs li { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 8px; border-radius: var(--mh-radius-sm); }
.mh-cat-subs li:hover { background: var(--mh-surface-2); }
.mh-cat-subs a { flex: 1; min-width: 0; color: var(--mh-text); font-weight: 550; text-decoration: none; }
.mh-cat-subs a::after { content: ""; position: absolute; inset: 0; }
.mh-cat-subs a:focus-visible { outline: none; }
.mh-cat-subs li:has(a:focus-visible) { outline: 3px solid var(--mh-primary); outline-offset: -3px; }
.mh-cat-subs span:not(.mh-chip, .mh-amount) { flex: 1; }
.mh-cat-sub-amount { margin-left: auto; font-size: var(--mh-fs-sm); }
.mh-cat-card-body .mh-help { margin: 6px 8px 10px; }
.mh-cat-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 8px 0; padding-top: 12px; border-top: 1px dashed var(--mh-border); }
@media (max-width: 599px) {
  .mh-listbar-actions { width: 100%; justify-content: flex-end; }
  .mh-cat-card summary { padding: 14px; gap: 12px; }
  .mh-cat-card-figure .mh-muted { display: none; }
}
.mh-cat-group + .mh-cat-group { border-top: 1px solid var(--mh-border); }
.mh-cat-children { list-style: none; margin: 0; padding: 0 0 10px; }
.mh-cat-children .mh-list-item { padding: 6px 18px 6px 72px; border: 0; }
.mh-cat-children .mh-list-title { font-weight: 550; }
@media (max-width: 599px) {
  .mh-cat-tree .mh-list-main .mh-chip { display: inline-flex; }
  .mh-cat-children .mh-list-item { padding: 6px 14px 6px 40px; }
}

/* 16. Transactions ============================================================================== */
.mh-day + .mh-day { margin-top: 22px; }
.mh-day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 4px 8px; }
.mh-day-title { margin: 0; font-size: var(--mh-fs-sm); font-weight: 650; color: var(--mh-muted); }
.mh-tx-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.mh-split { padding: 16px; margin-bottom: 18px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); background: var(--mh-surface-2); }
.mh-split .mh-field:last-child { margin-bottom: 0; }
.mh-split .mh-segmented { margin-bottom: 4px; }
@supports selector(:has(*)) {
  .mh-split, .mh-split-custom { display: none; }
  form:has(input[name="owner"][value="shared"]:checked) .mh-split { display: block; }
  form:has(input[name="split_mode"][value="custom"]:checked) .mh-split-custom { display: block; }
  form:has(input[name="split_mode"][value="custom"]:checked) .mh-split-equal { display: none; }
  /* Installments only show when a card pays (or when the field has an error to show). */
  .mh-installments { display: none; }
  form:has(select[name="paid_with"] option[value^="c:"]:checked) .mh-installments,
  .mh-installments:has(.mh-error) { display: block; }
}
/* Recurring rule: the end date or the count shows only for the end chosen. */
.mh-repeat { padding: 16px; margin-bottom: 18px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); background: var(--mh-surface-2); }
.mh-repeat .mh-segmented--3 { margin-bottom: 4px; }
@supports selector(:has(*)) {
  .mh-repeat-end-date, .mh-repeat-count { display: none; }
  form:has(input[name="ends"][value="on_date"]:checked) .mh-repeat-end-date { display: block; }
  form:has(input[name="ends"][value="after"]:checked) .mh-repeat-count { display: block; }
}
/* Recurring lists on phones: the amount and buttons go under the title instead of squeezing it. */
@media (max-width: 640px) {
  .mh-rec-list .mh-list-item { flex-wrap: wrap; gap: 10px; }
  .mh-rec-list .mh-list-main { flex: 1 1 100%; }
  .mh-rec-list .mh-list-actions { flex: 1 1 100%; justify-content: flex-end; flex-wrap: wrap; }
  .mh-rec-list .mh-list-actions .mh-amount { margin-right: auto; }
}
.mh-kind-income { color: var(--mh-income); }

/* 17. Home dashboard ============================================================================ */
.mh-dash { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.mh-dash > * { min-width: 0; }
.mh-dash .mh-card { padding: 20px; }
.mh-dash .mh-card-head { margin-bottom: 12px; align-items: center; }
.mh-dash .mh-card-head a { font-size: var(--mh-fs-sm); font-weight: 650; text-decoration: none; white-space: nowrap; }
.mh-compact { list-style: none; margin: 0 -8px; padding: 0; }
.mh-compact li { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--mh-radius-sm); }
.mh-compact li + li { border-top: 1px solid var(--mh-border); }
.mh-compact .mh-compact-text { flex: 1; min-width: 0; }
.mh-compact .mh-compact-text strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mh-compact .mh-compact-text span { display: block; font-size: var(--mh-fs-xs); color: var(--mh-muted); }
.mh-compact .mh-meter { margin-top: 6px; height: 6px; }
.mh-dash-side { display: grid; gap: 20px; }
.mh-dash-side .mh-card + .mh-card { margin-top: 0; }
.mh-empty--inline { padding: 20px 8px; }
.mh-dash .mh-card-head .mh-chip--sm + div h2 { font-size: var(--mh-fs-md); }
@media (max-width: 899px) { .mh-dash { grid-template-columns: 1fr; } }

/* 18. Goals ===================================================================================== */
.mh-goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.mh-goal { display: grid; gap: 10px; align-content: start; transition: box-shadow .15s, transform .15s; }
.mh-goal:has(a:hover) { box-shadow: var(--mh-shadow-md); }
.mh-goal + .mh-goal { margin-top: 0; }
.mh-goal-title { margin: 0; font-size: var(--mh-fs-md); }
.mh-goal-title a { color: var(--mh-text); text-decoration: none; }
.mh-goal-title a::after { content: ""; position: absolute; inset: 0; }
.mh-goal { position: relative; }
.mh-goal-amounts { margin: 6px 0 0; }
.mh-goal-amounts .mh-amount { font-size: var(--mh-fs-xl); }
.mh-goal-hint { display: flex; align-items: center; gap: 8px; margin: 0; font-size: var(--mh-fs-sm); color: var(--mh-muted); }
.mh-goal-hint .mh-icon { width: 16px; height: 16px; }
.mh-goal-where-title { margin: 4px 0 6px; font-size: var(--mh-fs-sm); font-weight: 600; color: var(--mh-muted); }
.mh-pills + .mh-goal-where-title { margin-top: 14px; }
.mh-goal-legacy { margin-bottom: 10px; box-shadow: none; }
.mh-goal-legacy .mh-message-text { display: grid; gap: 6px; font-weight: 400; }
.mh-goal-legacy-hint { align-items: flex-start; color: var(--mh-text); }
.mh-goal-legacy-hint .mh-icon { color: var(--mh-warning); margin-top: 2px; flex: none; }
.mh-goal-legacy-link { position: relative; z-index: 1; font-weight: 600; }
.mh-goal-percent { margin-left: auto; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--mh-text); }
.mh-goal .mh-meter span, .mh-compact .mh-goal-meter span { background: var(--mh-goal); }
.mh-meter--done span, .mh-goal .mh-meter--done span { background: var(--mh-success); }
.mh-budget-body { flex: 1; min-width: 0; }
.mh-list-main:has(.mh-budget-body) { flex: 1; }
.mh-budget .mh-meter { margin-top: 8px; max-width: 460px; }
.mh-budget--warning .mh-meter span { background: var(--mh-goal); }
.mh-budget--over .mh-meter span { background: var(--mh-expense); }
.mh-budget-left { margin: 0; font-size: var(--mh-fs-sm); line-height: 1.35; }

/* 19. Cards (credit) ============================================================================ */
.mh-ccard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.mh-ccard { position: relative; display: grid; gap: 14px; min-width: 0; padding: 20px; border-radius: var(--mh-radius-lg); border: 1px solid var(--mh-border); background: var(--mh-surface); box-shadow: var(--mh-shadow); transition: box-shadow .15s; container-type: inline-size; }
.mh-ccard:has(a:hover) { box-shadow: var(--mh-shadow-md); }
.mh-ccard-top { display: flex; align-items: center; gap: 12px; }
.mh-ccard-top > div { min-width: 0; flex: 1; }
.mh-ccard-name { margin: 0; font-size: var(--mh-fs-md); }
.mh-ccard-name a { color: var(--mh-text); text-decoration: none; }
.mh-ccard-name a::after { content: ""; position: absolute; inset: 0; }
.mh-ccard-figures { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mh-ccard-figures p { margin: 0; }
.mh-ccard-dates { display: flex; gap: 8px; flex-wrap: wrap; }
/* Above the name link's full-card hit area. */
.mh-ccard-import { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-size: var(--mh-fs-sm); font-weight: 600; }
.mh-ccard-import .mh-icon { width: 16px; height: 16px; }
.mh-ccard-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
/* Open bill on the card: what is on it plus the recurring still to come (an estimate). Above the */
/* card-wide link of the name, like the other links on the card. */
.mh-ccard-bill { position: relative; z-index: 1; display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--mh-radius-sm); background: var(--mh-surface-2); color: var(--mh-text); text-decoration: none; }
.mh-ccard-bill:hover { background: var(--mh-surface-3); }
.mh-ccard-bill-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mh-ccard-bill p, .mh-ccard-bill span { margin: 0; }
.mh-bill-estimate { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }

/* 20. Family ==================================================================================== */
.mh-member-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.mh-member { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; }
.mh-member + .mh-member { margin-top: 0; }
.mh-member > div { min-width: 0; flex: 1; }
.mh-member-name { margin: 0; font-size: var(--mh-fs-md); overflow-wrap: anywhere; }
.mh-member-name a { color: var(--mh-text); text-decoration: none; }
.mh-member-name a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.mh-member:has(a:hover) { box-shadow: var(--mh-shadow-md); }
.mh-member-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mh-invite { align-items: flex-start; }
.mh-invite-main { flex: 1; min-width: 0; }
.mh-invite-link { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mh-invite-link input { flex: 1 1 240px; min-width: 0; min-height: 40px; padding: 8px 12px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-sm); background: var(--mh-surface-2); color: var(--mh-muted); font: inherit; font-family: var(--mh-font-mono); font-size: var(--mh-fs-xs); }
.mh-invite-card { display: grid; gap: 8px; justify-items: start; }
.mh-invite-card h1 { margin: 8px 0 0; }
.mh-member--add { height: 100%; border-style: dashed; box-shadow: none; color: var(--mh-text); text-decoration: none; background: var(--mh-surface-2); }
.mh-member--add:hover { border-color: var(--mh-primary); background: var(--mh-primary-soft); }
.mh-member--add strong { display: block; }
.mh-member-meta .mh-status { font-size: .72rem; }
.mh-check--inline { margin: 10px 0 0; }
.mh-inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mh-inline-form input { min-height: 42px; padding: 8px 12px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; width: 180px; }
.mh-inline-form input:focus { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-card-head h2 .mh-status { margin-left: 6px; }
.mh-ccard-available { font-size: clamp(1rem, 8cqi, var(--mh-fs-xl)); }
.mh-title-icon { display: inline-flex; align-items: center; gap: 10px; }
.mh-title-icon .mh-icon { color: var(--mh-primary); }
.mh-auth-card > .mh-auth-alt { margin: 22px 0 0; }
@media (max-width: 599px) {
  /* Two columns only when each card is wide enough for a balance. A Galaxy S23 (360px) stays one column, so "R$ 12.345,67" does not run into the next card. */
  .mh-summaries { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
  .mh-summaries > * { min-width: 0; }
  .mh-summaries .mh-card { padding: 14px; }
  .mh-summaries--fill > .mh-tile { flex: 1 1 220px; }
  .mh-summaries .mh-tile-head .mh-chip { width: 32px; height: 32px; border-radius: 10px; }
  .mh-summaries .mh-tile-head .mh-chip .mh-icon { width: 18px; height: 18px; }
  .mh-summaries .mh-muted, .mh-summaries .mh-tile-link { font-size: var(--mh-fs-xs); }
  .mh-invite .mh-list-main > .mh-chip { display: none; }
  .mh-page-head .mh-scope { width: 100%; }
  .mh-page-head h1, .mh-card-head h2, .mh-card-head h3, .mh-goal-title, .mh-ccard-name { overflow-wrap: anywhere; }
  .mh-card-head, .mh-ccard-figures, .mh-ccard-bill-head, .mh-goal-hint, .mh-goal-amounts { flex-wrap: wrap; }
  .mh-goal-amounts { display: flex; align-items: baseline; gap: 2px 8px; }
  .mh-ccard-figures > *, .mh-ccard-bill-head > * { min-width: 0; max-width: 100%; }
  .mh-budget-figures { grid-template-columns: 1fr; }
  .mh-budget-figures > div, .mh-budget-figures dd { min-width: 0; }
  .mh-compact li { min-width: 0; }
  .mh-compact .mh-compact-text span { overflow-wrap: anywhere; }
  .mh-compact .mh-status { max-width: 42%; white-space: normal; text-align: end; }
  .mh-card .mh-btn, .mh-empty .mh-btn, .mh-segmented label, .mh-segmented a { white-space: normal; }
  .mh-segmented { display: flex; width: 100%; max-width: 100%; }
  .mh-segmented > * { flex: 1 1 0; min-width: 0; }
  .mh-appbar .mh-brand { flex: none; gap: 6px; }
  .mh-appbar .mh-wordmark { font-size: 1rem; }
}
@container (max-width: 200px) {
  .mh-summaries .mh-tile-head { flex-direction: column; align-items: flex-start; gap: 8px; }
}
@media (max-width: 599px) {
  .mh-profile-hero { flex-direction: column; text-align: center; padding: 22px 16px; }
  .mh-profile-hero > div { min-width: 0; max-width: 100%; }
  .mh-profile-hero p { overflow-wrap: anywhere; }
  .mh-profile-hero .mh-status { white-space: normal; }
}
.mh-plan-limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 24px; margin: 0; }
.mh-plan-limits li + li { border-top: 0; }

/* Error pages (templates/errors/base.html) */
.mh-error-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.mh-error-card { width: 100%; max-width: 480px; }
.mh-error-card .mh-brand { margin-bottom: 28px; }
.mh-error-code { margin: 0 0 8px; color: var(--mh-muted); font-size: var(--mh-fs-sm); font-weight: 650; }
.mh-error-card h1 { margin: 0 0 10px; font-size: var(--mh-fs-xl); }
.mh-error-card > p:not(.mh-error-code) { margin: 0 0 24px; color: var(--mh-muted); }
.mh-error-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.mh-waitlist-error { margin-bottom: 18px; }

/* Imports: review of a card bill or an investment statement (templates/imports) */
.mh-import-notes { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-import-notes li { display: flex; align-items: flex-start; gap: 8px; }
.mh-import-notes .mh-icon { flex: none; width: 18px; height: 18px; color: var(--mh-primary); }
.mh-import-rows { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.mh-import-row { display: grid; grid-template-columns: 28px 140px minmax(160px, 1fr) 130px minmax(160px, 220px) 70px 70px; align-items: end; gap: 8px 10px; padding: 12px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-sm); background: var(--mh-surface); }
.mh-import-row--op { grid-template-columns: 28px 140px 150px 110px 140px 110px 120px 110px 120px; }
.mh-import-row--money { grid-template-columns: 28px 140px minmax(160px, 1fr) 120px 110px minmax(160px, 220px); }
.mh-import-row--notice { grid-template-columns: 28px 140px minmax(160px, 1fr) 120px 110px minmax(150px, 200px) minmax(140px, 180px) 90px; }
.mh-import-row--muted { background: var(--mh-surface-2); }
/* "Only from the next bill on": purchases without installments ahead are not recorded (the server
   ignores them too), so they leave the list. */
.mh-import-next-note { display: none; }
.mh-import:has(input[name="start"][value="next_bill"]:checked) .mh-import-next-note { display: inline; }
.mh-import:has(input[name="start"][value="next_bill"]:checked) .mh-import-row--this-bill { display: none; }
.mh-import-row:has(.mh-import-include input:checked) { border-color: var(--mh-border-strong); background: var(--mh-surface); }
.mh-import-include { align-self: center; margin: 18px 0 0; }
.mh-import-field { min-width: 0; }
.mh-import-field label { display: block; margin-bottom: 4px; color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 650; }
.mh-import-field input, .mh-import-field select { display: block; width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; font-size: var(--mh-fs-sm); }
.mh-import-field input:focus-visible, .mh-import-field select:focus-visible { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-import-field .mh-error { font-size: var(--mh-fs-xs); }
.mh-import-meta { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.mh-import-meta:empty { display: none; }
.mh-import-meta .mh-status { max-width: 100%; white-space: normal; }
.mh-import-actions { position: sticky; bottom: 0; z-index: 2; padding: 12px 0; background: var(--mh-bg); }
@media (max-width: 1100px) {
  .mh-import-row, .mh-import-row--op, .mh-import-row--money, .mh-import-row--notice { grid-template-columns: 28px repeat(2, minmax(0, 1fr)); }
  .mh-import-row > .mh-import-include { grid-column: 1; grid-row: 1 / span 6; align-self: start; margin-top: 22px; }
  .mh-import-field--description, .mh-import-field--category, .mh-import-field--source, .mh-import-meta { grid-column: 2 / -1; }
  .mh-import-actions { position: static; }
}

/* Receipts by QR code (imports/receipt*.html) */
.mh-receipt-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.mh-receipt-actions .mh-btn { flex: 1 1 220px; justify-content: center; }
.mh-receipt-actions input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mh-receipt-actions .mh-receipt-photo:has(+ input:focus-visible) { box-shadow: var(--mh-ring); }
.mh-receipt-camera { position: relative; display: grid; gap: 10px; justify-items: center; margin-bottom: 16px; }
.mh-receipt-camera[hidden] { display: none; }
.mh-receipt-camera video { width: 100%; max-width: 480px; aspect-ratio: 1; object-fit: cover; border-radius: var(--mh-radius); background: var(--mh-surface-2); }
.mh-receipt-frame { position: absolute; top: 0; left: 50%; width: min(100%, 480px); aspect-ratio: 1; transform: translateX(-50%); pointer-events: none; }
.mh-receipt-frame::after { content: ""; position: absolute; inset: 18%; border: 3px solid var(--mh-primary); border-radius: var(--mh-radius-sm); box-shadow: 0 0 0 999px var(--mh-overlay); }
.mh-receipt-camera-hint { margin: 0; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-receipt-groups { display: grid; gap: 6px; margin: 16px 0 0; padding: 0; list-style: none; }
.mh-receipt-groups li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 12px; border-radius: var(--mh-radius-sm); background: var(--mh-surface-2); }
.mh-receipt-note { margin: 8px 0 0; font-size: var(--mh-fs-sm); }
.mh-receipt-items { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.mh-receipt-item { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(180px, 240px); align-items: center; gap: 6px 14px; padding: 10px 0; border-top: 1px solid var(--mh-border); }
.mh-receipt-item:first-child { border-top: 0; }
.mh-receipt-item-text { display: grid; gap: 2px; min-width: 0; }
.mh-receipt-item-name { overflow-wrap: anywhere; font-weight: 600; }
.mh-receipt-item-text .mh-muted { font-size: var(--mh-fs-xs); }
.mh-receipt-item-amount { text-align: right; white-space: nowrap; }
.mh-receipt-item-category select { display: block; width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; font-size: var(--mh-fs-sm); }
.mh-receipt-item-category select:focus-visible { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-receipt-item .mh-error { grid-column: 1 / -1; font-size: var(--mh-fs-xs); }
.mh-receipt .mh-section-card + .mh-section-card { margin-top: 16px; }
@media (max-width: 640px) {
  .mh-receipt-item { grid-template-columns: minmax(0, 1fr) auto; }
  .mh-receipt-item-category { grid-column: 1 / -1; }
}

/* Paid and expected (apps/cashflow) */
.mh-cf-muted .mh-list-title, .mh-cf-muted .mh-amount { color: var(--mh-muted); }
.mh-cf-alert { margin-bottom: 20px; }

/* Investment assistant: profile interview in chat (investments/_interview.html) */
.mh-chat { display: flex; flex-direction: column; gap: 14px; }
.mh-chat-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.mh-bubble { max-width: min(78%, var(--mh-measure)); padding: 10px 14px; border-radius: var(--mh-radius); line-height: 1.5; overflow-wrap: anywhere; }
.mh-bubble--assistant { align-self: flex-start; background: var(--mh-surface-3); color: var(--mh-text); border-bottom-left-radius: var(--mh-radius-sm); }
.mh-bubble--me { align-self: flex-end; background: var(--mh-primary); color: var(--mh-primary-text); border-bottom-right-radius: var(--mh-radius-sm); }
.mh-bubble--typing { display: flex; align-items: center; gap: 10px; color: var(--mh-muted); }
.mh-chat-form { display: flex; gap: 10px; align-items: flex-end; }
.mh-chat-form textarea { flex: 1; min-height: 48px; resize: vertical; padding: 10px 13px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; }
.mh-chat-form textarea:focus { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-chat-restart { align-self: flex-start; }
.mh-proposal { border: 1px solid var(--mh-border); border-radius: var(--mh-radius); padding: 16px; background: var(--mh-surface); display: flex; flex-direction: column; gap: 10px; }
.mh-proposal h4 { margin: 6px 0 0; font-size: var(--mh-fs-md); }
.mh-proposal p { margin: 0; max-width: var(--mh-measure); }
.mh-plan-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.mh-plan-figures div { display: flex; flex-direction: column; gap: 2px; }
.mh-plan-notice { margin-bottom: 16px; }
.mh-plan-figures strong { font-size: var(--mh-fs-lg); }
.mh-empty-actions { justify-content: center; }
@media (max-width: 640px) {
  .mh-bubble { max-width: 92%; }
  .mh-chat-form { flex-direction: column; align-items: stretch; }
}

/* Reset data (accounts/reset_data.html) */
.mh-reset { max-width: 720px; }
.mh-reset-intro { margin-bottom: 18px; }
.mh-reset-intro p { margin: 0 0 6px; }
.mh-reset .mh-check > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mh-reset-counts { color: var(--mh-text); font-size: var(--mh-fs-sm); }
.mh-reset-all { padding-bottom: 14px; border-bottom: 1px solid var(--mh-border); }

/* Evolution charts (apps/cashflow/charts.py): 12 month slots in HTML, so text stays crisp at any
   width. Solid = what happened, hatched or dashed = what is expected; months ahead sit on a soft
   band. One axis per chart; the tooltip (hover or focus) lists every value of the month. */
.mh-dash--even { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.mh-evo { margin: 0; }
.mh-evo-plot { position: relative; height: 200px; margin: 8px 0 30px 64px; }
.mh-evo-axis { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.mh-evo-axis li { position: absolute; left: 0; right: 0; border-top: 1px solid var(--mh-border); }
.mh-evo-axis li.is-zero { border-top-color: var(--mh-border-strong); }
.mh-evo-axis span { position: absolute; right: calc(100% + 8px); transform: translateY(-50%); color: var(--mh-subtle); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mh-evo-cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.mh-evo-col { position: relative; outline: none; border-radius: 6px; }
.mh-evo-col.is-future, .mh-evo-col.is-current { background: color-mix(in srgb, var(--mh-surface-3) 55%, transparent); }
.mh-evo-col.is-current { box-shadow: inset 2px 0 0 var(--mh-border-strong); }
.mh-evo-col:hover, .mh-evo-col:focus-visible { background: var(--mh-surface-3); }
.mh-evo-col:focus-visible { box-shadow: 0 0 0 2px var(--mh-primary); }
.mh-evo-pair { position: absolute; inset: 0; display: flex; justify-content: center; gap: 2px; }
.mh-evo-bar { position: relative; display: block; width: min(40%, 14px); align-self: auto; margin-top: auto; }
.mh-evo-pair .mh-evo-bar { position: absolute; }
.mh-evo-pair .mh-evo-bar--income { right: calc(50% + 1px); }
.mh-evo-pair .mh-evo-bar--expense { left: calc(50% + 1px); }
.mh-evo-pair .mh-evo-bar--result { left: 50%; transform: translateX(-50%); width: min(60%, 20px); }
.mh-evo-bar { --c: var(--mh-income); border-radius: 4px 4px 0 0; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 45%, transparent) 0 3px, color-mix(in srgb, var(--c) 14%, transparent) 3px 6px); }
.mh-evo-bar > span { position: absolute; left: 0; right: 0; bottom: 0; display: block; background: var(--c); border-radius: inherit; }
.mh-evo-bar--expense { --c: var(--mh-expense); }
.mh-evo-bar--result { background: var(--c); }
.mh-evo-bar--result.is-negative { --c: var(--mh-expense); border-radius: 0 0 4px 4px; }
.mh-evo-bar--result.is-forecast { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 70%, transparent) 0 3px, color-mix(in srgb, var(--c) 22%, transparent) 3px 6px); }
.mh-evo-month { position: absolute; top: calc(100% + 6px); left: 0; right: 0; overflow: hidden; color: var(--mh-subtle); font-size: 11px; line-height: 1.1; text-align: center; text-overflow: ellipsis; text-transform: lowercase; white-space: nowrap; }
.mh-evo-month small { display: block; font-size: 10px; }
.mh-evo-col.is-current .mh-evo-month { color: var(--mh-text); font-weight: 700; }
.mh-evo-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mh-evo-lines polyline { fill: none; stroke: var(--mh-goal); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.mh-evo-lines polyline.is-forecast { stroke-dasharray: 5 5; }
.mh-evo--invest .mh-evo-lines polyline, .mh-evo--invest .mh-evo-dot { --c: var(--mh-invest); stroke: var(--mh-invest); }
.mh-evo-dot { --c: var(--mh-goal); position: absolute; left: 50%; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--mh-surface); }
.mh-evo-dot.is-forecast { background: var(--mh-surface); box-shadow: inset 0 0 0 2px var(--c), 0 0 0 2px var(--mh-surface); }
.mh-evo-tip { position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 5; display: none; width: max-content; max-width: 260px; padding: 10px 12px; transform: translateX(-50%); border: 1px solid var(--mh-border); border-radius: var(--mh-radius-sm); background: var(--mh-surface); box-shadow: var(--mh-shadow-md); color: var(--mh-muted); font-size: var(--mh-fs-xs); text-align: left; }
.mh-evo-col.is-start .mh-evo-tip { left: 0; transform: none; }
.mh-evo-col.is-end .mh-evo-tip { left: auto; right: 0; transform: none; }
.mh-evo-col:hover .mh-evo-tip, .mh-evo-col:focus .mh-evo-tip { display: grid; gap: 4px; }
.mh-evo-tip-head { color: var(--mh-text); font-size: var(--mh-fs-xs); }
.mh-evo-tip-row { display: flex; align-items: center; gap: 6px; }
.mh-evo-tip-row b { color: var(--mh-text); font-variant-numeric: tabular-nums; }
.mh-evo-key { display: inline-block; flex: none; width: 12px; height: 3px; border-radius: 2px; background: var(--mh-border-strong); }
.mh-evo-key--income { background: var(--mh-income); }
.mh-evo-key--expense { background: var(--mh-expense); }
.mh-evo-key--worth, .mh-evo-key--line { background: var(--mh-goal); }
.mh-evo-key--invest, .mh-evo--invest .mh-evo-key--line { background: var(--mh-invest); }
.mh-evo-key--dashed { background: repeating-linear-gradient(90deg, var(--mh-goal) 0 4px, transparent 4px 7px); }
.mh-evo--invest .mh-evo-key--dashed { background: repeating-linear-gradient(90deg, var(--mh-invest) 0 4px, transparent 4px 7px); }
.mh-evo-key--expected { height: 10px; width: 10px; background: repeating-linear-gradient(135deg, var(--mh-subtle) 0 2px, transparent 2px 4px); }
.mh-evo-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 4px; color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-evo-legend span { display: inline-flex; align-items: center; gap: 6px; }
.mh-evo-end { margin-left: auto; color: var(--mh-text); font-weight: 650; }
.mh-evo-note { max-width: var(--mh-measure); margin: -6px 0 12px; font-size: var(--mh-fs-sm); }
.mh-evo-window a { white-space: normal; text-align: center; line-height: 1.2; }
.mh-dash + .mh-section { margin-top: 36px; }
.mh-table tr.is-future th, .mh-table tr.is-future td { background: color-mix(in srgb, var(--mh-surface-3) 45%, transparent); }
@media (max-width: 599px) {
  .mh-evo-plot { height: 170px; margin-left: 0; }
  .mh-evo-axis span { left: 0; right: auto; max-width: 42%; transform: translateY(-50%); padding-right: 4px; overflow: hidden; text-overflow: ellipsis; font-size: 10px; background: color-mix(in srgb, var(--mh-surface) 90%, transparent); }
  .mh-evo-month { font-size: 10px; }
  .mh-evo-month small { font-size: 9px; }
  .mh-evo-bar { width: min(42%, 10px); }
  .mh-evo-dot { width: 8px; height: 8px; margin: 0 0 -4px -4px; }
  .mh-evo-end { margin-left: 0; }
}
@media (forced-colors: active) { .mh-evo-bar, .mh-evo-bar > span, .mh-evo-dot { forced-color-adjust: none; } }

/* Home: month switcher and "today" balances --------------------------------------------------- */
.mh-home-month-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; font-weight: 650; font-size: var(--mh-fs-sm); }
.mh-home-month-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; text-decoration: none; }
.mh-home-month-links a:hover { text-decoration: underline; }
.mh-home-month-links .mh-icon { width: 16px; height: 16px; }
.mh-home-today { display: flex; margin-top: -8px; color: var(--mh-muted); font-size: var(--mh-fs-md); }
.mh-bill-note { margin: 10px 0 0; }
.mh-bill-rows .mh-list-main { min-width: 0; }
.mh-bill-rows .mh-list-title { overflow-wrap: anywhere; }
.mh-bill-rows .mh-amount { white-space: nowrap; }
@media (max-width: 599px) {
  .mh-bill-rows .mh-list-item { gap: 8px; padding: 12px 8px 12px 14px; }
  .mh-bill-rows .mh-list-actions { gap: 0; }
  .mh-bill-rows .mh-bill-edit { display: none; } /* the row itself opens the edit form */
}

/* 16. UX round (nov/2026): reusable components and per-screen fixes ============================ */
/* Toasts (static/js/components.js, includes/undo_toast.html): bottom centre, above the tab bar on
   phones, 5 s timer bar. Dark surface in both themes so it stands out from cards and the drawer. */
.mh-toasts { position: fixed; left: 50%; bottom: 24px; z-index: 60; display: grid; gap: 8px; width: min(520px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
.mh-toast { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; overflow: hidden; border-radius: var(--mh-radius); background: var(--mh-floresta); color: var(--mh-nevoa); box-shadow: var(--mh-shadow-md); pointer-events: auto; animation: mh-toast-in .2s ease-out; }
:root[data-theme="dark"] .mh-toast { background: var(--mh-nevoa); color: var(--mh-floresta); }
.mh-toast > .mh-icon { flex: none; color: var(--mh-verde-broto); }
:root[data-theme="dark"] .mh-toast > .mh-icon { color: var(--mh-verde-vital); }
.mh-toast-text { flex: 1; margin: 0; font-weight: 550; font-size: var(--mh-fs-sm); }
.mh-toast form { margin: 0; }
.mh-toast-action { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 0; border-radius: var(--mh-radius-sm); background: transparent; color: var(--mh-verde-broto); font: inherit; font-weight: 700; font-size: var(--mh-fs-sm); cursor: pointer; }
:root[data-theme="dark"] .mh-toast-action { color: var(--mh-verde-vital); }
.mh-toast-action:hover { background: rgb(255 255 255 / 10%); }
:root[data-theme="dark"] .mh-toast-action:hover { background: rgb(11 46 42 / 8%); }
.mh-toast-action .mh-icon { width: 16px; height: 16px; }
.mh-toast .mh-icon-btn { color: inherit; width: 36px; height: 36px; }
.mh-toast .mh-icon-btn:hover { background: rgb(255 255 255 / 10%); }
.mh-toast-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--mh-verde-broto); transform-origin: left; }
.mh-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
@keyframes mh-toast-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 899px) { .mh-toasts { bottom: calc(84px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .mh-toast { animation: none; } .mh-toast-timer { transition: none !important; } }

/* Inline destructive confirmation (includes/confirm.html) */
.mh-confirm > summary { list-style: none; width: fit-content; }
.mh-confirm > summary::-webkit-details-marker { display: none; }
.mh-confirm[open] > summary { opacity: .55; }
.mh-confirm-panel { margin-top: 12px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--mh-danger) 35%, transparent); border-radius: var(--mh-radius); background: var(--mh-danger-soft); animation: mh-fade-in .15s ease-out; }
.mh-confirm-text { display: flex; gap: 10px; margin: 0 0 12px; font-weight: 600; }
.mh-confirm-text .mh-icon { flex: none; color: var(--mh-danger); }
.mh-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* In a row of a list the panel opens on a line of its own, under the row's buttons. */
.mh-list-item:has(.mh-list-actions .mh-confirm[open]) { flex-wrap: wrap; }
.mh-list-actions:has(.mh-confirm[open]) { flex: 1 1 100%; flex-wrap: wrap; justify-content: flex-end; }
.mh-list-actions .mh-confirm[open] { flex: 1 1 100%; }
.mh-list-actions .mh-confirm[open] > summary { display: flex; margin-left: auto; }
.mh-list-actions .mh-confirm-panel { max-width: 520px; margin-left: auto; }
/* "Delete" stays 2rem away from "Save" (and "Automate") so a slip of the thumb does not reach it. */
.mh-danger-zone { margin-top: 2rem; }

/* "Automate" section in the transaction drawer: amber marks automation, as in goals. */
.mh-automate-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: var(--mh-fs-xs); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--mh-warning); }
.mh-automate-title .mh-icon { width: 16px; height: 16px; }
.mh-automate .mh-card-head h3 { margin: 0; font-size: var(--mh-fs-md); }
.mh-btn-automate { background: color-mix(in srgb, var(--mh-goal) 22%, var(--mh-surface)); color: var(--mh-text); border-color: color-mix(in srgb, var(--mh-goal) 60%, transparent); }
.mh-btn-automate:hover { background: color-mix(in srgb, var(--mh-goal) 34%, var(--mh-surface)); }
.mh-btn-automate .mh-icon { color: var(--mh-warning); }
.mh-drawer .mh-automate { margin-top: 28px; padding: 18px; border: 1px solid color-mix(in srgb, var(--mh-goal) 45%, transparent); border-radius: var(--mh-radius); background: color-mix(in srgb, var(--mh-goal) 8%, var(--mh-surface)); }

/* Danger zone on the profile: one tinted block, red title, consequence before every button. */
.mh-danger-area { border-color: color-mix(in srgb, var(--mh-danger) 35%, transparent); background: color-mix(in srgb, var(--mh-danger-soft) 70%, var(--mh-surface)); }
.mh-danger-area h2 { color: var(--mh-danger); }
.mh-danger-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 0 0; margin-top: 16px; border-top: 1px solid color-mix(in srgb, var(--mh-danger) 22%, transparent); }
.mh-danger-row h3 { margin: 0 0 4px; font-size: var(--mh-fs-md); }
.mh-danger-row p { margin: 0; max-width: var(--mh-measure); color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-danger-area .mh-btn-danger-soft { background: var(--mh-surface); }
@media (max-width: 599px) { .mh-danger-row { flex-direction: column; align-items: stretch; } }

/* Theme choice: the active option is filled (not just outlined) and its sun or moon is solid, so
   after a reload it is obvious which one is on. */
.mh-segmented--theme label:has(input:checked) { background: var(--mh-primary); color: var(--mh-primary-text); }
.mh-segmented--theme label:has(input:checked) .mh-icon { fill: currentColor; }

/* Transaction type tabs: filled colour for the active type. */
.mh-kind-tabs a.mh-kind-tab--expense[aria-current="page"] { background: var(--mh-danger-soft); color: var(--mh-danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mh-danger) 35%, transparent); }
.mh-kind-tabs a.mh-kind-tab--income[aria-current="page"] { background: var(--mh-success-soft); color: var(--mh-success); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mh-success) 35%, transparent); }
.mh-kind-tabs a.mh-kind-tab--transfer[aria-current="page"] { background: var(--mh-info-soft); color: var(--mh-info); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mh-info) 35%, transparent); }

/* File drop area (includes/dropzone.html) */
.mh-dropzone { position: relative; display: grid; justify-items: center; gap: 10px; padding: 28px 20px; border: 2px dashed var(--mh-border-strong); border-radius: var(--mh-radius); background: var(--mh-surface-2); text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.mh-dropzone:hover, .mh-dropzone.is-over { border-color: var(--mh-primary); background: var(--mh-primary-soft); }
.mh-dropzone:has(input:focus-visible) { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.mh-dropzone-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--mh-primary-soft); color: var(--mh-primary); }
.mh-dropzone.is-over .mh-dropzone-icon, .mh-dropzone.has-file .mh-dropzone-icon { background: var(--mh-primary); color: var(--mh-primary-text); }
.mh-dropzone-text { display: grid; gap: 4px; }
.mh-dropzone-text strong { font-weight: 650; }
.mh-dropzone-name { color: var(--mh-primary); font-weight: 650; font-size: var(--mh-fs-sm); overflow-wrap: anywhere; }
.mh-dropzone-formats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.mh-format { padding: 2px 8px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-pill); background: var(--mh-surface); color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 700; letter-spacing: .04em; }

/* Bill purchases: edit and delete appear on hover or focus of the row (pointer devices only; on touch
   they stay, there is no hover to reveal them). */
@media (hover: hover) {
  .mh-bill-rows .mh-list-actions .mh-icon-btn { opacity: 0; transition: opacity .15s; }
  .mh-bill-rows .mh-list-item:hover .mh-icon-btn, .mh-bill-rows .mh-list-item:focus-within .mh-icon-btn { opacity: 1; }
}

/* Category card, open: header and subcategories read as one block (no tinted header, no rule
   between them), with a stronger outline around the whole card. */
.mh-cat-card[open] { border-color: var(--mh-border-strong); box-shadow: var(--mh-shadow-md); }
.mh-cat-card[open] summary { border-bottom: 0; padding-bottom: 8px; }
.mh-cat-card[open] summary:hover { background: transparent; }
.mh-cat-card[open] .mh-cat-card-body { padding-top: 0; }
.mh-cat-card[open] .mh-cat-subs { margin-left: 54px; padding-left: 4px; border-left: 2px solid var(--mh-border); }
@media (max-width: 599px) { .mh-cat-card[open] .mh-cat-subs { margin-left: 8px; } }

/* "+" button: a label on hover/focus on wide screens; a speed dial on phones. */
.mh-fab summary { position: relative; }
@media (min-width: 900px) {
  .mh-fab summary::after { content: attr(data-tooltip); position: absolute; right: calc(100% + 12px); top: 50%; padding: 6px 12px; border-radius: var(--mh-radius-sm); background: var(--mh-floresta); color: var(--mh-nevoa); font-size: var(--mh-fs-sm); font-weight: 650; white-space: nowrap; box-shadow: var(--mh-shadow); opacity: 0; transform: translate(4px, -50%); transition: opacity .15s, transform .15s; pointer-events: none; }
  :root[data-theme="dark"] .mh-fab summary::after { background: var(--mh-nevoa); color: var(--mh-floresta); }
  .mh-fab:not([open]) summary:hover::after, .mh-fab:not([open]) summary:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
}
@media (max-width: 899px) {
  /* Speed dial: the choices rise above the "+" as a column of round, coloured buttons with their
     names, over a dimmed page (a huge layer behind the menu; a fixed overlay would be trapped by
     the transform that centres the "+"). One tap to the right kind of entry, thumb-reachable. */
  .mh-fab summary { z-index: 2; }
  .mh-fab-menu { z-index: 1; min-width: 0; padding: 0; gap: 10px; background: transparent; border: 0; bottom: calc(100% + 18px); }
  .mh-fab[open] .mh-fab-menu::before { content: ""; position: absolute; inset: -100vmax; z-index: -1; background: var(--mh-overlay); }
  .mh-fab-menu a { min-height: 48px; padding: 4px 18px 4px 4px; border-radius: var(--mh-radius-pill); background: var(--mh-surface); box-shadow: var(--mh-shadow-md); font-size: var(--mh-fs-md); }
  .mh-fab-menu a:hover { background: var(--mh-surface-2); }
  .mh-fab-menu .mh-chip { width: 44px; height: 44px; border-radius: 50%; }
  .mh-fab-menu .mh-chip--expense { background: var(--mh-expense); color: #fff; }
  .mh-fab-menu .mh-chip--income { background: var(--mh-verde-vital); color: #fff; }
  .mh-fab-menu .mh-chip--neutral { background: var(--mh-investimento); color: #fff; }
  .mh-fab-menu .mh-chip--goal { background: var(--mh-ambar); color: var(--mh-floresta); }
}

/* Menu group labels: a little more contrast and a hairline between groups to find one's way. */
.mh-nav-label { color: var(--mh-muted); }
.mh-nav-group + .mh-nav-group { padding-top: 14px; border-top: 1px solid var(--mh-border); }

/* Charts that enlarge in place: the card takes the whole row and the plot gets taller. */
.mh-evo-expand { margin-left: auto; flex: none; }
.mh-card-head a + .mh-evo-expand { margin-left: 4px; }
[data-chart]:not(.is-wide) .mh-evo { cursor: zoom-in; }
[data-chart].is-wide { grid-column: 1 / -1; }
[data-chart].is-wide .mh-evo-plot { height: 340px; }
@media (max-width: 599px) { [data-chart].is-wide .mh-evo-plot { height: 260px; } }

/* Family roles: three cards side by side; an accordion on phones (components.js opens the first). */
.mh-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mh-role { padding: 16px; border-radius: var(--mh-radius); background: var(--mh-surface-2); border: 1px solid var(--mh-border); }
.mh-role summary { display: flex; align-items: center; gap: 12px; list-style: none; }
.mh-role summary::-webkit-details-marker { display: none; }
.mh-role h3 { flex: 1; margin: 0; font-size: var(--mh-fs-md); }
.mh-role ul { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 6px; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-role .mh-caret { display: none; color: var(--mh-subtle); transition: transform .2s; }
@media (min-width: 600px) { .mh-role summary { pointer-events: none; } }
@media (max-width: 599px) {
  .mh-roles { gap: 8px; }
  .mh-role { padding: 0; }
  .mh-role summary { min-height: 52px; padding: 8px 14px; cursor: pointer; }
  .mh-role .mh-caret { display: inline-flex; }
  .mh-role[open] .mh-caret { transform: rotate(180deg); }
  .mh-role ul { margin: 0; padding: 0 14px 14px 34px; }
}

/* Install the app, per platform: the option for this device first, with the main button. */
.mh-setting--stack { flex-direction: column; align-items: stretch; }
.mh-install { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.mh-install-option { display: grid; grid-template-columns: auto 1fr; align-content: start; gap: 10px 12px; padding: 14px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); background: var(--mh-surface-2); }
.mh-install-option.is-recommended { border-color: color-mix(in srgb, var(--mh-primary) 45%, transparent); background: var(--mh-primary-soft); }
.mh-install-text p { margin: 2px 0 0; font-size: var(--mh-fs-sm); }
.mh-install-help { color: var(--mh-text); }
.mh-install-option .mh-btn { grid-column: 1 / -1; justify-self: start; }

/* Remaining spec items (nov/2026) ============================================================== */
/* Required "*" next to the label, optional "(opcional)" in grey (includes/field.html). */
.mh-required { margin-left: 3px; color: var(--mh-danger); font-weight: 700; }
/* Hairline between groups of a form (transaction and recurring forms). */
.mh-form-sep { height: 0; margin: 6px 0 22px; border: 0; border-top: 1px solid var(--mh-border); }

/* Custom dropdown (includes/rich_select.html) */
.mh-rselect { position: relative; margin-top: 6px; }
.mh-rselect .mh-rselect-native { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.mh-field .mh-rselect select:not(.mh-rselect-native) { margin-top: 0; }
.mh-rselect-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 12px 6px 8px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.mh-rselect-button:hover { border-color: var(--mh-muted); }
.mh-rselect-button:focus-visible, .mh-rselect.is-open .mh-rselect-button { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-rselect-button[aria-invalid="true"], .mh-field:has(.mh-error) .mh-rselect-button { border-color: var(--mh-danger); }
.mh-rselect-current { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.mh-rselect-current > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-rselect-placeholder { padding-left: 5px; color: var(--mh-subtle); }
.mh-rselect .mh-caret { display: inline-flex; color: var(--mh-subtle); transition: transform .2s; }
.mh-rselect.is-open .mh-caret { transform: rotate(180deg); }
.mh-rselect .mh-chip, .mh-rselect .mh-badge { width: 30px; height: 30px; flex: none; border-radius: 9px; font-size: 11px; }
.mh-rselect .mh-chip .mh-icon { width: 16px; height: 16px; }
.mh-rselect-pop { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); padding: 6px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); background: var(--mh-surface); box-shadow: var(--mh-shadow-md); animation: mh-fade-in .12s ease-out; }
.mh-rselect-search { margin: 0 0 6px; max-width: none; }
.mh-field .mh-rselect-search input { padding-left: 44px; border-radius: var(--mh-radius-pill); }
.mh-rselect-search input { min-height: 40px !important; margin: 0 !important; }
.mh-rselect-list { max-height: 300px; overflow-y: auto; margin: 0; padding: 0; list-style: none; outline: none; }
.mh-rselect-group { padding: 10px 10px 4px; color: var(--mh-subtle); font-size: var(--mh-fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.mh-rselect-option { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 5px 8px; border-radius: var(--mh-radius-sm); cursor: pointer; }
.mh-rselect-option.is-sub { padding-left: 30px; }
.mh-rselect-option:hover, .mh-rselect-option.is-active { background: var(--mh-surface-3); }
.mh-rselect-option[aria-selected="true"] { font-weight: 650; color: var(--mh-primary); }
.mh-rselect-option[aria-selected="true"]::after { content: "✓"; margin-left: auto; padding-right: 4px; }
.mh-rselect-empty { margin: 8px; font-size: var(--mh-fs-sm); }
@media (forced-colors: active) { .mh-rselect-option.is-active { outline: 2px solid Highlight; } }

/* Tag chips (data-tags) */
.mh-tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; margin-top: 6px; padding: 6px 8px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); cursor: text; transition: border-color .15s, box-shadow .15s; }
.mh-tag-input:focus-within { border-color: var(--mh-primary); box-shadow: var(--mh-ring); }
.mh-field .mh-tag-input input[data-tag-typing] { flex: 1 1 120px; width: auto; min-height: 32px; margin: 0; padding: 4px; border: 0; box-shadow: none; background: transparent; }
.mh-tag-chip { min-height: 30px; padding: 2px 4px 2px 12px; background: var(--mh-primary-soft); border-color: transparent; font-size: var(--mh-fs-sm); }
.mh-tag-remove { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--mh-muted); font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.mh-tag-remove:hover { background: var(--mh-surface); color: var(--mh-danger); }

/* Filters with a count when some are on */
.mh-filters.is-active summary { background: var(--mh-primary-soft); border-color: color-mix(in srgb, var(--mh-primary) 40%, transparent); color: var(--mh-primary); }
.mh-filter-count { font-weight: 700; }

/* Bill sections: open (green edge + badge), next (neutral, clock), closed (faded, check). */
.mh-bills--open .mh-list-item { box-shadow: inset 4px 0 0 var(--mh-primary); }
.mh-bills--later .mh-amount { color: var(--mh-muted); }
/* Only paid bills fade: an overdue one must keep catching the eye. */
.mh-bills--closed .is-paid .mh-list-main { opacity: .7; }
.mh-bills--closed .is-paid:hover .mh-list-main, .mh-bills--closed .is-paid:focus-within .mh-list-main { opacity: 1; }

/* Evolution period tabs: icons on phones, short labels elsewhere. */
.mh-evo-window .mh-icon { display: none; }
@media (max-width: 599px) {
  .mh-evo-window .mh-icon { display: inline-block; width: 20px; height: 20px; }
  .mh-evo-window .mh-evo-window-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Month-by-month table: two columns fold below 1024px; the edges fade while it scrolls. */
@media (max-width: 1023px) { .mh-table--evo .mh-col-extra { display: none; } }
.mh-table-scroll {
  background:
    linear-gradient(to right, var(--mh-surface) 30%, transparent) left / 40px 100% no-repeat local,
    linear-gradient(to left, var(--mh-surface) 30%, transparent) right / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--mh-text) 16%, transparent), transparent) left / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--mh-text) 16%, transparent), transparent) right / 14px 100% no-repeat scroll,
    var(--mh-surface);
}

/* Categories: pencil in the header, revealed on hover/focus where there is a mouse. */
.mh-cat-edit { flex: none; width: 34px; height: 34px; color: var(--mh-muted); }
@media (hover: hover) {
  .mh-cat-edit { opacity: 0; transition: opacity .15s; }
  .mh-cat-card summary:hover .mh-cat-edit, .mh-cat-card summary:focus-within .mh-cat-edit, .mh-cat-edit:focus-visible { opacity: 1; }
}
/* Category cards narrower than 380px (the grid now starts at 240px): the month total moves under
   the name instead of squeezing it. Container query, so it follows the card, not the screen. */
.mh-cat-card { container-type: inline-size; }
.mh-cat-card-text { min-width: 0; }
@container (max-width: 380px) {
  .mh-cat-card summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; column-gap: 12px; row-gap: 2px; }
  .mh-cat-card summary > .mh-chip { grid-row: 1 / 3; }
  .mh-cat-card-text { grid-column: 2; grid-row: 1; }
  .mh-cat-card-figure { grid-column: 2; grid-row: 2; display: flex; align-items: baseline; gap: 6px; text-align: left; }
  .mh-cat-card-figure .mh-amount { display: inline; font-size: var(--mh-fs-sm); }
  .mh-cat-card-figure .mh-muted { white-space: nowrap; }
  .mh-cat-card .mh-cat-edit { grid-column: 3; grid-row: 1 / 3; }
  .mh-cat-card .mh-caret { grid-column: 4; grid-row: 1 / 3; }
  .mh-cat-card[open] .mh-cat-subs { margin-left: 8px; }
}

/* ---------------------------------------------------------------------------------------------
   UX, second round (documents/DESIGN.md › Segunda rodada). Colours come from the --mh-* tokens:
   the spec's hex values (#1a3a2e, #7f1d1d, #b45309…) map to primary, danger and warning.
   --------------------------------------------------------------------------------------------- */

/* 3. Sidebar CTA at the standard 40px, the same weight as a button elsewhere. */
.mh-sidebar-cta { min-height: 40px; padding-block: 8px; }

/* 5. Transaction type tabs: the active one also gets a 2px underline in its colour; the others
   stay muted (not 50% opacity, which would drop below AA contrast). */
.mh-kind-tabs a:not([aria-current="page"]) { color: var(--mh-muted); }
.mh-kind-tabs a[aria-current="page"] { box-shadow: inset 0 -2px 0 currentColor !important; }

/* 6. Subcategories in the category list: indented and lighter than their main category. */
.mh-rselect-option.is-sub { padding-left: 24px; color: var(--mh-muted); font-weight: 450; }
.mh-rselect-option:not(.is-sub) { font-weight: 600; }

/* 7. "Today" / "Yesterday" next to the date. */
.mh-date-wrap { display: flex; gap: 6px; align-items: stretch; margin-top: 6px; }
.mh-field .mh-date-wrap input { margin-top: 0; }
.mh-date-wrap input { flex: 1; min-width: 0; }
.mh-date-shortcut { flex: none; padding: 0 12px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; font-size: var(--mh-fs-sm); font-weight: 600; cursor: pointer; }
.mh-date-shortcut:hover { border-color: var(--mh-primary); color: var(--mh-primary); }
.mh-date-shortcut[aria-pressed="true"] { border-color: var(--mh-primary); background: var(--mh-primary-soft); color: var(--mh-primary); }
.mh-form-row .mh-date-wrap { flex-wrap: wrap; }
.mh-form-row .mh-date-wrap input { flex-basis: 100%; }
.mh-form-row .mh-date-shortcut { flex: 1; min-height: 34px; }

/* 11. Amounts by type: income bold green, expenses red. */
.mh-amount--income { font-weight: 700; }
.mh-amount--expense { color: var(--mh-danger); }
/* A summary tile whose icon is an outflow uses the same red as the list, so the number is not only a label. */
.mh-tile:has(.mh-chip--expense) > .mh-amount { color: var(--mh-danger); }

/* 12. Filters: date range and the category checklist. */
.mh-filters-range, .mh-filters-cats { margin: 0; padding: 0; border: 0; min-width: 0; }
.mh-filters-range legend, .mh-filters-cats legend { margin-bottom: 6px; padding: 0; font-size: var(--mh-fs-sm); font-weight: 600; }
.mh-filters-range { display: flex; align-items: center; gap: 8px; grid-column: span 2; }
.mh-filters-range label { flex: 1; min-width: 0; }
.mh-filters-range input { width: 100%; }
@media (max-width: 599px) { .mh-filters-range { grid-column: 1 / -1; } }
.mh-filters-range input { min-height: 42px; padding: 8px 10px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; }
.mh-filters-cats { grid-column: 1 / -1; }
.mh-check-list { display: flex; flex-wrap: wrap; gap: 6px; }
.mh-filters-form .mh-check-item { display: inline-flex; grid-template-columns: none; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-pill); background: var(--mh-surface); font-weight: 550; cursor: pointer; }
.mh-check-item:has(input:checked) { border-color: var(--mh-primary); background: var(--mh-primary-soft); }
.mh-check-item input { width: 16px; height: 16px; accent-color: var(--mh-primary); }
.mh-check-item .mh-chip--sm { width: 24px; height: 24px; border-radius: 7px; }
.mh-check-item .mh-chip--sm .mh-icon { width: 14px; height: 14px; }

/* 19. Pickers: a check on the chosen option; names of compact icons on hover and focus. */
.mh-picker-option:has(input:checked)::after { content: ""; position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--mh-primary); box-shadow: 0 0 0 2px var(--mh-surface); }
.mh-picker-option:has(input:checked)::before { content: "✓"; position: absolute; z-index: 1; top: -6px; right: -6px; width: 20px; height: 20px; color: var(--mh-primary-text); font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.mh-picker--compact .mh-picker-option[data-tooltip]:is(:hover, :focus-within) > .mh-sr { position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 5; width: max-content; height: auto; margin: 0; padding: 4px 10px; clip: auto; clip-path: none; overflow: visible; white-space: nowrap; transform: translateX(-50%); border-radius: var(--mh-radius-sm); background: var(--mh-floresta); color: var(--mh-nevoa); font-size: var(--mh-fs-xs); font-weight: 650; box-shadow: var(--mh-shadow); pointer-events: none; }
.mh-picker-grid { overflow: visible; padding-top: 8px; padding-right: 8px; }
.mh-picker[data-picker] .mh-picker-grid { overflow-y: auto; }

/* 38. Options with a description: wide cards with the icon at the side. */
.mh-picker--described .mh-picker-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); max-height: none; }
.mh-picker--described .mh-picker-option { flex-direction: row; align-items: flex-start; gap: 12px; padding: 12px; text-align: left; }
.mh-picker--described .mh-picker-label { font-size: var(--mh-fs-sm); }
.mh-picker-desc { display: block; margin-top: 3px; color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 450; line-height: 1.35; }

/* 21. Limit bars: green below 70%, amber to 90%, red above. */
.mh-meter--low span { background: var(--mh-success); }
.mh-meter--mid span { background: var(--mh-goal); }
.mh-meter--high span { background: var(--mh-danger); }
.mh-budget .mh-meter--low span { background: var(--mh-success); }
.mh-budget .mh-meter--mid span { background: var(--mh-goal); }
.mh-budget .mh-meter--high span { background: var(--mh-danger); }

/* 2. Breadcrumb on nested pages; on phones only the closest parent shows ("‹ Itaú"). */
.mh-crumbs { margin-bottom: 12px; font-size: var(--mh-fs-sm); }
.mh-crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.mh-crumbs li { display: inline-flex; align-items: center; gap: 4px; color: var(--mh-muted); }
.mh-crumbs li + li::before { content: "/"; color: var(--mh-subtle); margin-right: 2px; }
.mh-crumbs a { display: inline-flex; align-items: center; gap: 4px; color: var(--mh-muted); font-weight: 550; text-decoration: none; }
.mh-crumbs a:hover { color: var(--mh-text); text-decoration: underline; }
.mh-crumbs a .mh-icon { display: none; width: 16px; height: 16px; }
.mh-crumbs [aria-current="page"] span { color: var(--mh-text); font-weight: 650; }
@media (max-width: 599px) {
  .mh-crumbs li { display: none; }
  .mh-crumbs li:nth-last-child(2) { display: inline-flex; }
  .mh-crumbs li::before { display: none; }
  .mh-crumbs li:nth-last-child(2) a .mh-icon { display: inline-block; }
}

/* 23. Paid / Expected with counts. */
.mh-cf-view { grid-auto-columns: minmax(90px, auto); }
.mh-count { color: var(--mh-subtle); font-weight: 550; }
.mh-segmented a[aria-current="page"] .mh-count { color: inherit; }
.mh-cf-view .mh-icon { width: 16px; height: 16px; }

/* 24. Change compared with today, under the new amount. */
.mh-amount-diff { min-height: 1.4em; margin: 6px 0 0; color: var(--mh-muted); font-size: var(--mh-fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.mh-amount-diff.is-up { color: var(--mh-warning); }
.mh-amount-diff.is-down { color: var(--mh-success); }

/* 25. Sparkline of the amounts recorded. */
.mh-spark { margin: 0 0 12px; color: var(--mh-primary); }
.mh-spark svg { display: block; max-width: 100%; height: auto; }
.mh-spark figcaption { margin-top: 4px; }

/* 26. Next dates of a recurring bill. */
.mh-schedule-preview { display: flex; align-items: center; gap: 8px; min-height: 1.4em; margin: 0 0 16px; padding: 8px 12px; border-radius: var(--mh-radius-sm); background: var(--mh-primary-soft); color: var(--mh-text); font-size: var(--mh-fs-sm); font-weight: 600; }
.mh-schedule-preview .mh-icon { width: 16px; height: 16px; color: var(--mh-primary); }
.mh-schedule-preview:empty { display: none; }

/* 29. Pockets open and close smoothly (where the browser can animate <details>). */
@supports (interpolate-size: allow-keywords) {
  .mh-pocket-group { interpolate-size: allow-keywords; }
  .mh-pocket-group details::details-content { height: 0; overflow: hidden; transition: height .3s ease, content-visibility .3s allow-discrete; }
  .mh-pocket-group details[open]::details-content { height: auto; }
}
@media (prefers-reduced-motion: reduce) { .mh-pocket-group details::details-content { transition: none; } }

/* 20 and 30. Projection of a goal at the current pace. */
.mh-projection { display: flex; align-items: flex-start; gap: 6px; margin: 6px 0 0; color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-projection .mh-icon { flex: none; width: 14px; height: 14px; margin-top: 2px; color: var(--mh-goal); }

/* 32. The chosen file, under the drop area. */
.mh-dropzone-file { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-sm); background: var(--mh-surface); }
.mh-dropzone-file[hidden] { display: none; }
.mh-dropzone-file-text { display: grid; min-width: 0; flex: 1; font-size: var(--mh-fs-sm); }
.mh-dropzone-file-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-dropzone.has-file { border-style: solid; border-color: var(--mh-primary); }

/* 33. Bill summary by category. */
.mh-bill-summary { display: grid; gap: 10px; margin: 0; padding: 16px 18px; list-style: none; }
.mh-bill-summary li { display: grid; grid-template-columns: auto minmax(90px, 1fr) minmax(60px, 2fr) 3.5em auto; align-items: center; gap: 12px; }
.mh-bill-summary-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-bill-summary-pct { text-align: right; font-size: var(--mh-fs-sm); font-variant-numeric: tabular-nums; }
.mh-bill-summary .mh-amount { text-align: right; }
.mh-meter--thin { height: 6px; }
.mh-meter--thin span[class*="mh-cat--"] { background: var(--cat); }
.mh-meter--thin span:not([class]) { background: var(--mh-neutro); }
@media (max-width: 599px) {
  .mh-bill-summary li { grid-template-columns: auto 1fr auto; row-gap: 4px; }
  .mh-bill-summary .mh-meter { grid-column: 2 / -1; grid-row: 2; }
  .mh-bill-summary-pct { display: none; }
}

/* 34. Day of the month on a grid. */
.mh-daypick { margin: 0; padding: 0; border: 0; min-width: 0; }
.mh-daypick legend { margin-bottom: 8px; padding: 0; font-weight: 600; font-size: var(--mh-fs-sm); }
.mh-daypick-grid { display: grid; grid-template-columns: repeat(7, minmax(34px, 1fr)); gap: 3px; max-width: 300px; }
.mh-daypick-day { position: relative; display: grid; place-items: center; height: 34px; border: 1px solid var(--mh-border); border-radius: 8px; background: var(--mh-surface); font-size: var(--mh-fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.mh-daypick-day:hover { border-color: var(--mh-primary); }
.mh-daypick-day input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.mh-daypick-day:has(input:checked) { border-color: var(--mh-primary); background: var(--mh-primary); color: var(--mh-primary-text); }
.mh-daypick-day:has(input:focus-visible) { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-daypick[aria-invalid="true"] .mh-daypick-grid { outline: 1px solid var(--mh-danger); outline-offset: 4px; border-radius: var(--mh-radius-sm); }
.mh-daypick .mh-help { display: block; margin-top: 8px; }

/* 35. Allocation total. */
.mh-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 8px 0 4px; padding: 8px 12px; border-radius: var(--mh-radius-sm); background: var(--mh-surface-2); font-size: var(--mh-fs-sm); }
.mh-sum strong { font-family: var(--mh-font-display); font-variant-numeric: tabular-nums; }
.mh-sum.is-ok { background: var(--mh-success-soft); color: var(--mh-success); }
.mh-sum.is-off { background: var(--mh-danger-soft); color: var(--mh-danger); }

/* 37. Assistant bubbles: the assistant on the soft green, the person on white. */
.mh-bubble--assistant { background: var(--mh-primary-soft); }
.mh-bubble--me { background: var(--mh-surface); color: var(--mh-text); border: 1px solid var(--mh-border-strong); }

/* 40. Coloured tags. */
.mh-tag--color { border-color: color-mix(in srgb, var(--cat) 45%, transparent); background: color-mix(in srgb, var(--cat) 14%, var(--mh-surface)); color: var(--mh-text); }
.mh-tag--color .mh-icon { color: var(--cat); }

/* 41. Family welcome when the space has one person. */
.mh-family-welcome { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.mh-family-welcome h2 { margin: 0 0 12px; }
.mh-benefits { display: grid; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.mh-benefits li { display: flex; gap: 10px; align-items: flex-start; }
.mh-benefits .mh-icon { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--mh-primary); }
@media (max-width: 599px) { .mh-family-welcome { flex-direction: column; } }

/* 17. Comparison line under a figure. */
.mh-delta { display: inline-flex; align-items: center; gap: 4px; margin: 6px 0 0; padding: 2px 8px; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 650; }
.mh-delta.is-up { background: var(--mh-success-soft); color: var(--mh-success); }
.mh-delta.is-down { background: var(--mh-danger-soft); color: var(--mh-danger); }

/* 42. Financial health (apps.insights): maturity score, debt level, reports and notifications. */
.mh-bell { position: relative; margin-left: auto; }
.mh-bell + .mh-appbar-user { margin-left: 0; }
.mh-bell-count, .mh-nav-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--mh-radius-pill); background: var(--mh-danger); color: var(--mh-primary-text); font-size: .7rem; font-weight: 700; line-height: 1; }
.mh-bell-count { position: absolute; top: 2px; right: 0; }
.mh-nav-count { margin-left: auto; }
.mh-scores { margin-bottom: 8px; }
.mh-score-main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; margin: 4px 0 12px; }
.mh-score-number { margin: 0; font-family: var(--mh-font-display); line-height: 1; }
.mh-score-number strong { font-size: var(--mh-fs-3xl); font-weight: 700; }
.mh-score-level { margin-bottom: 8px; }
.mh-score--starting .mh-score-level { background: var(--mh-danger-soft); color: var(--mh-danger); }
.mh-score--building .mh-score-level { background: var(--mh-warning-soft); color: var(--mh-warning); }
.mh-score--steady .mh-score-level, .mh-score--advanced .mh-score-level { background: var(--mh-success-soft); color: var(--mh-success); }
.mh-score--starting .mh-score-meter span { background: var(--mh-danger); }
.mh-score--building .mh-score-meter span { background: var(--mh-goal); }
.mh-score-debt, .mh-score-tip, .mh-limit-change { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 10px; }
.mh-score-debt .mh-icon, .mh-score-tip .mh-icon, .mh-limit-change .mh-icon { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.mh-debt--low .mh-icon { color: var(--mh-success); }
.mh-debt--moderate .mh-icon { color: var(--mh-warning); }
.mh-debt--high strong, .mh-debt--critical strong, .mh-debt--high .mh-icon, .mh-debt--critical .mh-icon { color: var(--mh-danger); }
.mh-score-parts { margin: 0 0 10px; }
.mh-score-parts summary { cursor: pointer; color: var(--mh-primary); font-weight: 600; font-size: var(--mh-fs-sm); }
.mh-score-parts .mh-compact { margin-top: 8px; }
.mh-monthly-plan .mh-field { flex: 1 1 160px; margin: 0; }
.mh-monthly-plan .mh-field input { margin-top: 0; }
.mh-monthly-plan .mh-daily-meta { margin-top: 6px; }
.mh-daily { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--mh-radius-sm); background: var(--mh-surface-2); }
.mh-daily-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.mh-daily-head .mh-icon { flex: none; width: 18px; height: 18px; color: var(--mh-primary); }
.mh-daily-meta { margin: 6px 0 0; font-size: var(--mh-fs-sm); }
.mh-daily--near .mh-meter span { background: var(--mh-goal); }
.mh-daily--over .mh-meter span { background: var(--mh-danger); }
.mh-daily--over .mh-daily-head .mh-icon { color: var(--mh-danger); }
.mh-score-trend { margin: 0 0 12px; }
.mh-score-trend > p { margin: 0 0 6px; font-size: var(--mh-fs-sm); }
.mh-score-bars { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mh-score-bar { flex: 1 1 0; display: flex; flex-direction: column; min-width: 0; }
.mh-score-bar-track { display: flex; align-items: flex-end; height: 56px; border-bottom: 1px solid var(--mh-border); }
.mh-score-bar-fill { display: block; width: 100%; max-width: 40px; margin: 0 auto; border-radius: 4px 4px 0 0; background: var(--mh-primary); }
.mh-score-bar.mh-score--starting .mh-score-bar-fill { background: var(--mh-danger); }
.mh-score-bar.mh-score--building .mh-score-bar-fill { background: var(--mh-goal); }
.mh-score-bar-label { margin-top: 4px; font-size: var(--mh-fs-xs); color: var(--mh-muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-score-bar-label strong { display: block; color: var(--mh-text); }
.mh-score-tip { padding: 10px 12px; border-radius: var(--mh-radius-sm); background: var(--mh-primary-soft); }
.mh-score-tip .mh-icon { color: var(--mh-primary); }
.mh-report-points { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.mh-report-point { display: flex; align-items: flex-start; gap: 8px; }
.mh-report-point .mh-icon { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.mh-report-point--good .mh-icon { color: var(--mh-success); }
.mh-report-point--improve .mh-icon { color: var(--mh-warning); }
.mh-report-text p:first-line { font-weight: inherit; }
.mh-report-text .mh-report-title { margin: 20px 0 6px; font-family: var(--mh-font-display); font-size: var(--mh-fs-md); font-weight: 600; color: var(--mh-text); }
.mh-report-text .mh-report-title:first-child { margin-top: 0; }
.mh-report-text p { margin: 0 0 10px; }
.mh-limits-mode { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.mh-limits-mode > div:first-child { flex: 1 1 320px; }
.mh-limits-mode h3 { margin: 0 0 4px; font-size: var(--mh-fs-md); }
.mh-limits-mode p { margin: 0; max-width: var(--mh-measure); }
.mh-limits-mode .mh-segmented button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 0; border-radius: var(--mh-radius-sm); background: none; color: var(--mh-muted); font: inherit; font-weight: 600; font-size: var(--mh-fs-sm); cursor: pointer; }
.mh-limits-mode .mh-segmented button[aria-pressed="true"] { background: var(--mh-surface); color: var(--mh-primary); box-shadow: var(--mh-shadow-sm); }
.mh-limits-mode .mh-segmented button:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-limit-change { margin: 6px 0 0; font-size: var(--mh-fs-xs); color: var(--mh-muted); }
.mh-limit-change .mh-icon { width: 14px; height: 14px; color: var(--mh-primary); }
.mh-limit-undo { padding: 0; border: 0; background: none; color: var(--mh-primary); font: inherit; font-weight: 650; text-decoration: underline; cursor: pointer; }
.mh-limit-undo:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-auto-limits-title { margin: 14px 0 6px !important; font-size: var(--mh-fs-sm); font-weight: 650; }
.mh-auto-limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 20px; margin: 0; padding: 0; list-style: none; font-size: var(--mh-fs-sm); }
.mh-auto-limits li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--mh-border); }
.mh-auto-limits strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mh-template-link { margin-top: 12px; }
.mh-template-list { margin: 16px 0 0; padding: 0; list-style: none; }
.mh-template-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--mh-border); }
.mh-template-row .mh-list-main { flex: 1 1 220px; }
.mh-template-row .mh-field { flex: 0 1 180px; margin: 0; }
.mh-template-row label.mh-list-title { display: block; }
.mh-notice--new { border-color: var(--mh-primary); }
.mh-suggestion s { color: var(--mh-subtle); }
.mh-asset-suggest { list-style: none; margin: 4px 0 0; padding: 4px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); background: var(--mh-surface); }
.mh-asset-suggest[hidden] { display: none; }
.mh-asset-suggest button { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: var(--mh-text); padding: 8px 10px; border-radius: 8px; font: inherit; cursor: pointer; }
.mh-asset-suggest button:hover, .mh-asset-suggest button:focus-visible { background: var(--mh-surface-3); outline: 2px solid var(--mh-text); outline-offset: 2px; }
@media (max-width: 599px) {
  .mh-score-number strong { font-size: var(--mh-fs-2xl); }
  .mh-limits-mode .mh-segmented { width: 100%; }
}

/* 43. Two-step verification tip, guided tour and help center (apps/help, static/js/tour.js). */
.mh-check-list { display: grid; gap: 12px; margin: 14px 0 18px; padding: 0; list-style: none; max-width: var(--mh-measure); }
.mh-check-list li { display: flex; gap: 12px; align-items: flex-start; }
.mh-check-list .mh-icon { flex: none; margin-top: 2px; color: var(--mh-primary); }
.mh-mfa-intro { max-width: 760px; }
.mh-mfa-intro section + section { margin-top: 24px; }
.mh-mfa-intro h2 { margin: 0 0 4px; }
.mh-mfa-intro .mh-form-actions { margin-top: 28px; }
.mh-tip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 24px; padding: 16px 18px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-lg); background: var(--mh-surface); box-shadow: var(--mh-shadow-sm); }
.mh-tip-text { flex: 1 1 320px; min-width: 0; }
.mh-tip-text h2 { margin: 0 0 2px; font-size: var(--mh-fs-md); }
.mh-tip-text p { margin: 0; max-width: var(--mh-measure); color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-tip-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mh-tip-actions form { margin: 0; }
.mh-help-btn { margin-left: auto; }
.mh-help-btn + .mh-bell { margin-left: 0; }

.mh-tour { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--mh-text); overflow: hidden; }
.mh-tour::backdrop { background: transparent; }
.mh-tour.is-centered { background: var(--mh-overlay); }
.mh-tour-spot { position: fixed; border-radius: var(--mh-radius); box-shadow: 0 0 0 3px var(--mh-highlight), 0 0 0 100vmax var(--mh-overlay); pointer-events: none; transition: left .2s, top .2s, width .2s, height .2s; }
.mh-tour-card { position: fixed; width: min(360px, calc(100vw - 28px)); padding: 22px; border-radius: var(--mh-radius-lg); background: var(--mh-surface); box-shadow: var(--mh-shadow-md); }
.mh-tour.is-centered .mh-tour-card { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 28px)); }
.mh-tour-card h2 { margin: 10px 0 6px; font-family: var(--mh-font-display); font-size: var(--mh-fs-lg); }
.mh-tour-card p { margin: 0 0 8px; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-tour-card a { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.mh-tour-card form { display: none; }
.mh-tour-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--mh-border); }
.mh-tour-count { margin: 0 !important; font-size: var(--mh-fs-xs) !important; font-weight: 650; }
.mh-tour-actions { display: flex; gap: 6px; margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .mh-tour-spot { transition: none; } }

.mh-help-search { position: relative; max-width: 640px; margin: 0 0 20px; }
.mh-help-search > .mh-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--mh-muted); pointer-events: none; }
.mh-help-search input { width: 100%; min-height: 48px; padding: 10px 14px 10px 44px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius); background: var(--mh-surface); color: var(--mh-text); font: inherit; }
.mh-help-screen { margin-bottom: 20px; border-color: var(--mh-primary); }
.mh-help-screen h2 { margin: 0 0 4px; }
.mh-help-screen p:last-child { margin: 0; }
.mh-help-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mh-help-topic { display: flex; gap: 14px; align-items: flex-start; padding: 18px; color: var(--mh-text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.mh-help-topic:hover { border-color: var(--mh-primary); box-shadow: var(--mh-shadow-md); }
.mh-help-topic strong, .mh-help-topic .mh-muted { display: block; }
.mh-help-topic .mh-muted { margin-top: 2px; font-size: var(--mh-fs-sm); }
.mh-help-results { display: grid; gap: 0; max-width: 860px; padding: 4px 22px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-lg); background: var(--mh-surface); }
.mh-help-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.mh-help-articles { padding: 4px 22px; }
.mh-help-article { border-bottom: 1px solid var(--mh-border); }
.mh-help-article:last-child { border-bottom: 0; }
.mh-help-article summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; font-weight: 650; cursor: pointer; list-style: none; }
.mh-help-article summary::-webkit-details-marker { display: none; }
.mh-help-article summary .mh-icon { flex: none; color: var(--mh-muted); transition: transform .15s; }
.mh-help-article[open] summary .mh-icon { transform: rotate(180deg); }
.mh-help-article summary:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: 2px; border-radius: var(--mh-radius-sm); }
.mh-help-answer { padding: 0 0 18px; max-width: var(--mh-measure); }
.mh-help-answer p { margin: 0 0 10px; }
.mh-help-answer .mh-steps { gap: 14px; margin: 6px 0 14px; }
.mh-help-examples-label { font-size: var(--mh-fs-sm); font-weight: 650; }
.mh-help-examples { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.mh-help-examples code { display: inline-block; padding: 4px 10px; border-radius: var(--mh-radius-pill); background: var(--mh-primary-soft); color: var(--mh-text); font-family: inherit; font-size: var(--mh-fs-sm); }
.mh-help-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-size: var(--mh-fs-sm); }
.mh-help-side { position: sticky; top: 24px; }
.mh-help-contact { margin-top: 28px; font-size: var(--mh-fs-sm); }
.mh-help-public { min-height: 100vh; background: var(--mh-bg); }
.mh-help-public-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) clamp(16px, 2.5vw, 64px) 14px; background: var(--mh-surface); border-bottom: 1px solid var(--mh-border); }
.mh-help-public .mh-main { max-width: 1200px; margin: 0 auto; padding-bottom: 64px; }
@media (max-width: 899px) {
  .mh-help-layout { grid-template-columns: minmax(0, 1fr); }
  .mh-help-side { position: static; }
  .mh-help-public .mh-main { padding: 20px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) { .mh-help-article summary .mh-icon { transition: none; } }
.mh-help-topics > .mh-card { margin: 0; }
@media (max-width: 599px) { .mh-tip { padding: 14px 16px; } .mh-tip > .mh-chip { display: none; } }

/* Budget ("Orçamento", apps.goals.budget): cards per main category and the planner. ---------- */
.mh-budget-summary { margin-bottom: 8px; }
.mh-budget-groups { display: grid; gap: 22px; }
.mh-budget-group-head h3 { margin: 0; font-size: var(--mh-fs-lg); }
.mh-budget-group-head p { margin: 4px 0 10px; font-size: var(--mh-fs-sm); }
/* One full-width row per category until the screen can hold two wide cards.
   A narrow card used to leave the title one letter wide under the status pill. */
.mh-budget-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mh-budget-card { display: grid; gap: 12px; align-content: start; min-width: 0; }
.mh-budget-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.mh-budget-card-head h3 { flex: 1 1 12rem; min-width: min(100%, 12rem); margin: 0; font-size: var(--mh-fs-md); overflow-wrap: break-word; }
.mh-budget-card-head .mh-status { flex: 1 1 100%; white-space: normal; justify-content: flex-start; }
.mh-budget-now { margin: 0; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-budget-now .mh-amount { color: var(--mh-text); font-size: var(--mh-fs-xl); }
.mh-budget-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cat, var(--mh-cat-slate)); }
.mh-budget-bar { display: flex; height: 8px; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); overflow: hidden; }
.mh-budget-bar span { display: block; height: 100%; transition: width .4s ease-out; }
.mh-budget-bar-spent { background: var(--mh-success); }
.mh-budget-bar--mid .mh-budget-bar-spent { background: var(--mh-goal); }
.mh-budget-bar--high .mh-budget-bar-spent { background: var(--mh-danger); }
.mh-budget--savings { --cat: var(--mh-goal); }
.mh-budget-bar--save .mh-budget-bar-spent { background: var(--mh-goal); }
/* What is still expected: the same colour, striped, after what was spent. */
.mh-budget-bar-expected { background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--mh-muted) 45%, transparent) 0 4px, transparent 4px 8px); }
.mh-budget-figures { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.mh-budget-figures > div { padding: 10px 12px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-sm); background: var(--mh-surface-2); }
.mh-budget-figures dt { color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.mh-budget-figures dd { margin: 2px 0 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.mh-budget-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding-top: 10px; border-top: 1px solid var(--mh-border); color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-budget-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.mh-budget-foot .mh-icon { width: 16px; height: 16px; }
.mh-budget-card--over { border-color: color-mix(in srgb, var(--mh-danger) 40%, var(--mh-border)); }

.mh-plan-income { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.mh-plan-income .mh-field { flex: 1 1 280px; max-width: 420px; margin: 0; }
.mh-plan-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.mh-plan-chart { display: grid; gap: 18px; justify-items: center; }
.mh-plan-chart > h2 { justify-self: start; margin: 0; }
.mh-donut { position: relative; display: grid; place-items: center; width: min(260px, 70vw); aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--donut, var(--mh-border) 0 100%)); }
.mh-donut::before { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: var(--mh-surface); }
.mh-donut-center { position: relative; display: grid; justify-items: center; margin: 0; }
.mh-donut-center strong { font-family: var(--mh-font-display); font-size: var(--mh-fs-2xl); letter-spacing: -.02em; }
.mh-donut-center span { color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-plan-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 18px; width: 100%; margin: 0; padding: 0; list-style: none; font-size: var(--mh-fs-sm); }
.mh-plan-legend li { display: flex; align-items: center; gap: 8px; }
.mh-plan-legend li span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mh-plan-legend strong { font-variant-numeric: tabular-nums; }
.mh-plan-actions { justify-content: center; width: 100%; margin: 0; }
.mh-plan-note { margin: 0; font-size: var(--mh-fs-xs); }
.mh-plan-row { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--mh-border); }
.mh-plan-row-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.mh-plan-row-head label { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; }
.mh-plan-avg { font-size: var(--mh-fs-xs); }
.mh-plan-row-body { display: flex; align-items: center; gap: 14px; }
/* The slider fills with the category colour up to its value (--fill, set by the page and by JS). */
.mh-plan-range { --fill: 0%; flex: 1; min-width: 0; height: 28px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.mh-plan-range::-webkit-slider-runnable-track { height: 6px; border-radius: var(--mh-radius-pill); background: linear-gradient(to right, var(--cat) 0 var(--fill), var(--mh-surface-3) var(--fill) 100%); }
.mh-plan-range::-moz-range-track { height: 6px; border-radius: var(--mh-radius-pill); background: linear-gradient(to right, var(--cat) 0 var(--fill), var(--mh-surface-3) var(--fill) 100%); }
.mh-plan-range::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border: 3px solid var(--cat); border-radius: 50%; background: var(--mh-surface); box-shadow: var(--mh-shadow-sm); }
.mh-plan-range::-moz-range-thumb { width: 14px; height: 14px; border: 3px solid var(--cat); border-radius: 50%; background: var(--mh-surface); }
.mh-plan-range:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: 4px; border-radius: var(--mh-radius-sm); }
.mh-plan-pct, .mh-plan-money { display: inline-flex; align-items: center; gap: 4px; }
.mh-plan-pct input { width: 5.5em; text-align: right; }
.mh-plan-money input { width: 9.5em; text-align: right; }
.mh-plan-row.is-invalid input { border-color: var(--mh-danger); }
.mh-plan[data-mode="pct"] [data-plan-money-wrap] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mh-plan[data-mode="money"] [data-plan-pct-wrap] { display: none; }
.mh-plan-allocated { display: flex; justify-content: space-between; margin: 16px 0 4px; font-weight: 650; }
.mh-plan-allocated strong { font-variant-numeric: tabular-nums; color: var(--mh-primary); }
.mh-plan-allocated.is-over strong { color: var(--mh-danger); }
.mh-plan-hint { min-height: 1.4em; margin: 0 0 14px; font-size: var(--mh-fs-sm); }
@media (max-width: 899px) { .mh-plan-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 599px) {
  .mh-plan-row-body { gap: 10px; }
  .mh-plan-pct input { width: 4.5em; }
  .mh-plan-money input { width: 7.5em; }
}
.mh-budget-grid > .mh-card, .mh-budget-groups > .mh-card, .mh-plan-grid > .mh-card { margin: 0; }
@media (min-width: 960px) {
  .mh-budget-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 50/30/20 rule (apps.goals.guideline): one bar per group, with a mark at its ceiling or floor. */
.mh-rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 8px 0 28px; }
.mh-rule-grid > .mh-card { margin: 0; }
.mh-rule-grid .mh-section-head p { margin: 4px 0 0; font-size: var(--mh-fs-sm); }
.mh-rule { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.mh-rule-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr) 3.5em; align-items: center; gap: 12px; font-size: var(--mh-fs-sm); }
.mh-rule-label { font-weight: 650; }
.mh-rule-label small { display: block; color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 500; }
.mh-rule-bar { position: relative; height: 10px; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); }
.mh-rule-bar > span { display: block; max-width: 100%; height: 100%; border-radius: inherit; background: var(--mh-success); transition: width .3s ease-out; }
.mh-rule-bar > i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--mh-text); opacity: .55; }
.mh-rule-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.mh-rule-row.is-off .mh-rule-bar > span { background: var(--mh-danger); }
.mh-rule-row.is-off strong { color: var(--mh-danger); }
.mh-rule-row--save .mh-rule-bar > span { background: var(--mh-goal); }
.mh-rule-plan { margin: 14px 0 0; font-size: var(--mh-fs-sm); }
.mh-plan-rule { width: 100%; padding-top: 14px; border-top: 1px solid var(--mh-border); }
.mh-plan-rule h3 { margin: 0 0 10px; font-size: var(--mh-fs-md); }
.mh-plan-group { margin-left: 4px; padding: 1px 8px; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 600; }
.mh-plan-group--needs { background: var(--mh-info-soft); color: var(--mh-info); }
.mh-ai-card { display: grid; gap: 12px; align-content: start; }
.mh-ai-card .mh-section-head { margin: 0; }
.mh-ai-points { display: grid; gap: 8px; margin: 0; padding-left: 20px; }
.mh-ai-card form { margin: 0; }
.mh-limits-detail { margin-top: 28px; }
.mh-limits-detail > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; cursor: pointer; list-style: none; }
.mh-limits-detail > summary::-webkit-details-marker { display: none; }
.mh-limits-detail > summary h2 { margin: 0; }
.mh-limits-detail > summary::after { content: "+"; margin-left: auto; font-weight: 700; color: var(--mh-muted); }
.mh-limits-detail[open] > summary { margin-bottom: 18px; }
.mh-limits-detail[open] > summary::after { content: "−"; }
.mh-limits-detail > summary:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: 4px; border-radius: var(--mh-radius-sm); }
.mh-goals-budget-link { margin: 4px 0 0; font-size: var(--mh-fs-sm); }
.mh-goals-budget-link a { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.mh-goals-budget-link .mh-icon { width: 16px; height: 16px; }
@media (max-width: 599px) { .mh-rule-row { grid-template-columns: minmax(0, 1fr) 3.5em; } .mh-rule-bar { grid-column: 1 / -1; grid-row: 2; } }

/* Budget plan month by month (goals/budget_roadmap.html) */
.mh-road-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 20px; }
.mh-road-top > .mh-card { margin: 0; }
.mh-road-form fieldset { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.mh-road-form legend { margin-bottom: 8px; font-weight: 650; }
.mh-road-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.mh-road-option { position: relative; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius-sm); background: var(--mh-surface); cursor: pointer; }
.mh-road-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mh-road-option strong { font-family: var(--mh-font-display); font-size: var(--mh-fs-lg); }
.mh-road-option span { color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-road-option:has(input:checked) { border-color: var(--mh-primary); background: var(--mh-primary-soft); }
.mh-road-option:has(input:focus-visible) { outline: 3px solid var(--mh-primary); outline-offset: 2px; }
.mh-road-custom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.mh-road-custom .mh-field { margin: 0; }
.mh-road-target:not(:has(input[value="custom"]:checked)) .mh-road-custom { display: none; }
.mh-road-horizon { display: grid; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.mh-road-groups { display: grid; gap: 12px; margin: 0 0 16px; }
.mh-road-groups dt { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.mh-road-groups dd { margin: 2px 0 0 20px; color: var(--mh-muted); font-size: var(--mh-fs-sm); }
.mh-road-rules { display: grid; gap: 8px; margin: 0; padding-left: 20px; font-size: var(--mh-fs-sm); }
.mh-road-key { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 4px; }
.mh-road-key--needs, .mh-road-bar--needs { background: var(--mh-info); }
.mh-road-key--wants, .mh-road-bar--wants { background: var(--mh-expense); }
.mh-road-key--save, .mh-road-bar--save { background: var(--mh-goal); }
.mh-road-summary { margin-bottom: 24px; }
.mh-road-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 12px 0 16px; }
.mh-road-steps > div { display: grid; gap: 2px; }
.mh-road-steps strong { font-family: var(--mh-font-display); font-size: var(--mh-fs-xl); }
.mh-road-steps small { color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-road-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 0; font-size: var(--mh-fs-sm); }
.mh-road-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.mh-road-months { display: grid; gap: 10px; }
.mh-road-month { margin: 0; padding: 0; }
.mh-road-month > summary { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(120px, 2fr) auto auto; align-items: center; gap: 8px 16px; padding: 14px 18px; cursor: pointer; list-style: none; }
.mh-road-month > summary::-webkit-details-marker { display: none; }
.mh-road-month > summary:focus-visible { outline: 3px solid var(--mh-primary); outline-offset: 2px; border-radius: var(--mh-radius); }
.mh-road-month-name { display: grid; }
.mh-road-month-name small { font-size: var(--mh-fs-xs); }
.mh-road-bar { display: flex; height: 12px; overflow: hidden; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); }
.mh-road-bar > span { display: block; height: 100%; }
.mh-road-pcts { grid-column: 2; font-size: var(--mh-fs-xs); color: var(--mh-muted); }
.mh-road-save { display: grid; justify-items: end; grid-row: 1 / span 2; grid-column: 3; font-size: var(--mh-fs-sm); }
.mh-road-month > summary .mh-status { grid-row: 1 / span 2; grid-column: 4; }
.mh-road-body { padding: 0 18px 18px; border-top: 1px solid var(--mh-border); }
.mh-road-why { margin: 16px 0 8px; font-size: var(--mh-fs-md); }
.mh-road-notes { display: grid; gap: 10px; margin: 0 0 16px; padding-left: 20px; font-size: var(--mh-fs-sm); max-width: var(--mh-measure); }
.mh-road-notes small { display: block; margin-top: 4px; }
.mh-road-changes { display: grid; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.mh-road-changes li { display: flex; justify-content: space-between; gap: 12px; max-width: 420px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .mh-road-month > summary { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
  .mh-road-bar, .mh-road-pcts { grid-column: 1 / -1; }
  .mh-road-save { grid-row: 1; grid-column: 2; }
  .mh-road-month > summary .mh-status { display: none; }
  .mh-road-body { padding: 0 14px 14px; }
  .mh-road-custom { grid-template-columns: 1fr; }
}

/* 44. Identity v2 (nov/2026): brand shell, home hero and the chart layer ======================== */
/* The menu and the phone app bar wear Floresta in both themes: the brand's structure colour frames
   every screen, the content stays on Névoa. Tokens only; the hero follows the same surface. */
:root {
  --mh-brand-bg: var(--mh-floresta);
  --mh-brand-bg-2: #0f3833;
  --mh-brand-text: var(--mh-nevoa);
  --mh-brand-muted: #a9bdb5;  /* 7.4:1 on Floresta */
  --mh-brand-subtle: #87a097; /* 5.2:1 on Floresta */
  --mh-brand-line: rgb(243 246 241 / 10%);
  --mh-brand-hover: rgb(243 246 241 / 7%);
  --mh-brand-active: rgb(61 220 151 / 16%);
  --mh-brand-accent: var(--mh-verde-broto);
  --mh-brand-accent-hover: #6ae6b0;
  --mh-brand-negative: #f6a08c; /* coral lifted to 7.2:1 on Floresta */
  --mh-brand-track: rgb(243 246 241 / 12%);
  --mh-heat-0: var(--mh-surface-3);
}
:root[data-theme="dark"] {
  --mh-brand-bg: #061c19;
  --mh-brand-bg-2: #0b2e2a;
  --mh-heat-0: var(--mh-surface-2);
}

/* Shell */
@media (min-width: 900px) { .mh-shell { background: linear-gradient(to right, var(--mh-brand-bg) 264px, var(--mh-bg) 264px); } }
:root[data-theme="dark"] .mh-hero { box-shadow: inset 0 0 0 1px var(--mh-brand-line), var(--mh-shadow-md); }
.mh-sidebar { background: var(--mh-brand-bg); border-right-color: var(--mh-brand-line); color: var(--mh-brand-text); scrollbar-color: var(--mh-brand-line) transparent; }
.mh-sidebar .mh-wordmark, .mh-appbar .mh-wordmark { color: var(--mh-brand-text); }
.mh-sidebar .mh-wordmark strong, .mh-appbar .mh-wordmark strong { color: var(--mh-brand-accent); }
.mh-sidebar .mh-space-name, .mh-sidebar .mh-space-switcher { background: var(--mh-brand-hover); border-color: var(--mh-brand-line); color: var(--mh-brand-text); }
.mh-sidebar .mh-space-label { color: var(--mh-brand-subtle); }
.mh-sidebar .mh-space-switcher button { color: var(--mh-brand-text); }
.mh-sidebar .mh-space-switcher button:hover:not(:disabled) { background: var(--mh-brand-hover); }
.mh-sidebar .mh-space-switcher button:disabled, .mh-sidebar .mh-caret { color: var(--mh-brand-accent); }
.mh-sidebar .mh-chip { background: var(--mh-brand-active); color: var(--mh-brand-accent); }
.mh-sidebar .mh-sidebar-cta { background: var(--mh-brand-accent); color: var(--mh-floresta); box-shadow: 0 6px 18px rgb(61 220 151 / 22%); }
.mh-sidebar .mh-sidebar-cta:hover { background: var(--mh-brand-accent-hover); }
.mh-sidebar .mh-nav-label { color: var(--mh-brand-subtle); }
.mh-sidebar .mh-nav a, .mh-sidebar .mh-nav button { color: var(--mh-brand-muted); }
.mh-sidebar .mh-nav a:hover, .mh-sidebar .mh-nav button:hover { background: var(--mh-brand-hover); color: var(--mh-brand-text); }
.mh-sidebar .mh-nav a[aria-current="page"] { background: var(--mh-brand-active); color: var(--mh-brand-text); }
.mh-sidebar .mh-nav a[aria-current="page"] .mh-icon { color: var(--mh-brand-accent); }
.mh-sidebar .mh-nav a[aria-current="page"]::before { background: var(--mh-brand-accent); }
.mh-sidebar .mh-sidebar-footer { border-top-color: var(--mh-brand-line); }
.mh-sidebar .mh-user { color: var(--mh-brand-text); }
.mh-sidebar .mh-user:hover, .mh-sidebar .mh-user[aria-current="page"] { background: var(--mh-brand-hover); }
.mh-sidebar .mh-user-text span, .mh-sidebar .mh-user .mh-caret, .mh-sidebar .mh-muted, .mh-sidebar .mh-version { color: var(--mh-brand-subtle); }
.mh-sidebar .mh-avatar { background: var(--mh-brand-active); color: var(--mh-brand-accent); }
.mh-sidebar :where(a, button, summary):focus-visible { outline-color: var(--mh-brand-accent); }
@media (max-width: 899px) {
  .mh-appbar { background: var(--mh-brand-bg); border-bottom-color: var(--mh-brand-line); color: var(--mh-brand-text); }
  .mh-appbar .mh-icon-btn { color: var(--mh-brand-muted); }
  .mh-appbar .mh-icon-btn:hover { background: var(--mh-brand-hover); color: var(--mh-brand-text); }
  .mh-appbar :where(a, button):focus-visible { outline-color: var(--mh-brand-accent); }
  .mh-appbar .mh-avatar { background: var(--mh-brand-active); color: var(--mh-brand-accent); }
  .mh-sidebar { border-bottom: 0; }
  .mh-tabbar a[aria-current="page"] .mh-icon, .mh-tabbar button[aria-expanded="true"] .mh-icon { background: var(--mh-primary-soft); }
}

/* Home hero: the month, the score and the next step, read in a few seconds. */
.mh-hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0; margin-bottom: 28px; border-radius: var(--mh-radius-lg); background: radial-gradient(120% 140% at 100% 0%, var(--mh-brand-bg-2) 0%, var(--mh-brand-bg) 55%); color: var(--mh-brand-text); box-shadow: var(--mh-shadow-md); }
.mh-hero::after { content: ""; position: absolute; z-index: -1; right: -60px; bottom: -90px; width: 340px; height: 340px; background: radial-gradient(closest-side, rgb(61 220 151 / 18%), transparent); pointer-events: none; }
.mh-hero > div { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 28px; }
.mh-hero > div + div { border-left: 1px solid var(--mh-brand-line); }
.mh-hero p { margin: 0; }
.mh-hero-eyebrow { margin: 0; font-family: var(--mh-font); font-size: var(--mh-fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mh-brand-accent); }
.mh-hero-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--mh-fs-sm); font-weight: 600; color: var(--mh-brand-muted); }
.mh-hero-label .mh-icon { width: 18px; height: 18px; color: var(--mh-brand-accent); }
.mh-hero-figure { font-family: var(--mh-font-display); font-size: clamp(2.25rem, 1.2rem + 3vw, var(--mh-fs-display)); font-weight: 650; letter-spacing: -.035em; line-height: 1.05; overflow-wrap: anywhere; }
.mh-hero-figure.is-negative { color: var(--mh-brand-negative); }
.mh-hero-note { font-size: var(--mh-fs-sm); color: var(--mh-brand-muted); }
.mh-hero-bars { display: grid; gap: 10px; margin: 10px 0 0; }
.mh-hero-bar { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 12px; }
.mh-hero-bar dt { display: inline-flex; align-items: center; gap: 6px; font-size: var(--mh-fs-sm); color: var(--mh-brand-muted); }
.mh-hero-bar dt .mh-icon { width: 16px; height: 16px; }
.mh-hero-bar dd { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0; }
.mh-hero-bar strong { font-family: var(--mh-font-display); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mh-hero-track { display: block; height: 12px; border-radius: var(--mh-radius-pill); background: var(--mh-brand-track); overflow: hidden; }
.mh-hero-fill { --tone: var(--mh-brand-accent); display: block; height: 100%; border-radius: inherit; background: repeating-linear-gradient(135deg, var(--tone) 0 3px, color-mix(in srgb, var(--tone) 35%, transparent) 3px 7px); }
.mh-hero-done { display: block; height: 100%; border-radius: inherit; background: var(--tone); }
.mh-hero-bar--income dt .mh-icon { color: var(--mh-brand-accent); }
.mh-hero-bar--expense .mh-hero-fill { --tone: var(--mh-despesa); }
.mh-hero-bar--expense dt .mh-icon { color: var(--mh-brand-negative); }
.mh-hero-key { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: var(--mh-fs-xs); color: var(--mh-brand-subtle); }
.mh-hero-key span { display: inline-flex; align-items: center; gap: 6px; }
.mh-hero-key i { display: inline-block; width: 18px; height: 8px; border-radius: var(--mh-radius-pill); }
.mh-hero-key-done { background: var(--mh-brand-muted); }
.mh-hero-key-expected { background: repeating-linear-gradient(135deg, var(--mh-brand-muted) 0 3px, transparent 3px 6px); }
.mh-hero-score { grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: center !important; gap: 18px !important; }
.mh-hero-level { font-family: var(--mh-font-display); font-size: var(--mh-fs-xl); font-weight: 650; letter-spacing: -.02em; }
.mh-hero-next { align-content: center !important; }
.mh-hero-tip { font-size: var(--mh-fs-md); line-height: 1.45; color: var(--mh-brand-text); }
.mh-btn-hero { justify-self: start; margin-top: 6px; background: var(--mh-brand-accent); color: var(--mh-floresta); box-shadow: none; }
.mh-btn-hero:hover { background: var(--mh-brand-accent-hover); }
.mh-hero :where(a, button):focus-visible { outline-color: var(--mh-brand-accent); }
@media (max-width: 1199px) {
  .mh-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mh-hero-month { grid-column: 1 / -1; }
  .mh-hero > .mh-hero-score { border-left: 0; }
  .mh-hero > div:not(.mh-hero-month) { border-top: 1px solid var(--mh-brand-line); }
}
@media (max-width: 640px) {
  .mh-hero { grid-template-columns: minmax(0, 1fr); border-radius: var(--mh-radius); }
  .mh-hero > div { padding: 20px; }
  .mh-hero > div + div { border-left: 0; }
  .mh-hero-bar { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .mh-btn-hero { justify-self: stretch; }
}

/* Score ring (includes/charts/ring.html) */
.mh-ring { --arc: var(--mh-brand-accent); position: relative; width: 112px; aspect-ratio: 1; flex: none; }
.mh-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.mh-ring circle { fill: none; stroke-width: 10; }
.mh-ring-track { stroke: var(--mh-brand-track); }
.mh-ring-arc { stroke: var(--arc); stroke-linecap: round; }
.mh-ring.mh-score--building { --arc: var(--mh-ambar); }
.mh-ring.mh-score--starting { --arc: var(--mh-despesa); }
.mh-ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.mh-ring-text strong { font-family: var(--mh-font-display); font-size: 1.75rem; font-weight: 650; letter-spacing: -.03em; }
.mh-ring-text small { margin-top: 4px; font-size: var(--mh-fs-xs); color: var(--mh-brand-subtle); }
@media (prefers-reduced-motion: no-preference) { .mh-ring-arc { animation: mh-ring-in .9s cubic-bezier(.2, .7, .2, 1) both; } }
@keyframes mh-ring-in { from { stroke-dasharray: 0 100; } }

/* Sparkline under a stat tile (includes/charts/sparkline.html) */
.mh-spark { --tone: var(--mh-primary); position: relative; display: block; height: 40px; margin: 6px 0 2px; }
.mh-spark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mh-spark-line { fill: none; stroke: var(--tone); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mh-spark-area { fill: color-mix(in srgb, var(--tone) 12%, transparent); stroke: none; }
.mh-spark-dot { position: absolute; width: 9px; height: 9px; margin: 0 0 -4.5px -4.5px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 2px var(--mh-surface); }
.mh-spark--income { --tone: var(--mh-income); }
.mh-spark--expense { --tone: var(--mh-expense); }
.mh-spark--worth { --tone: var(--mh-invest); }

/* Tiles: a little more presence, number first. */
.mh-tile { position: relative; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.mh-tile:hover { border-color: var(--mh-border-strong); box-shadow: var(--mh-shadow-md); }
.mh-tile .mh-amount--big { letter-spacing: -.03em; }

/* Donut with the total in the middle */
.mh-chart-split > .mh-donut .mh-donut-center { text-align: center; line-height: 1.1; }
.mh-chart-split > .mh-donut .mh-donut-center small { color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-chart-split > .mh-donut .mh-donut-center strong { font-size: var(--mh-fs-lg); }
.mh-dash--even .mh-chart-split { grid-template-columns: 1fr; justify-items: center; gap: 20px; }
.mh-dash--even .mh-chart-split > .mh-share-list { width: 100%; }

/* Spending calendar (includes/charts/heatmap.html): one hue, light to dark. */
.mh-heat { margin: 0; }
.mh-heat-grid { display: grid; gap: 4px; }
.mh-heat-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mh-heat-days span { font-size: var(--mh-fs-xs); color: var(--mh-subtle); text-align: center; text-transform: capitalize; }
.mh-heat-cell { position: relative; display: grid; place-items: center; min-height: 36px; aspect-ratio: 1.35; border-radius: 8px; background: var(--mh-heat-0); color: var(--mh-muted); font-size: var(--mh-fs-xs); font-variant-numeric: tabular-nums; }
.mh-heat-cell.is-empty { background: none; }
.mh-heat-cell.is-ahead { background: none; box-shadow: inset 0 0 0 1px var(--mh-border); color: var(--mh-subtle); }
.mh-heat-cell.is-today { box-shadow: 0 0 0 2px var(--mh-surface), 0 0 0 4px var(--mh-text); }
.mh-heat--1 { background: color-mix(in oklab, var(--mh-expense) 25%, var(--mh-heat-0)); color: var(--mh-text); }
.mh-heat--2 { background: color-mix(in oklab, var(--mh-expense) 50%, var(--mh-heat-0)); color: var(--mh-text); }
.mh-heat--3 { background: color-mix(in oklab, var(--mh-expense) 75%, var(--mh-heat-0)); color: var(--mh-floresta); }
.mh-heat--4 { background: var(--mh-expense); color: var(--mh-floresta); font-weight: 700; }
.mh-heat-tip { position: absolute; z-index: 3; bottom: calc(100% + 8px); left: 50%; display: none; padding: 6px 10px; border-radius: var(--mh-radius-sm); background: var(--mh-text); color: var(--mh-surface); font-size: var(--mh-fs-xs); white-space: nowrap; transform: translateX(-50%); box-shadow: var(--mh-shadow-md); pointer-events: none; }
.mh-heat-tip strong { display: block; font-weight: 650; text-transform: capitalize; }
.mh-heat-cell:hover .mh-heat-tip, .mh-heat-cell:focus-visible .mh-heat-tip { display: block; }
.mh-heat-row > .mh-heat-cell:nth-child(-n+2) .mh-heat-tip { left: 0; transform: none; }
.mh-heat-row > .mh-heat-cell:nth-last-child(-n+2) .mh-heat-tip { right: 0; left: auto; transform: none; }
.mh-heat-cell:focus-visible { outline-offset: 1px; }
.mh-heat-legend { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 14px; font-size: var(--mh-fs-xs); color: var(--mh-muted); }
.mh-heat-scale { display: inline-flex; align-items: center; gap: 4px; }
.mh-heat-scale .mh-heat-cell { min-height: 0; width: 14px; height: 14px; aspect-ratio: auto; border-radius: 4px; }
.mh-heat-scale .mh-heat-cell:first-child { margin-left: 4px; }
.mh-heat-scale .mh-heat-cell:last-child { margin-right: 4px; }
.mh-chart-table { margin-top: 10px; font-size: var(--mh-fs-sm); }
.mh-chart-table summary { cursor: pointer; color: var(--mh-primary); font-weight: 600; font-size: var(--mh-fs-xs); }
.mh-chart-table table { margin-top: 8px; }
.mh-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Planned × spent (includes/charts/bullets.html): the bar is what went out, the tick the limit. */
.mh-bullets { list-style: none; display: grid; gap: 16px; margin: 0; padding: 0; }
.mh-bullet { display: grid; gap: 6px; }
.mh-bullet-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mh-bullet-head strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.mh-bullet-left { font-size: var(--mh-fs-xs); font-weight: 650; color: var(--mh-muted); white-space: nowrap; }
.mh-bullet-track { position: relative; height: 10px; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); }
.mh-bullet-bar { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--mh-primary); }
.mh-budget--warning .mh-bullet-bar { background: var(--mh-goal); }
.mh-budget--over .mh-bullet-bar { background: var(--mh-expense); }
.mh-bullet-limit { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--mh-text); box-shadow: 0 0 0 2px var(--mh-surface); }
.mh-bullet-meta { margin: 0; font-size: var(--mh-fs-xs); color: var(--mh-muted); font-variant-numeric: tabular-nums; }

/* Planned × actual on the budget page (includes/charts/plan_actual.html) */
.mh-plan-card { margin-bottom: 24px; }
.mh-plan { margin: 0; }
.mh-plan-rows { list-style: none; display: grid; gap: 10px; margin: 0; padding: 0; }
.mh-plan-row { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) minmax(150px, auto); align-items: center; gap: 14px; }
.mh-plan-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: var(--mh-fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-plan-name .mh-share-swatch { flex: none; }
.mh-plan-track { position: relative; height: 14px; border-radius: 4px; background: var(--mh-surface-2); }
.mh-plan-spent, .mh-plan-expected { position: absolute; top: 0; bottom: 0; }
.mh-plan-spent { left: 0; border-radius: 4px 0 0 4px; background: var(--mh-primary); }
.mh-plan-expected { margin-left: 2px; border-radius: 0 4px 4px 0; background: repeating-linear-gradient(135deg, var(--mh-primary) 0 3px, transparent 3px 6px); }
.mh-budget--warning :is(.mh-plan-spent) { background: var(--mh-goal); }
.mh-budget--warning .mh-plan-expected { background: repeating-linear-gradient(135deg, var(--mh-goal) 0 3px, transparent 3px 6px); }
.mh-budget--over .mh-plan-spent { background: var(--mh-expense); }
.mh-budget--over .mh-plan-expected { background: repeating-linear-gradient(135deg, var(--mh-expense) 0 3px, transparent 3px 6px); }
.mh-budget--no_limit .mh-plan-spent { background: var(--mh-neutro); }
.mh-budget--no_limit .mh-plan-expected { background: repeating-linear-gradient(135deg, var(--mh-neutro) 0 3px, transparent 3px 6px); }
.mh-plan-limit { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--mh-text); box-shadow: 0 0 0 2px var(--mh-surface); }
.mh-plan-figure { font-variant-numeric: tabular-nums; font-size: var(--mh-fs-sm); font-weight: 650; text-align: right; white-space: nowrap; }
.mh-plan-figure .mh-muted { font-weight: 500; }
.mh-plan-key { display: inline-block; width: 16px; height: 10px; border-radius: 3px; }
.mh-plan-key--spent { background: var(--mh-primary); }
.mh-plan-key--expected { background: repeating-linear-gradient(135deg, var(--mh-primary) 0 3px, transparent 3px 6px); }
.mh-plan-key--limit { width: 3px; height: 14px; border-radius: 2px; background: var(--mh-text); }
@media (max-width: 640px) {
  .mh-plan-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
  .mh-plan-track { grid-column: 1 / -1; grid-row: 2; }
}
.mh-dash + .mh-section-title, .mh-dash + .mh-home-today { margin-top: 32px; }

/* Proactive alerts (Notifications) */
.mh-alerts-form { margin-bottom: 24px; }
.mh-alerts-form h3 { margin: 0 0 4px; }
.mh-alerts-form > .mh-muted { margin: 0 0 16px; }
.mh-alerts-kinds { margin: 0; padding: 0; border: 0; display: grid; gap: 2px 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.mh-alerts-kinds .mh-check, .mh-alerts-when .mh-check { margin-bottom: 14px; }
.mh-alerts-form .mh-check > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mh-alerts-when { display: grid; gap: 0 24px; grid-template-columns: minmax(140px, 200px) 1fr; align-items: end; padding-top: 12px; border-top: 1px solid var(--mh-border); }
.mh-alerts-when .mh-field { margin-bottom: 14px; }
@media (max-width: 600px) { .mh-alerts-when { grid-template-columns: 1fr; } }

/* 45. Goal simulator (apps.goals.simulator): controls beside the answer, three scenarios and the
   projection. The base is the goal line (amber, like the goal itself), conservative to optimistic
   the band around it, what goes in from the pocket a dashed neutral line and the target a rule in
   the text colour, so no two marks share a colour and the legend never relies on hue alone. */
.mh-sim { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.mh-sim-controls { position: sticky; top: 16px; }
.mh-sim-controls .mh-section-title { margin-bottom: 14px; }
.mh-sim-range { margin-bottom: 18px; }
.mh-sim-range-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.mh-sim-range-head label { font-weight: 600; font-size: var(--mh-fs-sm); }
.mh-sim-range-head output { font-family: var(--mh-font-display); font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.mh-sim-slider { --cat: var(--mh-goal); display: block; width: 100%; }
.mh-sim-range-scale { display: flex; justify-content: space-between; margin: 0; color: var(--mh-subtle); font-size: var(--mh-fs-xs); }
.mh-sim-inflation .mh-check { margin-bottom: 10px; }
.mh-sim-inflation .mh-check .mh-help { display: block; margin-top: 2px; font-weight: 400; }
.js .mh-sim-controls [data-sim-submit] { display: none; }
.mh-sim-result { display: grid; gap: 0; min-width: 0; }
.mh-sim-result.is-loading { opacity: .72; transition: opacity .2s; }
.mh-sim-hero { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr); }
.mh-sim-hero .mh-hero-label { margin: 0; }
.mh-sim-hero .mh-hero-level { font-variant-numeric: tabular-nums; }
.mh-sim-spread { max-width: var(--mh-measure); margin: 0; font-size: var(--mh-fs-sm); }
.mh-sim-scenarios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.mh-sim-scenario { display: grid; align-content: start; gap: 6px; padding: 18px; }
.mh-sim-scenario.is-base { box-shadow: inset 0 0 0 2px var(--mh-goal), var(--mh-shadow-sm); }
.mh-sim-scenario p { margin: 0; }
.mh-sim-scenario-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.mh-sim-scenario-rate { font-size: var(--mh-fs-sm); }
.mh-sim-scenario-when strong { font-family: var(--mh-font-display); font-size: var(--mh-fs-xl); font-weight: 650; letter-spacing: -.02em; }
.mh-sim-scenario-facts { display: grid; gap: 4px; margin: 6px 0 0; font-size: var(--mh-fs-sm); }
.mh-sim-scenario-facts div { display: flex; justify-content: space-between; gap: 8px; }
.mh-sim-scenario-facts dt { color: var(--mh-muted); }
.mh-sim-scenario-facts dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.mh-sim-key { display: inline-block; flex: none; width: 14px; height: 3px; border-radius: 2px; background: var(--mh-goal); }
.mh-sim-key--base { height: 3px; background: var(--mh-goal); }
.mh-sim-key--conservative, .mh-sim-key--optimistic { height: 10px; width: 10px; border-radius: 3px; background: color-mix(in srgb, var(--mh-goal) 22%, transparent); box-shadow: inset 0 0 0 1.5px var(--mh-goal); }
.mh-sim-key--conservative { box-shadow: inset 0 -3px 0 var(--mh-goal); }
.mh-sim-key--optimistic { box-shadow: inset 0 3px 0 var(--mh-goal); }
.mh-sim-key--band { height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--mh-goal) 22%, transparent); }
.mh-sim-key--contributed { background: repeating-linear-gradient(90deg, var(--mh-muted) 0 4px, transparent 4px 7px); }
.mh-sim-key--target { height: 2px; background: var(--mh-text); }
.mh-sim-chart .mh-evo-plot { height: 240px; }
.mh-sim-band { fill: color-mix(in srgb, var(--mh-goal) 18%, transparent); stroke: none; }
.mh-sim-lines polyline.mh-sim-base { stroke: var(--mh-goal); stroke-width: 2.5; }
.mh-sim-lines polyline.mh-sim-contributed { stroke: var(--mh-muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.mh-sim-target { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--mh-text); pointer-events: none; z-index: 1; }
.mh-sim-target span { position: absolute; right: 0; bottom: 4px; padding: 1px 6px; border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font-size: var(--mh-fs-xs); font-weight: 650; white-space: nowrap; }
.mh-sim-cols { z-index: 2; }
.mh-sim-cols .mh-evo-col.is-deadline { box-shadow: inset -2px 0 0 var(--mh-border-strong); }
.mh-sim-dot { width: 8px; height: 8px; margin: 0 0 -4px -4px; }
.mh-sim-dot.is-reached { background: var(--mh-goal); box-shadow: 0 0 0 2px var(--mh-surface), 0 0 0 3.5px var(--mh-goal); }
.mh-sim-chart .mh-table-wrap { overflow-x: auto; }
.mh-sim-budget-facts { display: grid; gap: 6px; margin: 8px 0 12px; font-size: var(--mh-fs-sm); }
.mh-sim-budget-facts div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--mh-border); }
.mh-sim-budget-facts dt { color: var(--mh-muted); }
.mh-sim-budget-facts dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.mh-sim-status { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-size: var(--mh-fs-sm); }
.mh-sim-status--ok .mh-icon { color: var(--mh-success); }
.mh-sim-status--over .mh-icon { color: var(--mh-warning); }
.mh-sim-apply .mh-check { margin: 12px 0; }
.mh-sim-disclaimer { margin: 0 0 24px; }
.mh-goal-sim-link { display: inline-flex; align-items: center; gap: 6px; font-size: var(--mh-fs-sm); font-weight: 600; }
.mh-goal-sim-link .mh-icon { width: 16px; height: 16px; }
@media (max-width: 1199px) {
  .mh-sim-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mh-sim-hero > div:first-child { grid-column: 1 / -1; }
  .mh-sim-hero > div:nth-child(2) { border-left: 0; }
}
@media (max-width: 899px) {
  .mh-sim { grid-template-columns: minmax(0, 1fr); }
  .mh-sim-controls { position: static; }
}
@media (max-width: 640px) {
  .mh-sim-hero { grid-template-columns: minmax(0, 1fr); }
  .mh-sim-scenarios { grid-template-columns: minmax(0, 1fr); }
  .mh-sim-chart .mh-evo-plot { height: 200px; }
}
.mh-goal-plan { color: var(--mh-text); }
.mh-goal-plan.is-late .mh-icon { color: var(--mh-warning); }
.mh-goal .mh-goal-sim-link { margin-top: 10px; }
.mh-sim-hero .mh-hero-figure { font-size: clamp(2rem, 1.1rem + 2vw, 3rem); white-space: nowrap; }
.mh-sim-scenario { margin: 0; }
.mh-sim-target span { right: auto; left: 4px; }
.mh-sim-disclaimer { margin-top: 12px; }
.mh-sim-scenarios > .mh-sim-scenario { margin: 0; }
.mh-sim-scenario-facts div { flex-wrap: wrap; }
.mh-sim-scenario-facts dd { white-space: nowrap; margin-left: auto; }

/* Subscriptions (apps/subscriptions) */
.mh-tile-meta { font-size: var(--mh-fs-xs); }
.mh-sub-chart { margin-top: 20px; padding: 16px 20px 12px; }
.mh-evo-bar--subs { --c: var(--mh-expense); }
.mh-evo-key--subs { background: var(--mh-expense); }
.mh-sub-notice { margin: 16px 0; }
.mh-sub-item { align-items: flex-start; }
.mh-sub-item .mh-list-main { align-items: flex-start; min-width: 0; }
.mh-sub-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.mh-sub-tags:empty { display: none; }
.mh-sub-tags .mh-icon { width: 14px; height: 14px; }
.mh-sub-history { margin-top: 6px; font-size: var(--mh-fs-xs); color: var(--mh-muted); }
.mh-sub-history summary { cursor: pointer; width: max-content; }
.mh-sub-history summary:focus-visible { outline: 2px solid var(--mh-primary); outline-offset: 2px; border-radius: 4px; }
.mh-sub-history ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 16px; margin: 8px 0 0; padding: 0; list-style: none; }
.mh-sub-history li { display: flex; justify-content: space-between; gap: 8px; font-variant-numeric: tabular-nums; }
.mh-sub-actions { flex-direction: column; align-items: flex-end; gap: 8px; }
.mh-sub-cost { display: grid; justify-items: end; gap: 2px; font-size: var(--mh-fs-xs); white-space: nowrap; }
.mh-sub-cost .mh-amount { font-size: var(--mh-fs-md); font-weight: 700; }
.mh-sub-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.mh-sub-more { position: relative; }
.mh-sub-more > summary { list-style: none; }
.mh-sub-more > summary::-webkit-details-marker { display: none; }
.mh-sub-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; display: grid; gap: 2px; min-width: 210px; padding: 6px; box-shadow: var(--mh-shadow-md); }
.mh-sub-menu .mh-btn, .mh-sub-menu button { justify-content: flex-start; width: 100%; }
@media (max-width: 599px) {
  .mh-sub-chart { padding: 12px 12px 8px; }
  .mh-sub-item { flex-direction: column; }
  .mh-sub-actions { width: 100%; align-items: stretch; }
  .mh-sub-cost { justify-items: start; }
  .mh-sub-buttons { justify-content: flex-start; }
}

/* Can I buy it? (insights/can_i_buy.html) */
.mh-buy-head { display: grid; gap: 8px; margin-bottom: 12px; border-left: 4px solid var(--mh-border-strong); }
.mh-buy-head--success { border-left-color: var(--mh-success); }
.mh-buy-head--warning { border-left-color: var(--mh-warning); }
.mh-buy-head--danger { border-left-color: var(--mh-danger); }
.mh-buy-head p { margin: 0; }
.mh-buy-head-amount { font-family: var(--mh-font-display); font-size: var(--mh-fs-xl); font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.mh-buy-head-tip { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.mh-buy-head-tip .mh-icon { width: 16px; height: 16px; color: var(--mh-primary); }
.mh-buy-options { margin-bottom: 16px; }
.mh-buy-option.is-best { box-shadow: inset 0 0 0 2px var(--mh-primary), var(--mh-shadow-sm); }
.mh-buy-option .mh-sim-scenario-facts div { align-items: baseline; }
.mh-buy-option .mh-sim-scenario-facts .is-warn dd { color: var(--mh-warning); }
.mh-buy-was { display: block; color: var(--mh-muted); font-size: var(--mh-fs-xs); font-weight: 400; }
.mh-sim .mh-buy-options { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Big decisions simulator (templates/insights/decisions.html): two paths, path A in the brand
   green and path B in the investment colour, the same keys on the cards, the chart and the table. */
.mh-dec-kinds { display: flex; flex-wrap: wrap; width: 100%; max-width: 760px; margin-bottom: 22px; }
.mh-dec-kinds a { flex: 1 1 150px; }
.mh-dec-group { margin: 6px 0 10px; padding: 0; font-weight: 700; font-size: var(--mh-fs-sm); color: var(--mh-muted); text-transform: uppercase; letter-spacing: .04em; }
.mh-dec-help { display: block; margin: -6px 0 14px; }
.mh-dec-premises { margin: 8px 0 0; padding: 14px 0 0; border: 0; border-top: 1px solid var(--mh-border); }
.mh-dec-choice { margin: 0 0 14px; padding: 0; border: 0; }
.mh-dec-choice legend { margin-bottom: 6px; font-weight: 600; font-size: var(--mh-fs-sm); }
.mh-dec-choice .mh-segmented--3 { margin-bottom: 0; }
.mh-sim .mh-dec-paths { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mh-dec-path.is-base { box-shadow: inset 0 0 0 2px var(--mh-primary), var(--mh-shadow-sm); }
.mh-dec-path .mh-sim-scenario-facts .is-warn dd { color: var(--mh-warning); }
.mh-dec-budget > .mh-sim-scenarios { margin: 12px 0; }
.mh-dec-key { display: inline-block; flex: none; width: 14px; height: 4px; border-radius: 2px; background: var(--mh-primary); }
.mh-dec-key--b { background: var(--mh-invest); }
.mh-dec-lines polyline.mh-dec-line--a { stroke: var(--mh-primary); stroke-width: 2.5; }
.mh-dec-lines polyline.mh-dec-line--b { stroke: var(--mh-invest); stroke-width: 2.5; stroke-dasharray: 6 3; }
.mh-dec-dot--a { --c: var(--mh-primary); }
.mh-dec-dot--b { --c: var(--mh-invest); }
@media (max-width: 599px) {
  .mh-sim .mh-dec-paths { grid-template-columns: minmax(0, 1fr); }
  .mh-dec-kinds a { flex-basis: 40%; }
}
.mh-sim-hero.mh-dec-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.mh-sim-hero.mh-dec-hero > div:first-child { grid-column: 1 / -1; }
.mh-sim-hero.mh-dec-hero > div:nth-child(2) { border-left: 0; }
@media (max-width: 640px) { .mh-sim-hero.mh-dec-hero { grid-template-columns: minmax(0, 1fr); } }
.mh-dec-hero .mh-hero-figure { font-size: clamp(1.6rem, 1rem + 1.4vw, 2.3rem); white-space: normal; line-height: 1.1; overflow-wrap: anywhere; }
.mh-dec-hero .mh-hero-level { white-space: nowrap; font-size: clamp(1.25rem, 1rem + .6vw, 1.6rem); }
.mh-dec-hero > div { min-width: 0; }

/* Debts and revolving credit (apps/debts) */
.mh-budget--debts { --cat: var(--mh-expense); }
.mh-debt-revolving { display: grid; gap: 12px; margin: 0 0 8px; padding: 0; list-style: none; }
.mh-debt-rev { display: grid; gap: 12px; border-left: 4px solid var(--mh-danger); }
.mh-debt-rev--soon { border-left-color: var(--mh-warning); }
.mh-debt-rev-head { display: flex; align-items: flex-start; gap: 12px; }
.mh-debt-rev-head > div { flex: 1; min-width: 0; }
.mh-debt-rev-head h3 { margin: 0; font-size: var(--mh-fs-md); }
.mh-debt-rev-head p { margin: 2px 0 0; font-size: var(--mh-fs-sm); }
.mh-debt-rev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 16px; margin: 0; }
.mh-debt-rev-facts div { display: grid; gap: 2px; }
.mh-debt-rev-facts dt { color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-debt-rev-facts dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.mh-debt-rev-next { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: var(--mh-fs-sm); }
.mh-debt-rev-next .mh-icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--mh-primary); }
.mh-debt-rev .mh-form-actions { align-items: center; margin: 0; }
.mh-debt-list { margin-bottom: 20px; }
.mh-debt-sim { margin-top: 8px; }
.mh-debt-strategies { display: grid; gap: 8px; }
.mh-debt-strategy { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--mh-border); border-radius: var(--mh-radius); cursor: pointer; }
.mh-debt-strategy:has(input:checked) { border-color: var(--mh-primary); box-shadow: inset 0 0 0 1px var(--mh-primary); }
.mh-debt-strategy:has(input:focus-visible) { outline: 2px solid var(--mh-primary); outline-offset: 2px; }
.mh-debt-strategy input { margin-top: 3px; accent-color: var(--mh-primary); }
.mh-debt-strategy span { display: grid; gap: 2px; }
.mh-debt-strategy small { font-size: var(--mh-fs-xs); }
.mh-debt-order { display: grid; gap: 0; margin: 8px 0 0; padding: 0; list-style: none; }
.mh-debt-order li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--mh-border); }
.mh-debt-order li:last-child { border-bottom: 0; }
.mh-debt-order-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mh-primary-soft); color: var(--mh-primary-text); font-weight: 700; font-size: var(--mh-fs-sm); }
.mh-debt-order-name, .mh-debt-order-when { display: grid; gap: 2px; }
.mh-debt-order-when { justify-items: end; text-align: right; font-variant-numeric: tabular-nums; }
.mh-debt-order small { font-size: var(--mh-fs-xs); }
.mh-inline-form { display: inline; }
/* Settling up and allowance (apps/household) */
.mh-settle-hero { margin-bottom: 20px; }
.mh-settle-even { display: flex; align-items: center; gap: 10px; margin: 8px 0; color: var(--mh-income); font-weight: 600; }
.mh-settle-moves .mh-list-actions { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.mh-settle-since { margin: 10px 0 0; font-size: var(--mh-fs-sm); }
.mh-settle-detail { display: grid; gap: 4px; margin: 10px 0 0; font-size: var(--mh-fs-sm); }
.mh-settle-detail div { display: flex; justify-content: space-between; gap: 12px; }
.mh-settle-detail dt { color: var(--mh-muted); }
.mh-settle-detail dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.mh-settle-reset { margin-top: 24px; }
.mh-allowance { display: grid; gap: 16px; }
.mh-allowance.is-paused { opacity: .85; }
.mh-allowance-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mh-allowance-who { flex: 1 1 200px; min-width: 0; }
.mh-allowance-who h2 { margin: 0; }
.mh-allowance-who p { margin: 2px 0 0; }
.mh-allowance-balance { display: grid; justify-items: end; text-align: right; }
.mh-allowance-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mh-allowance-block h3, .mh-allowance-more h3 { font-size: var(--mh-fs-sm); margin: 0 0 8px; }
.mh-allowance-block .mh-compact li { display: flex; align-items: center; gap: 10px; }
.mh-allowance-block .mh-compact .mh-compact-text { flex: 1; }
.mh-allowance-more summary { cursor: pointer; color: var(--mh-muted); }
@media (max-width: 599px) {
  .mh-allowance-balance { justify-items: start; text-align: left; width: 100%; }
  .mh-settle-moves .mh-list-item { flex-wrap: wrap; }

/* Hard month (apps/hardmonth) -------------------------------------------------------------- */
.mh-hard-notice { margin: 0 0 16px; }
.mh-hard-head { padding: 20px 22px; border-left: 4px solid var(--mh-border); }
.mh-hard-head--tight { border-left-color: var(--mh-warning); }
.mh-hard-head--on { border-left-color: var(--mh-primary); }
.mh-hard-head--calm { border-left-color: var(--mh-success); }
.mh-hard-state { margin: 0 0 8px; }
.mh-hard-headline { margin: 0 0 8px; font-size: var(--mh-fs-xl); }
.mh-hard-reasons { margin: 0 0 12px; padding-left: 18px; color: var(--mh-text); font-size: var(--mh-fs-sm); }
.mh-hard-reasons li + li { margin-top: 4px; }
.mh-hard-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 0; }
.mh-hard-figures div { padding: 10px 12px; border-radius: var(--mh-radius-sm); background: var(--mh-surface-2); }
.mh-hard-figures dt { color: var(--mh-muted); font-size: var(--mh-fs-xs); }
.mh-hard-figures dd { margin: 2px 0 0; font-size: var(--mh-fs-lg); }
.mh-hard-cuts { padding: 0; }
.mh-hard-cut .mh-list-main { align-items: center; }
.mh-hard-check { width: 18px; height: 18px; flex: none; accent-color: var(--mh-primary); }
.mh-hard-check:focus-visible { outline: none; box-shadow: var(--mh-ring); }
.mh-hard-cut label { cursor: pointer; }
.mh-hard-input { width: 120px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; text-align: right; font-variant-numeric: tabular-nums; }
.mh-hard-input:focus { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-hard-cut:has(.mh-hard-check:not(:checked)) .mh-hard-input { opacity: .55; }
.mh-hard-cuts-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--mh-border); }
.mh-hard-cuts-foot p { margin: 0; }
.mh-hard-track-body { flex: 1; min-width: 0; }
.mh-hard-track .mh-list-main { flex: 1; }
.mh-hard-meter { margin-top: 8px; max-width: 360px; }
.mh-hard-meter--ok span { background: var(--mh-success); }
.mh-hard-meter--warning span { background: var(--mh-goal); }
.mh-hard-meter--over span { background: var(--mh-danger); }
.mh-hard-left { display: grid; justify-items: end; text-align: right; }
.mh-hard-left .mh-muted { font-size: var(--mh-fs-xs); }
.mh-hard-talks .mh-list-item { align-items: flex-start; }
.mh-hard-talks .mh-list-main { align-items: flex-start; min-width: 0; }
.mh-hard-talks .mh-list-meta { margin-top: 4px; max-width: var(--mh-measure); color: var(--mh-text); }
@media (max-width: 640px) {
  .mh-hard-figures { grid-template-columns: 1fr 1fr; }
  .mh-hard-figures div:last-child { grid-column: 1 / -1; }
  .mh-hard-track, .mh-hard-skips .mh-list-item, .mh-hard-talks .mh-list-item { flex-wrap: wrap; }
  .mh-hard-track .mh-list-actions, .mh-hard-skips .mh-list-actions, .mh-hard-talks .mh-list-actions { width: 100%; justify-content: space-between; padding-left: 52px; }
  .mh-hard-left { justify-items: start; text-align: left; }
  .mh-hard-cut { flex-wrap: nowrap; }
  .mh-hard-cut .mh-list-main { min-width: 0; }
  .mh-hard-input { width: 92px; }
}

/* Anonymous comparison (apps/benchmark) ---------------------------------------------------- */
.mh-bench-intro { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.mh-bench-how, .mh-bench-join, .mh-bench-head, .mh-bench-leave { padding: 20px 22px; }
.mh-bench-points { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; font-size: var(--mh-fs-sm); }
.mh-bench-points li { display: flex; gap: 10px; }
.mh-bench-points .mh-icon { flex: none; color: var(--mh-success); margin-top: 2px; }
.mh-bench-head { margin-bottom: 16px; }
.mh-bench-head .mh-section-title { margin: 8px 0 4px; }
.mh-bench-head p { margin: 0; }
.mh-bench-group { margin: 0 0 12px; }
.mh-bench-body { flex: 1; min-width: 0; }
.mh-bench-row .mh-list-main { flex: 1; min-width: 0; }
.mh-bench-bar { position: relative; height: 10px; margin-top: 10px; max-width: 420px; border-radius: var(--mh-radius-pill); background: var(--mh-surface-3); }
.mh-bench-range { position: absolute; top: 0; bottom: 0; border-radius: var(--mh-radius-pill); background: color-mix(in srgb, var(--mh-primary) 28%, var(--mh-surface-3)); }
.mh-bench-median { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--mh-primary); }
.mh-bench-you { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid var(--mh-surface); border-radius: 50%; background: var(--mh-goal); box-shadow: 0 0 0 1px var(--mh-text); }
.mh-bench-people { display: flex; gap: 8px; align-items: center; }
.mh-bench-people input { width: 72px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--mh-border-strong); border-radius: var(--mh-radius-sm); background: var(--mh-surface); color: var(--mh-text); font: inherit; }
.mh-bench-people input:focus { border-color: var(--mh-primary); box-shadow: var(--mh-ring); outline: none; }
.mh-bench-leave { margin-top: 20px; }
.mh-bench-leave .mh-form-actions { margin-top: 12px; }
@media (max-width: 760px) {
  .mh-bench-intro { grid-template-columns: 1fr; }
  .mh-bench-row { flex-wrap: wrap; }
  .mh-bench-row .mh-list-actions { padding-left: 52px; }
}
