html,
body,
#map {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  --app-panel-max-width: 1120px;
  --app-panel-gutter: 12px;
  --app-panel-width: min(var(--app-panel-max-width, 1120px), calc(100vw - (var(--app-panel-gutter, 12px) * 2)));
}

.panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  padding: 0 12px 12px;
  display: none;
  touch-action: pan-y;
}

.panel.is-visible {
  display: block;
}

.panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -12px;
  padding: 10px 12px 8px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.panel-title-wrap {
  min-width: 0;
}

.panel-btn {
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.panel-show-btn {
  position: absolute;
  top: 14px;
  right: 12px;
  z-index: 11;
  border: 1px solid rgba(37, 99, 235, 0.92);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.95);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 12px;
  cursor: pointer;
  display: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
  touch-action: manipulation;
}

.panel-show-btn.is-visible {
  display: block;
}

.panel-close-fab {
  position: absolute;
  top: 14px;
  right: 12px;
  z-index: 12;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  display: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
  touch-action: manipulation;
}

.panel-close-fab.is-visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.map-tools {
  position: absolute;
  left: 64px;
  bottom: 64px;
  z-index: 13;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

.map-tools-actions,
.map-tool-panel {
  pointer-events: auto;
}

.map-tools-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.map-tool-action {
  border: 1px solid rgba(15, 23, 42, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.2);
}

.map-tool-action.is-active {
  border-color: rgba(30, 64, 175, 0.75);
  background: rgba(30, 64, 175, 0.95);
  color: #ffffff;
}

.map-tool-panel {
  width: min(320px, calc(100vw - 24px));
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.map-tool-panel[hidden] {
  display: none;
}

.map-tool-panel-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.map-tool-segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.map-tool-segment {
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
}

.map-tool-segment.is-active {
  border-color: rgba(30, 64, 175, 0.66);
  background: rgba(219, 234, 254, 0.82);
  color: #1e3a8a;
}

.map-tool-label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #334155;
}

.map-tool-label select {
  border: 1px solid rgba(148, 163, 184, 0.56);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  background: #ffffff;
  color: #0f172a;
}

.map-tool-color-palette {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.map-tool-color-chip {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.7);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.map-tool-color-chip[data-draw-color="#2563eb"] {
  background: #2563eb;
}

.map-tool-color-chip[data-draw-color="#dc2626"] {
  background: #dc2626;
}

.map-tool-color-chip[data-draw-color="#16a34a"] {
  background: #16a34a;
}

.map-tool-color-chip[data-draw-color="#f59e0b"] {
  background: #f59e0b;
}

.map-tool-color-chip[data-draw-color="#0f172a"] {
  background: #0f172a;
}

.map-tool-color-chip.is-active {
  border-color: #0f172a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 0 2px rgba(59, 130, 246, 0.28);
}

.map-tool-readout {
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.92);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.map-tool-readout-subtle {
  font-weight: 700;
  font-size: 12px;
}

.map-tool-hint {
  font-size: 11px;
  color: #475569;
}

.map-tool-footer {
  display: inline-flex;
  gap: 8px;
}

.map-tool-footer-btn {
  border: 1px solid rgba(30, 64, 175, 0.42);
  border-radius: 8px;
  background: #ffffff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}

#map.map-tool-measure-active .maplibregl-canvas,
#map.map-tool-draw-active .maplibregl-canvas {
  cursor: crosshair;
}

.title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 2px;
}

.subtitle {
  font-size: 12px;
  color: #334155;
}

.search-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.search-row input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
}

