/* Family Finance — app shell styles (package B1).
   Light theme only. Mobile first. No web fonts. No inline styles anywhere:
   values that change at run time (bar width, house fill) are CSS custom
   properties that JS sets with element.style.setProperty(), which the CSP allows. */

:root {
  /* colour tokens (design section 5) — contrast ratios are checked in app-test/contrast.test.mjs */
  --paper: #FAF7F2;      /* page background */
  --card: #FFFFFF;       /* card surface */
  --ink: #1C1B19;        /* main text */
  --mute: #6B665E;       /* labels, secondary text: 5.33:1 on paper, 5.70:1 on card */
  --line: #E7E1D7;       /* dividers and card borders (decorative only) */
  --track: #EFE9DF;      /* progress track, switch background */
  --field: #857E73;      /* input and key borders: 3.76:1 on paper (UI component >= 3:1) */
  --acc: #B5502C;        /* brick accent: buttons, active tab, bar fill */
  --acc-tint: #F3E3DA;   /* accent tint: selected states, info banner */
  --acc-deep: #9A4325;   /* brick text on tint: 5.25:1 */
  --on-acc: #FFFFFF;     /* text on brick: 5.06:1 */
  --up: #2E7D5B;         /* gain only */
  --down: #B3261E;       /* loss and over budget only */
  --down-tint: #FBE9E7;  /* error and locked background */
  --focus: #1C1B19;      /* focus ring */

  /* type and spacing */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --gap: 12px;
  --pad: 16px;
  --tap: 48px;           /* minimum touch target */
  --key: 56px;           /* keypad key height */
  --bar-h: 64px;         /* bottom bar height without safe area */
  --raise: 26px;         /* the raised + button stands this much above the bar */
  --max: 480px;          /* content width on large screens */
  --shadow: 0 6px 20px rgba(28, 27, 25, .08);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, p { margin: 0; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--acc-deep); }

/* ---------- focus and motion ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
/* headings get focus from JS on screen change; they are not controls */
h1:focus, [tabindex="-1"]:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- shell regions ---------- */
.app { display: block; }

.banner-region {
  position: sticky; top: 0; z-index: 20;
  max-width: var(--max); margin: 0 auto;
}
.banner-region:empty { display: none; }

.bar-region {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
}
.bar-region:empty { display: none; }

.toast-region {
  position: fixed; z-index: 40;
  left: 0; right: 0;
  bottom: calc(var(--bar-h) + 12px + env(safe-area-inset-bottom));
  display: flex; justify-content: center;
  padding: 0 var(--pad);
  pointer-events: none;
}

.noscript { padding: 24px var(--pad); max-width: var(--max); margin: 0 auto; }

