:root {
  --ink: #16202b;
  --ink-2: #45566a;
  --ink-3: #6c7d92;
  --line: #dde5ee;
  --line-2: #eef2f7;
  --bg: #f6f8fb;
  --card: #ffffff;
  --brand: #0f5c8c;
  --brand-dark: #0a4064;
  --warn-bg: #fff8e6;
  --warn-line: #f0d9a0;
  --warn-ink: #7a5600;
  --stop-bg: #fdf0ee;
  --stop-line: #f2c3ba;
  --stop-ink: #97331f;
  --ok-bg: #edf7f0;
  --ok-line: #b9dfc6;
  --ok-ink: #1d6b39;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(22, 32, 43, .06), 0 4px 14px rgba(22, 32, 43, .05);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

/* ---------- masthead ---------- */
.masthead {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.masthead-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding-top: 18px; padding-bottom: 18px;
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 7px; flex: none;
  background: linear-gradient(150deg, var(--brand) 0%, #12799b 100%);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 9px 8px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.tagline { margin: 1px 0 0; font-size: 13px; color: var(--ink-3); }
.masthead-meta { font-size: 12px; color: var(--ink-3); text-align: right; }

/* ---------- lookup ---------- */
.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); margin: 0 0 12px; font-weight: 600;
}
.lookup {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin: 26px 0;
}
.address-form { display: flex; gap: 10px; align-items: flex-end; }
.field { display: block; flex: 1; min-width: 0; }
.field-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 5px;
}
input[type=text], select {
  width: 100%; padding: 9px 11px; font-size: 15px; font-family: inherit;
  color: var(--ink); background: #fff;
  border: 1px solid #c6d2e0; border-radius: 6px;
}
input[type=text]:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 92, 140, .13);
}
select:disabled { background: #f2f5f9; color: var(--ink-3); }

.btn {
  padding: 9px 16px; font-size: 14px; font-weight: 600; font-family: inherit;
  color: var(--ink); background: #fff; border: 1px solid #c6d2e0;
  border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f4f7fb; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .55; cursor: default; }

.or-line {
  margin: 18px 0 12px; font-size: 12px; color: var(--ink-3);
  display: flex; align-items: center; gap: 10px;
}
.or-line::before, .or-line::after {
  content: ""; height: 1px; background: var(--line); flex: 1;
}
.picker { display: flex; gap: 12px; }
.status { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); min-height: 18px; }
.status.error { color: var(--stop-ink); }

/* ---------- results ---------- */
.results { margin-bottom: 40px; }
.report-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin: 34px 0 16px;
}
.report-head h2 { margin: 0; font-size: 25px; letter-spacing: -.015em; }
.result-sub { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }

.summary {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px;
}
.chip {
  font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
}
.chip strong { color: var(--ink); }
.chip.alert { background: var(--stop-bg); border-color: var(--stop-line); color: var(--stop-ink); }
.chip.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }

.notice {
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px;
  font-size: 14px; border: 1px solid;
}
.notice h3 { margin: 0 0 5px; font-size: 14px; }
.notice p { margin: 0; }
.notice.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.notice.stop { background: var(--stop-bg); border-color: var(--stop-line); color: var(--stop-ink); }
.notice.ok   { background: var(--ok-bg);   border-color: var(--ok-line);   color: var(--ok-ink); }

.group-head {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); font-weight: 700;
  margin: 26px 0 10px; padding-bottom: 7px; border-bottom: 1px solid var(--line);
}

