/* Docket — trustee's-sale triage.
   Palette: system greys + "deed teal" tint + highlighter yellow for Interesting. */

:root {
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --surface-2: #F7F7FA;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --label: #101216;
  --label-2: #5C6270;
  --label-3: #8C919C;
  --sep: rgba(60, 60, 67, .16);
  --tint: #0A6F68;
  --tint-ink: #FFFFFF;
  --tint-soft: rgba(10, 111, 104, .1);
  --marker: #FFE04A;
  --marker-ink: #A86E00;
  --marker-solid: #F5B800;
  --not: #8E8E93;
  --hot: #D93A3F;
  --soon: #D9730D;
  --bar: rgba(242, 242, 247, .82);
  --bar-2: rgba(250, 250, 252, .9);
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.06);
  --sheet-shadow: 0 -10px 40px rgba(0,0,0,.18);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "SF Pro", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --nav-h: 44px;
  --tab-h: 50px;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1C1C1E;
    --surface-2: #232326;
    --fill: rgba(118, 118, 128, .24);
    --fill-2: rgba(118, 118, 128, .36);
    --label: #F4F4F6;
    --label-2: #A4A7B0;
    --label-3: #6E717A;
    --sep: rgba(84, 84, 88, .55);
    --tint: #45C7B8;
    --tint-ink: #00201D;
    --tint-soft: rgba(69, 199, 184, .14);
    --marker: rgba(255, 214, 10, .4);
    --marker-ink: #FFD60A;
    --marker-solid: #FFD60A;
    --not: #7C7C82;
    --hot: #FF6369;
    --soon: #FF9F2E;
    --bar: rgba(0, 0, 0, .78);
    --bar-2: rgba(28, 28, 30, .82);
    --shadow: 0 0 0 1px rgba(255,255,255,.04);
    --sheet-shadow: 0 -10px 40px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--tint); text-decoration: none; }
svg { width: 1em; height: 1em; flex: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--tint); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .88em; letter-spacing: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.app { position: fixed; inset: 0; }

.list-pane {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px);
  transition: transform .5s var(--ease), filter .5s var(--ease);
  --stick-top: calc(var(--safe-t) + var(--nav-h));
}
.detail-pane {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  transform: translateX(100%);
  transition: transform .5s var(--ease), box-shadow .5s;
  z-index: 20;
  outline: none;
}
.d-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.app[data-view="detail"] .detail-pane { transform: none; box-shadow: -1px 0 0 var(--sep), -20px 0 40px rgba(0,0,0,.1); }
.app.dragging .detail-pane { box-shadow: -1px 0 0 var(--sep), -20px 0 40px rgba(0,0,0,.1); }
.app[data-view="detail"] .list-pane { transform: translateX(-28%); filter: brightness(.92); }
.app.dragging .detail-pane, .app.dragging .list-pane { transition: none; }

/* ---------- List header ---------- */
.list-head { padding: 0 calc(16px + var(--safe-r)) 8px calc(16px + var(--safe-l)); }
.lh-compact {
  position: sticky; top: 0; z-index: 6;
  padding: var(--safe-t) calc(8px + var(--safe-r)) 0 calc(8px + var(--safe-l));
  height: calc(var(--safe-t) + var(--nav-h));
  display: flex; align-items: center; justify-content: flex-end;
  background: transparent;
  transition: background .2s, box-shadow .2s;
}
.lh-compact-title {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--nav-h);
  display: grid; place-items: center;
  font-weight: 600; font-size: 17px;
  opacity: 0; transform: translateY(4px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.list-pane.scrolled .lh-compact {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .5px 0 var(--sep);
}
.list-pane.scrolled .lh-compact-title { opacity: 1; transform: none; }
.lh-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 2px 0 10px; }
.lh-title h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; }
.lh-sub { margin: 4px 0 0; color: var(--label-2); font-size: 15px; }
.lh-sub b { color: var(--label); font-weight: 600; }

.search-row { display: flex; gap: 8px; align-items: center; }
.search {
  flex: 1; display: flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 10px;
  border-radius: 11px; background: var(--fill);
  color: var(--label-3);
}
.search svg { font-size: 17px; }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: var(--label); font-size: 17px; height: 100%;
}
.search input::placeholder { color: var(--label-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search kbd { font: 500 12px var(--sans); border: 1px solid var(--sep); border-radius: 5px; padding: 1px 6px; color: var(--label-3); }
.search:focus-within kbd { display: none; }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  color: var(--tint); font-size: 22px;
}
.icon-btn:active { background: var(--fill); }
.icon-btn .dot { position: absolute; top: 9px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--tint); box-shadow: 0 0 0 2px var(--bg); }
.filter-btn { display: none; }

/* ---------- Segmented controls ---------- */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--fill); border-radius: 9px; padding: 2px; position: relative;
}
.seg button {
  position: relative; z-index: 1;
  height: 30px; border-radius: 7px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  color: var(--label); white-space: nowrap;
  transition: background .2s, box-shadow .2s;
}
.seg button[aria-checked="true"], .seg button[aria-selected="true"] {
  background: var(--surface); font-weight: 600;
  box-shadow: 0 1px 1px rgba(0,0,0,.04), 0 3px 8px rgba(0,0,0,.12);
}
@media (prefers-color-scheme: dark) {
  .seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: #636366; }
}
.seg .c { font-weight: 500; color: var(--label-3); font-variant-numeric: tabular-nums; }
.seg-main { margin: 2px 0 10px; display: none; }

/* ---------- List ---------- */
.list { outline: none; padding: 4px 0 0; }
.day-h {
  position: sticky; top: var(--stick-top); z-index: 4;
  display: flex; align-items: baseline; gap: 8px;
  padding: 18px calc(20px + var(--safe-r)) 7px calc(20px + var(--safe-l));
  background: linear-gradient(var(--bg) 70%, transparent);
  font-size: 13px; color: var(--label-2);
}
.day-h b { font-weight: 600; color: var(--label); font-size: 15px; letter-spacing: -.01em; }
.day-h .rel { margin-left: auto; font-variant-numeric: tabular-nums; }
.day-h .rel.hot { color: var(--hot); font-weight: 600; }
.day-h .rel.soon { color: var(--soon); font-weight: 600; }
.group {
  margin: 0 calc(16px + var(--safe-r)) 0 calc(16px + var(--safe-l));
  background: var(--surface); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow);
}
.group.flat { margin-top: 8px; }