/* ---------- screen layout ---------- */
.screen {
  max-width: var(--max);
  margin: 0 auto;
  padding:
    max(20px, env(safe-area-inset-top))
    max(var(--pad), env(safe-area-inset-right))
    calc(var(--bar-h) + var(--raise) + 24px + env(safe-area-inset-bottom))
    max(var(--pad), env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: var(--gap);
}
.screen--no-bar { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.screen--center { min-height: 100vh; min-height: 100dvh; justify-content: center; }

.screen-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.screen-head .seg { flex: 0 1 230px; }
.screen-title { font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
/* h1 that looks like a muted label, e.g. "Spent in November" above the big number */
.screen-title--label { font-size: 15px; font-weight: 500; color: var(--mute); letter-spacing: 0; }
.screen-title--center { text-align: center; }

.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.center { text-align: center; }

/* ---------- numbers and labels ---------- */
.big-number {
  font-size: clamp(34px, 11vw, 44px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.big-number--center { text-align: center; }
.big-number--muted { color: var(--mute); } /* empty amount "₹0" before typing */

.label { font-size: 15px; color: var(--mute); }
.small { font-size: 14px; }
.strong { font-weight: 700; }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.card--dashed { border-style: dashed; background: transparent; }
.card-title { font-size: 16px; font-weight: 700; }
.card--link { text-decoration: none; color: inherit; min-height: var(--tap); }

/* ---------- row (label / value) ---------- */
.row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  min-height: 28px;
}
.row-label { color: var(--mute); min-width: 0; overflow-wrap: anywhere; }
.row-label--ink { color: var(--ink); }
.row-value { font-weight: 700; text-align: right; white-space: nowrap; }
.row-value--plain { font-weight: 400; }
/* Shared expenses: "you owe" muted, only the amount bold and coloured */
.row-value--split { font-weight: 400; white-space: normal; }
.split-words { color: var(--mute); white-space: nowrap; }
.split-amount { font-weight: 700; white-space: nowrap; }

/* ---------- progress bar ---------- */
/* JS: bar.style.setProperty('--value', '61%'). Values over 100% are capped visually. */
.progress {
  height: 10px; border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}
.progress-fill {
  display: block; height: 100%;
  width: min(var(--value, 0%), 100%);
  background: var(--acc);
  border-radius: inherit;
  transition: width .4s var(--ease);
}
.progress--over .progress-fill { background: var(--down); }
.progress-note { font-size: 14px; color: var(--mute); }
.progress-note--over { color: var(--down); font-weight: 600; }

/* ---------- transaction list ---------- */
.tx-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tx {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.tx:last-child { border-bottom: 0; }
.tx-main { display: flex; flex-direction: column; min-width: 0; }
/* titles and meta lines wrap (no cut text when the text is large) */
.tx-title { overflow-wrap: anywhere; }
.tx-meta { font-size: 14px; color: var(--mute); overflow-wrap: anywhere; }
.tx-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.tx-amount { font-weight: 700; white-space: nowrap; }
.tx-amount--income { color: var(--up); }
.tx-pending {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  color: var(--acc-deep); background: var(--acc-tint);
  border-radius: 99px; padding: 1px 8px;
}
.tx-pending::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); min-width: var(--tap);
  padding: 10px 18px;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  background: transparent; color: var(--ink);
  transition: background-color .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn-primary { background: var(--acc); color: var(--on-acc); }
.btn-primary:active { background: var(--acc-deep); }
.btn-quiet { background: var(--card); border-color: var(--field); color: var(--ink); }
.btn-quiet:active { background: var(--track); }
.btn-danger { background: var(--card); border-color: var(--down); color: var(--down); }
.btn-danger:active { background: var(--down-tint); }
.btn-link { min-height: var(--tap); padding: 10px 4px; color: var(--acc-deep); text-decoration: underline; font-weight: 600; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: var(--track); border-color: transparent; color: var(--mute);
  cursor: not-allowed; transform: none;
}
/* loading: aria-busy="true"; label stays, a small ring shows before it */
.btn[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}

/* ---------- icon button (Refresh, Close): 48 x 48 target, no frame ---------- */
.icon-btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--tap); height: var(--tap); padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--mute);
  cursor: pointer; transition: background-color .15s;
}
.icon-btn:active { background: var(--track); }
.icon-btn svg { width: 22px; height: 22px; }
/* busy: the icon turns */
.icon-btn[aria-busy="true"] { color: var(--acc-deep); cursor: progress; }
.icon-btn[aria-busy="true"] svg { animation: spin 1s linear infinite; }

/* ---------- segmented switch (Expense / Income) ---------- */
.seg {
  display: flex; padding: 3px; gap: 3px;
  background: var(--track); border-radius: 99px;
}
.seg-item {
  flex: 1; min-height: var(--tap); padding: 6px 10px;
  border: 0; border-radius: 99px; background: transparent;
  font-weight: 600; cursor: pointer;
}
.seg-item[aria-checked="true"] { background: var(--ink); color: var(--paper); }

/* ---------- category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cat {
  min-height: var(--tap); padding: 6px 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 15px; line-height: 1.2; cursor: pointer;
  overflow-wrap: anywhere; hyphens: auto;
}
.cat[aria-pressed="true"] {
  background: var(--acc-tint); border: 2px solid var(--acc); font-weight: 700;
}
.cat--more { color: var(--mute); border-style: dashed; }
.cat:disabled { color: var(--mute); background: var(--track); cursor: not-allowed; }

/* ---------- chips (Date: Today, Paid by: UPI) ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--tap); padding: 6px 14px;
  background: var(--card); border: 1px solid var(--field); border-radius: 99px;
  cursor: pointer;
}
.chip-label { color: var(--mute); font-size: 14px; }
.chip-value { font-weight: 700; }

/* ---------- number keypad (3 x 4) ---------- */
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.key {
  min-height: var(--key);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 24px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; user-select: none;
}
.key:active { background: var(--track); }
.key--action { background: transparent; border-color: transparent; color: var(--ink); }
.key--action svg { width: 28px; height: 28px; }
.key:disabled { color: var(--line); cursor: default; }
.keypad--pin .key { min-height: 64px; font-size: 26px; }

/* ---------- PIN dots (4 to 12) ---------- */
.pin-dots {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  min-height: 24px; padding: 8px 0;
}
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--ink); background: transparent;
}
.pin-dot--filled { background: var(--ink); }
.pin-dots--error .pin-dot { border-color: var(--down); }
.pin-dots--error .pin-dot--filled { background: var(--down); }
.pin-dots--shake { animation: shake .4s linear; }
.pin-message { min-height: 24px; text-align: center; font-size: 15px; color: var(--mute); }
.pin-message--error { color: var(--down); font-weight: 600; }