.item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; margin-bottom: 12px;
  break-inside: avoid;
}
.item-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 3px;
}
.item h3 { margin: 0; font-size: 16.5px; letter-spacing: -.01em; }
.item-authority { font-size: 13px; color: var(--ink-3); margin: 0 0 12px; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .045em;
  text-transform: uppercase; padding: 3px 7px; border-radius: 4px;
  border: 1px solid; white-space: nowrap;
}
.badge.verified { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.badge.reported { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.badge.conflicting { background: var(--stop-bg); border-color: var(--stop-line); color: var(--stop-ink); }
.badge.cat { background: #eef4fa; border-color: #cfe0ee; color: var(--brand); }

.item-requirement {
  margin: 0 0 14px; padding: 12px 14px; background: #f7fafd;
  border-left: 3px solid var(--brand); border-radius: 0 5px 5px 0;
  font-size: 14.5px;
}

dl.facts {
  display: grid; grid-template-columns: 152px 1fr;
  gap: 7px 16px; margin: 0 0 14px; font-size: 14px;
}
dl.facts dt { color: var(--ink-3); font-weight: 600; font-size: 12.5px; padding-top: 1px; }
dl.facts dd { margin: 0; }

.assign-yes { color: var(--ok-ink); font-weight: 600; }
.assign-no { color: var(--stop-ink); font-weight: 600; }
.assign-cond { color: var(--warn-ink); font-weight: 600; }
.assign-unknown { color: var(--ink-3); font-weight: 600; }

.exemptions { margin: 0; padding-left: 18px; }
.exemptions li { margin-bottom: 2px; }

.item-note {
  font-size: 13.5px; background: var(--warn-bg); border: 1px solid var(--warn-line);
  color: var(--warn-ink); padding: 10px 12px; border-radius: 5px; margin: 0 0 14px;
}

.item-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--line-2); padding-top: 11px;
  font-size: 12.5px; color: var(--ink-3);
}
.item-foot a { color: var(--brand); font-weight: 600; text-decoration: none; }
.item-foot a:hover { text-decoration: underline; }
.cite { font-style: italic; }

/* ---------- negatives ---------- */
.negative {
  background: var(--card); border: 1px solid var(--ok-line);
  border-left: 3px solid var(--ok-ink);
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px;
  break-inside: avoid;
}
.negative h3 { margin: 0 0 8px; font-size: 15.5px; color: var(--ok-ink); }
.negative p { margin: 0 0 9px; font-size: 14px; }
.negative p:last-child { margin-bottom: 0; }
.negative .why {
  font-size: 13px; color: var(--ink-2); background: #f7fafd;
  padding: 9px 11px; border-radius: 5px;
}

/* ---------- disclaimer ---------- */
.disclaimer {
  margin-top: 30px; padding: 18px 20px; background: #eef2f7;
  border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px;
}
.disclaimer h3 { margin: 0 0 8px; font-size: 14px; }
.disclaimer p { margin: 0 0 8px; color: var(--ink-2); }
.disclaimer p:last-child { margin-bottom: 0; }
.disclaimer-note { font-size: 12.5px; }

/* ---------- coverage ---------- */
.coverage { margin: 40px 0; }
.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; min-width: 132px; box-shadow: var(--shadow);
}
.stat-num { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.stat-label { font-size: 12px; color: var(--ink-3); }

.coverage-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px;
}
.county-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow);
}
.county-card h3 { margin: 0 0 8px; font-size: 14px; }
.city-line {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; padding: 2px 0; color: var(--ink-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot.has { background: var(--brand); }
.dot.none { background: #b6c4d4; }
.dot.partial { background: #e6b95c; }
.dot.unresearched { background: #dde5ee; border: 1px solid #c9d5e2; }

.legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin: 0 0 14px; font-size: 12px; color: var(--ink-3);
}
.legend span { display: flex; align-items: center; gap: 6px; }

.footer {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 20px 0; margin-top: 40px;
}
.footer p { margin: 0; font-size: 12.5px; color: var(--ink-3); }

/* ---------- one search box ---------- */
.searchbox { position: relative; }
#searchInput {
  width: 100%; font: inherit; font-size: 15px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--card);
  color: var(--ink);
}
#searchInput:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.search-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 5px);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 28px rgba(22, 32, 43, .14); overflow: hidden; max-height: 340px;
  overflow-y: auto;
}
.search-hit {
  display: grid; grid-template-columns: 52px 1fr; gap: 2px 10px; width: 100%;
  text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-2);
  padding: 9px 12px; cursor: pointer; font: inherit;
}
.search-hit:hover, .search-hit:focus { background: var(--bg); }
.hit-kind {
  grid-row: 1 / span 2; align-self: center; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; text-align: center;
  padding: 3px 0; border-radius: 4px;
}
.hit-kind.jurisdiction { background: var(--brand); color: #fff; }
.hit-kind.requirement { background: var(--line-2); color: var(--ink-2); }
.hit-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.hit-sub { font-size: 12px; color: var(--ink-3); }
.search-empty { padding: 13px; font-size: 13.5px; color: var(--ink-3); }
.picker-fallback { margin-top: 12px; }
.picker-fallback summary {
  font-size: 13px; color: var(--ink-3); cursor: pointer; padding: 3px 0;
}
.picker-fallback[open] summary { margin-bottom: 8px; }

/* ---------- your files ---------- */
.files { margin: 26px 0 0; }
.files-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.file-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.file-top { display: flex; align-items: flex-start; gap: 10px; }
.file-name { font-size: 15px; font-weight: 600; }
.file-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.file-del {
  margin-left: auto; background: none; border: 0; color: var(--ink-3);
  font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline;
  flex: none;
}
.file-del:hover { color: var(--stop-ink); }
.file-bar {
  height: 5px; background: var(--line-2); border-radius: 3px; margin: 10px 0 4px;
  overflow: hidden;
}
.file-bar-fill { height: 100%; background: var(--brand); transition: width .2s; }
.file-count { font-size: 12px; color: var(--ink-3); }
.file-items { list-style: none; margin: 9px 0; padding: 0; }
.file-items li { padding: 3px 0; font-size: 13.5px; }
.file-items label { display: flex; align-items: flex-start; gap: 7px; cursor: pointer; }
.file-items input { margin-top: 3px; flex: none; }
.file-item-done { color: var(--ink-3); text-decoration: line-through; }
.file-flag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--stop-bg); color: var(--stop-ink); border-radius: 4px; padding: 1px 5px;
  white-space: nowrap;
}
.btn-small { font-size: 13px; padding: 6px 11px; }

