/* ClearView builder portal - shared styles for modernized pages (see inc/layout.asp). */

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --hover: #f3f4f6;
  --brand: #00cd8a;
  --brand-dark: #00a06c;
  --brand-soft: #e6faf3;
  --accent: #99c1c1;
  --danger: #b91c1c;
  --warn-soft: #fff7ed;
  --shadow: 0 6px 18px rgba(0, 0, 0, .08);
  --radius: 14px;
  --sidebar-w: 280px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  background: var(--card);
  border-right: 1px solid var(--border);
  overflow: hidden;
  z-index: 30;
}
.side-title {
  margin: 10px 8px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.side-link:hover { background: var(--hover); }
.side-link.active { background: var(--brand-soft); color: #065f46; }
.side-divider { height: 1px; background: var(--border); margin: 8px 6px; flex: 0 0 auto; }

.nei-search { margin: 0 2px 6px; }
.nei-list {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  padding-right: 2px;
}
.nei-item {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
}
.nei-item:hover { background: var(--hover); }
.nei-item.active { background: var(--brand-soft); color: #065f46; }
.nei-item.active .meta { color: #047857; }
.nei-item .name { font-weight: 700; }
.nei-item .meta { font-size: 12px; color: var(--muted); }
.nei-empty { padding: 8px 10px; color: var(--muted); font-size: 13px; }

.sidebar-bottom { flex: 0 0 auto; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0; font-size: 18px; font-weight: 800; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn.menu-btn { display: none; }
.topbar-logo { display: none; }
.topbar-logo .brand img { height: 46px; }
.topbar-logo .brand-sub { display: none; }

.content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .3);
  z-index: 25;
}

/* ---------- Brand ---------- */
.brand { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.brand img { display: block; height: 34px; width: auto; }
.sidebar-brand { display: flex; justify-content: center; padding: 6px 6px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.sidebar-brand .brand img { height: 96px; }
/* "Powered by ClearView" (sidebar bottom, sign-in pages) */
.powered { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px 2px;
  font-size: 11px; color: var(--muted); white-space: nowrap; }
.powered img { height: 16px; width: auto; opacity: .75; }
.powered strong { color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-sub { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Signed-out pages (AuthStart / AuthEnd) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 32px 16px;
}
.auth-brand .brand img { height: 140px; }
.auth-card { width: 100%; max-width: 400px; padding: 24px; }
.auth-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 800; }
.auth-card .lead { margin: 0 0 18px; color: var(--muted); }
.auth-foot { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.auth-foot a { text-decoration: underline; }
.auth-wide { max-width: 560px; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #052e1f; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.input, .select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  outline: none;
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(153, 193, 193, .3);
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack .btn { width: 100%; }
.hint { font-size: 12px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand-dark); }
.split { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.link { color: #047857; font-weight: 600; }
.link:hover { text-decoration: underline; }

.msg { padding: 10px 12px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.msg-error { background: #fef2f2; border-color: #fecaca; color: var(--danger); }
.msg-ok { background: var(--brand-soft); border-color: #a7f3d0; color: #065f46; }
.msg-info { background: #f0f9ff; border-color: #bae6fd; color: #075985; }

/* ---------- Cards and panels ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.section-title {
  margin: 22px 2px 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.stat { display: block; }
.stat:hover { background: #fafafa; }
.stat .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat .v { margin-top: 4px; font-size: 28px; font-weight: 800; }
.stat .v.alert { color: var(--danger); }

.panels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.panel {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.count {
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--hover);
  font-size: 12px;
  text-align: center;
}
.panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  max-height: 420px;
  overflow-y: auto;
}
.item {
  display: block;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.item:hover { background: #f9fafb; border-color: #d1d5db; }
.item .l1 { font-weight: 700; }
.item .l2, .item .l3 { margin-top: 2px; font-size: 13px; color: var(--muted); }
.empty {
  padding: 10px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
}

.prose { max-width: 760px; }
.prose p { margin: 0 0 12px; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: #047857; font-weight: 600; text-decoration: underline; }
.doc-frame {
  display: block;
  width: 100%;
  height: min(60vh, 560px);
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.notice {
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: var(--warn-soft);
}

/* ---------- Neighbourhood map (map.asp, js/map.js) ---------- */
.map-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.map-title { margin: 0; font-size: 22px; font-weight: 800; }
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.map-find { display: flex; gap: 6px; }
.map-find .input { width: 78px; }
.map-find.not-found .input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(185, 28, 28, .15); }
.zoom { display: flex; gap: 4px; }
.zoom .btn { min-width: 40px; padding: 8px 10px; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 2px 10px; font-size: 13px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend .pin { position: static; transform: none; width: 14px; height: 14px; border-width: 2px; cursor: default; }

.map-viewport {
  position: relative;
  height: calc(100vh - 230px);
  min-height: 360px;
  padding: 0;
  overflow: auto;
  background: #eef0f3;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
}
.map-viewport.dragging { cursor: grabbing; user-select: none; }
.map-canvas { position: relative; visibility: hidden; }
.map-canvas.ready { visibility: visible; }
.map-img { display: block; max-width: none; user-select: none; }
.map-canvas.no-image { min-width: 100%; min-height: 300px; }
.map-canvas.no-image .map-img { display: none; }
.map-empty { margin: 16px; }

.pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
  cursor: pointer;
  background: #fff;
}
.pin:hover, .pin:focus-visible { transform: translate(-50%, -50%) scale(1.3); z-index: 2; outline: none; }
.pin-empty { background: #fff; border-color: #6b7280; }
.pin-info { background: #3b82f6; }
.pin-app { background: #f59e0b; }
.pin-approved { background: var(--brand-dark); }
.pin-legacy { background: #8b5cf6; }
.pin.flash { animation: pin-flash 1.2s ease-out 2; z-index: 3; }
@keyframes pin-flash {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .9); }
  100% { box-shadow: 0 0 0 22px rgba(239, 68, 68, 0); }
}

/* Lot popup (native <dialog>) */
.lot-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  color: var(--text);
}
.lot-dialog.wide { width: min(1000px, calc(100vw - 24px)); }
.lot-dialog[open] { display: flex; flex-direction: column; }
.lot-dialog::backdrop { background: rgba(17, 24, 39, .45); }
.lot-dialog-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.lot-dialog-head h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 800; }
.btn-icon { min-width: 36px; min-height: 36px; padding: 4px 8px; font-size: 18px; }
.lot-dialog-body { padding: 14px; overflow: auto; font-size: 14px; }
.loading { padding: 24px; text-align: center; color: var(--muted); }

/* Feedback button and form (inc/layout.asp) */
.fb-btn { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px 11px 14px; border: 0; border-radius: 999px; background: #111827; color: #fff; font: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(17, 24, 39, .28); }
.fb-btn:hover { background: #1f2937; }
.fb-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.fb-btn svg { width: 18px; height: 18px; color: var(--brand); }
.content { padding-bottom: 88px; }
.fb-dialog form { display: flex; flex-direction: column; min-height: 0; }
.fb-body .field { margin-bottom: 12px; }
.fb-intro { margin: 0 0 10px; }
.fb-scope { margin-bottom: 14px; font-size: 13px; }
.fb-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.fb-kind { position: relative; cursor: pointer; }
.fb-kind input { position: absolute; opacity: 0; }
.fb-kind span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; }
.fb-kind small { font-size: 12px; color: var(--muted); }
.fb-kind input:checked + span { border-color: var(--brand); background: var(--brand-soft); }
.fb-kind input:focus-visible + span { box-shadow: 0 0 0 3px rgba(153, 193, 193, .4); }
.fb-page { margin: 0 0 10px; overflow-wrap: anywhere; }
.fb-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }

/* Feedback inbox (feedback.asp) */
.fb-list { display: flex; flex-direction: column; gap: 10px; }
.fb-item { padding: 14px 16px; }
.fb-item.is-done { opacity: .6; }
.fb-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 6px; }
.fb-item-msg { white-space: pre-wrap; margin: 6px 0; }
.fb-item-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.fb-item pre { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: #fef2f2; color: #991b1b; font-size: 12px; white-space: pre-wrap; }
.fb-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.fb-filter a.active { background: var(--brand-soft); border-color: var(--brand); }

/* Messages (mailbox.asp), mail-app style */
.mail { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px; align-items: start; }
.mail-folders { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 76px; }
.mail-folder { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 14px;
  border-radius: 0 999px 999px 0; font-weight: 600; color: var(--text); }
.mail-folder:hover { background: var(--hover); }
.mail-folder.active { background: var(--brand-soft); color: #065f46; font-weight: 800; }
.mail-main { padding: 0; overflow: hidden; }
.mail-search { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); position: relative; }
.mail-search svg { position: absolute; left: 26px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.mail-search .input { padding-left: 38px; border-radius: 999px; background: var(--hover); border-color: transparent; }
.mail-search .input:focus { background: var(--card); }
.mail-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mail-toolbar form { margin: 0; }
.mail-pager { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.btn.is-disabled { opacity: .35; cursor: default; }
.mail-check { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; cursor: pointer; }
.mail-check input { width: 16px; height: 16px; cursor: pointer; }
.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-row { display: flex; align-items: center; padding-left: 10px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.mail-row:hover { box-shadow: inset 0 -1px 0 var(--border), 0 1px 3px rgba(17, 24, 39, .12); position: relative; z-index: 1; }
.mail-row.is-unread { background: var(--card); }
.mail-row.is-selected { background: #e8f0fe; }
.mail-link { flex: 1; min-width: 0; display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 14px 11px 4px; color: var(--text); font-size: 14px; }
.mail-from, .mail-subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subject { display: flex; align-items: center; gap: 6px; }
.mail-lot { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.mail-snippet { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.mail-snippet::before { content: "\2013\00a0"; }
.mail-snippet:empty { display: none; }
.mail-row.is-unread .mail-from, .mail-row.is-unread .mail-lot, .mail-row.is-unread .mail-date { font-weight: 800; }
.mail-meta { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.mail-date { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 52px; text-align: right; }
.mail-row.is-unread .mail-date { color: var(--text); }
.mail-clip svg, .mail-attachment svg { width: 16px; height: 16px; color: var(--muted); display: block; }
.mail-empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.mail-read { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 16px; }
.mail-read-subject { margin: 0; font-size: 20px; font-weight: 700; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.mail-read-head { display: flex; align-items: flex-start; gap: 12px; }
.mail-read-who { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.mail-read-who .hint:last-child { flex-basis: 100%; }
.mail-read-date { white-space: nowrap; }
.mail-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #6366f1; color: #fff; font-weight: 800; font-size: 17px; }
.mail-avatar.is-office { background: #2f855a; }
.mail-read-body { white-space: pre-wrap; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.mail-attachment { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; max-width: 100%; }
.mail-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-attachment:hover { background: var(--hover); }
.reply-ok { display: none; }
.reply-ok:target { display: block; }

/* Information maps (imap_view.asp) */
.imap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.imap-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: var(--text); transition: box-shadow .15s; }
.imap-card:hover { box-shadow: 0 6px 18px rgba(17, 24, 39, .12); }
.imap-card > span:last-child { display: flex; flex-direction: column; }
.imap-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: #065f46; }
.imap-icon svg { width: 22px; height: 22px; }

/* Developer search (developer/results.asp) */
.search-form { display: flex; flex-direction: column; gap: 12px; }
.search-form .sub-details .form-grid { margin-top: 10px; }
.label-like { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.field-range input { min-width: 0; flex: 1 1 0; }
@media (min-width: 700px) { .field-range { grid-column: span 2; } }
.results-card { padding: 0; }
.results-table { min-width: 980px; }
.results-table th { white-space: nowrap; padding-top: 12px; }
.results-table td:first-child { white-space: nowrap; }
.results-table th:first-child, .results-table td:first-child { padding-left: 14px; }
.results-table tbody tr:hover { background: #f9fafb; }

/* Company users (su.asp) */
.user-list { display: flex; flex-direction: column; gap: 10px; }
.user-card { padding: 0; }
.user-card > summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; }
.user-card > summary::-webkit-details-marker { display: none; }
.user-card > summary::after { content: ""; width: 8px; height: 8px; margin-left: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex: none; }
.user-card[open] > summary::after { transform: rotate(-135deg); }
.user-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-who .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.user-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 16px 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.user-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.user-actions form { margin: 0; }
.user-remove { flex: 1 1 260px; }

/* Streetscape (streetscape.asp): front elevations side by side on one ground line, all at one height */
.street { --street-h: 260px; display: flex; flex-direction: column; gap: 10px; }
.street-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.street-scroll { position: relative; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  margin: 0 -14px; padding: 8px 14px 4px; background: linear-gradient(#f3f7fb, #fff 70%); }
.street-row { display: flex; align-items: flex-end; gap: 0; margin: 0; padding: 0; list-style: none; width: max-content; }
.street-lot { flex: none; display: flex; flex-direction: column; scroll-snap-align: center; border-radius: 10px; }
.street-house { height: var(--street-h); display: flex; align-items: flex-end; justify-content: center; padding: 0 6px;
  border-bottom: 3px solid #9ca3af; }
.street-house a { display: block; height: 100%; }
.street-house img { display: block; height: 100%; width: auto; max-width: none; object-fit: contain; mix-blend-mode: multiply; }
.street-empty { width: calc(var(--street-h) * .62); height: 70%; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--border); border-bottom: 0; border-radius: 8px 8px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.street-label { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 6px 8px; text-align: center; }
.street-lotno { font-weight: 800; font-size: 13px; }
.street-style { font-size: 12px; color: var(--muted); }
.street-side { font-size: 12px; }
.street-lot.is-this { background: var(--brand-soft); }
.street-lot.is-this .street-house { border-bottom-color: var(--brand); }

/* Lot details (getinfo.asp) */
.lot-info { display: flex; flex-direction: column; gap: 12px; }
.lot-info h3 { margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lot-note { padding: 10px 12px; border-radius: 10px; background: var(--hover); white-space: pre-wrap; }
.lot-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.lot-status .what { font-weight: 700; }
.lot-status .who { font-size: 13px; color: var(--muted); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip-approved { background: var(--brand-soft); color: #065f46; }
.chip-pending { background: #fef3c7; color: #92400e; }
.chip-draft { background: var(--hover); color: var(--muted); }
.lot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.spec-table th, .spec-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.spec-table th { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.spec-table td:first-child { font-weight: 700; }
.spec-table td.changed, .changed-key { background: #fef3c7; color: #92400e; font-weight: 700; }
.changed-key { padding: 0 4px; border-radius: 4px; }
.mat-label .hint { font-weight: 400; }
.table-scroll { overflow-x: auto; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs img { display: block; width: 150px; height: auto; border-radius: 8px; border: 1px solid var(--border); }

/* Popup forms (prelim_sub.asp, ...) */
.checklist { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.file-input { padding: 6px; }
.file-input::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--hover);
  font-weight: 700;
  cursor: pointer;
}
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress-bar { height: 10px; border-radius: 999px; background: var(--hover); overflow: hidden; }
.progress-bar span { display: block; width: 0; height: 100%; background: var(--brand); transition: width .15s ease; }
.btn:disabled { opacity: .6; cursor: default; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
textarea.input { min-height: 80px; resize: vertical; }
.mat-grid { display: flex; flex-direction: column; gap: 8px; }
.mat-row { display: grid; grid-template-columns: 150px repeat(3, minmax(0, 1fr)); gap: 8px; align-items: center; }
.mat-label { font-weight: 700; }
.mat-head { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) {
  .mat-head { display: none; }
  .mat-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
}

/* Draft application (application.asp, createapp.asp) */
.terms { font-size: 13px; color: var(--muted); }
.terms p { margin: 0 0 8px; }
.app-page { display: flex; flex-direction: column; gap: 14px; max-width: 1000px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-title { margin: 2px 0; font-size: 22px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notes-card summary { font-weight: 700; cursor: pointer; }
.notes-card .lot-note { margin-top: 10px; }
.app-section { display: flex; flex-direction: column; gap: 14px; }
.app-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.app-section-head h3, .submit-card h3 { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: #065f46; font-size: 13px; }
.req { color: var(--danger); }
.size-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.input.is-saved, .select.is-saved { border-color: var(--brand); background: #f0fdf8; }
.input.is-error, .select.is-error { border-color: var(--danger); background: #fef2f2; }
.input[readonly] { background: var(--hover); }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.file-row[data-required="Y"][data-has="N"] { border-left: 3px solid #f59e0b; }
.file-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.file-name { font-weight: 700; }
.file-link { color: #047857; font-size: 13px; overflow-wrap: anywhere; }
.file-link:hover { text-decoration: underline; }
.file-rejected { font-size: 13px; padding: 6px 10px; }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn:focus-within { box-shadow: 0 0 0 3px rgba(153, 193, 193, .4); }
.submit-card { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.submit-card > div:first-child { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1 1 300px; }
.missing-list { color: #92400e; font-size: 14px; }
.submit-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-danger-text { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-text:hover { background: #fef2f2; }

/* Lot file (bfile.asp) */
.chip-action { background: #fee2e2; color: #991b1b; }
.msg-action { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.next-step { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.next-step > div { flex: 1 1 320px; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
.jump a { flex: none; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 700; white-space: nowrap; }
.jump a:hover { background: var(--hover); }
.jump .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand-soft); color: #065f46; font-size: 11px; text-align: center; }
.jump button { flex: none; margin-left: auto; padding: 6px 12px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.jump button:hover { color: var(--text); }
.file-section { display: block; padding: 0; scroll-margin-top: 70px; }
.file-section > summary { list-style: none; cursor: pointer; padding: 14px; border-radius: inherit; user-select: none; }
.file-section > summary::-webkit-details-marker { display: none; }
.file-section > summary:hover { background: var(--hover); }
.file-section > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.file-section > summary h3 { flex: 1 1 auto; }
.file-section > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin: 0 4px 3px 2px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.file-section[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.file-section[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.section-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.section-body { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 14px; }
.rev-block { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.ins-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.ins-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ins-results { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ins-photos { flex-wrap: wrap; }
.file-page .check { align-items: flex-start; }
.file-page .check input { margin-top: 3px; flex: none; }
@media print {
  .sidebar, .topbar, .scrim, .jump, form, .fb-btn { display: none !important; }
  .main, .content { margin: 0 !important; padding: 0 !important; }
  .file-section { box-shadow: none; }
  .file-section > summary::after { display: none; }
  body { background: #fff; }
}
.detail-grid .value { min-height: 22px; padding: 2px 0; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.sub-title { margin: 4px 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sub-details summary { font-weight: 700; cursor: pointer; }
.sub-details .lot-note { margin-top: 8px; }
.cond-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.cond-list li { padding-left: 4px; }
.cond-text { white-space: pre-wrap; }
.cond-meta { display: flex; gap: 12px; align-items: center; margin-top: 2px; }
.msg-compose { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--hover); }
.compose-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.compose-row .file-input { flex: 1 1 220px; width: auto; background: var(--card); }
.compose-row .field { flex: 0 1 260px; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.thread-msg { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; gap: 4px; }
.thread-msg.from-office { background: #f0f9ff; border-color: #bae6fd; }
.thread-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.thread-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--sidebar-w), 85vw);
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 20px 0 40px rgba(0, 0, 0, .15);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; }
  .btn.menu-btn { display: inline-flex; }
  .topbar-logo { display: block; }
  .topbar h1 { display: none; }
}
@media (max-width: 640px) {
  .user-card > summary { flex-wrap: wrap; position: relative; padding-right: 40px; }
  .user-card > summary::after { position: absolute; right: 18px; top: 26px; }
  .user-meta { flex-basis: 100%; justify-content: flex-start; padding-left: 52px; }
  .mail { grid-template-columns: 1fr; gap: 10px; }
  .mail-folders { position: static; flex-direction: row; overflow-x: auto; gap: 6px; }
  .mail-folder { flex: none; border-radius: 999px; padding: 7px 14px; border: 1px solid var(--border); }
  .mail-main { margin: 0 -12px; border-radius: 0; }
  .mail-link { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "from meta" "subject subject"; gap: 2px 8px; padding: 10px 14px 10px 2px; }
  .mail-from { grid-area: from; }
  .mail-meta { grid-area: meta; }
  .mail-subject { grid-area: subject; flex-wrap: wrap; white-space: normal; gap: 2px 6px; }
  .mail-lot { max-width: 100%; white-space: nowrap; }
  .mail-snippet { flex-basis: 100%; white-space: nowrap; }
  .mail-snippet::before { content: none; }
  .mail-read { padding: 16px; }
  .mail-read-subject { font-size: 17px; }
  .mail-read-head { flex-wrap: wrap; }
  .mail-read-date { flex-basis: 100%; padding-left: 52px; margin-top: -8px; }
  .fb-btn { right: 12px; bottom: 12px; padding: 10px 14px 10px 12px; }
  .fb-kinds { grid-template-columns: 1fr; }
  .street { --street-h: 190px; }
  .jump { flex-wrap: nowrap; overflow-x: auto; }
  .size-grid { grid-template-columns: minmax(0, 1fr); }
  .file-row { flex-direction: column; align-items: stretch; }
  .file-actions { justify-content: flex-start; }
  .submit-actions { width: 100%; justify-content: space-between; }
  .content { padding: 12px 12px 88px; }
  .map-viewport { height: calc(100vh - 260px); }
  .map-tools { width: 100%; }
  .map-find { flex: 1 1 100%; min-width: 0; }
  .map-find .input { flex: 1 1 0; width: 0; min-width: 0; }
  .lot-dialog { max-height: calc(100vh - 24px); }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 10px; }
  .stat .v { font-size: 22px; }
  .topbar { padding: 8px 12px; }
  .topbar .pill { display: none; }
}