/* ---------- fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 15px; font-weight: 600; }
.input {
  min-height: var(--tap); width: 100%;
  padding: 10px 12px;
  background: var(--card); border: 1px solid var(--field); border-radius: var(--radius-sm);
  font-size: 16px; /* 16 px stops the zoom on focus */
}
.input::placeholder { color: var(--mute); opacity: 1; }
.input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.input[aria-invalid="true"] { border: 2px solid var(--down); }
.input:disabled { background: var(--track); color: var(--mute); }
.field-hint { font-size: 14px; color: var(--mute); }
.field-error { font-size: 14px; color: var(--down); font-weight: 600; }

/* ---------- bottom bar ---------- */
.tabbar {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end;
  min-height: var(--bar-h);
  padding: 0 8px env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px;
  min-height: var(--bar-h); min-width: var(--tap); padding-bottom: 8px;
  color: var(--mute); text-decoration: none;
  font-size: 13px; font-weight: 600;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--acc-deep); }
.tab-add-circle {
  width: 60px; height: 60px; margin-top: calc(-1 * var(--raise)); /* raised above the bar */
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--acc); color: var(--on-acc);
  box-shadow: var(--shadow);
  border: 4px solid var(--paper);
}
.tab-add-circle svg { width: 28px; height: 28px; }
.tab--add[aria-current="page"] .tab-add-circle { background: var(--acc-deep); }

/* ---------- toast ---------- */
.toast {
  pointer-events: auto;
  width: 100%; max-width: calc(var(--max) - 2 * var(--pad));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 6px 6px 6px 16px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  animation: toast-in .2s var(--ease);
}
.toast-text { min-width: 0; }
.toast-action {
  flex: none; min-height: var(--tap); min-width: var(--tap); padding: 8px 14px;
  background: transparent; border: 0; border-radius: 8px;
  color: var(--acc-tint); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  cursor: pointer;
}
.toast-action:focus-visible { outline-color: var(--paper); }

/* ---------- banner ---------- */
.banner {
  display: flex; align-items: center; gap: 10px;
  min-height: var(--tap); padding: 10px var(--pad);
  font-size: 15px; line-height: 1.35;
  background: var(--acc-tint); color: var(--ink);
}
.banner svg { width: 20px; height: 20px; flex: none; }
.banner--offline { background: var(--ink); color: var(--paper); }
.banner--locked { background: var(--down-tint); color: var(--down); font-weight: 600; }
.banner--info { background: var(--acc-tint); color: var(--ink); }
.banner--inline { border-radius: var(--radius-sm); }

