/* Urban Legacy Property — shares the Urban Legacy Umbrella palette, type and dark mode. */
:root {
  --ink: #141a2a; --muted: #5d6478; --paper: #f6f7fa; --card: #ffffff; --line: #e1e4ec;
  --navy: #14203d; --navy-2: #1d2b4f; --rail-ink: #c9d0e3;
  --gold: #b08a3e; --gold-soft: #f3ead6;
  --ok: #1f7a4d; --ok-bg: #e3f3ea; --warn: #9a6200; --warn-bg: #fbf0d9;
  --bad: #b3261e; --bad-bg: #fbe5e3; --info: #2a4f9e; --info-bg: #e5ecfa;
  --display: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ink: #e8ebf3; --muted: #9aa2b8; --paper: #0e1322; --card: #161d31; --line: #273152;
  --navy: #0a0f1d; --navy-2: #18213a; --rail-ink: #aab3cc; --gold: #d4ae62; --gold-soft: #3a3020;
  --ok: #6fd3a0; --ok-bg: #143326; --warn: #f0c063; --warn-bg: #3a2c10; --bad: #ff8a80; --bad-bg: #3d1a18; --info: #9cb8ff; --info-bg: #1b2747;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --ink: #e8ebf3; --muted: #9aa2b8; --paper: #0e1322; --card: #161d31; --line: #273152;
  --navy: #0a0f1d; --navy-2: #18213a; --rail-ink: #aab3cc; --gold: #d4ae62; --gold-soft: #3a3020;
  --ok: #6fd3a0; --ok-bg: #143326; --warn: #f0c063; --warn-bg: #3a2c10; --bad: #ff8a80; --bad-bg: #3d1a18; --info: #9cb8ff; --info-bg: #1b2747;
  color-scheme: dark }

* { box-sizing: border-box }
html, body { margin: 0; min-height: 100% }
body { background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55 }
h1, h2, h3 { font-family: var(--display); margin: 0; text-wrap: balance; letter-spacing: -0.01em }
h1 { font-size: 1.6rem; font-weight: 700 } h2 { font-size: 1.15rem; font-weight: 600 } h3 { font-size: 1rem; font-weight: 600 }
p { margin: 0 }
a { color: var(--info) }
button, input, select, textarea { font: inherit; color: inherit }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px }
.mono { font-family: var(--mono); font-size: .85em }
.muted { color: var(--muted) } .small { font-size: .85rem }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600 }
.hidden { display: none !important }

/* brand mark */
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: inherit }
.mark { width: 34px; height: 34px; border-radius: 8px; background: var(--navy-2); display: grid; place-items: center; color: var(--gold);
  font-weight: 700; font-family: var(--display); letter-spacing: .04em; font-size: .8rem; border: 1px solid rgba(255,255,255,.08); flex: none }
.brand b { color: #fff; font-family: var(--display); display: block; font-size: .95rem; line-height: 1.2 }
.brand span { font-size: .72rem; color: var(--rail-ink) }

/* buttons, forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; font-size: .92rem; min-height: 40px }
.btn:hover { background: var(--navy-2) }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1b1404 }
.btn.gold:hover { filter: brightness(1.06) }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line) }
.btn.ghost:hover { background: var(--card) }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: .82rem }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad) }
.btn:disabled { opacity: .6; cursor: progress }
:root[data-theme="dark"] .btn:not(.gold):not(.ghost):not(.danger) { background: var(--navy-2); border-color: var(--line) }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn:not(.gold):not(.ghost):not(.danger) { background: var(--navy-2); border-color: var(--line) } }
label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; font-weight: 500; min-width: 0 }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400 }
input, select, textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); width: 100%; min-width: 0; font-size: .95rem }
label.check input { width: auto; margin-top: 3px }
textarea { min-height: 90px; resize: vertical }
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) }
.form .wide { grid-column: 1 / -1 }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center }

/* panels */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden }
.stat { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; margin: 0 -1px -1px 0 }
.stat strong { font-family: var(--display); font-size: 1.5rem; font-variant-numeric: tabular-nums }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--line); color: var(--ink); white-space: nowrap }
.pill.ok { background: var(--ok-bg); color: var(--ok) } .pill.warn { background: var(--warn-bg); color: var(--warn) }
.pill.bad { background: var(--bad-bg); color: var(--bad) } .pill.info { background: var(--info-bg); color: var(--info) }
.pill.gold { background: var(--gold-soft); color: var(--gold) }
.note { padding: 10px 14px; border-radius: 8px; background: var(--info-bg); color: var(--info); font-size: .9rem }
.note.bad { background: var(--bad-bg); color: var(--bad) } .note.ok { background: var(--ok-bg); color: var(--ok) } .note.warn { background: var(--warn-bg); color: var(--warn) }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r) }

