/* Veluxe Finance
   One page colour. Two surfaces above it. Everything else is type and gold.
   Costs are NEUTRAL, never red - rent alone runs 60-80% of revenue here, so
   red on routine costs made every healthy unit look like it was failing.
   Red means one thing only: money was lost. */

:root {
  --bg: #08080a;
  --surface: #121215;
  --surface-2: #1a1a1e;
  --track: #232329;

  --text: #f2efea;
  --dim: #9a968f;
  --label: #6f6c67;
  --faint: #4a4844;

  --accent: #c9954f;
  --accent-deep: #a87a3c;
  --green: #7fb894;
  --red: #cf7a7f;
  --cost: #4d4d55;          /* the neutral half of every ratio bar */
  --cost-ink: #d8d5cf;
  --on-gold: #12100e;
  --on-green: #0f1a13;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);

  --radius: 20px;
  --radius-card: 24px;
  --radius-tile: 16px;
  --radius-row: 18px;

  --ui: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding-bottom: 3rem;
}

#app { max-width: 480px; margin: 0 auto; }

/* Trip Payout Ledger finish, shared across Finance screens. */
@media screen {
  :root {
    color-scheme: dark;
    --radius: 12px;
    --radius-card: 14px;
    --radius-tile: 9px;
    --radius-row: 10px;
    --label: #a49b8e;
    --finance-gold: linear-gradient(112deg, #f2d29b 0%, #d9ab68 48%, #b48040 100%);
  }

  html body {
    background: radial-gradient(ellipse at 76% 0%, #5c42282e, transparent 36rem), var(--bg);
  }

  #brand-home-btn {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }

  #app button.primary {
    background: var(--finance-gold);
    color: var(--on-gold);
    border: 1px solid #eac18c50;
  }

  #app .building-card {
    border: 1px solid var(--border-strong);
    background: linear-gradient(145deg, #1b1a1b, var(--surface) 65%);
    box-shadow: inset 0 1px #e8c38e14;
  }

  #app .building-card:hover { border-color: #c9954f75; }
  #app .building-card h3 { color: #f0dcbf; }
  #app .ratio .kept { background: var(--finance-gold); color: var(--on-gold); }
  #app .ratio-legend .kept-amt { color: #e3bc83; }
  #app .break-even .bar-fill:not(.over) { background: var(--finance-gold); }
  #app .stat { border: 1px solid var(--border); }

  @media (min-width: 850px) {
    #app { max-width: 1080px; padding-inline: 1.5rem; }
    #building-cards {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 1rem;
    }
  }
}

/* Digits are Manrope everywhere, with tabular figures. Cormorant sets OLD-STYLE
   numerals (1 short, 6 and 9 descending) which made a unit code like 1609 look
   broken, so the serif is headings and building names only. */
.num, .amount, .stat .value, .value {
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 { margin: 0 0 0.75rem; }
h1 { font-family: var(--display); font-size: 2rem; font-weight: 600; }
h2 { font-family: var(--display); font-size: 1.6rem; font-weight: 600; line-height: 1.05; }
h3 { font-family: var(--display); font-size: 1.35rem; font-weight: 600; }
p { color: var(--dim); line-height: 1.55; font-size: 0.85rem; }

/* ------------------------------------------------------------------ login */
#login-screen { padding: 4rem 1.4rem 0; text-align: center; }
#login-screen .lockup { justify-content: center; margin-bottom: 2rem; }
#login-screen input { text-align: center; }
#login-status { margin-top: 1rem; min-height: 1.2rem; font-size: 0.85rem; color: var(--dim); }

/* ----------------------------------------------------------------- header */
/* Scrolls away. The month bar below it does not. */
header {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.9rem 1.4rem 0.75rem;
}

.lockup { display: flex; align-items: center; gap: 0.7rem; flex-grow: 1; }
.lockup-mark { width: 34px; height: 37px; flex: none; }
.lockup-words { display: flex; flex-direction: column; gap: 7px; }
.lockup-wordmark { width: 168px; height: 16px; display: block; }
.lockup-finance {
  font-family: var(--display); font-size: 15px; font-weight: 600;
  letter-spacing: 0.42em; line-height: 1; color: var(--accent);
}

.who { display: flex; align-items: center; gap: 0.55rem; flex: none; }
.who-name { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
#who-name { font-size: 0.75rem; font-weight: 700; }
.role-badge {
  font-size: 0.56rem; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent);
}
.avatar {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2);
  font-size: 0.95rem; font-weight: 800; color: var(--accent);
  border: none; cursor: pointer; font-family: inherit;
}