/* ---------- empty state ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 8px 8px; text-align: center;
}
.empty img { width: 160px; height: 112px; }
.empty-title { font-size: 17px; font-weight: 700; }
.empty-text { color: var(--mute); max-width: 32ch; }

/* ---------- house picture (inline SVG from img/house.svg) ---------- */
/* JS: svg.style.setProperty('--fill', '0.34'). The body of the house is 64 units high (y 46 to 110). */
.house { width: 160px; height: 120px; margin: 0 auto; }
.house-fill {
  height: calc(var(--fill, 0) * 64px);
  y: calc(110px - var(--fill, 0) * 64px);
  transition: height .6s var(--ease), y .6s var(--ease);
}

/* ---------- skeleton loading ---------- */
/* Each block has the same height as the content it stands for, so layout shift stays near 0. */
.skel {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, var(--line) 0%, var(--track) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skel-label { height: 22px; width: 45%; }          /* .label line */
.skel-big { height: 48px; width: 60%; }            /* .big-number line */
.skel-bar { height: 10px; width: 100%; border-radius: 99px; }
.skel-line { height: 20px; width: 80%; }
.skel-card { height: 96px; width: 100%; border-radius: var(--radius); }
.skel-tx { height: 56px; width: 100%; }
.skel-title { height: 28px; width: 40%; }          /* .screen-title */
.skel-value { display: inline-block; height: 20px; width: 72px; vertical-align: middle; } /* a value in a row */

/* ---------- animations ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .skel { animation: none; background: var(--line); }
  /* the wrong-PIN state stays visible through colour and the message text */
  .pin-dots--shake { animation: none; }
  /* busy: the ring and the icon stay still; the colour and aria-busy say "busy" */
  .icon-btn[aria-busy="true"] svg, .btn[aria-busy="true"]::before, .key[aria-busy="true"]::before { animation: none; }
}