.cell { position: relative; overflow: hidden; touch-action: pan-y; }
.cell + .cell::before {
  content: ""; position: absolute; top: 0; left: 76px; right: 0; height: .5px;
  background: var(--sep); z-index: 2;
}
.act {
  position: absolute; inset: 0; display: flex; align-items: center;
  padding: 0 24px; font-weight: 600; font-size: 15px; gap: 8px;
  opacity: 0;
}
.act svg { font-size: 26px; transition: transform .25s var(--spring); }
.act-yes { background: var(--marker-solid); color: #3A2A00; justify-content: flex-start; }
.act-no { background: var(--not); color: #fff; justify-content: flex-end; }
.cell.sw-r .act-yes, .cell.sw-l .act-no { opacity: 1; }
.cell.armed .act svg { transform: scale(1.25); }

.row {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 60px 1fr auto; gap: 0 12px;
  padding: 12px 14px 12px 12px; min-height: 76px;
  background: var(--surface); color: var(--label);
  transition: background .15s, opacity .3s, transform .45s var(--ease);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.row:active { background: var(--surface-2); }
.row.sel { background: var(--tint-soft); }
.row.sel::after { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--tint); }
.cell.dragging .row { transition: none; }

.cd {
  align-self: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 52px; border-radius: 12px; background: var(--fill);
  font-family: var(--round); line-height: 1;
}
.cd b { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cd span { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); margin-top: 3px; }
.cd.hot { background: color-mix(in srgb, var(--hot) 14%, transparent); color: var(--hot); }
.cd.hot span, .cd.soon span { color: inherit; opacity: .85; }
.cd.soon { background: color-mix(in srgb, var(--soon) 14%, transparent); color: var(--soon); }
.cd.past { color: var(--label-3); background: transparent; box-shadow: inset 0 0 0 1px var(--sep); }
.cd.word b { font-size: 14px; letter-spacing: 0; }

.rb { min-width: 0; }
.r1 { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.street { font-weight: 600; font-size: 17px; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.r2, .r3 { font-size: 14px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.r3 { color: var(--label-3); }
.r2 .sep, .r3 .sep { margin: 0 5px; opacity: .6; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chip {
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  padding: 2px 7px; border-radius: 6px; background: var(--fill); color: var(--label-2);
}
.chip.warn { background: color-mix(in srgb, var(--soon) 15%, transparent); color: var(--soon); }
.chip.risk { background: color-mix(in srgb, var(--hot) 13%, transparent); color: var(--hot); }
.rside { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-top: 2px; color: var(--label-3); font-size: 13px; }
.rside .st { font-size: 18px; }
.rside .st.yes { color: var(--marker-solid); }
.rside .st.no { color: var(--not); }
.rside .has-note { font-size: 15px; }

/* The signature: Interesting gets a highlighter pass over the address. */
.hl {
  background-image: linear-gradient(100deg, transparent .2em, var(--marker) .35em, var(--marker) calc(100% - .3em), transparent calc(100% - .15em));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 0% 62%;
  transition: background-size .5s var(--ease);
  padding: 0 .15em; margin: 0 -.15em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.is-yes .hl { background-size: 100% 62%; }
.is-no .row { opacity: .55; }
.is-no .row:hover, .is-no .row.sel { opacity: .85; }

.cell.leaving { transition: height .32s var(--ease), opacity .25s; }

/* Skeleton & empty */
.sk { display: grid; grid-template-columns: 60px 1fr; gap: 12px; padding: 12px; min-height: 76px; }
.sk i { display: block; background: var(--fill); border-radius: 7px; animation: pulse 1.4s ease-in-out infinite; }
.sk .a { height: 52px; border-radius: 12px; }
.sk .b { height: 15px; width: 62%; margin: 4px 0 8px; }
.sk .c { height: 12px; width: 84%; margin-bottom: 6px; }
.sk .d { height: 12px; width: 44%; }
@keyframes pulse { 50% { opacity: .45; } }

.empty { text-align: center; padding: 64px 32px; color: var(--label-2); }
.empty .glyph { font-size: 44px; color: var(--label-3); margin-bottom: 12px; }
.empty .glyph.yes { color: var(--marker-solid); }
.empty h2 { margin: 0 0 6px; font-size: 20px; color: var(--label); letter-spacing: -.015em; }
.empty p { margin: 0 auto 18px; max-width: 30ch; font-size: 15px; }

.pill-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 22px;
  background: var(--tint); color: var(--tint-ink); font-weight: 600; font-size: 15px;
}
.pill-btn.ghost { background: var(--fill); color: var(--tint); }
.text-btn { color: var(--tint); font-weight: 500; min-height: 44px; padding: 0 6px; }
.text-btn.sm { font-size: 14px; min-height: 32px; }

/* ---------- Tab bar (phones) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  background: var(--bar-2);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -.5px 0 var(--sep);
  transition: transform .5s var(--ease);
}
.app[data-view="detail"] .tabbar { transform: translateY(110%); }
.tabbar button {
  height: var(--tab-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; font-weight: 600; color: var(--label-3); position: relative;
}
.tabbar button svg { font-size: 25px; }
.tabbar button[aria-selected="true"] { color: var(--tint); }
.tabbar .badge {
  position: absolute; top: 3px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--hot); color: #fff; font-size: 11.5px; line-height: 18px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.tabbar .badge.quiet { background: var(--fill-2); color: var(--label-2); }

/* ---------- Filter sheet / sidebar ---------- */
.side {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 14px 14px 0 0;
  box-shadow: var(--sheet-shadow);
  transform: translateY(105%); transition: transform .45s var(--ease);
  padding-bottom: var(--safe-b);
}
.side.open { transform: none; }
.sheet-grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 6px auto 0; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px 0 20px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; }
.brand img { border-radius: 7px; }
.side-scroll { overflow-y: auto; padding: 4px 16px 16px; overscroll-behavior: contain; }
.side-segs { display: none; }
.fgroup { margin-top: 18px; }
.fgroup-h { margin: 0 0 8px 4px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); }
.fgroup-hrow { display: flex; align-items: center; justify-content: space-between; }
.fgroup-hrow .fgroup-h { margin-bottom: 0; }
.fgroup-note { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--label-3); }
.fgroup-hint { margin: 0 0 8px 4px; font-size: 13px; color: var(--label-3); }
.seg-sm button { height: 32px; }
.county-list { background: var(--surface); border-radius: 12px; overflow: hidden; margin-top: 6px; }
.county {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 44px; padding: 0 14px; text-align: left; font-size: 16px;
  position: relative;
}
.county + .county::before { content: ""; position: absolute; top: 0; left: 46px; right: 0; height: .5px; background: var(--sep); }
.county .box {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1.5px var(--label-3); color: transparent; font-size: 14px;
  transition: background .15s, box-shadow .15s;
}
.county[aria-checked="true"] .box { background: var(--tint); box-shadow: none; color: var(--tint-ink); }
.county .n { margin-left: auto; color: var(--label-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.county .n b { color: var(--label-2); font-weight: 600; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 6px 0 14px; background: var(--surface); font-size: 16px; }
.field:first-of-type { border-radius: 12px 12px 0 0; }
.field:last-of-type { border-radius: 0 0 12px 12px; box-shadow: 0 -.5px 0 var(--sep); }
.field select {
  border: 0; background: transparent; color: var(--label-2); text-align: right; text-align-last: right;
  max-width: 60%; min-height: 44px; font-size: 16px; padding-right: 8px; cursor: pointer;
}
.flag-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 34px; padding: 0 12px; border-radius: 17px;
  background: var(--surface); font-size: 14px; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--sep);
}
.fchip .n { color: var(--label-3); font-variant-numeric: tabular-nums; }
.fchip[data-state="include"] { background: var(--tint); color: var(--tint-ink); box-shadow: none; }
.fchip[data-state="include"] .n { color: inherit; opacity: .75; }
.fchip[data-state="exclude"] { background: color-mix(in srgb, var(--hot) 12%, var(--surface)); color: var(--hot); box-shadow: none; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 22px; padding: 0 4px; }
.scrape-info { font-size: 13px; color: var(--label-3); line-height: 1.35; }
.scrape-info b { color: var(--label-2); font-weight: 600; }
.side-foot-btns { display: flex; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kbd-only { display: none; }
@media (hover: hover) and (pointer: fine) { .kbd-only { display: inline-grid; } .search kbd.kbd-only { display: inline; } }

.backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.32); opacity: 0; transition: opacity .3s; }
.backdrop.show { opacity: 1; }

/* ---------- Detail ---------- */
.d-nav {
  position: sticky; top: 0; z-index: 6;
  height: calc(var(--safe-t) + var(--nav-h)); padding: var(--safe-t) calc(8px + var(--safe-r)) 0 calc(4px + var(--safe-l));
  display: flex; align-items: center; gap: 4px;
  background: transparent; transition: background .2s, box-shadow .2s;
}
.detail-pane.scrolled .d-nav { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 .5px 0 var(--sep); }
.back-btn { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 8px 0 4px; color: var(--tint); font-size: 17px; }
.back-btn svg { font-size: 24px; }
.d-nav-title { flex: 1; min-width: 0; text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
.detail-pane.scrolled .d-nav-title { opacity: 1; }
.d-nav-spacer { width: 88px; display: flex; justify-content: flex-end; }

.d-body { padding: 4px calc(16px + var(--safe-r)) 32px calc(16px + var(--safe-l)); max-width: 760px; margin: 0 auto; }
.d-eyebrow { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .05em; }
.d-eyebrow .mono { text-transform: none; font-weight: 500; color: var(--label-3); letter-spacing: 0; }
.d-title { margin: 6px 0 2px; font-size: 32px; line-height: 1.12; font-weight: 700; letter-spacing: -.028em; text-wrap: balance; }
.d-sub { margin: 0; color: var(--label-2); font-size: 17px; }
.d-aka { margin: 4px 0 0; color: var(--label-3); font-size: 14px; }
.d-links { display: flex; gap: 8px; margin: 16px -16px 0; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
.d-links::-webkit-scrollbar { display: none; }
.lk {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--surface); color: var(--tint); font-size: 15px; font-weight: 600;
  box-shadow: var(--shadow);
}
.lk svg { font-size: 17px; }

.card { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); margin-top: 14px; overflow: hidden; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 4px 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); }
.card-h + .card { margin-top: 8px; }
.card-h .aside { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--label-3); }

/* Countdown hero */
.when { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; padding: 16px 18px; align-items: center; }
.when-n { grid-row: span 2; font-family: var(--round); line-height: .9; text-align: center; min-width: 74px; }
.when-n b { display: block; font-size: 56px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.when-n span { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--label-2); margin-top: 6px; }
.when-n.word b { font-size: 30px; letter-spacing: -.02em; }
.when.hot .when-n { color: var(--hot); } .when.hot .when-n span { color: inherit; }
.when.soon .when-n { color: var(--soon); } .when.soon .when-n span { color: inherit; }
.when.past .when-n { color: var(--label-3); }
.when-date { font-size: 20px; font-weight: 650; letter-spacing: -.015em; align-self: end; }
.when-time { color: var(--label-2); font-size: 15px; align-self: start; }
.when-loc { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 10px; padding-top: 12px; border-top: .5px solid var(--sep); font-size: 14px; color: var(--label-2); }
.when-loc svg { font-size: 17px; color: var(--label-3); margin-top: 1px; }