/* ------------------------------------------------------- the pinned bar */
/* Sticks to the top while everything above scrolls past. The drawer button
   lives HERE, not in the header, or it would scroll out of reach with it. */
.month-nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.25rem;
  height: 56px; padding: 0 0.75rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.month-nav.stuck { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55); }

.month-controls { display: flex; align-items: center; gap: 0.25rem; flex-grow: 1; }
.month-pill {
  display: flex; align-items: center; justify-content: center; gap: 0.45rem;
  flex-grow: 1; height: 34px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid rgba(201, 149, 79, 0.4);
  color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 700;
  cursor: pointer;
}
.month-pill svg { flex: none; }
.today-btn {
  display: flex; align-items: center; gap: 0.3rem;
  height: 34px; padding: 0 0.6rem; flex: none;
  background: none; border: none; color: var(--label);
  font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: none;
  background: none; border: none; color: var(--dim); cursor: pointer; padding: 0;
}
.icon-btn.narrow { width: 30px; }

/* -------------------------------------------------------- nav: staff tabs */
#tabs {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 0.5rem;
  height: 56px; padding: 0 1.4rem; overflow-x: auto;
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
#tabs::-webkit-scrollbar { display: none; }
#tabs button {
  flex: none; height: 38px; padding: 0 1.05rem; border-radius: 19px;
  background: var(--surface-2); border: none; color: var(--dim);
  font-size: 0.845rem; font-weight: 600; white-space: nowrap;
}
#tabs button.active { background: var(--accent); color: var(--on-gold); font-weight: 800; }

/* ------------------------------------------------------- nav: owner drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.62); z-index: 40; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 80%; max-width: 310px;
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 1.25rem 0.9rem; z-index: 41; overflow-y: auto;
}
.drawer button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); padding: 0.85rem 0.75rem; font-size: 0.95rem;
  font-weight: 600; border-radius: var(--radius-tile);
}
.drawer button.active { background: var(--surface-2); color: var(--accent); font-weight: 800; }
.drawer .drawer-label {
  font-size: 0.62rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--label); margin: 1.2rem 0.75rem 0.4rem;
}

main { padding: 0 1.4rem; }

.back-link {
  display: flex; align-items: center; gap: 0.4rem; height: 44px;
  background: none; border: none; color: var(--dim);
  padding: 0; font-size: 0.845rem; cursor: pointer;
}

/* ----------------------------------------------------------------- views */
.view { display: none; }
.view.active { display: block; padding-bottom: 2.5rem; }
.view > h2 { margin: 0.4rem 0 1.4rem; font-size: 2.1rem; }

/* --------------------------------------------------------------- buttons */
button {
  font: inherit; font-family: var(--ui); cursor: pointer;
  border-radius: var(--radius); padding: 0.75rem 1rem; border: none;
  background: var(--surface-2); color: var(--text); font-weight: 600;
}
button.primary {
  background: linear-gradient(100deg, var(--accent), var(--accent-deep));
  color: var(--on-gold); font-weight: 800;
}
button.danger { background: transparent; border: 1px solid var(--red); color: var(--red); }
button:disabled { opacity: 0.45; cursor: default; }
button.block {
  display: flex; align-items: center; gap: 0.85rem;
  width: 100%; min-height: 62px; padding: 0 1.25rem;
  margin-bottom: 0.75rem; font-size: 0.97rem; text-align: left;
}
button.block.centred { justify-content: center; }

/* ---------------------------------------------------------------- inputs */
input, select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-tile); padding: 0.85rem 1rem;
  font: inherit; font-family: var(--ui); margin-bottom: 0.9rem;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: rgba(201, 149, 79, 0.55);
}
input::placeholder { color: #57544f; }
label {
  display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--label); margin-bottom: 0.5rem;
}
.field { margin-bottom: 1.1rem; }
.hint { font-size: 0.72rem; color: var(--label); margin: -0.5rem 0 0.9rem; line-height: 1.5; }

/* search box above the unit list */
.search-row {
  display: flex; align-items: center; gap: 0.65rem;
  height: 50px; padding: 0 1rem; margin-bottom: 0.75rem;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-tile);
}
.search-row svg { flex: none; }
.search-row input {
  flex-grow: 1; background: none; border: none; margin: 0; padding: 0;
  font-size: 0.9rem; font-weight: 600;
}
.search-row input:focus { border: none; }
.search-clear {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; padding: 0; flex: none;
  border-radius: 12px; background: var(--surface-2);
}
.result-count {
  font-size: 0.72rem; font-weight: 600; color: var(--label); margin-bottom: 0.75rem;
}