/* ---------- what changed ---------- */
.changes { margin: 34px 0 0; }
.section-blurb {
  font-size: 13.5px; color: var(--ink-2); margin: -4px 0 14px; max-width: 70ch;
}
.changes-list { display: grid; gap: 11px; }
.change {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
/* An ordinance change is the only kind that is news about the world rather
   than news about this dataset, so it is the only one that shouts. */
.change-ordinance { border-left-color: var(--brand); }
.change-correction { border-left-color: var(--stop-ink); }
.change-new_record { border-left-color: var(--ok-ink); }
.change-negative { border-left-color: var(--warn-ink); }
.change-coverage { border-left-color: var(--ink-3); }
.change-top { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.change-kind {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  background: var(--line-2); color: var(--ink-2); border-radius: 4px; padding: 2px 7px;
}
.change-ordinance .change-kind { background: var(--brand); color: #fff; }
.change-correction .change-kind { background: var(--stop-bg); color: var(--stop-ink); }
.change-new_record .change-kind { background: var(--ok-bg); color: var(--ok-ink); }
.change-negative .change-kind { background: var(--warn-bg); color: var(--warn-ink); }
.change-date { font-size: 12px; color: var(--ink-3); }
.change h3 { margin: 0 0 6px; font-size: 15.5px; }
.change-detail { margin: 0 0 7px; font-size: 13.5px; color: var(--ink-2); }
.change-why { margin: 0; font-size: 13.5px; color: var(--ink); }
.change-kindnote { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); font-style: italic; }
.change-where { margin: 9px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.change-link {
  font: inherit; font-size: 12.5px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 20px; padding: 3px 10px; cursor: pointer; color: var(--brand-dark);
}
.change-link:hover { background: var(--card); border-color: var(--brand); }

/* ---------- what it costs ---------- */
.money { margin: 18px 0 4px; }
.money-row { display: flex; flex-wrap: wrap; gap: 10px; }
.money-cell {
  flex: 1 1 220px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow);
}
.money-cell.alert { background: var(--warn-bg); border-color: var(--warn-line); }
.money-num { font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
.money-cell.alert .money-num { color: var(--warn-ink); }
.money-label { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.money-cell.alert .money-label { color: var(--warn-ink); }
.money-note { font-size: 12.5px; color: var(--ink-2); margin: 9px 0 0; }
.money-note.warn-note { color: var(--warn-ink); }

/* ---------- the plan ---------- */
.plan-head {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  margin: 22px 0 10px;
}
.field-inline { flex: 0 0 auto; }
.field-inline input[type="date"] {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 7px; background: var(--card); color: var(--ink);
}
.plan-hint { font-size: 12.5px; color: var(--ink-3); margin: 0 0 6px; flex: 1 1 220px; }

.phase {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); padding: 13px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow);
}
/* Pre-listing items are the ones that are already late by the time a file
   reaches escrow, so they get the only loud treatment on the page. */
.phase-urgent { border-left-color: var(--stop-ink); background: var(--stop-bg); }
.phase-quiet { background: var(--bg); box-shadow: none; }
.phase h4 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.phase-urgent h4 { color: var(--stop-ink); }
.phase-count {
  font-size: 11px; font-weight: 700; background: var(--line-2); color: var(--ink-2);
  border-radius: 20px; padding: 1px 8px;
}
.phase-urgent .phase-count { background: #fff; color: var(--stop-ink); }
.phase-blurb { margin: 4px 0 9px; font-size: 12.5px; color: var(--ink-2); }
.phase-urgent .phase-blurb { color: var(--stop-ink); }
.phase-list { list-style: none; margin: 0; padding: 0; }
.phase-list li {
  padding: 7px 0; border-top: 1px solid var(--line-2);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px;
}
.phase-item { font-size: 14px; font-weight: 600; }
.phase-auth { font-size: 12px; color: var(--ink-3); }
.phase-when {
  font-size: 12.5px; margin-left: auto; white-space: nowrap;
  color: var(--brand-dark); font-weight: 600;
}
.phase-when.muted { color: var(--ink-3); font-weight: 400; white-space: normal; }
.plan-foot { font-size: 12.5px; color: var(--ink-3); margin: 8px 0 0; }

/* ---------- print: this is the deliverable ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 10.5pt; }
  .no-print, .masthead-meta { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .masthead { border-bottom: 2px solid var(--ink); margin-bottom: 14px; }
  .masthead-inner { padding: 0 0 10px; }
  .item, .negative, .county-card, .lookup, .stat, .phase, .money-cell {
    box-shadow: none; break-inside: avoid;
  }
  /* The plan and the money are the part an escrow officer actually reads, so
     they must survive the print, unlike the date picker that produced them. */
  .phase { border: 1px solid #ccc; border-left: 3px solid var(--ink); }
  .phase-urgent { border-left-width: 5px; }
  .money-row { gap: 8px; }
  .item { border: 1px solid #ccc; padding: 11px 13px; margin-bottom: 9px; }
  .report-head { margin: 0 0 12px; }
  .results { margin: 0; }
  a { color: var(--ink) !important; text-decoration: none; }
  .item-foot a::after { content: " (" attr(href) ")"; font-size: 8.5pt; word-break: break-all; }
  .disclaimer { background: #fff; border: 1.5px solid var(--ink); }
}

@media (max-width: 720px) {
  .address-form, .picker { flex-direction: column; align-items: stretch; }
  .masthead-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  dl.facts { grid-template-columns: 1fr; gap: 2px 0; }
  dl.facts dd { margin-bottom: 8px; }
  .report-head { flex-direction: column; }
}

/* ---------- who to call ---------- */
.contacts { margin: 18px 0 4px; }
.contacts-note { font-size: 12.5px; color: var(--ink-2); margin: 0 0 10px; max-width: 74ch; }
.contact-list { display: flex; flex-wrap: wrap; gap: 8px; }
.contact {
  display: flex; align-items: center; gap: 9px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 13px; box-shadow: var(--shadow); flex: 1 1 250px;
}
.contact:hover { border-color: var(--brand); }
.contact-icon { font-size: 15px; color: var(--brand); flex: none; }
.contact-agency { display: block; font-size: 12px; color: var(--ink-3); }
.contact-value { display: block; font-size: 14.5px; font-weight: 600; color: var(--brand-dark); }

/* ---------- file alerts ---------- */
.file-alerts { display: grid; gap: 5px; margin: 9px 0 2px; }
.file-alert {
  font-size: 12.5px; border-radius: 6px; padding: 7px 10px; border: 1px solid transparent;
}
.file-alert.stop { background: var(--stop-bg); border-color: var(--stop-line); color: var(--stop-ink); }
.file-alert.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }

.masthead-link {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--brand);
  text-decoration: none; margin-bottom: 2px;
}
.masthead-link:hover { text-decoration: underline; }