/* Decision: in the toolbar on phones, inline on wider screens */
.decide-wrap { display: none; }
.decide { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.dbtn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; border-radius: 14px; font-size: 17px; font-weight: 600;
  background: var(--surface); box-shadow: var(--shadow); color: var(--label);
  transition: transform .2s var(--spring), background .2s, color .2s;
}
.dbtn svg { font-size: 21px; }
.dbtn:active { transform: scale(.96); }
.dbtn.yes svg { color: var(--marker-solid); }
.dbtn.no svg { color: var(--not); }
.dbtn.yes[aria-pressed="true"] { background: var(--marker-solid); color: #2E2200; }
.dbtn.yes[aria-pressed="true"] svg { color: #2E2200; }
.dbtn.no[aria-pressed="true"] { background: var(--not); color: #fff; }
.dbtn.no[aria-pressed="true"] svg { color: #fff; }
.dbtn kbd { font: 600 11px var(--mono); opacity: .5; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; display: none; }
@media (hover: hover) and (pointer: fine) { .dbtn kbd { display: inline; } }
.dbtn.pop { animation: pop .45s var(--spring); }
@keyframes pop { 40% { transform: scale(1.05); } }

/* Note */

/* Rows / key-value lists */
.kv { margin: 0; }
.kv > div { display: flex; gap: 16px; justify-content: space-between; align-items: baseline; padding: 11px 16px; position: relative; min-height: 44px; }
.kv > div + div::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.kv dt { color: var(--label-2); font-size: 15px; flex: none; }
.kv dd { margin: 0; text-align: right; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.kv dd.muted { color: var(--label-3); font-weight: 400; }
.kv dd .copy { margin-left: 6px; color: var(--tint); vertical-align: -2px; font-size: 15px; }

.flags { padding: 4px 0; }
.flag { display: grid; grid-template-columns: 28px 1fr; gap: 2px 10px; padding: 11px 16px; position: relative; }
.flag + .flag::before { content: ""; position: absolute; top: 0; left: 54px; right: 0; height: .5px; background: var(--sep); }
.flag .ic { grid-row: span 2; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--fill); color: var(--label-2); font-family: var(--round); }
.flag.warn .ic { background: color-mix(in srgb, var(--soon) 16%, transparent); color: var(--soon); }
.flag.risk .ic { background: color-mix(in srgb, var(--hot) 14%, transparent); color: var(--hot); }
.flag b { font-size: 15px; font-weight: 600; }
.flag p { margin: 0; font-size: 14px; color: var(--label-2); }

.parties { list-style: none; margin: 0; padding: 4px 0; }
.parties li { padding: 10px 16px; font-size: 15px; position: relative; }
.parties li + li::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }

/* Property data slot */
.prop-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.prop-grid > div { padding: 14px 10px 12px 16px; position: relative; }
.prop-grid > div + div::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: .5px; background: var(--sep); }
.prop-grid b { display: block; font-family: var(--round); font-size: 20px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prop-grid span { font-size: 12px; color: var(--label-2); font-weight: 500; }
.prop-grid.ghost b { color: var(--label-3); opacity: .5; }
.prop-empty { display: flex; gap: 12px; align-items: center; padding: 12px 16px 14px; border-top: .5px solid var(--sep); color: var(--label-2); font-size: 14px; }
.prop-empty svg { font-size: 22px; color: var(--label-3); }
.photos { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px; scrollbar-width: none; }
.photos img { flex: none; width: 82%; max-width: 420px; aspect-ratio: 4/3; object-fit: cover; border-radius: 11px; scroll-snap-align: start; background: var(--fill); }

/* Legal notice */
.legal summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0 16px; cursor: pointer; font-weight: 600; font-size: 16px;
}
.legal summary::-webkit-details-marker { display: none; }
.legal summary .chev { color: var(--label-3); transition: transform .3s var(--ease); font-size: 15px; transform: rotate(180deg); }
.legal[open] summary .chev { transform: rotate(270deg); }
.legal summary small { font-weight: 400; color: var(--label-3); font-size: 13px; margin-left: 8px; }
.legal-text {
  max-width: 70ch;
  padding: 4px 18px 20px; font-family: var(--serif); font-size: 15.5px; line-height: 1.6; color: var(--label);
  letter-spacing: 0; overflow-wrap: anywhere; hyphens: auto;
}
.legal-text p { margin: 0 0 .9em; }
.legal-h { margin: 0 0 .9em; font-family: var(--sans); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--label-2); }
.legal-text mark { background: var(--marker); color: inherit; border-radius: 3px; padding: 0 2px; }
.legal-missing { padding: 4px 16px 16px; color: var(--label-3); font-size: 14px; }
.sk-lines i { display: block; height: 11px; margin: 0 16px 9px; border-radius: 6px; background: var(--fill); animation: pulse 1.4s infinite; }

.d-foot { margin: 22px 4px 0; font-size: 12.5px; color: var(--label-3); line-height: 1.5; }

/* Detail decision toolbar on phones */
.d-toolbar {
  flex: none; position: relative; z-index: 7;
  padding: 10px calc(16px + var(--safe-r)) calc(10px + var(--safe-b)) calc(16px + var(--safe-l));
  background: var(--bar-2);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -.5px 0 var(--sep);
}
.d-toolbar .decide { margin: 0; max-width: 728px; margin-inline: auto; }
.d-toolbar .dbtn { box-shadow: none; background: var(--fill); min-height: 50px; }

.d-empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--label-3); padding: 32px; }
.d-empty h2 { margin: 12px 0 6px; font-size: 20px; color: var(--label-2); letter-spacing: -.015em; }
.d-empty p { margin: 0; font-size: 14px; }
.d-empty .keys { display: inline-grid; grid-template-columns: auto auto; gap: 6px 14px; margin-top: 18px; text-align: left; font-size: 13px; }
.d-empty kbd, .kbd-dialog kbd { font: 600 12px var(--mono); border: 1px solid var(--sep); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; color: var(--label-2); background: var(--surface); }
.d-empty .glyph { font-size: 52px; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed; left: 0; right: 0; z-index: 60; pointer-events: none;
  bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 16px;
}
.app[data-view="detail"] ~ .toasts { bottom: calc(80px + var(--safe-b)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  max-width: 440px; width: max-content; min-height: 48px; padding: 6px 8px 6px 16px; border-radius: 16px;
  background: rgba(30, 30, 32, .94); color: #fff; font-size: 15px;
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: toast-in .45s var(--spring);
}
@media (prefers-color-scheme: dark) { .toast { background: rgba(58, 58, 62, .94); } }
.toast.out { animation: toast-out .25s ease-in forwards; }
.toast .ic { font-size: 18px; }
.toast .ic.yes { color: #FFD60A; }
.toast .ic.err { color: #FF6369; }
.toast .msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast button { color: #5EE0D1; font-weight: 600; min-height: 36px; padding: 0 10px; border-radius: 10px; }
.toast:not(:has(button)) { padding-right: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Keyboard dialog ---------- */
.kbd-dialog { border: 0; border-radius: 18px; padding: 22px 24px 18px; background: var(--surface); color: var(--label); box-shadow: 0 20px 60px rgba(0,0,0,.3); width: min(360px, 92vw); }
.kbd-dialog::backdrop { background: rgba(0,0,0,.3); }
.kbd-dialog h2 { margin: 0 0 12px; font-size: 20px; }
.kbd-dialog dl { margin: 0 0 16px; }
.kbd-dialog dl div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; }
.kbd-dialog dd { margin: 0; color: var(--label-2); }
.kbd-dialog form { display: flex; justify-content: flex-end; }

/* Property refresh + sale history */
.card-h .prop-aside { display: inline-flex; align-items: center; gap: 2px; }
.prop-refresh { width: 30px; height: 30px; font-size: 16px; border-radius: 8px; margin: -8px -6px -8px 0; }
.prop-refresh:disabled { opacity: .6; }
.history { list-style: none; margin: 0; padding: 4px 0; border-top: .5px solid var(--sep); }
.history li { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: baseline; padding: 5px 16px; font-size: 14px; position: relative; }
.history li::before { content: ""; position: absolute; left: 119.25px; top: 0; bottom: 0; width: 1.5px; background: var(--fill-2); }
.history li:first-child::before { top: 50%; } .history li:last-child::before { bottom: 50%; }
.history li:only-child::before { display: none; }
.history time { color: var(--label-3); font-variant-numeric: tabular-nums; font-size: 13px; }
.history .ev { padding-left: 14px; position: relative; }
.history .ev::before { content: ""; position: absolute; left: -1.5px; top: .45em; width: 7px; height: 7px; border-radius: 50%; background: var(--tint); }
.history .ev { min-width: 0; }
.history .ev small { display: block; color: var(--label-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Enrichment: risk strip, county-record timelines, source links */
.risk-strip { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 2px; }
.risk-strip .chip { font-size: 13px; padding: 4px 9px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; }
.risk-strip .chip svg { font-size: 13px; }
.chip.ok { background: var(--tint-soft); color: var(--tint); }
.kv dd.risk { color: var(--hot); }
.history.rec { border-top: 0; }
.history.rec li.is-open .ev::before { background: var(--hot); }
.history b.st { font-size: 12px; color: var(--label-3); }
.history b.st.open { color: var(--hot); }
.history.rec .ev small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.history.rec b { text-align: right; }
.history a.pdf { display: flex; justify-content: flex-end; align-items: center; gap: 3px; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--tint); }
.history a.pdf svg { font-size: 12px; }
details.more { border-top: .5px solid var(--sep); }
details.more > summary { list-style: none; cursor: pointer; padding: 10px 16px; color: var(--tint); font-size: 14px; font-weight: 600; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { display: none; }
.prop-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 14px; border-top: .5px solid var(--sep); }
.lk.sm { min-height: 32px; padding: 0 12px; font-size: 14px; background: var(--fill); box-shadow: none; }
.lk.sm svg { font-size: 14px; }

/* ---------- Sign in + account ---------- */
body.auth-page { overflow: auto; min-height: 100dvh; display: grid; place-items: center;
  padding: calc(var(--safe-t) + 24px) calc(16px + var(--safe-r)) calc(var(--safe-b) + 24px) calc(16px + var(--safe-l)); }
.auth { width: min(380px, 100%); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; text-align: center; }
.auth-brand img { width: 64px; height: 64px; border-radius: 15px; box-shadow: var(--shadow); }
.auth-brand h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
.auth-brand p { margin: -6px 0 0; color: var(--label-2); font-size: 15px; }
.inset { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.inset label { display: flex; align-items: center; min-height: 50px; padding: 0 16px; gap: 12px; }
.inset label + label { box-shadow: inset 0 .5px 0 var(--sep); }
.inset label span { flex: none; width: 76px; font-size: 16px; color: var(--label); }
.inset input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 17px; color: var(--label); height: 50px; }
.inset input::placeholder { color: var(--label-3); }
.auth .pill-btn, .acct .pill-btn { width: 100%; min-height: 50px; border-radius: 14px; font-size: 17px; margin-top: 18px; }
.pill-btn:disabled { opacity: .5; }
.auth-msg { margin: 12px 4px 0; font-size: 14px; color: var(--hot); min-height: 1.35em; }
.auth-msg.ok { color: var(--tint); }
.auth-foot { margin: 22px 4px 0; text-align: center; font-size: 13px; color: var(--label-3); }

.acct { width: min(400px, 94vw); padding: 22px 20px 16px; background: var(--bg); }
.acct h2 { margin: 0 4px 2px; font-size: 22px; letter-spacing: -.02em; }
.acct .who { margin: 0 4px 18px; font-size: 15px; color: var(--label-2); overflow-wrap: anywhere; }
.acct h3 { margin: 0 4px 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); }
.acct .inset label span { width: 84px; font-size: 15px; }
.acct .inset input { font-size: 16px; }
.acct .pill-btn { margin-top: 14px; }
.acct #pwForm { display: block; }
.acct .acct-row form { display: contents; }
.acct-row { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 10px; border-top: .5px solid var(--sep); }
.acct-row .danger { color: var(--hot); }

.d-markby { margin: 10px 4px 0; font-size: 13px; color: var(--label-3); }

/* ---------- Tablet: list + detail ---------- */
@media (min-width: 760px) {
  body { font-size: 15px; }
  .app { display: grid; grid-template-columns: minmax(340px, 400px) 1fr; grid-template-rows: minmax(0, 1fr); }
  .app > * { min-height: 0; }
  .list-pane, .detail-pane { position: relative; inset: auto; transform: none !important; filter: none !important; }
  .list-pane { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; border-right: .5px solid var(--sep); --stick-top: 0px; }
  .list-head { padding: calc(var(--safe-t) + 14px) 16px 10px; border-bottom: .5px solid var(--sep); background: var(--bg); }
  .lh-compact { display: none; }
  .lh-title h1 { font-size: 26px; }
  .lh-sub { font-size: 14px; }
  .seg-main { display: grid; }
  .filter-btn { display: inline-grid; }
  .list { flex: 1; overflow-y: auto; padding-bottom: 32px; overscroll-behavior: contain; }
  .tabbar { display: none; }
  .detail-pane { box-shadow: none; z-index: auto; }
  .back-btn { display: none; }
  .d-nav { padding-left: 16px; }
  .d-nav-spacer { width: auto; }
  .d-body { padding-top: 8px; padding-bottom: 48px; }
  .d-title { font-size: 36px; }
  .d-toolbar { display: none; }
  .decide-wrap { display: block; }
  .toasts { bottom: 24px; }
  .app[data-view="detail"] ~ .toasts { bottom: 24px; }
  .side { left: auto; right: 16px; top: 16px; bottom: 16px; width: 360px; max-height: none; border-radius: 18px; transform: translateX(calc(100% + 24px)); }
  .side.open { transform: none; }
  .sheet-grab { display: none; }
  .row { min-height: 72px; }
  .street { font-size: 16px; }
  .r2, .r3 { font-size: 13px; }
  .group { margin: 0 12px; border-radius: 12px; }
  .day-h { padding: 16px 16px 6px; }
  .row:hover { background: var(--surface-2); }
  .row.sel:hover { background: var(--tint-soft); }
}

/* ---------- Desktop: sidebar + list + detail ---------- */
@media (min-width: 1180px) {
  .app { grid-template-columns: 252px minmax(360px, 420px) 1fr; }
  .side {
    position: relative; inset: auto; width: auto; max-height: none; transform: none;
    border-radius: 0; box-shadow: none; padding: 0;
    background: color-mix(in srgb, var(--bg) 70%, var(--surface));
    border-right: .5px solid var(--sep);
  }
  @media (prefers-color-scheme: dark) { .side { background: #0E0E10; } }
  .side-head { padding: calc(var(--safe-t) + 18px) 18px 4px 20px; }
  .sheet-done { display: none; }
  .side-scroll { flex: 1; display: flex; flex-direction: column; padding: 6px 12px 14px; }
  .side-foot { margin-top: auto; padding-top: 18px; }
  .side-segs { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; }
  .sseg {
    display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: 8px;
    font-size: 14.5px; font-weight: 500; color: var(--label); text-align: left;
  }
  .sseg svg { font-size: 19px; color: var(--tint); }
  .sseg.yes svg { color: var(--marker-solid); }
  .sseg.no svg { color: var(--not); }
  .sseg .c { margin-left: auto; color: var(--label-3); font-size: 13px; font-variant-numeric: tabular-nums; }
  .sseg:hover { background: var(--fill); }
  .sseg[aria-selected="true"] { background: var(--fill-2); font-weight: 600; }
  .seg-main { display: none; }
  .filter-btn { display: none; }
  .fgroup { margin-top: 20px; }
  .fgroup-h { font-size: 11.5px; }
  .county { min-height: 34px; font-size: 14px; }
  .county .box { width: 18px; height: 18px; font-size: 12px; }
  .county + .county::before { left: 40px; }
  .field { min-height: 36px; font-size: 14px; }
  .field select { min-height: 36px; font-size: 14px; }
  .fchip { min-height: 28px; font-size: 13px; padding: 0 10px; }
  .backdrop { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hl { transition: none; }
}

/* comments */
/* Chat (public/comments.js): the Messages panel (inbox + thread), bubbles, the composer, presence, the
   property's Chat card, the Changes feed, and email settings in the Account sheet. */
:root { --av-a: #5463C4; --av-b: #B9541E; --av-c: #7A55B8; --av-d: #2E7A4B; }
@media (prefers-color-scheme: dark) { :root { --av-a: #7C89E6; --av-b: #E07A3E; --av-c: #A381E0; --av-d: #4FB27A; } }

.av {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  color: #fff; font: 700 11px/1 var(--round); letter-spacing: .02em; user-select: none;
}
.av-a { background: var(--av-a); } .av-b { background: var(--av-b); } .av-c { background: var(--av-c); } .av-d { background: var(--av-d); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Presence: "Randy is here" */
.pres { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--label-2); text-transform: none; letter-spacing: 0; white-space: nowrap; }
.pres-av { width: 22px; height: 22px; font-size: 9px; box-shadow: 0 0 0 2px var(--bg); }
.pres .pres-av + .pres-av { margin-left: -9px; }
.pres-nav { display: inline-flex; align-items: center; padding-right: 4px; }
.pres-nav .pres-av { width: 26px; height: 26px; font-size: 10px; }
.pres-nav .pres-av + .pres-av { margin-left: -8px; }
/* List rows: who has this property open (rule per row comes from comments.js) */
.rside::before {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font: 700 8.5px/1 var(--round); box-shadow: 0 0 0 2px var(--surface);
}

/* Bubbles */
.bubbles { list-style: none; margin: 0; padding: 6px 12px 2px; display: flex; flex-direction: column; }
.b { position: relative; margin-top: 2px; }
.b.first { margin-top: 10px; }
.b-row { display: flex; align-items: flex-end; gap: 7px; }
.b.me .b-row { justify-content: flex-end; }
.b-av, .b-av-sp { width: 28px; flex: none; }
.b-av-sp { height: 1px; }
.b-name { margin: 0 0 3px 48px; font-size: 12px; font-weight: 500; color: var(--label-3); }
.b-bubble {
  max-width: min(78%, 540px); padding: 8px 13px 9px; border-radius: 19px;
  font-size: 16.5px; line-height: 1.38; white-space: pre-wrap; overflow-wrap: anywhere;
}
.b.them .b-bubble { background: var(--surface); color: var(--label); box-shadow: 0 0 0 .5px var(--sep); }
.b.me .b-bubble { background: var(--tint); color: var(--tint-ink); }
.b.me .b-bubble a { color: inherit; text-decoration: underline; }
.b.them .b-bubble a { color: var(--tint); }
/* Runs read as one block: the corners facing the sender tighten inside a group. */
.b.me:not(.first) .b-bubble { border-top-right-radius: 6px; }
.b.me:not(.last) .b-bubble { border-bottom-right-radius: 6px; }
.b.them:not(.first) .b-bubble { border-top-left-radius: 6px; }
.b.them:not(.last) .b-bubble { border-bottom-left-radius: 6px; }
.b.sending .b-bubble { opacity: .55; }
.b.failed .b-bubble { background: color-mix(in srgb, var(--hot) 75%, var(--tint)); }
.b-via { display: flex; align-items: center; gap: 4px; margin: 3px 0 0 48px; font-size: 11.5px; color: var(--label-3); }
.b.me .b-via { justify-content: flex-end; margin: 3px 4px 0 0; }
.b-via svg { font-size: 13px; }
.b-fail { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 3px; font-size: 12.5px; color: var(--hot); }
.b-fail button { color: var(--tint); font-weight: 600; min-height: 32px; padding: 0 4px; }
.b-sep { list-style: none; margin: 18px 0 4px; text-align: center; font-size: 12px; color: var(--label-3); }
.b-sep b { font-weight: 600; color: var(--label-2); }
.b-seen { list-style: none; margin: 4px 4px 0 0; text-align: right; font-size: 12px; font-weight: 500; color: var(--label-3); }
.b.typing { margin-top: 8px; padding: 0 12px; }
.b.typing .b-bubble { display: flex; align-items: center; gap: 4px; padding: 13px 14px; }
.b.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--label-3); animation: typing-dot 1.2s infinite ease-in-out; }
.b.typing i:nth-child(2) { animation-delay: .15s; }
.b.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* Bubble actions: pin (anyone) and delete (your own). Hover on desktop; tap the bubble on touch. */
.b-acts { align-self: center; display: inline-flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.b:hover .b-acts, .b-acts:focus-within, .b.acts-open .b-acts { opacity: 1; }
.b-act { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--label-3); font-size: 16px; }
.b-act:hover { color: var(--label); background: var(--fill); }
.b-act.del:hover { color: var(--hot); }
.b.pinned .b-act[data-pin] { color: var(--marker-ink); }
@media (hover: none) {
  .b-acts { display: none; }
  .b.acts-open .b-acts { display: inline-flex; }
  .b-act { width: 44px; height: 44px; font-size: 19px; }
}
.b-pinned { float: left; margin: 2px 5px 0 -3px; font-size: 14px; opacity: .8; }
.b.pinned .b-bubble { box-shadow: 0 0 0 2px var(--marker-solid); }
.b.me.pinned .b-bubble { box-shadow: 0 0 0 2px var(--marker-solid), 0 0 0 .5px var(--sep); }

/* The pinned note: the property's note, kept at the top of its conversation. A highlighter strip, as the
   app marks what matters. */
.tv-pin { position: sticky; top: 0; z-index: 2; padding: 8px 10px 8px; margin-bottom: -6px; background: linear-gradient(var(--bg) 75%, transparent); }
.tv-inline .tv-pin { background: linear-gradient(var(--surface) 75%, transparent); }
.msgs-on .view-fab { display: none; }
button.th-title { color: inherit; border-radius: 10px; padding: 2px 8px; }
.tv-pin:empty { display: none; }
.pin-card {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px 10px 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--marker) 30%, var(--surface)); box-shadow: inset 3px 0 0 var(--marker-solid), 0 2px 10px rgba(0,0,0,.06);
}
.pin-ic { flex: none; margin-top: 2px; font-size: 17px; color: var(--marker-ink); }
.pin-main { flex: 1; min-width: 0; }
.pin-k { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--marker-ink); }
.pin-k span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--label-2); }
.pin-body { margin: 2px 0 0; font-size: 15.5px; line-height: 1.4; color: var(--label); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pin-body a { color: var(--tint); }
.pin-x { flex: none; width: 32px; height: 32px; margin: -4px 0 -4px; border-radius: 50%; display: grid; place-items: center; color: var(--label-3); font-size: 15px; }
.pin-x:hover { background: var(--fill); color: var(--label); }
@media (hover: none) { .pin-x { width: 44px; height: 44px; margin: -10px -4px -10px 0; } }
@media (prefers-color-scheme: dark) { .pin-card { background: color-mix(in srgb, #FFD60A 16%, var(--surface)); } }
.tv-window.min [data-dw-open] { display: none; }

/* ThreadView (comments.js): one conversation. The scroller holds the pin, the bubbles and typing; the
   composer sits under it. */
.tv { display: flex; flex-direction: column; min-height: 0; color: var(--label); }
.tv-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tv-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: 10px; }
.tv-typing .b.typing { padding: 0 12px; }
.chat-loading, .th-loading, .thr-loading { list-style: none; padding: 14px 6px; display: grid; gap: 8px; }
.th-loading i, .thr-loading i { display: block; height: 30px; border-radius: 15px; background: var(--fill); width: 62%; }
.th-loading i + i { width: 44%; justify-self: end; }
.thr-loading i { height: 56px; width: auto; border-radius: 12px; margin: 0 16px; }
.th-empty { list-style: none; padding: 28px 24px; text-align: center; font-size: 15px; line-height: 1.45; color: var(--label-3); }
.th-jump {
  position: absolute; z-index: 3; left: 50%; bottom: 70px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--surface); color: var(--tint); font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.16), 0 0 0 .5px var(--sep);
}

/* Composer */
.composer {
  flex: none; display: flex; align-items: flex-end; gap: 4px;
  padding: 7px calc(6px + var(--safe-r)) calc(7px + var(--safe-b)) calc(10px + var(--safe-l));
  background: var(--bar-2); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -.5px 0 var(--sep);
}
.composer textarea {
  flex: 1; min-width: 0; min-height: 40px; max-height: 160px; resize: none; field-sizing: content;
  padding: 9px 15px; border-radius: 20px; border: 0; outline: 0; box-shadow: inset 0 0 0 .5px var(--sep);
  background: var(--surface); color: var(--label); font-size: 16.5px; line-height: 1.33; transition: box-shadow .15s;
}
.composer textarea:focus { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 55%, transparent); }
.composer textarea::placeholder { color: var(--label-3); }
.composer-send {
  flex: none; width: 44px; height: 44px; padding: 4px; margin-bottom: -2px; border-radius: 50%;
  background: var(--tint) content-box; color: var(--tint-ink); font-size: 20px; display: grid; place-items: center;
  transition: opacity .15s, transform .2s var(--spring);
}
.composer-send:disabled { opacity: .3; cursor: default; }
.composer-send:not(:disabled):active { transform: scale(.88); }

/* Inline: the property's notes + conversation, in place of the old Note card. */
.chat-card-wrap .card-h .aside { display: inline-flex; align-items: center; gap: 8px; }
.chat-n { color: var(--label-3); font-weight: 500; }
.chat-card { padding: 0; overflow: hidden; }
.tv-inline .tv-scroll { max-height: min(56dvh, 460px); min-height: 120px; }
.tv-inline .composer { background: var(--surface-2); padding: 8px 8px 8px 10px; }
.tv-inline .composer textarea { background: var(--surface); }
.tv-inline .th-jump { bottom: 66px; }
.cm-pop { display: none; align-items: center; gap: 5px; min-height: 32px; padding: 0 10px; border-radius: 16px; color: var(--tint); font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.cm-pop svg { font-size: 15px; }
.cm-pop:hover { background: var(--tint-soft); }
@media (min-width: 760px) { .cm-pop { display: inline-flex; } }

/* Risk dot: back taxes / flood / under contract, as on the list's chips. */
.risk-dot { display: inline-block; width: 7px; height: 7px; margin: 0 5px 1px 0; border-radius: 50%; background: var(--soon); vertical-align: middle; }
.risk-dot.risk { background: var(--hot); }

/* Entry points */
.act-hbtn { display: none; }
@media (min-width: 760px) and (max-width: 1179px) { .act-hbtn { display: inline-grid; } }
.tabbar:has([data-activity]) { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.act-sseg { margin-top: 10px; position: relative; }
.act-sseg::before { content: ""; position: absolute; left: 10px; right: 10px; top: -6px; border-top: .5px solid var(--sep); }
.act-sseg .c:not([hidden]) { color: var(--tint-ink); background: var(--tint); border-radius: 9px; padding: 0 6px; font-weight: 600; font-size: 12px; line-height: 18px; }
.act-sseg.on { background: var(--fill-2); font-weight: 600; }
.msgs-on .tabbar button[data-seg] { color: var(--label-3); }
.msgs-on .tabbar button[data-activity] { color: var(--tint); }

/* Inbox (dock panel + phone screen) */
.ibx { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.ibx-tools { display: grid; gap: 8px; padding: 8px calc(16px + var(--safe-r)) 10px calc(16px + var(--safe-l)); border-bottom: .5px solid var(--sep); }
.ibx-search { height: 36px; }
.ibx-search input { font-size: 16px; }
.ib-c { margin-left: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--tint); color: var(--tint-ink); font: 600 11px/18px var(--round); }
.ibx-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.thr-list { list-style: none; margin: 0; padding: 0 0 24px; }
.thr {
  position: relative; width: 100%; min-height: 78px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px calc(16px + var(--safe-r)) 10px calc(16px + var(--safe-l)); text-align: left; color: inherit;
}
.thr-list li + li .thr::before { content: ""; position: absolute; top: 0; right: 0; left: calc(76px + var(--safe-l)); border-top: .5px solid var(--sep); }
.thr:active { background: var(--fill); }
.thr-tile.cd { width: 48px; height: 48px; align-self: center; border-radius: 13px; }
.thr-tile.cd b { font-size: 19px; }
.thr-tile.cd.word b { font-size: 12.5px; }
.thr-tile.cd span { font-size: 9.5px; margin-top: 2px; }
.thr-tile.team { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-soft); color: var(--tint); font-size: 25px; }
.thr-here { position: absolute; left: calc(50px + var(--safe-l)); top: 6px; }
.thr-here .pres-av { box-shadow: 0 0 0 2px var(--bg); }
.thr-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.thr-top { display: flex; align-items: baseline; gap: 8px; }
.thr-name { flex: 1; min-width: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thr-top time { flex: none; font-size: 13px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.thr-place { font-size: 12.5px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thr-prev { font-size: 14.5px; line-height: 1.3; color: var(--label-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.thr-prev em { font-style: normal; color: var(--tint); }
.thr.unread .thr-prev { color: var(--label); }
.thr.unread .thr-top time { color: var(--tint); font-weight: 600; }
.thr-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: grid; place-items: center; background: var(--tint); color: var(--tint-ink); font: 600 12.5px/1 var(--round); font-variant-numeric: tabular-nums; }

/* Phone thread header + context strip */
.th-head {
  position: relative; z-index: 3; flex: none; display: grid; grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr); align-items: center;
  min-height: calc(var(--safe-t) + 52px); padding: var(--safe-t) calc(10px + var(--safe-r)) 2px calc(4px + var(--safe-l));
  background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 .5px 0 var(--sep);
}
.th-back { justify-self: start; }
.th-title { min-width: 0; max-width: 56vw; text-align: center; display: flex; flex-direction: column; line-height: 1.2; }
.th-title b { font-size: 16.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-title small { font-size: 12px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-pres { justify-self: end; }
.th-ctx { padding: 12px calc(12px + var(--safe-r)) 2px calc(12px + var(--safe-l)); }
.ctx { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); text-align: left; color: inherit; }
.ctx .thr-tile.cd { width: 44px; height: 44px; border-radius: 12px; }
.ctx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ctx-street { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-sub { font-size: 13px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctx-go { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; color: var(--tint); }
.ctx-go .fwd { transform: scaleX(-1); font-size: 14px; }
.ctx.prop:hover { background: var(--surface-2); }
.ctx.team { align-items: flex-start; background: var(--tint-soft); box-shadow: none; }
.ctx.team > svg { font-size: 22px; color: var(--tint); margin-top: 1px; }
.ctx.team p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--label-2); }
.ctx.team b { color: var(--label); margin-right: 4px; }

/* Changes (event feed) */
.act-feed { padding: 0 calc(12px + var(--safe-r)) 24px calc(12px + var(--safe-l)); }
.act-day { margin: 20px 8px 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--label-2); }
.act-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.act-item + .act-item { box-shadow: inset 0 .5px 0 var(--sep); }
.act-item.is-new { background: color-mix(in srgb, var(--tint-soft) 70%, transparent); }
.act-item.ev { display: flex; gap: 11px; padding: 12px 14px; }
.ev-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; background: var(--fill); color: var(--label-2); }
.ev-ic.tint { background: var(--tint-soft); color: var(--tint); }
.ev-ic.soon { background: color-mix(in srgb, var(--soon) 14%, transparent); color: var(--soon); }
.ev-ic.hot { background: color-mix(in srgb, var(--hot) 13%, transparent); color: var(--hot); }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; color: inherit; text-decoration: none; }
.ev-street { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.ev-street.is-yes .hl { background-size: 100% 62%; }
.ev-what { font-size: 14px; color: var(--label); }
.ev-what b { font-weight: 600; }
.ev-where { font-size: 13px; color: var(--label-3); }
.act-empty { text-align: center; padding: 64px 28px; color: var(--label-2); }
.act-empty svg { font-size: 40px; color: var(--label-3); }
.act-empty h3 { margin: 10px 0 6px; font-size: 20px; color: var(--label); }
.act-empty p { margin: 0 auto; max-width: 34ch; font-size: 15px; line-height: 1.45; }

/* Phones: Messages is a tab. The inbox is a normal screen under the tab bar; a thread pushes over
   everything, sized to the visual viewport so the composer rides on the keyboard. */
.ms-inbox {
  position: absolute; inset: 0; z-index: 14; display: flex; flex-direction: column; background: var(--bg);
  padding-top: var(--safe-t); padding-bottom: calc(var(--tab-h) + var(--safe-b));
}
.ms-head { padding: 8px calc(20px + var(--safe-r)) 2px calc(20px + var(--safe-l)); }
.ms-head h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; }
.ms-inbox .ibx-tools { border-bottom: .5px solid var(--sep); }
.ms-thread {
  position: fixed; left: 0; right: 0; top: var(--vvt, 0px); height: var(--vvh, 100%); z-index: 30;
  display: flex; flex-direction: column; background: var(--bg);
  transform: translateX(100%); transition: transform .45s var(--ease), box-shadow .45s;
}
.ms-thread.show { transform: none; box-shadow: -1px 0 0 var(--sep), -20px 0 40px rgba(0,0,0,.1); }
.ms-thread.dragging { transition: none; }
.ms-thread .tv { flex: 1; }
.ms-thread .bubbles { padding-left: calc(12px + var(--safe-l)); padding-right: calc(12px + var(--safe-r)); }
.ms-thread .tv-pin { padding: 8px calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l)); }
.ms-thread .th-jump { bottom: calc(70px + var(--safe-b)); }
.ms-thread.kb .composer { padding-bottom: 7px; }
.ms-thread.kb .th-jump { bottom: 70px; }

/* Wider screens: the dock. A Messaging bar at the bottom right that opens into the inbox, with chat
   windows docked to its left. Not modal: only the dock's own boxes take clicks. */
.dock { display: none; }
@media (min-width: 760px) {
  .ms-inbox, .ms-thread { display: none !important; }
  .dock {
    position: fixed; right: calc(16px + var(--safe-r)); bottom: 0; z-index: 35;
    display: flex; align-items: flex-end; gap: 12px; pointer-events: none;
  }
  .dock > * { pointer-events: auto; }
  .dock-wins { display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 12px; pointer-events: none; }
  .dock-wins > * { pointer-events: auto; }
  .dock-ibx, .tv-window {
    display: flex; flex-direction: column; background: var(--surface); border-radius: 14px 14px 0 0;
    box-shadow: 0 0 0 .5px var(--sep), 0 -2px 24px rgba(0,0,0,.14);
  }
  @media (prefers-color-scheme: dark) { .dock-ibx, .tv-window { background: #1C1C1E; box-shadow: 0 0 0 .5px rgba(255,255,255,.12), 0 -2px 30px rgba(0,0,0,.6); } }
  .dock-ibx { width: 340px; }
  .dock-bar { display: flex; align-items: center; gap: 10px; width: 100%; height: 50px; padding: 0 12px 0 14px; border-radius: 14px 14px 0 0; text-align: left; }
  .dock-bar:hover { background: var(--fill); }
  .dock-who { display: inline-flex; }
  .dock-who .pres-av { width: 26px; height: 26px; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
  .dock-who .pres-av + .pres-av { margin-left: -9px; }
  .dock-label { flex: 1; font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
  .dock-chev { font-size: 18px; color: var(--label-2); transform: rotate(180deg); transition: transform .3s var(--ease); }
  .dock.open .dock-chev { transform: none; }
  .dock-body { display: flex; flex-direction: column; height: min(62vh, 620px); border-top: .5px solid var(--sep); }
  .dock-body .ibx-tools { padding: 10px 12px; }
  .dock .thr { min-height: 70px; padding: 8px 12px; gap: 11px; grid-template-columns: 42px minmax(0, 1fr) auto; }
  .dock .thr-tile.cd, .dock .thr-tile.team { width: 42px; height: 42px; }
  .dock .thr-tile.team { font-size: 22px; }
  .dock .thr-tile.cd b { font-size: 17px; }
  .dock .thr-here { left: 40px; }
  .dock .thr-list li + li .thr::before { left: 65px; }
  .dock .thr:hover { background: var(--fill); }
  .dock .thr.sel { background: var(--tint-soft); }
  .dock .thr-name { font-size: 15px; }
  .dock .thr-prev { font-size: 13.5px; -webkit-line-clamp: 1; }
  .dock .act-feed { padding: 0 10px 16px; }

  /* Chat windows */
  .tv-window { width: 360px; height: min(540px, calc(100dvh - 90px)); }
  .tv-window.min { width: 240px; height: auto; }
  .dw-head { flex: none; display: flex; align-items: center; gap: 2px; min-height: 56px; padding: 0 4px 0 6px; border-bottom: .5px solid var(--sep); border-radius: 14px 14px 0 0; }
  .tv-window.min .dw-head { border-bottom: 0; min-height: 50px; }
  .dw-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 6px; border-radius: 10px; text-align: left; color: inherit; }
  .dw-title:hover { background: var(--fill); }
  .dw-tile.cd, .dw-tile.team { width: 36px; height: 36px; border-radius: 10px; flex: none; }
  .dw-tile.cd b { font-size: 15px; }
  .dw-tile.cd span { font-size: 8px; margin-top: 1px; }
  .dw-tile.cd.word b { font-size: 10.5px; }
  .dw-tile.team { border-radius: 50%; font-size: 20px; }
  .dw-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .dw-t b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dw-t small { font-size: 12px; color: var(--label-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tv-window.min .dw-tile { width: 30px; height: 30px; }
  .tv-window.min .dw-tile.cd b { font-size: 13px; }
  .tv-window.min .dw-tile.cd span { display: none; }
  .dw-pres .pres > span:last-child { display: none; }
  .dw-pres .pres-av { box-shadow: 0 0 0 2px var(--surface); }
  .dw-btn { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--label-2); font-size: 17px; }
  .dw-btn:hover { background: var(--fill); color: var(--label); }
  .dw-btn .up { transform: rotate(180deg); }
  .tv-window .tv-body { background: var(--bg); }
  .tv-window .bubbles { padding: 4px 10px 2px; }
  .tv-window .b-bubble { font-size: 14.5px; max-width: 82%; padding: 7px 12px 8px; }
  .tv-window .b-name { margin-left: 44px; }
  .tv-window .b-av, .tv-window .b-av-sp { width: 26px; }
  .tv-window .av.b-av { width: 26px; height: 26px; font-size: 10px; }
  .tv-window .composer { background: var(--surface); padding: 8px 6px 8px 10px; }
  .tv-window .composer textarea { font-size: 14.5px; min-height: 36px; padding: 8px 13px; background: var(--fill); box-shadow: none; }
  .tv-window .composer-send { width: 40px; height: 40px; font-size: 18px; }
  .tv-window .th-jump { bottom: 64px; }
  .tv-window .pin-body { font-size: 14px; -webkit-line-clamp: 3; }
  .tv-window .th-empty { font-size: 14px; padding: 24px 18px; }
  .b-bubble { font-size: 15.5px; }

  /* Room for the dock under the app's own bottom-right furniture. */
  .d-body { padding-bottom: 96px; }
  .map-card, .draw-bar { bottom: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  .ms-thread, .dock-chev { transition: none; }
}

/* Account sheet: email settings */
.acct-mail { margin-bottom: 22px; }
.acct-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 0 12px 0 16px; }
.acct-line + .acct-line { box-shadow: inset 0 .5px 0 var(--sep); }
.inset .acct-line span { width: auto; font-size: 15px; }
.acct-line .seg { width: 210px; flex: none; }
.acct-line input[type="checkbox"] { width: auto; height: auto; flex: none; accent-color: var(--tint); transform: scale(1.15); }
.acct-hint { margin: 8px 4px 0; font-size: 12.5px; line-height: 1.4; color: var(--label-3); }
.acct-hint.warn { color: var(--soon); }

/* Login: forgot password */
.auth-forgot { display: block; margin: 14px auto 0; font-size: 15px; }
.auth-forgot-form[hidden] { display: none; }
.auth-forgot[hidden] { display: none; }

/* map + rules */
/* Map view (map.js), buy box sheet (rules.js), linked-notice badge + sale-date timeline. */
.fwd { transform: rotate(180deg); }

/* Phone: the map covers the list under the tab bar; detail still pushes over it. */
.map-pane { position: absolute; inset: 0; z-index: 10; background: var(--bg); overflow: hidden; transition: transform .5s var(--ease), filter .5s var(--ease); }
.app[data-view="detail"] .map-pane { transform: translateX(-28%); filter: brightness(.92); }
.app.dragging .map-pane { transition: none; }
.map-pane .map-canvas { position: absolute; inset: 0; } /* beats .maplibregl-map { position: relative } */
.map-canvas .maplibregl-canvas { outline: none; }
.map-pane .maplibregl-ctrl-bottom-right { bottom: calc(var(--tab-h) + var(--safe-b)); }
.maplibregl-ctrl-attrib { font-size: 11px; }
.map-err { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; padding: 32px; color: var(--label-2); }
.map-err > svg { font-size: 40px; color: var(--label-3); }
.map-err h2 { margin: 10px 0 4px; font-size: 19px; color: var(--label); }
.map-err p { margin: 0 0 16px; font-size: 15px; }

.glass {
  background: var(--bar-2);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.map-top, .map-btn, .map-chip, .map-card, .draw-bar, .view-fab { -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.map-top {
  position: absolute; z-index: 3; top: calc(var(--safe-t) + 8px); left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r));
  height: 48px; padding: 0 2px 0 18px; border-radius: 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bar-2); box-shadow: 0 1px 0 var(--sep), 0 6px 20px rgba(0,0,0,.1);
}
.map-title { font-weight: 650; font-size: 17px; letter-spacing: -.015em; }
.map-hud { position: absolute; z-index: 2; top: calc(var(--safe-t) + 66px); left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.map-hud > * { pointer-events: auto; }
.map-chip { padding: 6px 11px; border-radius: 12px; background: var(--bar-2); font-size: 13px; color: var(--label-2); box-shadow: 0 1px 0 var(--sep), 0 4px 14px rgba(0,0,0,.08); font-variant-numeric: tabular-nums; }
.map-chip:empty { display: none; }
.map-chip b { color: var(--label); font-weight: 650; }
.map-tools { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 0 var(--sep), 0 6px 20px rgba(0,0,0,.12); }
.map-btn { width: 44px; height: 44px; display: grid; place-items: center; background: var(--bar-2); color: var(--tint); font-size: 21px; }
.map-btn + .map-btn { box-shadow: inset 0 .5px 0 var(--sep); }
.map-btn:active { background: var(--fill-2); }
.map-pane.drawing [data-map="draw"] { background: var(--tint); color: var(--tint-ink); }

/* Pin card, draw bar: float above the tab bar + view toggle on phones */
.map-card, .draw-bar {
  position: absolute; z-index: 4; left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r));
  bottom: calc(var(--tab-h) + var(--safe-b) + 66px);
  border-radius: 20px; background: var(--bar-2);
  box-shadow: 0 0 0 .5px var(--sep), 0 12px 36px rgba(0,0,0,.2);
  animation: card-in .38s var(--spring);
}
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.mc { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 12px 10px 12px 12px; cursor: pointer; }
.mc .cd { height: 52px; }
.mc-body { min-width: 0; }
.mc-addr { font-weight: 650; font-size: 17px; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-sub { font-size: 14px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-stats { margin-top: 3px; font-size: 14px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.mc-stats b { font-family: var(--round); font-size: 16px; color: var(--label); font-weight: 700; }
.mc-stats .sep { margin: 0 5px; opacity: .6; }
.mc-stats.muted { color: var(--label-3); }
.mc .chips { margin-top: 7px; }
.mc.is-no .mc-body, .mc.is-no .cd { opacity: .6; }
.mc-acts { display: flex; flex-direction: column; gap: 4px; }
.mc-btn { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; background: var(--fill); }
.mc-btn.yes { color: var(--marker-solid); }
.mc-btn.no { color: var(--not); }
.mc-btn.yes[aria-pressed="true"] { background: var(--marker-solid); color: #2E2200; }
.mc-btn.no[aria-pressed="true"] { background: var(--not); color: #fff; }
.mc-btn:active { transform: scale(.94); }
.chip.why { background: color-mix(in srgb, var(--hot) 10%, transparent); color: var(--label-2); }

.mc-area { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 10px 8px 10px 16px; min-height: 64px; }
.mc-area .mc-body b { display: block; font-size: 16px; }
.mc-area .mc-body span { font-size: 13.5px; color: var(--label-2); }
.icon-btn.danger { color: var(--hot); }
.icon-btn.confirm { width: auto; padding: 0 12px; font-size: 15px; font-weight: 600; background: color-mix(in srgb, var(--hot) 12%, transparent); }
.swatch { width: 16px; height: 16px; border-radius: 5px; border: 2px dashed var(--hot); background: color-mix(in srgb, var(--hot) 16%, transparent); flex: none; }
.swatch.include { border-color: var(--tint); background: var(--tint-soft); }

.draw-bar { padding: 12px 12px 10px 16px; }
.draw-bar p { margin: 2px 0 8px; font-size: 15px; color: var(--label); }
.db-btns { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.db-btns .text-btn:first-child { margin-right: auto; }
.text-btn:disabled { opacity: .4; }
.pill-btn.sm { min-height: 40px; padding: 0 18px; font-size: 15px; }
.db-name { display: grid; gap: 10px; }
.db-name input { height: 44px; border: 0; outline: 0; border-radius: 12px; padding: 0 14px; background: var(--fill); font-size: 16px; color: var(--label); }
.db-name input:focus-visible { box-shadow: 0 0 0 2px var(--tint); }

.view-fab {
  position: fixed; z-index: 16; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 12px);
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 18px 0 15px; border-radius: 22px;
  background: color-mix(in srgb, var(--label) 88%, transparent); color: var(--bg); font-weight: 650; font-size: 15px;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  transition: transform .45s var(--ease), opacity .3s;
}
.view-fab svg { font-size: 19px; }
.view-fab:active { transform: translateX(-50%) scale(.95); }
.app[data-view="detail"] ~ .view-fab, .app[data-view="detail"] .view-fab { transform: translate(-50%, 140px); opacity: 0; pointer-events: none; }
.app[data-mode="map"] .view-fab { background: var(--bar-2); color: var(--tint); box-shadow: 0 0 0 .5px var(--sep), 0 8px 24px rgba(0,0,0,.18); }
.map-pane.drawing ~ .view-fab { opacity: 0; pointer-events: none; }
.seg-view { display: none; }

/* List: postponement badge, hidden-by-rules affordances */
.chip.moved { font-variant-numeric: tabular-nums; }
.why { display: flex; align-items: baseline; gap: 5px; margin-top: 2px; font-size: 13.5px; color: var(--hot); min-width: 0; }
.why svg { flex: none; font-size: 13px; transform: translateY(2px); }
.why span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.why .sep { margin: 0 5px; opacity: .55; }
.hidden-link {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 32px); margin: 18px auto 8px;
  min-height: 44px; border-radius: 12px; color: var(--label-2); font-size: 15px; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--sep);
}
.hidden-link svg { font-size: 17px; color: var(--label-3); }
.hidden-link .fwd { font-size: 13px; }
.hidden-link:active { background: var(--fill); }
.hidden-head button { white-space: nowrap; }
.hidden-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 20px 2px; font-size: 14px; color: var(--label-2); }
.sub-link { color: var(--tint); font-weight: 500; font-size: inherit; padding: 6px 0; margin: -6px 0; }

/* Buy box entry in the sidebar / filter sheet */
.buybox-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; width: 100%;
  min-height: 58px; padding: 10px 12px; text-align: left; border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow);
}
.bb-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--tint-soft); color: var(--tint); font-size: 19px; }
.bb-t b { display: block; font-size: 16px; font-weight: 600; }
.bb-t small { display: block; font-size: 13px; color: var(--label-2); margin-top: 1px; }
.buybox-row .fwd { color: var(--label-3); font-size: 14px; }

/* Sale-date timeline across linked notices */
.sale-dates li.cur .ev { font-weight: 600; }
.sale-dates li.cur .ev::before { background: var(--marker-solid); box-shadow: 0 0 0 3px color-mix(in srgb, var(--marker-solid) 30%, transparent); }
.sale-dates li.moved .ev::before { background: var(--soon); }
.sale-dates .to { font-weight: 600; }
.sale-dates li:not(.cur) .to { color: var(--label-2); }
.sale-dates li.moved + li .to, .sale-dates .arrow { color: var(--soon); }
.sale-dates .ev small { font-size: 11.5px; }
.cur-tag { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--tint-soft); color: var(--tint); }
.sd-foot { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 16px 12px; border-top: .5px solid var(--sep); font-size: 13px; color: var(--label-3); }
.sd-foot svg { font-size: 14px; margin-top: 2px; flex: none; }

/* Buy box sheet: bottom sheet on phones, side panel on wide screens */
.rules-sheet {
  position: fixed; inset: auto 0 0 0; margin: 0; width: 100%; max-width: none; max-height: 92dvh; height: 92dvh;
  border: 0; padding: 0; border-radius: 16px 16px 0 0;
  background: var(--bg); color: var(--label);
  box-shadow: var(--sheet-shadow);
  display: none; flex-direction: column;
  transform: translateY(100%); transition: transform .42s var(--ease);
}
.rules-sheet[open] { display: flex; }
.rules-sheet.in { transform: none; }
.rules-sheet::backdrop { background: rgba(0,0,0,.32); }
.rs-head { flex: none; padding: 0 12px 6px 20px; border-bottom: .5px solid var(--sep); }
.rs-top { display: flex; align-items: flex-start; justify-content: space-between; padding-top: 6px; }
.rs-top h2 { margin: 6px 0 0; font-size: 24px; letter-spacing: -.022em; }
.rs-sub { margin: 2px 0 0; font-size: 15px; color: var(--label-2); font-variant-numeric: tabular-nums; }
.rs-sub b { color: var(--hot); }
.rs-hidden { padding: 0; margin: 0 0 2px; }
.rs-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px calc(28px + var(--safe-b)); }
.rs-intro { margin: 12px 4px 4px; font-size: 14px; color: var(--label-2); }
.rs-scroll .fgroup-h { margin: 22px 0 8px 4px; }
.rgroup { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.rrow { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 12px 6px 16px; position: relative; width: 100%; text-align: left; font-size: 16px; }
.rrow + .rrow::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--sep); }
.rl { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.rl small { display: block; color: var(--label-2); font-size: 13px; }
.area .rl { flex-direction: column; gap: 0; }
.rc { font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--hot); font-variant-numeric: tabular-nums; }
.rc:empty { display: none; }
.rc::before { content: "−"; }
.rgroup .rin {
  flex: none; width: 86px; height: 36px; border: 0; outline: 0; border-radius: 9px; padding: 0 10px;
  background: var(--fill); color: var(--label); font-size: 16px; text-align: right; font-variant-numeric: tabular-nums;
}
.rgroup .rin.wide { width: 112px; }
.rgroup .rin:focus { box-shadow: 0 0 0 2px var(--tint); }
.rgroup .rin.bad { box-shadow: 0 0 0 2px var(--hot); }
.rgroup .rin::placeholder { color: var(--label-3); }
.range .rl { flex: 1; }
.dash { color: var(--label-3); }
.steps { flex: none; grid-auto-columns: minmax(40px, auto); }
.steps button { padding: 0 8px; }
.rs-chips { margin-top: 2px; }
.rrow.add { color: var(--tint); font-weight: 500; gap: 12px; }
.rrow.add svg { font-size: 20px; }
.icon-btn.sm { width: 40px; height: 40px; font-size: 19px; }
.rs-hint { margin: 8px 4px 0; }
.rs-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 4px 0; font-size: 13px; color: var(--label-3); }
.text-btn.danger { color: var(--hot); }