/* ----------------------------------------------------------------- chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.1rem; }
.chip {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 1rem; border-radius: 22px;
  background: var(--surface-2); color: var(--dim);
  font-size: 0.845rem; font-weight: 600; cursor: pointer;
}
.chip.selected { background: var(--accent); color: var(--on-gold); font-weight: 800; }
.chip.big { flex: 1 1 45%; min-height: 58px; font-size: 0.97rem; }

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--surface); border-radius: var(--radius-card);
  padding: 1.25rem; margin-bottom: 0.65rem;
}
.card-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.card .meta { font-size: 0.72rem; color: var(--label); margin-top: 0.35rem; }
.amount { font-weight: 800; font-size: 1rem; }
.amount.in { color: var(--green); }
.amount.out { color: var(--red); }
.amount.pending { color: var(--label); font-style: italic; }

.pill {
  display: inline-flex; align-items: center;
  font-size: 0.68rem; font-weight: 700; padding: 0.2rem 0.55rem;
  border-radius: 9px; background: var(--surface-2); color: var(--dim);
  margin-right: 0.3rem;
}
.pill.warn { background: rgba(207, 122, 127, 0.14); color: var(--red); }
.pill.ok { background: rgba(127, 184, 148, 0.16); color: var(--green); }
.pill.gold { background: rgba(201, 149, 79, 0.16); color: var(--accent); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.stat { background: var(--surface-2); border-radius: var(--radius-tile); padding: 0.9rem 1rem; }
.stat .label {
  font-size: 0.655rem; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--label);
}
.stat .value { font-size: 0.9rem; font-weight: 700; margin-top: 0.25rem; }
.stat .value.in { color: var(--green); }
.stat .value.out { color: var(--red); }
.stat .value.gold { color: var(--accent); }
.stat .value.green { color: var(--green); }
.stat.tall .value { font-family: var(--ui); font-size: 1.9rem; font-weight: 800; }

/* NET line under a totals card */
.net-row { display: flex; align-items: baseline; justify-content: space-between; }
.net-row .label {
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--label); margin: 0;
}
.net-row .value {
  font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em;
}
.net-row .value.out { color: var(--red); }

/* --------------------------------------------------------- the ratio bar */
/* Whole width is revenue. One segment is what costs ate, the other is what
   stayed. Percentages sit INSIDE so the bar explains itself. */
.ratio { display: flex; height: 24px; border-radius: 8px; overflow: hidden; background: var(--track); }
.ratio.slim { height: 22px; border-radius: 7px; }
.ratio .cost {
  display: flex; align-items: center; padding-left: 10px;
  background: var(--cost); color: var(--cost-ink);
  font-size: 0.69rem; font-weight: 800; white-space: nowrap; overflow: hidden;
}
.ratio .cost.loss { background: var(--red); color: #2a1416; }
.ratio .kept {
  display: flex; align-items: center; justify-content: flex-end; padding-right: 10px;
  background: var(--green); color: var(--on-green);
  font-size: 0.69rem; font-weight: 800; white-space: nowrap; overflow: hidden;
}
.ratio-legend {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
  font-size: 0.72rem; font-weight: 600; margin-top: 0.55rem;
}
.ratio-legend .cost-amt { color: var(--dim); }
.ratio-legend .kept-amt { color: var(--green); }
.ratio-legend .warn { color: var(--red); font-weight: 700; }

/* booking mix chips under a unit */
.book-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.75rem; }
.book-chip {
  font-size: 0.69rem; font-weight: 700; padding: 0.2rem 0.5rem;
  border-radius: 9px; background: var(--surface-2); color: var(--dim);
}
.book-chip.gold { background: rgba(201, 149, 79, 0.16); color: var(--accent); }
.book-chip.green { background: rgba(127, 184, 148, 0.16); color: var(--green); }

