/* Key Panel. Built on ellsworthequities.com's system: Objectivity type, pill buttons with the round arrow,
   24px cards, white on light grey, near-black text.
   Colour roles:  blue = something you tap (main button, active tab, links, "Review").
                  red  = overdue only.   Everything else: black, white, greys. */
@font-face { font-family: "Objectivity"; font-weight: 400 500; font-display: swap; src: url("fonts/Objectivity-Medium.woff2") format("woff2"); }
@font-face { font-family: "Objectivity"; font-weight: 600 800; font-display: swap; src: url("fonts/Objectivity-Bold.woff2") format("woff2"); }

:root {
  --ink: #14161C; --text: #464851; --muted: #767985; --faint: #A4A6B0;
  --line: #EEEFF1; --line-2: #E2E4E9;
  --dark: #202127; --surface: #FFFFFF; --soft: #FAFAFB; --bg: #F3F4F6;
  --blue: #2F5FE8; --blue-deep: #1E46C2; --blue-tint: #EBF0FE;
  --red: #C2261B; --red-tint: #FDEDEB;
  --r-lg: 24px; --r-md: 16px; --r-sm: 12px; --pill: 300px;
  --shadow: 0 1px 2px rgba(20,22,28,.04), 0 4px 16px rgba(20,22,28,.05);
  --shadow-lift: 0 2px 6px rgba(20,22,28,.06), 0 16px 36px rgba(20,22,28,.10);
  --safe-b: env(safe-area-inset-bottom); --safe-t: env(safe-area-inset-top);
  font-family: "Objectivity", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500; letter-spacing: -0.03em; color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%; caret-color: var(--blue);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; font-variant-numeric: tabular-nums; }
