/* m.css — Ledgerly Mobile Vault for Households, Business Owners & CPAs.
   One column, 48px+ thumb-sized targets, frosted header, zero horizontal scroll. */
:root {
  --ink: #0f172a;
  --dim: #475569;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --accent: #0b6b5e;
  --accent-bg: #ecfdf5;
  --warn: #92400e;
  --warnbg: #fef3c7;
  --bad: #991b1b;
  --badbg: #fee2e2;
  --ok: #065f46;
  --okbg: #d1fae5;
  --shadow: 0 2px 6px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6rem);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.hh-demo-banner {
  background: #064e3b;
  color: #ecfdf5;
  padding: 6px 14px;
  min-height: 42px;
  margin: -12px -16px 10px -16px;
  border-bottom: 2px solid #10b981;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}
body.hh-desktop-view .hh-demo-banner {
  margin: -14px calc(-1 * clamp(20px, 3vw, 40px)) 12px calc(-1 * clamp(20px, 3vw, 40px));
  padding: 0 clamp(16px, 2.5vw, 32px);
  height: 42px;
}
body.hh-mobile-view .hh-demo-banner {
  height: auto;
  flex-wrap: wrap;
  padding: 8px 12px;
  gap: 6px;
}
body.hh-mobile-view .hh-demo-banner-left {
  width: 100%;
  justify-content: space-between;
}
body.hh-mobile-view .hh-demo-banner-links {
  width: 100%;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
}
.hh-demo-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex-shrink: 0;
}
.hh-demo-badge {
  background: #10b981;
  color: #022c22;
  font-weight: 800;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.hh-demo-sub {
  color: #a7f3d0;
  font-size: 11.5px;
}
.hh-demo-banner-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  flex-shrink: 0;
}
.hh-demo-pill {
  color: #ecfdf5;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.hh-demo-pill:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.45);
}
.hh-demo-pill.active {
  color: #022c22;
  background: #a7f3d0;
  border-color: #34d399;
  font-weight: 800;
}
.hh-demo-exit {
  color: #022c22;
  background: #fbbf24;
  border: 1px solid #f59e0b;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  padding: calc(env(safe-area-inset-top, 0px) + .75rem) 1rem .7rem;
  border-bottom: 1px solid var(--line);
}
.head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.eyebrow {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .1rem;
}
h1 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.head-actions { display: flex; gap: .4rem; align-items: center; }
.head-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: .4rem .8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.head-chip.primary-chip {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.sub { color: var(--dim); font-size: .84rem; margin-top: .25rem; font-weight: 500; }
main { padding: .85rem 1rem 1rem; max-width: 640px; margin: 0 auto; }
@media (min-width: 900px) {
  main { width: 100%; max-width: min(96vw, 2400px); padding: 1.25rem clamp(20px, 3vw, 40px) 3rem; }
  .head-top, header .sub { max-width: min(96vw, 2400px); margin-left: auto; margin-right: auto; }
}
.search-bar, .m-input, .m-select {
  width: 100%;
  min-height: 46px;
  padding: .55rem .85rem;
  margin-bottom: .65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  box-shadow: var(--shadow);
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
  margin-bottom: .8rem;
}
.kpi-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .75rem .85rem;
  box-shadow: var(--shadow);
}
.kpi-lbl {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--dim);
}
.kpi-val {
  font-size: 1.2rem;
  font-weight: 800;
  margin-top: .2rem;
  font-variant-numeric: tabular-nums;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .9rem 1rem;
  margin-bottom: .65rem;
  box-shadow: var(--shadow);
}
.card.accent-border {
  border: 2px solid var(--accent);
}
button.card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  min-height: 56px;
  transition: transform 0.08s ease, border-color 0.12s ease;
}
button.card:active { transform: scale(0.99); background: var(--bg); }
.name { font-weight: 700; font-size: .98rem; display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; }
.meta { color: var(--dim); font-size: .82rem; margin-top: .25rem; line-height: 1.4; }
.pill {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  padding: .15rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  margin-left: .2rem;
}
.pill.warn { background: var(--warnbg); color: var(--warn); border-color: transparent; }
.pill.bad  { background: var(--badbg);  color: var(--bad);  border-color: transparent; }
.pill.ok   { background: var(--okbg);   color: var(--ok);   border-color: transparent; }
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .7rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  flex: 1 1 calc(50% - .25rem);
  min-height: 46px;
  padding: .5rem .8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem 1rem;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: var(--accent-bg);
  color: var(--ink);
  margin-bottom: .75rem;
  cursor: pointer;
  min-height: 92px;
}
.url-box {
  width: 100%;
  min-height: 44px;
  padding: .5rem .65rem;
  margin-top: .45rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
}
.empty { color: var(--dim); padding: 1.5rem 1rem; text-align: center; font-size: .92rem; }
.back {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  padding: .2rem 0 .6rem;
  cursor: pointer;
}
h2 {
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--dim);
  margin: 1.1rem 0 .5rem;
}
nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: 0;
  color: var(--dim);
  font: inherit;
  font-size: .74rem;
  font-weight: 600;
  padding: .55rem .2rem;
  cursor: pointer;
  min-height: 54px;
}
nav button .nav-ico { font-size: 1rem; line-height: 1; font-weight: 800; }
nav button[aria-selected="true"] {
  color: var(--accent);
  font-weight: 750;
  box-shadow: inset 0 2px 0 var(--accent);
}