/* ------------------------------------------------------- building cards */
.card-carousel { display: flex; flex-direction: column; gap: 0.75rem; }
.building-card {
  background: var(--surface); border-radius: var(--radius-card);
  padding: 1.35rem; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.building-card .bc-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
  margin-bottom: 1.1rem;
}
.building-card h3 { font-size: 1.75rem; margin: 0; }
.building-card .net-block { margin-bottom: 1.1rem; }
.building-card .net-block .label {
  font-size: 0.69rem; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--label);
}
.building-card .net-block .value {
  font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 0.25rem;
}
.building-card .net-block .value.out { color: var(--red); }
.building-card .stat-grid { margin-bottom: 1.1rem; }

.yoy { font-size: 0.72rem; font-weight: 700; }
.yoy .up { color: var(--green); }
.yoy .down { color: var(--red); }
.yoy.none { color: var(--label); font-weight: 700; }

.break-even { margin-top: 0.85rem; }
.break-even .bar { height: 7px; border-radius: 4px; background: var(--track); overflow: hidden; margin-bottom: 0.5rem; }
.break-even .bar-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.break-even .bar-fill.over { background: var(--green); }
.break-even .label { font-size: 0.72rem; color: var(--dim); }

/* ------------------------------------------------- year on year blocks */
.year-row { margin-bottom: 1rem; }
.year-row:last-child { margin-bottom: 0; }
.year-row .yr-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.year-row .yr-name { display: flex; align-items: baseline; gap: 0.55rem; }
.year-row .yr-label { font-size: 0.8rem; font-weight: 800; color: var(--label); }
.year-row .yr-count { font-size: 0.68rem; color: var(--label); }
.year-row .yr-amt { font-size: 0.82rem; font-weight: 700; color: var(--dim); }
.year-row .yr-bar { height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.year-row .yr-fill { height: 100%; background: var(--cost); border-radius: 5px; }
.year-row .yr-net { font-size: 0.68rem; color: var(--label); margin-top: 0.5rem; }
.year-row.current { background: var(--surface-2); border-radius: var(--radius-tile); padding: 0.9rem; }
.year-row.current .yr-label, .year-row.current .yr-count { color: var(--accent); }
.year-row.current .yr-amt { font-size: 0.9rem; font-weight: 800; color: var(--text); }
.year-row.current .yr-fill { background: var(--green); }

.year-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.year-tile {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 0.6rem 0.65rem; background: var(--surface-2); border-radius: 12px;
}
.year-tile .yt-year {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em; color: var(--label);
}
.year-tile .yt-amt { font-size: 0.75rem; font-weight: 700; color: var(--dim); }
.year-tile.current { border: 1px solid rgba(201, 149, 79, 0.4); }
.year-tile.current .yt-year { color: var(--accent); }
.year-tile.current .yt-amt { color: var(--text); font-weight: 800; }
.year-tile.absent { background: #0f0f12; }
.year-tile.absent .yt-year, .year-tile.absent .yt-amt { color: var(--faint); }

.note-card {
  display: flex; gap: 0.85rem; align-items: flex-start;
  background: var(--surface); border-radius: var(--radius-row);
  padding: 1.1rem 1.15rem; margin-bottom: 0.65rem;
}
.note-card.flagged { border-left: 3px solid var(--accent); }
.note-card svg { flex: none; margin-top: 2px; }
.note-card .nc-body { font-size: 0.78rem; line-height: 1.55; color: var(--dim); }
.note-card .nc-title { font-size: 0.78rem; font-weight: 800; color: var(--accent); margin-bottom: 0.4rem; }
.note-card strong { color: var(--text); }

/* ------------------------------------------------------------ breakdowns */
.breakdown-row { margin-bottom: 1rem; }
.breakdown-row:last-child { margin-bottom: 0; }
.breakdown-row .breakdown-label {
  display: flex; justify-content: space-between; gap: 0.6rem;
  font-size: 0.845rem; font-weight: 600; margin-bottom: 0.45rem;
}
.breakdown-row .breakdown-label .amt { color: var(--label); font-weight: 500; font-size: 0.75rem; }
.breakdown-bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.breakdown-bar .fill { height: 100%; background: var(--accent); border-radius: 3px; }
.breakdown-bar .fill.expense { background: var(--red); }

/* ------------------------------------------------------------- misc bits */
/* Collapsible sections (Tomorrow's check-ins, Today's check-outs). Native
   <details>/<summary> - the browser owns open/closed state and keyboard
   behaviour, nothing to track in JS. */
details.section-collapse { margin-bottom: 1.25rem; }
details.section-collapse summary {
  display: flex; align-items: center; gap: 0.6rem;
  list-style: none; cursor: pointer; user-select: none;
  padding: 0.15rem 0;
}
details.section-collapse summary::-webkit-details-marker { display: none; }
details.section-collapse summary h3 { margin: 0; flex-grow: 1; }
details.section-collapse summary::before {
  content: ''; width: 0; height: 0; flex: none;
  border-left: 6px solid var(--dim); border-top: 5px solid transparent; border-bottom: 5px solid transparent;
  transition: transform 0.15s ease;
}
details.section-collapse[open] summary::before { transform: rotate(90deg); }
details.section-collapse .count-pill {
  display: flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 0.4rem; border-radius: 11px;
  background: var(--surface-2); color: var(--dim);
  font-size: 0.72rem; font-weight: 800;
}
details.section-collapse[open] summary { margin-bottom: 0.75rem; }

.empty { color: var(--label); text-align: center; padding: 2rem 0; font-size: 0.845rem; }

.toast {
  position: fixed; bottom: 1.1rem; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  padding: 0.8rem 1.2rem; border-radius: var(--radius-tile); font-size: 0.845rem;
  opacity: 0; transition: opacity 0.2s; z-index: 60; max-width: 90vw;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.toast.show { opacity: 1; }
.toast.err { border-color: var(--red); color: var(--red); }

.entry-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.9rem; }
.entry-actions button { min-height: 46px; padding: 0 0.75rem; font-size: 0.82rem; border-radius: 14px; }
.entry-actions button:only-child { grid-column: 1 / -1; }

details.home-panel > summary {
  padding: 1rem 1.15rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-card);
}
details.home-panel > summary h3 { font-family: var(--ui); font-size: 0.9rem; font-weight: 600; }
details.home-panel .count-pill { background: rgba(207,122,127,0.14); color: var(--red); }
.inline-approvals-body { padding-top: 0.15rem; }
.booking-breakdown { margin-top: 0.8rem; padding-top: 0.65rem; border-top: 1px solid var(--border); }
.booking-breakdown .card-row { font-size: 0.75rem; color: var(--dim); margin-top: 0.3rem; }
.booking-breakdown .card-row:last-child { color: var(--text); font-weight: 700; }

.editing-banner {
  background: var(--surface-2); border-left: 3px solid var(--accent);
  border-radius: var(--radius-tile); padding: 0.85rem 1rem;
  font-size: 0.845rem; margin-bottom: 1.1rem;
}
.link-btn {
  background: none; border: none; color: var(--accent); padding: 0; margin: 0;
  text-decoration: underline; font-size: inherit; width: auto; min-height: 0;
}

/* ---------------------------------------------------------------- modals */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72);
  display: flex; align-items: center; justify-content: center; z-index: 70; padding: 1rem;
}
.modal {
  background: var(--surface); border-radius: 26px;
  padding: 1.5rem 1.4rem; width: 100%; max-width: 380px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.modal h3 { font-size: 1.75rem; margin-bottom: 0.4rem; }
.modal p { margin-bottom: 1.1rem; }
.modal-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; margin-top: 0.4rem; }
.modal-actions button { min-height: 54px; border-radius: var(--radius-row); }