::selection { background: var(--blue-tint); color: var(--ink); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; letter-spacing: inherit; cursor: pointer; }
input, select { font: inherit; letter-spacing: inherit; }
img { display: block; }
h1, h2, h3 { color: var(--ink); font-weight: 500; letter-spacing: -0.03em; margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.i, .btn-icon { display: inline-grid; place-items: center; flex: none; }
.i svg { width: 20px; height: 20px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 112px; }
.logo img:first-child { width: 34px; height: auto; }
.logo img:last-child { width: 112px; height: auto; }
.banner { background: var(--dark); color: #fff; font-size: 13px; text-align: center; padding: calc(var(--safe-t) + 6px) 16px 6px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 8px 8px 6px 20px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 16px; line-height: 20px; white-space: nowrap; transition: transform .15s ease, background .15s ease, box-shadow .15s ease; }
.btn .btn-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--bg); color: var(--ink); }
.btn .btn-icon svg { width: 16px; height: 16px; stroke-width: 2.2; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(47,95,232,.25); }
.btn.primary .btn-icon { background: #fff; color: var(--blue); }
.btn.primary:hover { background: var(--blue-deep); }
.btn.quiet:hover { background: var(--soft); }
.btn.small { min-height: 40px; padding: 4px 4px 2px 16px; font-size: 15px; gap: 8px; }
.btn.small .btn-icon { width: 30px; height: 30px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn .btn-icon svg { transition: transform .2s ease; }
.btn:hover .btn-icon svg { transform: translateX(2px); }
.tab-new:active, .round:active { transform: scale(.94); }
.tab-new:active { transform: scale(.94); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.loading .btn-icon svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { border: 0; background: none; padding: 6px 2px; color: var(--blue); font-size: 15px; }
.link:hover { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.link.muted { color: var(--muted); }
.link-row { display: flex; justify-content: space-between; align-items: center; }
.link-row.center { justify-content: center; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); color: var(--ink); display: grid; place-items: center; box-shadow: var(--shadow); }
.round.small { width: 36px; height: 36px; box-shadow: none; background: var(--bg); }
.round .i { display: grid; place-items: center; width: 22px; height: 22px; line-height: 0; }
.round .i svg { display: block; width: 22px; height: 22px; }
.round.small .i, .round.small .i svg { width: 18px; height: 18px; }
.round.on { background: var(--blue-tint); color: var(--blue); }

/* ---------- forms ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; }
label, .label { font-size: 15px; color: var(--ink); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row .link { padding: 0; font-size: 14px; }
.help { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.input-wrap { position: relative; }
.input-wrap .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.input-wrap .i svg { width: 18px; height: 18px; }
.input-wrap input { padding-left: 46px; }
input, select { width: 100%; height: 52px; padding: 0 18px; border: 0; border-radius: var(--pill); background: var(--soft); color: var(--ink); font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .15s ease, background .15s ease; }
input::placeholder { color: var(--faint); }
input:focus, select:focus { box-shadow: inset 0 0 0 2px var(--blue); background: #fff; }
select { padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2314161C' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 20px center; }
.code-input { height: 64px; text-align: center; font-size: 28px; letter-spacing: .3em; padding-left: .3em; border-radius: var(--r-md); }
.err { margin: 0; font-size: 14px; color: var(--red); line-height: 1.4; }
.err:empty { display: none; }
.rules { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 6px; }
.rules li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.rules li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); flex: none; }
.rules li.ok { color: var(--ink); }
.rules li.ok::before { background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center no-repeat; box-shadow: none; }
.step-head { display: flex; gap: 14px; align-items: flex-start; }
.step-head h2 { font-size: 20px; line-height: 1.25; }
.step-head p { margin: 4px 0 0; font-size: 15px; color: var(--text); line-height: 1.45; }
.step-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--bg); color: var(--ink); display: grid; place-items: center; flex: none; }

/* ---------- sign in (website contact-page layout) ---------- */
.signin { min-height: 100vh; min-height: 100dvh; padding: calc(var(--safe-t) + 16px) 12px calc(16px + var(--safe-b)); background: var(--soft); display: flex; justify-content: center; align-items: center; }
.signin-card { width: 100%; max-width: 520px; background: var(--ink); border-radius: var(--r-lg); padding: 40px 16px 16px; text-align: center; color: #fff; }
.signin-card .logo { margin: 0 auto 28px; width: 132px; }
.signin-card .logo img:first-child { width: 42px; }
.signin-card .logo img:last-child { width: 132px; }
.signin-title { color: #fff; font-size: 40px; line-height: 1.1; }
.signin-sub { margin: 10px auto 28px; max-width: 300px; color: #A4A6B0; font-size: 15px; line-height: 1.45; }
.form-card { background: var(--surface); border-radius: 20px; padding: 28px 20px 24px; text-align: left; color: var(--text); }
.form-card .btn { width: 100%; justify-content: space-between; }

/* ---------- app shell ---------- */
.app { min-height: 100vh; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 12px) 20px 12px; background: rgba(243,244,246,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.top-mono { width: 56px; height: auto; }
.side { display: none; }
.main { padding: 4px 16px calc(112px + var(--safe-b)); max-width: 1180px; margin: 0 auto; }

.tabs { position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 6; display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: center; background: var(--surface); border-radius: var(--pill); padding: 6px; box-shadow: var(--shadow-lift); }
.tabs button[data-tab] { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border-radius: var(--pill); color: var(--muted); font-size: 11px; }
.tabs button[data-tab].on { background: var(--blue-tint); color: var(--blue); }
.tab-new { width: 50px; height: 50px; margin: 0 auto; border: 0; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 12px rgba(47,95,232,.30); }
.tab-new svg { width: 24px; height: 24px; stroke-width: 2.2; }

/* ---------- page parts ---------- */
.page-head { margin: 8px 4px 20px; }
.page-head h1 { font-size: 30px; line-height: 1.15; }
.page-head p { margin: 6px 0 0; font-size: 15px; color: var(--text); }
.page-head.with-action { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.col > * + * { margin-top: 16px; }
.cols > .col + .col { margin-top: 16px; }
.section-title { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.section-title h2 { font-size: 17px; }
.count { min-width: 26px; height: 26px; padding: 2px 8px 0; border-radius: var(--pill); background: var(--bg); color: var(--ink); font-size: 13px; display: inline-grid; place-items: center; }

.row { display: flex; align-items: center; gap: 14px; padding: 13px 20px; width: 100%; min-height: 68px; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); }
.row-top { align-items: flex-start; }
.section-title + .row, .card > .row:first-child { border-top: 0; }
button.row:hover { background: var(--soft); }
.main-col { flex: 1; min-width: 0; }
.row .t { color: var(--ink); font-size: 16px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--muted); font-size: 14px; line-height: 1.35; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { flex: none; font-size: 13px; color: var(--muted); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--bg); color: var(--ink); font-size: 14px; }
.avatar svg { width: 19px; height: 19px; }
.empty { margin: 0; padding: 2px 20px 20px; color: var(--muted); font-size: 15px; }

.tag { flex: none; display: inline-flex; align-items: center; height: 26px; padding: 2px 10px 0; border-radius: var(--pill); font-size: 13px; white-space: nowrap; background: var(--bg); color: var(--text); }
.tag.red { background: var(--red-tint); color: var(--red); }
.tag.off { background: transparent; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-2); }
.pill-link { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 2px 14px 0; border-radius: var(--pill); background: var(--blue-tint); color: var(--blue); font-size: 14px; }
button.row:hover .pill-link { background: var(--blue); color: #fff; }

/* summary tiles: same size, one-line labels */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border-radius: var(--r-md); padding: 16px 14px 14px; box-shadow: var(--shadow); min-width: 0; }
.stat .n { color: var(--ink); font-size: 30px; line-height: 1; }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.red .n, .stat.red .l { color: var(--red); }
.stat.red { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--red-tint); }

.alert { background: var(--surface); border-radius: var(--r-lg); padding: 18px 20px 20px; box-shadow: var(--shadow), inset 0 0 0 1.5px #F6CFCA; margin-bottom: 16px; }
.alert-top { display: flex; gap: 14px; align-items: center; }
.alert-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--red-tint); color: var(--red); display: grid; place-items: center; flex: none; }
.alert-icon svg { width: 19px; height: 19px; }
.alert h2 { font-size: 17px; line-height: 1.3; }
.alert .main-col p { margin: 2px 0 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-fee { margin: 12px 0 0 56px; font-size: 14px; color: var(--text); }
.alert-fee b { color: var(--red); font-weight: 500; }
.alert-actions { display: flex; gap: 8px; margin: 14px 0 0 56px; flex-wrap: wrap; }

.year { display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px 20px 20px; gap: 12px; }
.year .n { color: var(--ink); font-size: 24px; }
.year .l { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* segmented controls (filters, view toggle) */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--line); border-radius: var(--pill); }
.seg.scroll { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 0 16px; width: max-content; max-width: 100%; }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 2px 14px 0; border: 0; border-radius: var(--pill); background: transparent; color: var(--text); font-size: 14px; }
.seg-btn .i svg { width: 16px; height: 16px; }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(20,22,28,.12); }

/* lockbox panel: every box the same size, two address lines, combination always visible */
.panel { background: var(--dark); border-radius: var(--r-lg); padding: 10px; box-shadow: var(--shadow-lift); }
.panel-in { background: #E8E9ED; border-radius: var(--r-md); padding: 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.box { position: relative; height: 112px; border: 0; border-radius: var(--r-sm); background: var(--surface); padding: 8px 8px 9px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; color: var(--ink); box-shadow: 0 1px 0 rgba(20,22,28,.05), 0 3px 8px rgba(20,22,28,.06); transition: transform .15s ease, box-shadow .15s ease; }
.box:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(20,22,28,.06), 0 8px 16px rgba(20,22,28,.10); }
.box-top { display: flex; justify-content: space-between; align-items: center; }
.box .p { font-size: 11px; color: var(--muted); }
.box-addr { display: flex; flex-direction: column; font-size: 12px; line-height: 1.25; }
.box-addr span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.box-addr span:first-child { color: var(--ink); }
.box-addr span:last-child { color: var(--muted); }
.box-combo { font-size: 17px; letter-spacing: .06em; color: var(--ink); }
.box.spare { background: transparent; box-shadow: inset 0 0 0 1.5px #CBCDD4; }
.box.spare .box-addr span, .box.spare .box-combo { color: var(--faint); }
.flag { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.flag.attention { background: var(--ink); }
.flag.pending { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.box.attention, .box.pending { box-shadow: 0 0 0 2px var(--ink), 0 3px 8px rgba(20,22,28,.08); }
.legend { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; color: var(--text); margin: 14px 4px 0; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.pos-badge { width: 42px; height: 42px; border-radius: 12px; background: var(--bg); color: var(--ink); display: grid; place-items: center; font-size: 14px; flex: none; }
.list-combo { flex: none; font-size: 18px; letter-spacing: .08em; color: var(--ink); padding: 4px 12px 2px; border-radius: 10px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.list-combo.attention, .list-combo.pending { box-shadow: inset 0 0 0 2px var(--ink); }

/* history */
.thumbs { display: flex; gap: 6px; margin-top: 10px; }
.thumb { width: 76px; height: 52px; border-radius: 10px; background: var(--bg); display: grid; place-items: center; color: var(--faint); font-size: 11px; }
.day { color: var(--muted); font-size: 14px; margin: 20px 6px 8px; }
.page-head + .day { margin-top: 0; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(20,22,28,.38); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 10px 20px calc(24px + var(--safe-b)); max-height: 92vh; overflow-y: auto; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { font-size: 21px; line-height: 1.2; }
.sheet .actions { display: grid; gap: 10px; margin-top: 20px; }
.sheet .actions .btn { width: 100%; justify-content: space-between; }
.sub { font-size: 15px; margin: 24px 0 10px; }
.info { background: var(--soft); border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); }
.info-row { display: flex; justify-content: space-between; gap: 16px; padding: 13px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.info-row:first-child { border-top: 0; }
.info-row span { color: var(--muted); }
.info-row b { color: var(--ink); font-weight: 500; text-align: right; }
.mono { letter-spacing: .08em; }
.combo-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--r-md); background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.combo-card span { font-size: 13px; color: var(--muted); }
.combo-card b { font-weight: 500; font-size: 30px; letter-spacing: .12em; color: var(--ink); line-height: 1.1; }
.combo-card.big { align-items: center; padding: 22px 18px; }
.combo-card.big b { font-size: 44px; letter-spacing: .18em; padding-left: .18em; }
.combo-card.new { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }
.combo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.steps { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 12px; font-size: 15px; line-height: 1.45; color: var(--text); }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--bg); color: var(--ink); display: grid; place-items: center; font-size: 13px; flex: none; margin-top: -1px; }
.steps b { color: var(--ink); font-weight: 500; letter-spacing: .06em; }
.note { font-size: 14px; color: var(--muted); margin: 14px 2px 0; line-height: 1.45; }
.note b { color: var(--ink); font-weight: 500; }
.note.warn { color: var(--text); background: var(--soft); box-shadow: inset 0 0 0 1px var(--line-2); border-radius: var(--r-sm); padding: 12px 14px; margin: 14px 0 0; }
.note.first { margin: 0 0 14px; }
.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice.two { grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.choice button { border: 0; border-radius: var(--r-md); background: var(--soft); box-shadow: inset 0 0 0 1px var(--line-2); padding: 14px 12px 12px; text-align: left; color: var(--ink); font-size: 15px; line-height: 1.25; display: flex; flex-direction: column; gap: 6px; }
.choice button small { color: var(--muted); font-size: 12px; }
.choice button .i { color: var(--muted); }
.choice button.on { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }
.choice button.on .i { color: var(--ink); }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); z-index: 30; background: var(--ink); color: #fff; padding: 14px 20px 12px; border-radius: var(--pill); font-size: 14px; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-lift); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- desktop ---------- */
@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 272px 1fr; }
  .top, .tabs { display: none; }
  .side { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 16px; height: calc(100vh - 32px); margin: 16px 0 16px 16px; padding: 32px 20px 20px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); }
  .side .logo { margin: 0 auto 8px; width: 128px; }
  .side .logo img:first-child { width: 40px; }
  .side .logo img:last-child { width: 128px; }
  .side-new { width: 100%; justify-content: space-between; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav button, .side-settings { display: flex; align-items: center; gap: 14px; border: 0; background: none; padding: 12px 16px 10px; border-radius: var(--pill); color: var(--text); font-size: 16px; text-align: left; }
  .side-nav button:hover, .side-settings:hover { background: var(--soft); }
  .side-nav button.on { background: var(--blue-tint); color: var(--blue); }
  .side-settings { margin-top: auto; }
  .main { padding: 40px 48px 56px; width: 100%; }
  .page-head { margin: 0 0 28px; }
  .page-head h1 { font-size: 42px; }
  .page-head p { font-size: 17px; }
  .stats { gap: 16px; margin-bottom: 20px; }
  .stat { padding: 22px 24px 20px; border-radius: var(--r-lg); }
  .stat .n { font-size: 40px; }
  .stat .l { font-size: 15px; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .cols > .col + .col { margin-top: 0; }
  .col > * + * { margin-top: 20px; }
  .panel { max-width: 840px; padding: 14px; }
  .panel-in { gap: 10px; padding: 12px; }
  .box { height: 132px; padding: 12px 14px; }
  .box .p { font-size: 12px; }
  .box-addr { font-size: 15px; }
  .box-combo { font-size: 22px; }
  .seg.scroll { flex-wrap: wrap; }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: var(--r-lg); padding: 28px 32px 32px; box-shadow: var(--shadow-lift); }
  .sheet-grab { display: none; }
  .toast { bottom: 32px; left: calc(50% + 136px); }
  .banner { padding-left: 288px; }
}

/* overdue card: the most important thing on Today */
.gap { height: 14px; }
.overdue { background: var(--surface); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 16px; box-shadow: var(--shadow-lift), inset 0 0 0 1.5px #F3C9C4; }
.overdue-band { display: flex; align-items: center; gap: 10px; padding: 12px 20px 10px; background: var(--red); color: #fff; font-size: 15px; }
.overdue-band .i svg { width: 18px; height: 18px; }
.overdue-late { margin-left: auto; padding: 3px 10px 1px; border-radius: var(--pill); background: rgba(255,255,255,.18); font-size: 13px; white-space: nowrap; }
.overdue-body { padding: 18px 20px 20px; }
.overdue-who { display: flex; align-items: center; gap: 14px; }
.avatar.big { width: 52px; height: 52px; font-size: 17px; background: var(--red-tint); color: var(--red); }
.overdue-who h2 { font-size: 22px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overdue-who p { margin: 2px 0 0; font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overdue-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 16px 0 0; background: var(--line); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.overdue-facts div { background: var(--soft); padding: 11px 14px 10px; min-width: 0; }
.overdue-facts dt { font-size: 12px; color: var(--muted); }
.overdue-facts dd { margin: 2px 0 0; font-size: 15px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.overdue-facts dd.red { color: var(--red); }
.overdue-actions { display: grid; gap: 10px; margin-top: 16px; }
.overdue-actions .btn { width: 100%; justify-content: space-between; }
.list-combo.off { color: var(--faint); background: transparent; }
@media (min-width: 960px) {
  .overdue-body { padding: 22px 24px 24px; }
  .overdue-facts { grid-template-columns: repeat(4, 1fr); }
  .overdue-actions { grid-template-columns: 1fr 1fr; max-width: 560px; }
}

.combo-card b { white-space: nowrap; }
.combo-card.big.long b { font-size: 34px; letter-spacing: .12em; padding-left: .12em; }

/* settings page */
.profile { display: flex; align-items: center; gap: 16px; padding: 20px; }
.profile h2 { font-size: 20px; }
.profile p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.pad { padding: 4px 20px 20px; }
.sub.tight { margin-top: 6px; }
.signout { width: 100%; justify-content: space-between; margin-top: 16px; }
.side-settings.on { background: var(--blue-tint); color: var(--blue); }

.box-row { padding: 0 16px 0 0; gap: 8px; }
.row-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 13px 4px 13px 20px; border: 0; background: none; text-align: left; min-height: 68px; }
.row-open:hover { background: var(--soft); }
.row-reset { border: 0; cursor: pointer; }
.row-reset:hover { background: var(--blue); color: #fff; }
.row-reset-space { width: 64px; flex: none; }
@media (max-width: 959px) { .row-reset, .row-reset-space { display: none; } .box-row { padding-right: 0; } .row-open { padding-right: 20px; } }

.mono-tile { display: grid; place-items: center; width: 52px; height: 52px; background: var(--ink); border-radius: 12px; flex: none; }
.mono-tile img { width: 34px; height: auto; display: block; }
.top-tile { width: 44px; height: 44px; border-radius: 10px; }
.top-tile img { width: 29px; }
.side-brand { display: flex; justify-content: center; padding: 6px 0 22px; }
.choice.two button { align-items: center; justify-content: center; text-align: center; }

.choice button small { white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.tel { color: var(--blue); text-decoration: none; font-weight: inherit; }
.tel:hover { text-decoration: underline; }

/* Keep the logo in the same place on every sign-in step */
.signin { align-items: flex-start; padding-top: calc(var(--safe-t) + clamp(16px, 50vh - 340px, 200px)); padding-top: calc(var(--safe-t) + clamp(16px, 50dvh - 340px, 200px)); }

.mono-tile, .top-tile { border-radius: 0; }
.note.center { text-align: center; }
.box-top { display: flex; justify-content: space-between; align-items: center; }
.box-edit { display: grid; place-items: center; width: 18px; height: 18px; color: var(--faint); }
.box-edit svg { width: 13px; height: 13px; }
.box:hover .box-edit { color: var(--blue); }

.sym-list { letter-spacing: .04em; }

/* Header scrolls away with the page */
.top { position: static; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Pencil lines up with the box position label */
.box-top { height: 14px; line-height: 14px; }
.box .p { line-height: 14px; display: block; }
.box-edit { width: 14px; height: 14px; margin-right: -1px; }
.box-edit svg { width: 12px; height: 12px; display: block; }
.box-edit { transform: translateY(-2px); }

#nc-tenant { display: flex; flex-direction: column; gap: 16px; }
#nc-tenant[hidden] { display: none; }

.settings-col { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }

#chpw .btn { justify-content: space-between; }

/* Custom dropdown (building, unit) */
.pick { position: relative; }
.pick-btn { width: 100%; height: 52px; padding: 0 44px 0 18px; border: 0; border-radius: var(--pill); background: var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2314161C' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 20px center; box-shadow: inset 0 0 0 1px var(--line-2); text-align: left; color: var(--ink); font-size: 16px; cursor: pointer; }
.pick-btn:disabled { opacity: .5; cursor: not-allowed; }
.pick.open .pick-btn { box-shadow: inset 0 0 0 2px var(--blue); }
.pick-label.ph { color: var(--muted); }
.pick-list { position: absolute; left: 0; right: 0; top: 58px; z-index: 20; background: var(--surface); border-radius: var(--r-md); box-shadow: 0 2px 4px rgba(20,22,28,.06), 0 18px 40px rgba(20,22,28,.18); padding: 6px; max-height: 320px; overflow-y: auto; }
.pick-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 11px 14px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; }
.pick-opt:hover { background: var(--soft); }
.pick-opt.on { background: var(--blue-tint); }
.pick-opt .t { color: var(--ink); font-size: 16px; }
.pick-opt .s { color: var(--muted); font-size: 13px; }
/* Roommate chooser */
.who-list { display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; border-radius: var(--r-md); background: var(--soft); box-shadow: inset 0 0 0 1px var(--line-2); text-align: left; cursor: pointer; }
.who .main-col { display: flex; flex-direction: column; }
.who .t { color: var(--ink); font-size: 16px; }
.who .s { color: var(--muted); font-size: 13px; }
.who .check { margin-left: auto; width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--line-2); flex: none; display: grid; place-items: center; color: transparent; }
.who .check svg { width: 14px; height: 14px; }
.who.on { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface); }
.who.on .check { background: var(--blue); box-shadow: none; color: #fff; }

/* Thinner cabinet frame */
.panel { padding: 4px; border-radius: 22px; }
.panel-in { border-radius: 18px; }

/* Dropdown open: dim everything else */
.pick-dim { position: fixed; inset: 0; background: rgba(20,22,28,.42); z-index: 40; animation: fadeIn .15s ease; }
.pick.open { z-index: 41; }
.pick.open .pick-btn { background-color: var(--surface); box-shadow: inset 0 0 0 2px var(--blue), 0 8px 24px rgba(20,22,28,.18); }
.pick-list { z-index: 41; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.nc-person[hidden] { display: none; }

.sent-row span { line-height: 1.4; }
.sent-row .who-name { color: var(--ink); font-weight: 500; }
.sent-row .mono { font-size: 18px; letter-spacing: .08em; }

.signin { align-items: flex-start; padding-top: calc(var(--safe-t) + var(--signin-top, 16px)); }

/* Desktop Today: Keys out on the left, To review on the right */
@media (min-width: 960px) { .col-out { order: -1; } }
/* History rows open a detail sheet */
.log-row { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }
.log-row:hover { background: var(--soft); }
.cams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.cam { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.cam-img { aspect-ratio: 4 / 3; border-radius: var(--r-md); background: linear-gradient(160deg, #D9DBE0, #C4C7CE); display: grid; place-items: center; color: #8B8E98; }
.cam-img svg { width: 28px; height: 28px; }
.cam figcaption { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.cam figcaption b { color: var(--ink); font-weight: 500; font-size: 15px; }

/* Open dropdown: field and list read as one piece */
.pick.open .pick-btn { border-radius: 26px 26px 0 0; background-color: var(--surface); box-shadow: 0 -4px 18px rgba(20,22,28,.10); }
.pick.open .pick-list { top: 52px; border-radius: 0 0 22px 22px; padding: 4px 6px 8px; box-shadow: 0 18px 36px rgba(20,22,28,.18); border-top: 1px solid var(--line); }

.log-row .t, .log-row .s { white-space: normal; overflow: visible; text-overflow: clip; }

@media (max-width: 959px) { .page-head .yr { display: block; } }

/* Today: last 7 days (phone and desktop) */
.recent { display: block; margin-top: 16px; }
.recent .section-title { display: flex; align-items: center; justify-content: space-between; }
.recent-day { padding: 14px 20px 6px; font-size: 13px; font-weight: 600; color: var(--muted, #767985); }
.recent-row .end { margin-left: auto; font-size: 14px; color: var(--muted, #767985); white-space: nowrap; padding-left: 8px; }
button.pill-link { border: 0; font: inherit; font-size: 14px; letter-spacing: inherit; line-height: 1; height: 32px; padding: 1px 14px 0; cursor: pointer; transition: background-color .15s, color .15s; }
button.pill-link:hover { background: var(--blue); color: #fff; }

/* Motion: very subtle. Views and lists fade up 6px; sheets slide up; nothing on reduced motion. */
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes sheetPop { from { transform: translateY(10px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
.enter { animation: viewIn .24s cubic-bezier(.2,.7,.2,1) both; }
.sheet-wrap:not([hidden]) { animation: fadeIn .12s linear both; }
.sheet-wrap:not([hidden]) .sheet { animation: sheetUp .26s cubic-bezier(.2,.8,.2,1) both; }
@media (min-width: 960px) { .sheet-wrap:not([hidden]) .sheet { animation-name: sheetPop; } }
#sheet-body.swap { animation: viewIn .2s ease both; }
.sheet-wrap.closing { animation: fadeOut .16s ease forwards; }
.sheet-wrap.closing .sheet { animation: none; transition: transform .16s ease; transform: translateY(12px); }
.pick-list:not([hidden]) { animation: fadeIn .14s ease; }
.tabs [data-tab], .side-nav [data-tab], .seg-btn { transition: background-color .18s ease, color .18s ease; }
@media (prefers-reduced-motion: reduce) { .enter, .sheet-wrap, .sheet, #sheet-body.swap, .pick-list { animation: none !important; transition: none !important; } }
#np-msg:empty { display: none; }
#np-msg { color: var(--red, #C2261B); }

/* Focus: one ring only (the field's own inset ring), no second outline */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
/* Password fields: bigger dots you can count, and an eye to show the password */
input.pw:not(.pw-shown) { font-family: Verdana, Tahoma, sans-serif; font-size: 20px; letter-spacing: .18em; }
input.pw:not(.pw-shown)::placeholder { font-family: "Objectivity", -apple-system, "Helvetica Neue", Arial, sans-serif; font-size: 16px; letter-spacing: normal; }
.input-wrap.has-eye input { padding-right: 52px; }
.input-wrap.no-icon input { padding-left: 16px; }
.pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--faint); display: grid; place-items: center; cursor: pointer; }
.pw-eye:hover { color: var(--ink, #14161C); background: rgba(20,22,28,.05); }
.pw-eye svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tag.pending-tag { background: #EEF2FD; color: #2F5FE8; }

/* password checklist (setup, reset, settings) */
.pw-box { display: grid; gap: 10px; }
.pw-ok { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: #EEF8F1; color: #15562B; font-weight: 600; font-size: 15px; animation: viewIn .18s ease both; }
.pw-ok[hidden] { display: none; }
.pw-ok-i { width: 26px; height: 26px; border-radius: 50%; background: #1F8A45; color: #fff; display: grid; place-items: center; flex: none; }
.pw-ok-i svg { width: 14px; height: 14px; }
.pw-list { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; }
.pw-list p { margin: 0; font-size: 14px; color: var(--ink); font-weight: 500; }
.pw-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.pw-list .pw-match { border-top: 1px solid var(--line); padding-top: 9px; }
.pw-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 18px; color: var(--muted); transition: color .15s; }
.pw-list li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); flex: none; transition: background-color .15s; }
.pw-list li.ok { color: #15562B; }
.pw-list li.ok::before { background: #1F8A45 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='8' viewBox='0 0 10 8'%3E%3Cpath d='M1 4l2.5 2.5L9 1' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center no-repeat; box-shadow: none; }
.pw-box.typing .pw-list li:not(.ok) { color: var(--ink); }

/* phones: nothing shows below the floating tab bar */
/* Extends well below the window: iPhone Safari draws the page behind its floating address bar, so the cover has to reach under it too. */
@media (max-width: 959px) { .app::after { content: ""; position: fixed; z-index: 5; left: 0; right: 0; bottom: -320px; height: calc(362px + var(--safe-b)); background: var(--bg); pointer-events: none; } }
.sheet-wrap, .sheet { overscroll-behavior: contain; }
.sheet { touch-action: pan-y; }
.sheet-grab { padding: 8px 0; margin-top: -8px; background-clip: content-box; height: 21px; box-sizing: border-box; cursor: grab; }
.recent-row .t, .recent-row .s { white-space: normal; overflow: visible; text-overflow: clip; }
@media (min-width: 960px) { .side { align-self: start; height: calc(100vh - 32px); height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; } }
.pick.open { z-index: 41; }

/* lockbox picker rows: position, address, combination on one line */
.box-opt { flex-direction: row !important; align-items: center !important; gap: 12px !important; }
.box-pick .pick-label { display: flex; align-items: center; gap: 12px; white-space: nowrap; overflow: hidden; }
.bx-pos { flex: none; min-width: 30px; font-weight: 600; color: var(--ink); }
.bx-addr { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.bx-combo { flex: none; font-variant-numeric: tabular-nums; letter-spacing: .08em; color: var(--muted); }
.box-pick .pick-label.ph { display: block; }
/* Home-screen app: iPhone blurs a strip under the status bar; keep the logo below it. */
@media (display-mode: standalone) and (max-width: 959px) { .top { padding-top: calc(var(--safe-t) + 30px); } }
/* Phone sheets stop well below the top so there's room to tap out or pull down. */
@media (max-width: 959px) { .sheet { max-height: calc(100vh - 140px); max-height: calc(100dvh - var(--safe-t) - 110px); } }

.choice.ext { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.choice.ext button { align-items: center; text-align: center; padding: 14px 6px 12px; white-space: nowrap; }
.choice button.on { box-shadow: inset 0 0 0 2px var(--ink); background: var(--surface); }
.ext-new { color: var(--blue); }
/* Backdrop reaches up under the status bar too, so the whole screen dims as one. */
.sheet-wrap { top: calc(-1 * var(--safe-t) - 60px); padding-top: calc(var(--safe-t) + 60px); }
@media (max-width: 959px) {
  .cols { display: flex; flex-direction: column; gap: 16px; }
  .cols > .col + .col { margin-top: 0; }
  .col-out { order: -1; }
}

.sms-preview { background: var(--soft); border-radius: 18px 18px 18px 6px; padding: 14px 16px; white-space: pre-wrap; font-size: 15px; line-height: 1.45; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
textarea.sms-edit { width: 100%; box-sizing: border-box; border: 0; border-radius: 18px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line-2); padding: 14px 16px; font: inherit; font-size: 16px; line-height: 1.45; color: var(--ink); resize: none; min-height: 140px; letter-spacing: inherit; }
textarea.sms-edit:focus { outline: none; box-shadow: inset 0 0 0 2px var(--blue); }
.sheet .info + .field { margin-top: 16px; }
.proto-code { margin: 0; padding: 12px 14px; border-radius: 12px; background: #FFF6E5; color: #7A4B00; font-size: 14px; line-height: 1.4; }
.proto-code b { letter-spacing: .12em; }