.search-row button {
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.action-row button {
  border: 1px solid #0f172a;
  border-radius: 8px;
  background: #0f172a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #0f172a;
  margin-top: 8px;
}

.toggle-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hint {
  margin-top: 6px;
  font-size: 11px;
  color: #475569;
}

.status {
  margin-top: 8px;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  min-height: 16px;
}

.status.error {
  background: #fef2f2;
  color: #991b1b;
}

.parcel-tooltip {
  position: absolute;
  top: 56px;
  left: 12px;
  bottom: 12px;
  z-index: 10;
  width: min(760px, calc(100vw - 24px));
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
  padding: 10px 12px;
  color: #0f172a;
  display: flex;
  flex-direction: column;
}

.parcel-tooltip[hidden] {
  display: none;
}

.parcel-tooltip-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.parcel-tooltip-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.parcel-tooltip-close {
  border: 1px solid rgba(15, 23, 42, 0.22);
  border-radius: 999px;
  width: 24px;
  height: 24px;
  line-height: 1;
  font-size: 15px;
  color: #0f172a;
  background: #ffffff;
  cursor: pointer;
  padding: 0;
}

.parcel-tooltip-content {
  font-size: 11px;
  line-height: 1.32;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.parcel-tooltip-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.28);
}

.parcel-tooltip-section-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.parcel-tooltip-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.95fr);
  gap: 0;
}

.parcel-tooltip-primary-pane {
  min-width: 0;
}

.parcel-tooltip-primary-pane + .parcel-tooltip-primary-pane {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(148, 163, 184, 0.34);
}

.parcel-tooltip-primary-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.parcel-tooltip-primary-block + .parcel-tooltip-primary-block {
  margin-top: 10px;
}

.parcel-tooltip-photo-pane {
  min-width: 0;
}

.parcel-tooltip-photo-box {
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.95);
  overflow: hidden;
}

.parcel-tooltip-photo-box-missing {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.parcel-tooltip-photo-main-link {
  display: block;
}

.parcel-tooltip-photo-main {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(241, 245, 249, 0.95);
}

.parcel-tooltip-photo-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 5px;
  padding: 6px;
}

.parcel-tooltip-photo-thumb-link {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.42);
}

.parcel-tooltip-photo-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.parcel-tooltip-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed rgba(100, 116, 139, 0.5);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.95) 100%);
  color: #475569;
}

.parcel-tooltip-photo-placeholder-icon {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
}

.parcel-tooltip-photo-placeholder-text {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.parcel-tooltip-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 11px;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  overflow: hidden;
}

.parcel-tooltip-table th,
.parcel-tooltip-table td {
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  padding: 4px 6px;
  vertical-align: top;
  text-align: left;
}

.parcel-tooltip-table tr:last-child th,
.parcel-tooltip-table tr:last-child td {
  border-bottom: none;
}

.parcel-tooltip-table th {
  width: 38%;
  color: #334155;
  background: rgba(248, 250, 252, 0.98);
  font-weight: 700;
  word-break: break-word;
  border-right: 1px solid rgba(226, 232, 240, 0.92);
}

.parcel-tooltip-table td {
  color: #0f172a;
  background: #ffffff;
  word-break: break-word;
}

.app-inline-link {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 700;
}

.app-inline-link:hover {
  text-decoration: underline;
}

.parcel-tooltip-table tr.parcel-tooltip-table-subhead th {
  width: auto;
  background: rgba(241, 245, 249, 0.95);
  color: #0f172a;
  border-right: none;
}

.parcel-tooltip-table tr.parcel-tooltip-table-note td {
  color: #475569;
  font-style: italic;
  background: rgba(248, 250, 252, 0.92);
}

.parcel-tooltip-grid-table thead th {
  background: #e2e8f0;
  color: #0f172a;
  text-align: right;
  border-bottom: 1px solid rgba(148, 163, 184, 0.52);
}

.parcel-tooltip-grid-table thead th:first-child {
  text-align: left;
}

.parcel-tooltip-grid-table tbody th {
  width: 32%;
}

.parcel-tooltip-grid-table tbody td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.parcel-tooltip-grid-table tbody tr:nth-child(odd) td {
  background: rgba(248, 250, 252, 0.72);
}

.parcel-tooltip-sales-table thead th {
  background: #e2e8f0;
  color: #0f172a;
  border-bottom: 1px solid rgba(148, 163, 184, 0.52);
}

.parcel-tooltip-sales-table th,
.parcel-tooltip-sales-table td {
  white-space: nowrap;
}