.check-row {
  display: flex; align-items: center; gap: 0.75rem;
  min-height: 44px; margin-bottom: 0.4rem; font-size: 0.845rem; cursor: pointer;
}
.check-row input {
  width: 22px; height: 22px; flex: none; margin: 0;
  accent-color: var(--accent); border-radius: 7px;
}

[hidden] { display: none !important; }
/* Finance overview: V17 actual Veluxe monogram gold. */
:root {
  --vx17-gold:#a47645;
  --vx17-gold-small:#ab7d4c;
  --vx17-cream:#f1ddbd;
  --vx17-espresso:linear-gradient(112deg,#221b14,#120f0d);
}
#brand-home-btn .lockup-finance, #drawer button.active { color:var(--vx17-gold); }
#brand-home-btn .lockup-mark, #login-screen .lockup-mark { fill:var(--vx17-gold); }
#brand-home-btn .lockup-wordmark { color:#f2efea; }
.month-pill, .vx17-figure {
  background:var(--vx17-espresso);
  border:1px solid #554126;
  border-radius:13px;
  box-shadow:inset 3px 0 var(--vx17-gold);
  color:var(--vx17-cream);
}
.month-pill { min-height:43px; height:auto; }
.vx17-month-copy { display:grid; gap:2px; line-height:1.16; }
.vx17-month-copy small,.vx17-kicker,.vx17-figure dt {
  color:var(--vx17-gold-small);
  font-size:.67rem;
  letter-spacing:.12em;
  text-transform:uppercase;
  font-weight:750;
}
.vx17-summary,.vx17-grid,.vx17-home-actions { margin-bottom:.9rem; }
.vx17-summary .vx17-intro { display:block; padding:.2rem 0 .9rem; }
.vx17-summary .vx17-intro p { margin:.12rem 0; }
.vx17-summary h1 {
  margin:.12rem 0;
  color:var(--vx17-gold);
  font-size:clamp(2.6rem,5vw,4rem);
  line-height:1.02;
}
.vx17-figures { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.55rem; margin:.25rem 0 .7rem; }
.vx17-figure { min-width:0; padding:.8rem .65rem .8rem .85rem; }
.vx17-figure dd {
  margin:.25rem 0;
  color:var(--vx17-cream);
  font-size:clamp(1rem,2.5vw,1.75rem);
  line-height:1.25;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
.vx17-figure small { display:block; color:#b9a88f; font-size:.68rem; }
.vx17-jumps { display:flex; flex-wrap:wrap; align-items:center; gap:.35rem .85rem; }
.vx17-jumps a { color:var(--vx17-gold); font-weight:650; font-size:.78rem; min-height:32px; display:inline-flex; align-items:center; }
#view-home.vx17-owner .vx17-home-actions { display:grid; gap:.55rem; }
#view-home.vx17-owner .vx17-home-actions .block { margin:0 !important; }
#view-home.vx17-owner .vx17-grid { display:grid; gap:.75rem; grid-template-columns:minmax(0,1fr); }
#view-home.vx17-owner .vx17-panel {
  min-width:0; padding:1rem;
  border:1px solid var(--border); border-radius:14px; background:var(--surface);
  scroll-margin-top:66px;
}
#view-home.vx17-owner #vx17-needs { order:0; }
#view-home.vx17-owner #vx17-payouts { order:1; }
#view-home.vx17-owner #vx17-trend { order:2; }
#view-home.vx17-owner #vx17-buildings { order:3; }
.vx17-panel h2,#vx17-buildings-heading { color:var(--vx17-gold); margin-bottom:.55rem; }
.vx17-panel p { margin:.3rem 0 .75rem; }
.vx17-scroll {
  max-height:19rem;
  overflow-y:auto;
  overscroll-behavior-y:contain;
  scrollbar-width:thin;
  scrollbar-gutter:stable;
  scrollbar-color:var(--vx17-gold) var(--track);
  padding-right:.15rem;
}
.vx17-scroll:focus-visible,.vx17-jumps a:focus-visible { outline:2px solid var(--vx17-gold-small); outline-offset:2px; }
.vx17-trend-row { display:grid; grid-template-columns:1fr auto; gap:.25rem .5rem; padding:.55rem 0; font-size:.8rem; }
.vx17-trend-row strong { color:var(--vx17-cream); font-variant-numeric:tabular-nums; }
.vx17-trend-track { grid-column:1/-1; background:var(--track); border-radius:5px; overflow:hidden; height:5px; }
.vx17-trend-track i { display:block; height:100%; background:var(--vx17-gold); }
@media(min-width:850px) {
  .vx17-figures { grid-template-columns:repeat(4,minmax(0,1fr)); gap:.8rem; }
  #view-home.vx17-owner .vx17-home-actions { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #view-home.vx17-owner .vx17-grid { grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); }
  #view-home.vx17-owner #vx17-trend { order:0; }
  #view-home.vx17-owner #vx17-buildings { order:2; }
  #view-home.vx17-owner #vx17-buildings #building-cards { grid-template-columns:minmax(0,1fr); }
  #month-controls { margin-left:auto; flex:0 1 clamp(300px,36vw,410px); }
  #view-home.vx17-owner #vx17-needs { order:1; }
  #view-home.vx17-owner #vx17-payouts { order:3; }
  .vx17-scroll { max-height:24rem; }
}

#main-screen > header .lockup { min-width:0; }
#main-screen > header .who-name { min-width:0; }
#main-screen > header #who-name { overflow-wrap:anywhere; }
@media(max-width:480px) {
  #main-screen > header { padding-inline:.75rem; gap:.5rem; }
  #main-screen > header .lockup { gap:.45rem; padding-inline:.3rem; }
  #main-screen > header .lockup-wordmark { width:clamp(100px,37vw,168px); }
  #main-screen > header .who { max-width:45%; }
}