/* iOS-style switch */
.switch { position: relative; flex: none; width: 51px; height: 31px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--fill-2); transition: background .25s; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2), 0 0 0 .5px rgba(0,0,0,.04); transition: transform .3s var(--spring); }
.switch input:checked + i { background: var(--tint); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2.5px solid var(--tint); outline-offset: 2px; }
.rrow.sw { cursor: pointer; }

@media (min-width: 760px) {
  .seg-view { display: grid; flex: none; width: 92px; align-self: center; }
  .seg-view button { height: 30px; font-size: 17px; color: var(--label-2); }
  .seg-view button[aria-checked="true"] { color: var(--tint); }
  .view-fab { display: none; }
  .detail-pane, .map-pane { grid-row: 1; grid-column: -2 / -1; }
  .map-pane { position: relative; inset: auto; transform: none !important; filter: none !important; z-index: auto; border-left: 0; }
  .app[data-mode="map"] .detail-pane { display: none; }
  .map-top { display: none; }
  .map-hud { top: calc(var(--safe-t) + 14px); left: 14px; right: 14px; }
  .map-pane .maplibregl-ctrl-bottom-right { bottom: 0; }
  .map-card, .draw-bar { left: auto; right: 16px; width: min(440px, calc(100% - 32px)); bottom: 34px; }
  .rules-sheet { inset: 16px 16px 16px auto; width: 420px; height: auto; max-height: calc(100dvh - 32px); border-radius: 18px; transform: translateX(calc(100% + 24px)); }
  .rules-sheet .sheet-grab { display: none; }
  .rs-top { padding-top: 14px; }
  .row.sel .why { color: var(--hot); }
}
@media (min-width: 1180px) {
  .fgroup:has(.buybox-row) { margin-top: 14px; }
  .buybox-row { min-height: 50px; padding: 8px 10px; border-radius: 10px; box-shadow: none; background: var(--fill); }
  .bb-ic { width: 28px; height: 28px; font-size: 16px; border-radius: 7px; }
  .bb-t b { font-size: 14.5px; }
  .bb-t small { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .map-card, .draw-bar { animation: none; }
}
@media (max-width: 759.98px) {
  .list-pane { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 80px); }
}
.area .rl { white-space: normal; }
.sale-dates .ev small .mono { font-size: 11px; }
.sale-dates .ev small { font-weight: 400; }