.parcel-tooltip-sales-table tbody td:nth-child(2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.parcel-tooltip-sales-table td:nth-child(4),
.parcel-tooltip-sales-table td:nth-child(5) {
  white-space: normal;
}

.parcel-tooltip-table-scroll {
  overflow-x: auto;
  padding-bottom: 2px;
}

.parcel-tooltip-table-scroll .parcel-tooltip-table {
  min-width: 620px;
}

.parcel-tooltip-grid-table .parcel-valuation-year {
  display: block;
  font-size: 11px;
  font-weight: 700;
}

.parcel-tooltip-grid-table .parcel-valuation-type {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

.parcel-tooltip-valuation-scroll .parcel-tooltip-valuation-grid {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.parcel-tooltip-valuation-grid thead th:first-child,
.parcel-tooltip-valuation-grid tbody th {
  min-width: 176px;
}

.parcel-tooltip-valuation-grid thead th:not(:first-child),
.parcel-tooltip-valuation-grid tbody td {
  min-width: 122px;
}

.parcel-tooltip-land-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  overflow: hidden;
}

.parcel-tooltip-land-table td {
  width: 33.333%;
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding: 5px 6px;
  vertical-align: top;
}

.parcel-tooltip-land-table tr:last-child td {
  border-bottom: none;
}

.parcel-tooltip-land-table td:last-child {
  border-right: none;
}

.parcel-land-key {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.parcel-land-value {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #0f172a;
}

.parcel-tooltip-land-panel > summary {
  font-size: 11px;
}

.parcel-tooltip-note {
  margin: 0;
  padding: 6px 7px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 6px;
  font-size: 11px;
  color: #475569;
  background: rgba(248, 250, 252, 0.9);
}

.parcel-tooltip-improvements {
  display: grid;
  gap: 8px;
}

.parcel-tooltip-improvement {
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.parcel-tooltip-improvement > summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.parcel-tooltip-improvement > summary::-webkit-details-marker {
  display: none;
}

.parcel-tooltip-improvement > summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  margin-right: 6px;
  color: #1d4ed8;
}

.parcel-tooltip-improvement[open] > summary::before {
  content: "-";
}

.parcel-tooltip-improvement-content {
  padding: 6px;
}

.parcel-file-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.parcel-file-photo-link {
  display: block;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  text-decoration: none;
}

.parcel-file-photo-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(248, 250, 252, 0.95);
}

.parcel-file-photo-meta {
  display: block;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  background: rgba(248, 250, 252, 0.95);
}

.parcel-file-link-list {
  margin: 0;
  padding-left: 20px;
}

.parcel-file-link-list li + li {
  margin-top: 4px;
}

.parcel-file-link-name {
  display: block;
  font-size: 11px;
  color: #64748b;
}

.parcel-tooltip-loading {
  color: #475569;
}

.parcel-tooltip-value-loading {
  color: #94a3b8;
  font-style: italic;
}

.maplibregl-ctrl.maplibregl-ctrl-attrib {
  font-size: 10px;
}

.choropleth-legend {
  position: absolute;
  z-index: 9;
  right: 12px;
  bottom: 12px;
  max-width: 320px;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  padding: 8px 10px;
  font-size: 11px;
  display: none;
}

.choropleth-legend.is-visible {
  display: block;
}

.choropleth-legend-title {
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.choropleth-legend-section + .choropleth-legend-section {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.26);
}

.choropleth-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0;
}

.choropleth-legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  border: 1px solid rgba(15, 23, 42, 0.2);
}

