@import url("/assets/icons.css");

:root {
  color-scheme: light;
  --ink: #182b3e;
  --muted: #53657a;
  --low: #68798d;
  --line: #dbe4ec;
  --paper: #fff;
  --surface: #f3f6fa;
  --nav: #173343;
  --nav-muted: #afc1cc;
  --primary: #1a5bd3;
  --primary-hover: #174aaa;
  --green: #08684e;
  --radius: 12px;
  --shadow: 0 1px 2px #172b4010;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; margin: 0; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; }
p, h1, h2, h3, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.028em; }
h1 { font-size: clamp(1.65rem, 3vw, 2.32rem); font-weight: 720; }
h2 { font-size: 1.2rem; font-weight: 690; }
h3 { font-size: 1rem; font-weight: 680; }
code { overflow-wrap: anywhere; font-size: .9em; }
:focus-visible { outline: 2px solid #1f72ef; outline-offset: 3px; }
.sr-only { position: absolute; clip-path: inset(50%); white-space: nowrap; width: 1px; height: 1px; overflow: hidden; }
.subtle, .source-note { color: var(--muted); }
.source-note { font-size: .84rem; display: flex; align-items: baseline; gap: .5rem; margin-top: 1.2rem; }
.initial { display: grid; min-height: 100vh; place-items: center; padding: 1rem; }
.loading, .empty { color: var(--muted); padding: 2.2rem 1.2rem; }
.empty { display: grid; align-content: center; justify-items: center; min-height: 136px; gap: 10px; text-align: center; }
.empty .bi { font-size: 1.35rem; }
.error-panel { color: #a82a26; background: #fff1f0; border: 1px solid #f1cbc8; border-radius: 8px; padding: 10px 12px; }
.spaced { margin-top: 16px; }

.button, .icon-button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  min-height: 38px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.28;
  font-weight: 630;
}
.button { padding: 8px 13px; }
.icon-button { width: 36px; min-height: 36px; flex: 0 0 auto; }
.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.primary:hover { background: var(--primary-hover); }
.quiet { background: #fff; border-color: #d5e0e9; }
.quiet:hover, .icon-button:hover { background: #edf3f9; }
.quiet[aria-pressed="true"] { color: #144fc0; background: #e9f0ff; border-color: #c8d8f9; }
.text-button { color: #184eab; padding-inline: 8px; }
.text-button:hover { background: #edf3ff; }
.danger { color: #a62b24; }
.danger-solid, .danger-solid:hover { background: #a62b24; border-color: #a62b24; }
.field { display: grid; gap: 6px; min-width: 0; font-size: .89rem; font-weight: 610; }
.field > span { color: var(--muted); }
.field input, .field select, .field textarea {
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfdbe7;
  border-radius: 8px;
  min-width: 0;
  min-height: 40px;
  padding: 9px 11px;
  width: 100%;
  font-weight: 480;
}
.field input::placeholder { color: #708196; }
.field textarea { resize: vertical; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); vertical-align: middle; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; gap: 8px; align-items: center; }
form > * + *, .padded > * + * { margin-top: 14px; }

.login {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 26px 16px;
  position: relative;
  background: linear-gradient(110deg, #0b25305c, #132d3e37), url("/assets/aerial.webp") center center / cover, #345762;
}
.login-card {
  width: min(100%, 374px);
  background: #fff;
  border: 1px solid #ffffff8c;
  border-radius: 12px;
  box-shadow: 0 14px 42px #0e233b52;
  text-align: center;
  padding: 23px 24px;
}
.login-logo { display: block; margin: 0 auto 12px; }
.login h1 { font-size: 1.75rem; font-weight: 590; }
.login-tenant { color: var(--muted); margin: 5px 0 18px; }
.login form { text-align: left; }
.login form .field input { min-height: 45px; }
.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.reveal { position: absolute; right: 5px; bottom: 5px; color: var(--muted); }
.login-submit { width: 100%; min-height: 42px; }
.lab-accounts { background: #f1f5fa; margin-top: 18px; border: 1px solid #e7edf3; border-radius: 9px; padding: 13px; }
.lab-accounts p { color: var(--muted); font-size: .87rem; margin-bottom: 9px; }
.lab-accounts div { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.lab-accounts button { min-height: 34px; }
.imagery-credit { position: fixed; right: 9px; bottom: 8px; color: #fff; background: #142633d9; border-radius: 4px; padding: 2px 6px; font-size: .72rem; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 216px minmax(0, 1fr); grid-template-rows: 62px 1fr; }
.skip { position: fixed; z-index: 9; top: 5px; left: 5px; transform: translateY(-200%); background: #fff; border: 2px solid var(--primary); border-radius: 4px; padding: 8px 12px; }
.skip:focus { transform: translateY(0); }
.topbar {
  grid-column: 1 / -1;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 0 24px 0 19px;
  background: white;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  min-width: 185px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  font-size: 1.27rem;
  line-height: 1;
  letter-spacing: -.043em;
  text-decoration: none;
}
.brand-dot { color: #188569; }
.tenant-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 580; }
.tenant-label .bi { color: #5d748e; }
.tenant-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-label {
  font-size: .74rem;
  font-weight: 650;
  background: #eff4f8;
  color: #4f6278;
  border: 1px solid #e3ebf3;
  border-radius: 20px;
  padding: 2px 8px;
}
.menu-toggle { display: none; font-size: 1.4rem; }
.account { margin-left: auto; position: relative; }
.account summary { display: flex; align-items: center; gap: 9px; list-style: none; }
.account summary::-webkit-details-marker { display: none; }
.avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; color: #065e49; background: #daf0e8; font-size: .79rem; font-weight: 770; }
.account-name { display: grid; font-size: .83rem; font-weight: 680; white-space: nowrap; }
.account-name small { font-size: .73rem; font-weight: 520; color: var(--muted); }
.account-menu {
  width: 230px;
  position: absolute;
  z-index: 2;
  right: 0;
  top: calc(100% + 10px);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px;
  background: #fff;
  box-shadow: 0 8px 30px #17304422;
}
.account-menu p { color: var(--muted); padding: 7px 9px; overflow-wrap: anywhere; }
.account-menu a, .account-menu button { display: block; border: 0; border-radius: 5px; background: transparent; text-align: left; width: 100%; padding: 7px 9px; color: var(--ink); text-decoration: none; }
.account-menu a:hover, .account-menu button:hover { background: #edf3f9; }
.sidebar { background: var(--nav); color: #f0f5fa; padding: 22px 11px; display: flex; flex-direction: column; gap: 24px; }
.sidebar nav { position: sticky; top: 84px; }
.sidebar nav p { color: var(--nav-muted); margin: 0 9px 7px; font-size: .73rem; font-weight: 710; letter-spacing: .055em; text-transform: uppercase; }
.sidebar nav p:not(:first-child) { margin-top: 24px; }
.sidebar nav a { display: flex; gap: 10px; min-height: 38px; align-items: center; margin: 2px 0; padding: 8px 9px; border-radius: 7px; color: #e0eaf0; text-decoration: none; font-weight: 535; }
.sidebar nav a .bi { width: 17px; flex: 0 0 auto; color: #b7ceda; }
.sidebar nav a:hover { background: #ffffff14; }
.sidebar nav a[aria-current="page"] { color: #fff; background: #32617a; font-weight: 660; }
.sidebar nav a[aria-current="page"] .bi { color: #fff; }
.sidebar-footer { margin: auto 9px 0; padding-top: 12px; border-top: 1px solid #ffffff26; color: #cee0e9; font-size: .84rem; overflow-wrap: anywhere; }
.sidebar-footer .bi { margin-right: 6px; }
.workspace { min-width: 0; padding: 25px clamp(14px, 2.5vw, 36px) 42px; }
.workspace:focus { outline: none; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-header p { font-size: .95rem; margin-top: 5px; color: var(--muted); }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.padded { padding: 19px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; align-items: start; }
.entry-layout { grid-template-columns: minmax(0, .92fr) minmax(0, 1fr); }
.access-layout { grid-template-columns: minmax(0, 1.08fr) minmax(0, .72fr); }
.panel-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 15px 17px; }
.panel-bar .field { min-width: 144px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 17px; }
.metric {
  background: #fff;
  min-width: 0;
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 13px;
  text-decoration: none;
}
a.metric:hover { border-color: #b5c7de; }
.metric-icon { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; font-size: 1.12rem; }
.blue { color: #1b56ac; background: #e8f0ff; }
.mint { color: #12634f; background: #ddf2ea; }
.amber { color: #7c4511; background: #fff0da; }
.violet { color: #5f439b; background: #efe9f9; }
.metric-label { display: block; font-size: .83rem; color: var(--muted); font-weight: 580; }
.metric strong { display: block; margin-top: 1px; font-size: 1.48rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric > .bi { margin: 0 0 auto auto; color: #687e92; font-size: .73rem; }
.filters { padding: 13px 14px; }
.filters-main, .filters-extra, .inline-form { display: grid; align-items: end; gap: 9px; }
.filters-main { grid-template-columns: minmax(0, 1.6fr) minmax(110px, .9fr) minmax(110px, .9fr) auto auto; }
.filters-extra { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; }
.filters .button, .inline-form .button { min-height: 40px; }
.search-field { position: relative; }
.search-field .bi { position: absolute; left: 11px; top: 14px; color: var(--low); }
.search-field input { padding-left: 33px; }
.results-header { margin: 17px 0 10px; display: flex; justify-content: space-between; align-items: center; gap: 11px; }
.results-header h2 { font-size: 1.12rem; }
.results-controls, .segmented { display: flex; align-items: center; gap: 7px; }
.segmented { background: #e8eef5; border: 1px solid #dce5ef; border-radius: 9px; gap: 2px; padding: 3px; }
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 6px;
  padding: 6px 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 640;
}
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.market-results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.market-results.with-map { grid-template-columns: minmax(460px, 1.03fr) minmax(0, 1fr); }
.listing-panel { max-height: 550px; overflow: auto; scrollbar-width: thin; }
.table-wrap { min-width: 0; overflow: auto; scrollbar-width: thin; }
table { border-collapse: collapse; width: 100%; text-align: left; }
thead th { font-size: .76rem; color: var(--muted); font-weight: 690; background: #f7f9fc; white-space: nowrap; }
th, td { padding: 10px 12px; }
th, tr:not(:last-child) td { border-bottom: 1px solid #e6edf4; }
tbody tr:hover { background: #f8fafd; }
tbody td { font-size: .9rem; }
.table-number { white-space: nowrap; font-weight: 680; font-variant-numeric: tabular-nums; }
.cell-secondary { display: block; color: var(--muted); font-size: .78rem; }
.result-link { color: #174b9f; border: 0; background: transparent; display: block; text-align: left; padding: 3px 0; font-size: .93rem; }
.result-link:hover strong { text-decoration: underline; }
.result-link small { display: block; font-size: .79rem; font-weight: 520; color: var(--muted); }
.result-link strong { font-weight: 690; }
.save-button { color: #5b6e82; }
.save-button[aria-pressed="true"] { color: #885500; background: #fff8e7; }
.tag { display: inline-flex; align-items: center; border-radius: 20px; padding: 3px 8px; font-weight: 660; font-size: .75rem; white-space: nowrap; background: #eaf0f7; color: #415573; }
.tag.mint { background: #e3f4ed; color: #075e46; }
.tag.amber { background: #fff0da; color: #7b4210; }
.dpe { display: inline-grid; min-width: 25px; height: 23px; place-items: center; border-radius: 4px; font-size: .8rem; font-weight: 770; }
.dpe-a { color: #fff; background: #28723d; }
.dpe-b { color: #154320; background: #b4df96; }
.dpe-c { color: #374919; background: #d5e9ac; }
.dpe-d { color: #584514; background: #f2e1a0; }
.dpe-e { color: #764315; background: #ffda9a; }
.dpe-f { color: #842f13; background: #ffc2a3; }
.dpe-g { color: #8f251f; background: #ffbfbe; }

.map-panel { min-height: 435px; max-height: 550px; position: relative; overflow: hidden; border: 1px solid #cbdbe5; border-radius: var(--radius); background: #e9ede7; }
.map-stage, .map-overlays { position: absolute; inset: 0; overflow: hidden; }
.map-stage { cursor: grab; touch-action: pan-y; }
.map-stage.dragging { cursor: grabbing; }
.map-stage img { position: absolute; max-width: none; user-select: none; pointer-events: none; }
.map-marker {
  transform: translate(-50%, -100%);
  position: absolute;
  z-index: 1;
  border: 1px solid #ffffff;
  border-radius: 18px;
  background: #1f58aa;
  color: #fff;
  padding: 4px 7px;
  box-shadow: 0 2px 5px #163f6677;
  white-space: nowrap;
  font-size: .72rem;
  font-weight: 730;
}
.map-marker:hover, .map-marker:focus { z-index: 2; background: #12356f; }
.map-controls { position: absolute; top: 10px; right: 10px; z-index: 3; display: grid; gap: 3px; }
.map-control { display: grid; place-content: center; width: 34px; height: 33px; border: 1px solid #c9d7e1; background: #fff; border-radius: 7px; box-shadow: var(--shadow); color: var(--ink); font-weight: 720; font-size: 1.15rem; }
.map-control:hover { background: #edf3f9; }
.map-attribution { position: absolute; right: 0; bottom: 0; background: #ffffffed; padding: 2px 6px; color: #45586d; font-size: .65rem; }
.inline-form { grid-template-columns: minmax(0, 440px) auto; justify-content: start; }
.inline-form > * + * { margin-top: 0; }
.inline-form .error-panel { grid-column: 1 / -1; }
.candidates { list-style: none; padding: 0; margin: 0; }
.candidates > li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: start; gap: 8px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.candidates > li:last-child { border: 0; }
.candidates p, .candidates ul { color: var(--muted); font-size: .82rem; }
.candidates ul { margin-top: 4px; padding-left: 14px; }
.candidates .result-link { padding-top: 0; }
.candidate-number { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; font-weight: 700; color: #154d9e; background: #ecf3ff; }
.endpoints > div + div { margin-top: 10px; }
.endpoints dt { color: var(--muted); font-size: .83rem; font-weight: 650; }
.endpoints dd { padding: 5px 0; }
.api-spec { color: #174b9f; font-size: .86rem; }

.dialog { width: min(calc(100vw - 26px), 545px); max-height: calc(100dvh - 26px); padding: 0; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); box-shadow: 0 20px 55px #0b23345c; }
.dialog-wide { width: min(calc(100vw - 26px), 830px); }
.dialog::backdrop { background: #122b40a0; }
.dialog-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px 9px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.dialog-body { padding: 19px 20px 20px; }
.dialog-body > * + * { margin-top: 16px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; }
.listing-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.listing-heading h3 { font-size: clamp(1.25rem, 3vw, 1.7rem); margin-bottom: 3px; }
.listing-heading p { color: var(--muted); }
.listing-heading > strong { font-size: clamp(1rem, 3vw, 1.6rem); white-space: nowrap; color: #164a97; }
.property-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.property-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 9px; }
.facts > div { background: #f6f9fc; border: 1px solid #edf2f6; border-radius: 8px; padding: 9px; overflow-wrap: anywhere; }
.facts dt { color: var(--muted); font-size: .75rem; }
.facts dd { margin-top: 3px; font-weight: 670; }
.detail-blocks { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
.detail-blocks section { border: 1px solid var(--line); border-radius: 9px; padding: 12px; min-width: 0; }
.detail-blocks section:first-child { grid-column: 1 / -1; }
.detail-blocks section h3 { margin-bottom: 9px; }
.valuation-preview > * + * { margin-top: 9px; }
.price-band { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.price-band > div { border-radius: 8px; padding: 9px 11px; background: #eef4ff; }
.price-band span { display: block; font-size: .76rem; color: var(--muted); }
.price-band strong { color: #17478f; font-size: clamp(.85rem, 2vw, 1.23rem); }
#print-report > * + * { margin-top: 14px; }
.announcement { position: fixed; right: 14px; bottom: 14px; z-index: 8; max-width: calc(100vw - 28px); }
.announcement div { display: flex; align-items: center; gap: 9px; border-radius: 8px; background: #174634; color: #fff; padding: 9px 12px; box-shadow: 0 3px 12px #16302633; }

@media (max-width: 1200px) {
  .shell { grid-template-columns: 192px minmax(0, 1fr); }
  .brand { min-width: 162px; }
  .market-results.with-map { grid-template-columns: minmax(390px, 1.05fr) minmax(0, 1fr); }
  .listing-panel th, .listing-panel td { padding-inline: 8px; }
}
@media (max-width: 980px) {
  .market-results.with-map { grid-template-columns: minmax(0, 1fr); }
  .map-panel { grid-row: 1; min-height: 335px; }
  .metric { min-height: 70px; gap: 8px; padding: 9px; }
  .metric-icon { width: 33px; height: 33px; }
  .metric > .bi { display: none; }
  .entry-layout, .access-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 780px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px 1fr; }
  .topbar { gap: 9px; padding-inline: 8px 12px; }
  .menu-toggle { display: inline-flex; }
  .brand { min-width: auto; gap: 6px; }
  .brand img { width: 27px; height: 27px; }
  .brand > span { font-size: 1.17rem; }
  .topbar .lab-label { display: none; }
  .sidebar { display: none; position: fixed; inset: 56px auto 0 0; width: min(255px, 80vw); z-index: 4; overflow-y: auto; box-shadow: 10px 0 30px #172c4338; }
  .sidebar nav { position: static; }
  .navigation-open .sidebar { display: flex; }
  .workspace { padding-top: 18px; }
  .account-name { display: none; }
  .tenant-label .bi { display: none; }
  .tenant-label { font-size: .78rem; min-width: 0; margin-left: auto; }
  .account { margin-left: 3px; }
}
@media (max-width: 610px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { min-height: 60px; }
  .metric strong { font-size: 1.33rem; }
  .metric-icon { width: 34px; height: 34px; }
  .filters-main, .filters-extra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-field { grid-column: 1 / -1; }
  .filters-main button, .filters-extra button { width: 100%; }
  .page-header { flex-wrap: wrap; margin-bottom: 14px; }
  .page-header > .button { min-height: 35px; }
  .results-controls { gap: 4px; }
  .results-controls > .button, .segmented button { padding-inline: 7px; }
  .map-panel { min-height: 310px; }
  .listing-panel { max-height: none; }
  .listing-panel th, .listing-panel td { padding: 8px 6px; }
  .listing-panel th:nth-child(3), .listing-panel td:nth-child(3) { display: none; }
  .listing-panel .result-link { font-size: .85rem; }
  .dialog-header { padding-left: 13px; }
  .dialog-body { padding: 13px; }
  .detail-blocks { grid-template-columns: minmax(0, 1fr); }
  .listing-heading { flex-wrap: wrap; }
  .form-grid { gap: 10px; }
}
@media (max-width: 360px) {
  .topbar .brand > span { display: none; }
  .tenant-label { margin-left: 2px; }
  .account { margin-left: auto; }
  .listing-panel th:nth-child(5), .listing-panel td:nth-child(5) { display: none; }
}
@media print {
  body:has(#print-report) #app,
  body:has(#print-report) .announcement,
  .dialog:has(#print-report) .dialog-header,
  .dialog:has(#print-report) .dialog-actions { display: none; }
  .dialog:has(#print-report) { display: block; position: static; width: 100%; max-width: none; max-height: none; border: 0; margin: 0; box-shadow: none; }
  .dialog:has(#print-report)::backdrop { display: none; }
}

.price-delta {
  display: block;
  color: #854a12;
  font-size: .76rem;
  font-weight: 680;
  white-space: nowrap;
}

/* Market records and field tours */
.records-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  align-items: end;
  gap: 10px;
  max-width: 900px;
}
.records-filters .button { min-height: 40px; justify-self: start; }
.local-filters > summary { color: var(--muted); font-weight: 660; }
.local-filters[open] .form-grid { margin-top: 12px; max-width: 720px; }
.records-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(430px, 1fr); gap: 13px; }
.records-layout .records-panel { max-height: 530px; overflow-y: auto; }
.records-layout .map-panel { min-height: 435px; max-height: 530px; }
.data-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
  gap: 9px;
  margin: 0 0 13px;
}
.data-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafd;
  padding: 10px 12px;
}
.data-summary dt { color: var(--muted); font-size: .83rem; }
.data-summary dd { font-weight: 700; font-size: 1.12rem; margin-top: 3px; }
.tour-current { display: flex; gap: 5px 12px; justify-content: space-between; flex-wrap: wrap; border-radius: 8px; padding: 10px 12px; background: #edf4ff; }
.tour-choices { min-width: 0; margin-inline: 0; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; }
.tour-choices legend { padding: 0 5px; font-weight: 680; }
.tour-options { max-height: 240px; overflow-y: auto; scrollbar-width: thin; margin: 8px 0; }
.tour-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 4px;
  border-bottom: 1px solid #edf1f6;
  cursor: pointer;
}
.tour-option:last-child { border-bottom: 0; }
.tour-option small { display: block; color: var(--muted); font-size: .8rem; }
.checkbox-line { display: flex; align-items: center; gap: 7px; cursor: pointer; color: var(--ink); font-weight: 585; }
.checkbox-line input { margin: 0; flex: none; }
.filters-extra { grid-template-columns: repeat(5, minmax(0, 1fr)) auto; }
.market-quick-filters { display: flex; gap: 7px 18px; flex-wrap: wrap; padding: 0 1px; font-size: .86rem; }
.result-link .grouped-count { color: #285a9a; font-size: .74rem; }
.tour-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 12px; align-items: start; }
.tour-stops { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 9px; }
.tour-stop { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; padding: 10px; align-items: start; }
.tour-stop + .tour-stop { border-top: 1px solid var(--line); }
.tour-stop .subtle { font-size: .82rem; }
.tour-stop .tag { margin-top: 5px; }
.tour-stop-notes { margin-top: 4px; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.tour-stop-actions { display: grid; justify-items: end; gap: 5px; }
.tour-stop-actions .button { font-size: .81rem; min-height: 31px; padding: 5px 7px; }
.order-buttons { display: flex; gap: 3px; }
.order-button { width: 30px; min-height: 30px; border-color: var(--line); }
.order-button:disabled { cursor: default; }
.tour-map { min-height: 295px; max-height: 295px; }
.map-route { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-stop, .map-grade { transform: translate(-50%, -50%); min-width: 24px; height: 24px; padding: 0 4px; border-width: 2px; font-size: .79rem; }
.map-stop-visited { background: #15835c; }
.map-grade-a { background: #247342; }
.map-grade-b { background: #407d31; }
.map-grade-c { background: #6b761c; }
.map-grade-d { background: #8b6512; }
.map-grade-e { background: #ac5919; }
.map-grade-f { background: #bf4b29; }
.map-grade-g { background: #a32f37; }
.advert-section { border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.advert-section > * + * { margin-top: 7px; }
.ad-history { min-width: 84px; }
.ad-history ul { margin: 6px 0 0; padding-left: 14px; font-size: .83rem; white-space: nowrap; }

.staging { max-width: 1000px; }
.staging input[type="file"] { padding: 7px; }
.staging input::file-selector-button { border: 0; border-radius: 5px; background: #edf4ff; color: #174b9f; padding: 6px 9px; margin-right: 8px; cursor: pointer; }
.staging-figure { margin: 15px 0 0; }
.staging-canvas { aspect-ratio: 16 / 9; background: #203241; position: relative; border-radius: 8px; overflow: hidden; }
.staging-canvas img { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; }
.staging-divider { position: absolute; inset-block: 0; width: 2px; background: #fff; box-shadow: 0 0 4px #162633; }
.staging-figure [data-staging-range] { margin-top: 12px; }
.staging input[type="range"] { padding: 0; accent-color: var(--primary); min-height: 31px; }
.staging-figure figcaption { font-size: .87rem; color: var(--muted); margin-top: 6px; }
@media (max-width: 1100px) {
  .records-layout { grid-template-columns: minmax(0, 1fr); }
  .records-layout .map-panel { min-height: 330px; }
}
@media (max-width: 700px) {
  .tour-layout { grid-template-columns: minmax(0, 1fr); }
  .tour-map { grid-row: 1; min-height: 235px; max-height: 235px; }
  .filters-extra { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staging-inputs { grid-template-columns: 1fr; }
  .records-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.recorded-sales { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.recorded-sales > * + * { margin-top: 8px; }
.recorded-sales .price-band > div { background: #eef5f2; }
.recorded-sales .price-band strong { color: #14684f; }
.estimate-adjustment { background: #fff4df; border: 1px solid #f1ddba; border-radius: 6px; padding: 8px 10px; color: #744313; overflow-wrap: anywhere; }

.workspace-content:focus { outline: none; }
.sidebar nav { max-height: calc(100dvh - 96px); overflow-y: auto; scrollbar-width: thin; }
.visit-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid #bed5f7;
  border-radius: var(--radius);
  background: #edf4ff;
}
.visit-symbol { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 9px; background: #dbeaff; color: #1a55b1; }
.visit-content p { margin-top: 4px; }
.visit-content a { color: var(--primary); }
.visit-actions, .visit-row-actions, .tour-route-links, .tour-stop-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.visit-row-actions { min-width: 180px; }
.visit-row-actions .button, .tour-route-links .button, .stop-nav-link { font-size: .82rem; min-height: 34px; }
.visit-filters .records-filters { grid-template-columns: minmax(110px, .6fr) minmax(160px, 1fr) auto; }
.tour-current { align-items: center; }
.tour-current strong { display: block; }
.tour-navigation { margin-top: 10px; background: #f9fbfd; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.tour-navigation summary { font-weight: 650; }
.tour-navigation p { font-size: .84rem; margin: 6px 0; }
.tour-stop-nav { grid-column: 2 / -1; }
.tour-stop-nav .button { padding: 5px 7px; min-height: 29px; }
.tour-stop-details .tag.blue { background: #e8f0ff; color: #1b56ac; }
.tour-options + [data-selection-count] { margin-right: 7px; }
.catalog-state { border-bottom: 1px solid var(--line); }
.catalog-state > * + * { margin-top: 5px; }
.catalog-state .loading { padding: 0; }
.catalog-state + form .form-actions { flex-wrap: wrap; }
.address-assist { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.address-assist .inline-form { justify-content: stretch; grid-template-columns: minmax(0, 1fr) auto; }
.address-assist [data-geocode-results]:not(:empty) { margin-top: 8px; }
.geocode-choices { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow: auto; }
.geocode-choices li + li { border-top: 1px solid var(--line); }
.geocode-choices .result-link { display: block; width: 100%; padding: 7px 4px; }
@media (max-width: 780px) {
  .sidebar nav { max-height: none; overflow-y: visible; }
  .visit-banner { grid-template-columns: auto minmax(0, 1fr); }
  .visit-actions { grid-column: 1 / -1; }
  .visit-filters .records-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .tour-map { grid-row: auto; }
  .tour-stop { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .tour-stop-actions .button { white-space: normal; }
}
[data-personal-visits-form] .form-actions { flex-wrap: wrap; }