/* tables become cards on phones */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card) }
table { width: 100%; border-collapse: collapse; font-size: .9rem }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--paper) }
tr:last-child td { border-bottom: 0 }
td.num { font-variant-numeric: tabular-nums; text-align: right } th.num { text-align: right }
tr[data-edit] { cursor: pointer } tr[data-edit]:hover td { background: var(--paper) }
@media (max-width: 700px) {
  .table-wrap { border: 0; background: none }
  table, thead, tbody, tr, td { display: block } thead { display: none }
  tr { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; padding: 6px 0 }
  td { border: 0; padding: 5px 14px; display: flex; justify-content: space-between; gap: 12px; text-align: right }
  td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left }
  td.num { text-align: right }
}

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--card); color: var(--ink); width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px) }
dialog::backdrop { background: rgba(10, 15, 29, .55) }
dialog form { padding: 20px; display: flex; flex-direction: column; gap: 16px }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px }

/* toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--navy); color: #fff; padding: 10px 18px;
  border-radius: 8px; font-size: .9rem; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: calc(100vw - 32px) }
#toast.bad { background: var(--bad) }

/* ============ public site ============ */
.site-head { background: var(--navy); color: var(--rail-ink) }
.site-head .in { max-width: 1140px; margin: 0 auto; padding: 14px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap }
.site-nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center }
.site-nav a { color: var(--rail-ink); text-decoration: none; padding: 7px 10px; border-radius: 8px; font-size: .9rem }
.site-nav a:hover { background: var(--navy-2); color: #fff }
.site-nav .btn { margin-left: 6px }
.hero { background: var(--navy); color: #fff; padding: 56px 16px 64px; border-top: 1px solid rgba(255,255,255,.06) }
.hero .in { max-width: 1140px; margin: 0 auto; display: grid; gap: 32px; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.1; color: #fff }
.hero h1 em { font-style: normal; color: var(--gold) }
.hero p.lead { color: var(--rail-ink); font-size: 1.08rem; margin-top: 14px; max-width: 56ch }
.hero .actions { margin-top: 24px }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.3) }
.hero .btn.ghost:hover { background: var(--navy-2) }
.hero-card { background: var(--navy-2); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 14px }
.hero-card .row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 10px; color: var(--rail-ink) }
.hero-card .row:last-child { border: 0; padding: 0 }
.hero-card strong { color: #fff; font-variant-numeric: tabular-nums }
.section { max-width: 1140px; margin: 0 auto; padding: 56px 16px; display: flex; flex-direction: column; gap: 22px }
.section > header { max-width: 680px; display: flex; flex-direction: column; gap: 8px }
.section h2 { font-size: 1.6rem }
.aud { border-top: 3px solid var(--gold) }
.aud ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; color: var(--muted) }
.price { font-family: var(--display); font-size: 2rem; font-weight: 700 }
.calc-out { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) }
.calc-out div { background: var(--paper); border-radius: 8px; padding: 12px }
.calc-out strong { display: block; font-family: var(--display); font-size: 1.25rem; font-variant-numeric: tabular-nums }
.site-foot { background: var(--navy); color: var(--rail-ink); font-size: .85rem }
.site-foot .in { max-width: 1140px; margin: 0 auto; padding: 28px 16px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between }
.site-foot a { color: var(--rail-ink) }
@media (max-width: 860px) {
  .hero .in { grid-template-columns: 1fr }
  .site-nav { margin-left: 0; width: 100% }
  .site-nav a.hide-sm { display: none }
}

/* ============ app shell ============ */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh }
.rail { background: var(--navy); color: var(--rail-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0 }
.nav button { all: unset; cursor: pointer; padding: 9px 10px; border-radius: 8px; font-size: .92rem; display: flex; justify-content: space-between; gap: 8px }
.nav button:hover { background: var(--navy-2); color: #fff }
.nav button[aria-current="page"] { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--gold) }
.nav .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: var(--rail-ink); opacity: .7; padding: 14px 10px 4px }
.rail-foot { margin-top: auto; font-size: .8rem; display: flex; flex-direction: column; gap: 8px; padding-inline: 6px }
.rail-foot button, .rail-foot a { all: unset; cursor: pointer; color: var(--rail-ink); text-decoration: underline }
.main { min-width: 0; display: flex; flex-direction: column }
.topbar { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap }
.topbar .who { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: .85rem }
.content { padding: 24px 24px 96px; display: flex; flex-direction: column; gap: 22px; max-width: 1180px; width: 100% }
.head { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; justify-content: space-between }
.menu-btn { display: none }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr) }
  .rail { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s }
  .rail.open { transform: none; box-shadow: 0 0 0 100vmax rgba(10,15,29,.5) }
  .menu-btn { display: inline-flex }
  .topbar, .content { padding-left: 16px; padding-right: 16px }
}

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--navy) }
.auth .panel { width: min(460px, 100%); gap: 18px }
.auth .brand b { color: var(--ink) }
.auth .brand span { color: var(--muted) }
.tabs { display: flex; gap: 4px; background: var(--paper); padding: 4px; border-radius: 10px }
.tabs button { all: unset; cursor: pointer; flex: 1; text-align: center; padding: 8px; border-radius: 8px; font-weight: 600; font-size: .9rem }
.tabs button[aria-selected="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.08) }
.choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) }
.choice { border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; background: var(--card) }
.choice:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) }
.choice input { width: auto; margin-top: 4px }