.app-shell {
  position: absolute;
  top: var(--app-panel-gutter, 12px);
  left: var(--app-panel-gutter, 12px);
  z-index: 24;
  width: var(--app-panel-width);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.app-shell[hidden] {
  display: none;
}

.app-shell-header {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell-logo-btn {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.app-shell-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 420px;
  object-fit: contain;
  flex: 0 0 auto;
}

.app-shell-search-row {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 10px 6px;
}

.app-shell.is-collapsed .app-shell-body {
  display: none;
}

.app-view[hidden] {
  display: none;
}

.app-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

#app-search-input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 62px 8px 10px;
  font-size: 13px;
  width: 100%;
  box-sizing: border-box;
}

.app-shell-search-btn {
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.app-shell-about-btn {
  border: 1px solid rgba(30, 58, 138, 0.32);
  border-radius: 8px;
  background: #ffffff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
}

.app-search-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 7px;
  background: #ffffff;
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
}

.app-search-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.app-btn {
  border: 1px solid #1d4ed8;
  border-radius: 8px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  cursor: pointer;
}

.app-btn-secondary {
  border-color: rgba(15, 23, 42, 0.2);
  background: #ffffff;
  color: #0f172a;
}

.app-search-meta {
  margin-top: 2px;
  min-height: 0;
  font-size: 12px;
  color: #334155;
}

.app-results-list {
  margin-top: 6px;
  display: grid;
  gap: 8px;
}

.app-search-meta:empty {
  display: none;
}

.app-results-list:empty {
  display: none;
  margin-top: 0;
}

.app-result-card {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.92);
  padding: 9px 10px;
  cursor: pointer;
}

.app-result-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.app-result-card-owner {
  margin-top: 2px;
  font-size: 12px;
  color: #334155;
}

.app-result-card-footer {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-result-card-map {
  font-size: 11px;
  color: #1e40af;
  font-weight: 700;
}

.app-result-card-actions {
  display: flex;
  gap: 6px;
}

.app-result-card-action {
  border: 1px solid rgba(30, 58, 138, 0.32);
  border-radius: 8px;
  background: #ffffff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 8px;
  cursor: pointer;
}

.app-empty {
  margin-top: 12px;
  font-size: 12px;
  color: #475569;
}

.app-report-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 22;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding:
    var(--app-report-top-offset, 56px)
    var(--app-panel-gutter, 12px)
    var(--app-report-bottom-offset, 12px);
}

.app-report-modal-backdrop[hidden] {
  display: none;
}

.app-report-modal-card {
  width: var(--app-panel-width);
  height: calc(100vh - var(--app-report-top-offset, 56px) - var(--app-report-bottom-offset, 12px));
  max-height: calc(100vh - var(--app-report-top-offset, 56px) - var(--app-report-bottom-offset, 12px));
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #ffffff;
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.35);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-report-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.app-report-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-report-modal-title {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.app-report-modal-search {
  border: 1px solid #1d4ed8;
  border-radius: 999px;
  background: #1d4ed8;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
}

.app-report-modal-print {
  border: 1px solid rgba(30, 58, 138, 0.3);
  border-radius: 999px;
  background: #ffffff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
}

.app-report-modal-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(15, 23, 42, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.app-photo-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(2, 6, 23, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.app-photo-modal-backdrop[hidden] {
  display: none;
}

.app-photo-modal-card {
  position: relative;
  width: min(1480px, 98vw);
  max-height: 98vh;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: 0 20px 44px rgba(2, 6, 23, 0.58);
  padding: 42px 10px 10px;
}

.app-photo-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(226, 232, 240, 0.65);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.app-photo-modal-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-photo-modal-image {
  display: block;
  max-width: 100%;
  max-height: calc(98vh - 110px);
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.95);
}

.app-photo-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: 1px solid rgba(226, 232, 240, 0.66);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.app-photo-modal-nav-prev {
  left: 10px;
}

.app-photo-modal-nav-next {
  right: 10px;
}

.app-photo-modal-nav[hidden] {
  display: none;
}

.app-photo-modal-caption {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: #e2e8f0;
}

.parcel-photo-thumb-link:hover,
.parcel-photo-thumb-link:focus-visible {
  outline: none;
  border-color: rgba(37, 99, 235, 0.8);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.app-report-root {
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding-right: 4px;
}

.app-report-title {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.app-report-subtitle {
  margin: 3px 0 0;
  font-size: 13px;
  color: #334155;
}

.app-report-map-action {
  margin-top: 10px;
}

.app-report-card {
  margin-top: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
  padding: 10px;
}

.app-report-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, 1fr);
  gap: 0;
}

.app-report-primary-pane {
  min-width: 0;
}

.app-report-primary-pane + .app-report-primary-pane {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(148, 163, 184, 0.35);
}

.app-report-primary-pane-title {
  margin: 0 0 8px;
  font-size: 11px;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.app-report-primary-block + .app-report-primary-block {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.92);
}

.app-report-photo-pane {
  min-width: 0;
}

.app-report-photo-box {
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.95);
  overflow: hidden;
}

.app-report-photo-box-missing {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
}

.app-report-photo-main-link {
  display: block;
}

.app-report-photo-main {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: rgba(241, 245, 249, 0.95);
}

.app-report-photo-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  padding: 8px;
}