/* ======================= screens (packages B3–B5) ======================= */
[hidden] { display: none !important; }
.lead { font-size: 16px; }
.btn-sm { padding: 8px 12px; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.welcome-icon { width: 72px; height: 72px; margin-top: 16px; }

/* message line: errors and notes, with an optional Retry button */
.msg { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.msg:empty { display: none; }
.msg--center { align-items: center; text-align: center; }
.msg-text { font-size: 15px; color: var(--mute); }
.msg-text--error { color: var(--down); font-weight: 600; }

/* PIN screens: a column as high as the screen; title and dots at the top, keypad and links at the bottom */
.screen--pin { min-height: 100vh; min-height: 100dvh; }
.pin-head { display: flex; flex-direction: column; gap: var(--gap); padding-top: clamp(0px, calc(14vh - 56px), 64px); }
.pin-foot { margin-top: auto; padding-top: var(--gap); display: flex; flex-direction: column; gap: 4px; }
/* one message line stays reserved, so a message does not move the keypad */
.screen--pin .msg { min-height: 24px; }
.screen--pin .msg:empty { display: flex; }
.screen--pin .keypad { width: 100%; max-width: 360px; margin: 0 auto; }
.pin-hello { text-align: center; font-size: 16px; color: var(--mute); }
.pin-step { text-align: center; font-weight: 600; }
.pin-wait { text-align: center; font-size: 15px; font-weight: 600; }
.pin-wait:empty { display: none; }
.pin-links { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 16px; }
.key--ok { background: var(--acc); border-color: var(--acc); color: var(--on-acc); font-size: 20px; font-weight: 700; }
.key--ok:disabled { background: var(--track); border-color: transparent; color: var(--mute); }
.key[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; margin-right: 6px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
.screen--reset .keypad--pin .key { min-height: 56px; }
@media (max-height: 700px) {
  .pin-head { gap: 8px; }
  .keypad--pin .key { min-height: 56px; }
  .screen--reset .keypad--pin .key { min-height: 52px; }
}

/* Add: tighter, so Save stays above the bar and the raised + button at 360 x 640.
   On a tall screen the keypad and Save sit at the bottom, near the thumb. */
.screen--add {
  gap: 8px; padding-top: max(12px, env(safe-area-inset-top));
  min-height: 100vh; min-height: 100dvh;
  padding-bottom: calc(var(--bar-h) + var(--raise) + 8px + env(safe-area-inset-bottom));
}
.add-body { gap: 8px; flex: 1; }
.add-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.screen--add .keypad { gap: 6px; }
.screen--add .key { min-height: 50px; }
.screen--add .cat-grid { gap: 6px; }
.screen--add .chip { padding: 6px 10px; gap: 4px; }
.chip--add { color: var(--acc-deep); font-weight: 600; border-style: dashed; }
/* a short screen (360 x 640): smaller gaps and number, keys at the 48 px minimum, so Save stays above the + button */
@media (max-height: 700px) {
  .screen--add { gap: 4px; padding-top: max(8px, env(safe-area-inset-top)); }
  .add-body, .add-foot { gap: 4px; }
  .screen--add .big-number { font-size: 32px; }
  .fix-error { font-size: 14px; line-height: 1.25; }
  .screen--add .btn-lg { min-height: 52px; }
  .screen--add .keypad { gap: 4px; }
  .screen--add .key { min-height: var(--tap); }
  .screen--add .seg { padding: 2px; }
}

/* entry rows: tap to fix, "Not saved" mark, row with a Delete button */
.tx--open { padding: 0; }
.tx-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 56px; padding: 8px 0;
  background: transparent; border: 0; text-align: left; cursor: pointer;
}
.tx-failed {
  font-size: 12.5px; font-weight: 600; line-height: 1.3;
  color: var(--down); background: var(--down-tint);
  border-radius: 99px; padding: 1px 8px; white-space: nowrap;
}
.tx > .btn { flex: none; }
.tx-main { flex: 1; }

/* Home: install banner, the last part of Home (one row: text, Install or the menu hint, Close) */
.install-slot:empty { display: none; }
.install-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 4px 14px;
  background: var(--card); border: 1px dashed var(--field); border-radius: var(--radius-sm);
}
.install-text { flex: 1; min-width: 0; }
.install-title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.install-hint { font-size: 14px; color: var(--mute); }
.install-banner .btn { flex: none; padding: 8px 14px; }

/* Home: house goal card */
.house-row { display: flex; align-items: center; gap: 12px; }
.house-slot { flex: none; width: 96px; height: 72px; }
.house--small { width: 96px; height: 72px; margin: 0; }
.house-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

/* Month: ‹ November 2026 › */
.month-head .screen-title { flex: 1; text-align: center; }
.month-head .btn { font-size: 24px; padding: 4px 12px; }

/* dialogs (native <dialog> with showModal: focus trap and Escape come free) */
.dialog {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  padding: 20px 16px 16px; border: 0; border-radius: var(--radius);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(28, 27, 25, .45); }
.dialog-title { font-size: 19px; line-height: 1.3; margin-bottom: 12px; }
.dialog-body { display: flex; flex-direction: column; gap: 12px; }
.dialog-text { color: var(--ink); }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.choice-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choice {
  min-height: var(--tap); padding: 6px 8px;
  background: var(--card); border: 1px solid var(--field); border-radius: var(--radius-sm);
  font-size: 15px; line-height: 1.2; cursor: pointer; overflow-wrap: anywhere;
}
.choice[aria-pressed="true"] { background: var(--acc-tint); border: 2px solid var(--acc); font-weight: 700; }

/* larger screens: content stays a phone-width column, centred */
@media (min-width: 600px) {
  .screen { padding-top: 32px; }
}