/* ── MONARCH-STYLE DESKTOP HOUSEHOLD DASHBOARD (body.hh-desktop-view) ── */
body.hh-desktop-view {
  padding-bottom: 2rem;
  background: #f1f5f9;
}
body.hh-desktop-view header {
  position: relative;
  top: auto;
  z-index: 20;
  padding: .65rem clamp(20px, 3vw, 40px);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
body.hh-desktop-view .head-top {
  max-width: min(96vw, 2400px);
  margin: 0 auto;
}
body.hh-desktop-view .head-brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
body.hh-desktop-view .eyebrow {
  margin-bottom: 0;
  padding-right: 12px;
  border-right: 1px solid var(--line);
}
body.hh-desktop-view h1 {
  font-size: 1.25rem;
}
body.hh-desktop-view header .sub {
  max-width: min(96vw, 2400px);
  margin: .2rem auto 0;
  font-size: .8rem;
}
body.hh-desktop-view nav {
  position: sticky;
  top: 0;
  left: auto;
  bottom: auto;
  right: auto;
  width: 100%;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding: .45rem clamp(20px, 3vw, 40px);
  gap: .5rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 0;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
  z-index: 25;
}
body.hh-desktop-view nav button {
  flex: 0 0 auto;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.15rem;
  border-radius: 999px;
  font-size: .88rem;
  min-height: 44px;
  text-align: center;
}
body.hh-desktop-view nav button:hover {
  background: #f1f5f9;
}
body.hh-desktop-view nav button[aria-selected="true"] {
  background: var(--accent-bg);
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
  font-weight: 800;
}
body.hh-desktop-view main {
  margin: 0 auto;
  max-width: min(96vw, 2400px);
  width: 100%;
  padding: 1.5rem clamp(20px, 3vw, 40px) 3rem;
}
body.hh-desktop-view .kpi-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
body.hh-desktop-view .kpi-tile {
  padding: 1rem 1.15rem;
}
body.hh-desktop-view .kpi-val {
  font-size: 1.45rem;
}
body.hh-desktop-view .hh-desktop-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  align-items: start;
}
body.hh-desktop-view .hh-desktop-two-col > .card {
  margin-bottom: 0;
  height: 100%;
}

/* ── PHONE VIEW ON WIDE MONITOR: SLEEK PHONE FRAME PREVIEW ── */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}
@media (max-width: 480px) {
  header { padding-left: .65rem; padding-right: .65rem; }
  .head-top { flex-wrap: wrap; gap: .35rem; }
  .head-actions { flex-wrap: wrap; gap: .3rem; }
  .head-chip { padding: .35rem .6rem; font-size: .76rem; min-height: 40px; }
  main { padding-left: .65rem; padding-right: .65rem; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
}
@media (min-width: 720px) {
  body.hh-mobile-view {
    max-width: 440px;
    margin: 14px auto;
    border: 2px solid #cbd5e1;
    border-radius: 28px;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.14);
    background: var(--bg);
    min-height: calc(100vh - 28px);
    position: relative;
  }
  body.hh-mobile-view header {
    border-radius: 26px 26px 0 0;
  }
  body.hh-mobile-view nav {
    max-width: 436px;
    margin: 0 auto;
    border-radius: 0 0 26px 26px;
  }
}