.app-report-photo-thumb-link {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.42);
}

.app-report-photo-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.app-report-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed rgba(100, 116, 139, 0.48);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.94) 100%);
  color: #475569;
}

.app-report-photo-placeholder-icon {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
}

.app-report-photo-placeholder-text {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.app-report-section-title {
  margin: 0 0 8px;
  font-size: 11px;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.app-report-row {
  margin: 3px 0;
  font-size: 12px;
  color: #334155;
}

.app-report-row strong {
  color: #1e3a8a;
}

.app-report-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  overflow: hidden;
}

.app-report-table th,
.app-report-table td {
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding: 5px 7px;
  vertical-align: top;
  text-align: left;
}

.app-report-table tr:last-child th,
.app-report-table tr:last-child td {
  border-bottom: none;
}

.app-report-table th {
  width: 34%;
  color: #334155;
  background: rgba(248, 250, 252, 0.98);
  font-weight: 700;
  word-break: break-word;
  border-right: 1px solid rgba(226, 232, 240, 0.92);
}

.app-report-table td {
  color: #0f172a;
  background: #ffffff;
  word-break: break-word;
}

.app-report-table tr.app-report-table-subhead th {
  width: auto;
  background: rgba(241, 245, 249, 0.95);
  color: #0f172a;
  border-right: none;
}

.app-report-table tr.app-report-table-note td {
  color: #475569;
  font-style: italic;
  background: rgba(248, 250, 252, 0.9);
}

.app-report-grid-table thead th {
  background: #e2e8f0;
  color: #0f172a;
  text-align: right;
  border-bottom: 1px solid rgba(148, 163, 184, 0.52);
}

.app-report-grid-table thead th:first-child {
  text-align: left;
}

.app-report-grid-table tbody th {
  width: 28%;
}

.app-report-grid-table tbody td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.app-report-grid-table tbody tr:nth-child(odd) td {
  background: rgba(248, 250, 252, 0.78);
}

.app-report-sales-table thead th {
  background: #e2e8f0;
  color: #0f172a;
  border-bottom: 1px solid rgba(148, 163, 184, 0.52);
}

.app-report-sales-table tbody td {
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}

.app-report-sales-table tbody td:nth-child(2) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.app-report-sales-table tbody td:nth-child(4),
.app-report-sales-table tbody td:nth-child(5) {
  white-space: normal;
}

.app-report-table-caption {
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
}

.app-report-table-scroll {
  overflow-x: auto;
  padding-bottom: 3px;
}

.app-report-table-scroll .app-report-table {
  min-width: 820px;
}

.app-report-grid-table .parcel-valuation-year {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.app-report-grid-table .parcel-valuation-type {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.015em;
}

.app-report-valuation-scroll .app-report-valuation-grid {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}

.app-report-valuation-grid thead th:first-child,
.app-report-valuation-grid tbody th {
  min-width: 220px;
}

.app-report-valuation-grid thead th:not(:first-child),
.app-report-valuation-grid tbody td {
  min-width: 140px;
}

.app-report-expandable {
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
}

.app-report-expandable > summary {
  list-style: none;
  cursor: pointer;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  background: rgba(248, 250, 252, 0.96);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.app-report-expandable > summary::-webkit-details-marker {
  display: none;
}

.app-report-expandable > summary::before {
  content: "+";
  display: inline-block;
  width: 14px;
  margin-right: 6px;
  color: #1d4ed8;
}

.app-report-expandable[open] > summary::before {
  content: "-";
}

.app-report-expandable-content {
  padding: 8px;
}

.app-report-improvements {
  display: grid;
  gap: 8px;
}

.parcel-tooltip-improvement-columns,
.app-report-improvement-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.parcel-tooltip-improvement-table,
.app-report-improvement-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.parcel-tooltip-improvement-table th,
.parcel-tooltip-improvement-table td,
.app-report-improvement-table th,
.app-report-improvement-table td {
  padding: 2px 4px;
  vertical-align: top;
  text-align: left;
}

.parcel-tooltip-improvement-table th,
.app-report-improvement-table th {
  width: 52%;
  color: #0f172a;
  font-weight: 700;
}

.parcel-tooltip-improvement-table td,
.app-report-improvement-table td {
  color: #111827;
}

.app-report-land-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  overflow: hidden;
}

.app-report-land-table td {
  width: 33.333%;
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding: 7px 8px;
  vertical-align: top;
}

.app-report-land-table tr:last-child td {
  border-bottom: none;
}

.app-report-land-table td:last-child {
  border-right: none;
}

.app-about-text {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: #334155;
}

.app-about-heading {
  margin: 0 0 8px;
  font-size: 13px;
  color: #0f172a;
}

.app-about-link {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.app-about-link:hover {
  text-decoration: underline;
}

.app-about-image {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  margin: 8px 0 10px;
}

.app-about-sync-card {
  margin: 0 0 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.88);
  padding: 8px 10px;
}

.app-sync-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #0f172a;
}

.app-sync-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid transparent;
}

.app-sync-pill-healthy {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

.app-sync-pill-warning {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}

.app-sync-pill-offline {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

.app-sync-pill-loading {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.app-sync-mono {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.app-sync-note {
  margin-top: 6px;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 40;
  transform: translate(-50%, 12px);
  max-width: min(92vw, 520px);
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.28);
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  padding: 9px 11px;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-toast.warning {
  background: rgba(146, 64, 14, 0.94);
  border-color: rgba(251, 191, 36, 0.65);
}

.app-toast.error {
  background: rgba(153, 27, 27, 0.94);
  border-color: rgba(252, 165, 165, 0.75);
}

.app-disclaimer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.app-disclaimer-backdrop[hidden] {
  display: none;
}

.app-disclaimer-card {
  width: min(680px, 100%);
  max-height: min(86vh, 760px);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: #ffffff;
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.35);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-disclaimer-title {
  margin: 0;
  font-size: 16px;
  color: #0f172a;
}

.app-disclaimer-scroll {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
  flex: 1;
  min-height: 160px;
}

.app-disclaimer-text {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.42;
  color: #334155;
}

.app-disclaimer-actions {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 800px) {
  .panel {
    left: 12px;
    right: 12px;
    width: auto;
    max-height: 80vh;
  }
  .panel-close-fab {
    right: 12px;
  }
  .app-shell {
    top: var(--app-panel-gutter, 12px);
    left: var(--app-panel-gutter, 12px);
    right: var(--app-panel-gutter, 12px);
    width: auto;
    max-height: 82vh;
  }
  .app-shell-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .app-shell-search-row {
    width: 100%;
  }
  .app-shell-logo {
    height: 36px;
    max-width: 100%;
  }

  .parcel-tooltip-primary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .parcel-tooltip-primary-pane + .parcel-tooltip-primary-pane {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(148, 163, 184, 0.34);
    padding-top: 10px;
  }

  .app-report-primary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .app-report-primary-pane + .app-report-primary-pane {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding-top: 10px;
  }

  .parcel-tooltip-improvement-columns,
  .app-report-improvement-columns {
    grid-template-columns: 1fr;
  }

  .map-tools {
    left: 56px;
    right: auto;
    bottom: 56px;
    align-items: flex-start;
  }

  .map-tools-actions {
    justify-content: flex-start;
  }

  .map-tool-panel {
    width: min(320px, calc(100vw - 68px));
  }
}

@page {
  size: landscape;
  margin: 0.25in;
}

@media print {
  html,
  body {
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
    background: #ffffff !important;
  }

  body.map-print-mode > :not(#map) {
    display: none !important;
  }

  body.map-print-mode #map {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
  }

  body.map-print-mode .maplibregl-control-container {
    display: none !important;
  }
}
