:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1a1d23;
  --muted: #6b7280;
  --accent: #134ca8;
  --accent-light: #e6f4f1;
  --accent-hover: #134ca8;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --ai-shimmer: linear-gradient(90deg, transparent 0%, rgba(19,76,168,0.08) 50%, transparent 100%);
  /* Typography — single source of truth */
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'DM Sans', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-2xs: 0.7rem;
  --fs-xs: 0.78rem;
  --fs-sm: 0.85rem;
  --fs-base: 1rem;
  --fs-lg: 1.15rem;
  --fs-xl: 1.45rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.1rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.01em;
}

header {
  padding: 1.75rem 1.25rem 0.75rem;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
}

header p {
  color: var(--muted);
  font-size: var(--fs-base);
  margin-top: 0.25rem;
}

.panel {
  max-width: 1140px;
  margin: 0 auto 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.hidden { display: none !important; }

.input-tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
  margin: 0 -1.5rem 1rem;
  padding: 0 1.5rem;
}

.input-tab {
  background: none;
  color: var(--muted);
  border: 0;
  border-radius: 0;
  padding: 0.6rem 1rem;
  margin-bottom: -1px;
  font-weight: 600;
  font-size: var(--fs-sm);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.input-tab:hover { color: var(--text); background: none; }

.input-tab--active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: none;
}

/* ----- Batch UI ----- */

.muted { color: var(--muted); }

.batch-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.batch-section-head h3 { margin: 0; }

.batch-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  resize: vertical;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.batch-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.batch-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}

.batch-upload-btn:hover {
  background: #f3f4f6;
  border-color: var(--accent);
}

.batch-drop-active {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(19, 76, 168, 0.15);
  background: var(--accent-light);
}

.batch-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.5rem 1rem;
}

.batch-modes label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-weight: 500;
  font-size: var(--fs-sm);
}

.batch-modes input[type="checkbox"] {
  width: auto;
  padding: 0;
  margin: 0;
}

.batch-progress-bar {
  position: relative;
  height: 10px;
  background: #f3f4f6;
  border-radius: 5px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.batch-progress-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 200ms ease;
}

.batch-progress-meta {
  margin: 0.4rem 0 0;
  font-size: var(--fs-sm);
}

.batch-error-count { color: #b91c1c; font-weight: 600; }

.batch-actions-inline {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.batch-actions-inline button {
  padding: 0.4rem 0.75rem;
  font-size: var(--fs-sm);
}

.batch-recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  background: #fcfcfd;
}

.batch-recent-meta {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: var(--fs-sm);
}

.batch-status-tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.batch-status-tag--queued,
.batch-status-tag--running {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.batch-status-tag--completed {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.batch-status-tag--cancelled {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

.batch-status-tag--failed,
.batch-status-tag--interrupted {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.batch-status-tag--stopped_quota_low {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.auth-panel {
  display: grid;
  place-items: center;
  min-height: 300px;
  background:
    radial-gradient(circle at top left, rgba(19, 76, 168, 0.08), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.auth-card {
  width: min(480px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-kicker {
  display: inline-block;
  margin-bottom: 0.65rem;
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-card h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.35rem, 3vw, 1.8rem);
}

.auth-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.google-signin-slot {
  display: flex;
  justify-content: center;
  min-height: 44px;
  margin: 1.25rem 0 0.75rem;
}

.auth-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.auth-status-copy {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.auth-status-label {
  color: var(--muted);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

form {
  display: grid;
  gap: 1rem;
}

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  background: #fcfcfd;
}

.form-section h3 {
  margin: 0 0 0.7rem;
  font-size: var(--fs-base);
}

.fields-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.25rem;
  align-items: end;
}

.fields-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.field-full {
  grid-column: 1 / -1;
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding-top: 0.25rem;
}

.include-2b-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  padding-top: 0.5rem;
  font-size: var(--fs-lg);
  color: var(--muted);
}

.include-2b-field input[type="checkbox"] {
  margin: 0;
}

label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: var(--fs-base);
  font-weight: 500;
}

.req {
  color: #e53e3e;
  font-weight: 600;
}

.label-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.info-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: var(--fs-xs);
  cursor: help;
  border: 0;
  padding: 0;
}

.tooltip-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  background: var(--text);
  color: #fff !important;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  font-size: var(--fs-sm);
  line-height: 1.35;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 1200;
}

.tooltip-box * {
  color: #fff !important;
}

.tooltip-box--list ul {
  margin: 0;
  padding-left: 1rem;
}

.tooltip-box--list li + li {
  margin-top: 0.25rem;
}

.tooltip-wrap:hover .tooltip-box,
.tooltip-wrap:focus-within .tooltip-box {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

input, button, select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.6rem 0.75rem;
  font-size: var(--fs-base);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(19,76,168,0.1);
}

button {
  background: var(--accent);
  color: white;
  border: 0;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease;
}

button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.secondary-btn {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-btn:hover {
  background: #f3f4f6;
}

.error { color: #b91c1c; min-height: 1.2rem; }
.progress-panel { margin-top: 1rem; }
.progress-panel h3 { margin: 0 0 0.5rem 0; font-size: var(--fs-base); }
#progress-log {
  margin: 0;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f9fafb;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: var(--fs-sm);
  line-height: 1.4;
  font-family: var(--font-mono);
}

.prescreening-wrap {
  margin: 0.9rem 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  background: var(--surface);
}

.prescreening-wrap h3 {
  margin: 0 0 0.75rem;
  font-size: var(--fs-base);
}

.prescreening-wrap h4 {
  margin: 0 0 0.65rem;
  font-size: var(--fs-base);
}

.prescreening-head {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.prescreening-head h3 {
  margin: 0;
}

.tooltip-box--wide {
  width: min(360px, 86vw);
}

.prescreen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.prescreen-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  background: #fcfcfd;
}

.prescreen-card--pass {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.prescreen-card--fail {
  border-color: #fecaca;
  background: #fef2f2;
}

.prescreen-card--empty {
  grid-column: 1 / -1;
  color: var(--muted);
}

.prescreen-card__label {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prescreen-card__value {
  display: block;
  margin-top: 0.35rem;
  font-size: var(--fs-lg);
  font-family: var(--font-display);
}

.prescreen-card__meta {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.4;
}

.prescreen-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 0.85fr);
  gap: 1rem;
  align-items: stretch;
}

#prescreen-map {
  min-height: 430px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #eef2f7;
}

.prescreen-map-empty {
  display: grid;
  min-height: 430px;
  place-items: center;
  color: var(--muted);
}

.prescreen-map-side {
  display: grid;
  align-content: start;
  gap: 0.85rem;
}

.prescreen-map-legend,
.prescreen-map-badges {
  display: grid;
  gap: 0.7rem;
}

.prescreen-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
}

.prescreen-legend-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.prescreen-legend-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border: 1px solid color-mix(in srgb, var(--layer-color) 55%, #ffffff);
  border-radius: 50%;
  background: color-mix(in srgb, var(--layer-color) 16%, #ffffff);
  color: var(--layer-color);
  flex: 0 0 auto;
  font-size: var(--fs-2xs);
  font-weight: 800;
  line-height: 1;
}

.prescreen-legend-swatch--center {
  border-color: transparent;
  background: transparent;
  color: #111827;
  font-size: var(--fs-base);
}

.prescreen-legend-swatch--threshold {
  border-radius: 4px;
}

.prescreen-map-section-group {
  display: grid;
  gap: 0.55rem;
}

.prescreen-map-section-group h4 {
  margin: 0.35rem 0 0.1rem;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prescreen-map-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.78rem 0.8rem 0.55rem;
  background: #fcfcfd;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.prescreen-map-section.is-active {
  border-color: color-mix(in srgb, var(--layer-color) 58%, #ffffff);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--layer-color) 14%, transparent);
  transform: translateY(-1px);
}

.prescreen-map-section--threshold {
  background: linear-gradient(180deg, #fffaf7 0%, #ffffff 100%);
}

.prescreen-map-section__main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.prescreen-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid color-mix(in srgb, var(--layer-color) 34%, #ffffff);
  border-radius: 999px;
  background: color-mix(in srgb, var(--layer-color) 13%, #ffffff);
  color: color-mix(in srgb, var(--layer-color) 86%, #111827);
  cursor: default;
  font-size: var(--fs-base);
  font-weight: 900;
  line-height: 1;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.prescreen-section-icon:hover,
.prescreen-section-icon.is-active {
  border-color: var(--layer-color);
  background: color-mix(in srgb, var(--layer-color) 24%, #ffffff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--layer-color) 12%, transparent);
  transform: scale(1.04);
}

.prescreen-section-icon--threshold {
  border-radius: 7px;
}

.prescreen-map-section__content {
  min-width: 0;
}

.prescreen-map-section__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.prescreen-map-section__head strong {
  color: var(--text);
  font-size: var(--fs-base);
  line-height: 1.22;
}

.prescreen-map-badge__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: var(--accent-light);
  color: var(--accent);
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 700;
}

.prescreen-map-section__metric {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin-top: 0.35rem;
}

.prescreen-map-section__raw {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 0.32rem;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.25;
}

.prescreen-map-section__score {
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: 800;
  line-height: 1.1;
}

.prescreen-map-section__meta {
  margin-top: 0.38rem;
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.prescreen-map-section__expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
  margin-top: 0.6rem;
  border: 0;
  border-top: 1px solid var(--border);
  padding: 0.48rem 0 0;
  background: transparent;
  color: color-mix(in srgb, var(--layer-color) 78%, var(--muted));
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 800;
}

.prescreen-map-section__expand:hover {
  color: var(--layer-color);
}

.prescreen-map-badge__places {
  margin-top: 0.45rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.55rem;
}

.prescreen-map-badge__places ul {
  display: grid;
  gap: 0.45rem;
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding-left: 1rem;
}

.prescreen-map-badge__places p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.prescreen-map-badge__places li {
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.35;
}

.prescreen-map-badge__places li strong {
  display: inline;
  margin: 0;
  font-size: var(--fs-sm);
}

.prescreen-map-badge__places li span {
  display: inline;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.prescreen-map-hard-filters {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

.prescreen-map-count-icon {
  background: transparent;
  border: 0;
}

.prescreen-map-count-icon span {
  display: grid;
  gap: 0.04rem;
  max-width: 156px;
  overflow: hidden;
  border: 1.5px solid var(--layer-color);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  /* lower opacity so the map underneath is still readable */
  background: rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(2px);
  box-shadow: var(--shadow);
  color: var(--text);
  text-align: center;
  line-height: 1.08;
  transition: box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

/* on hover / when the user is interacting, raise opacity so the text is fully readable */
.prescreen-map-count-icon:hover span,
.prescreen-map-count-icon.is-highlighted span {
  background: rgba(255, 255, 255, 0.94);
}

.prescreen-map-count-icon strong,
.prescreen-map-count-icon em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prescreen-map-count-icon strong {
  color: var(--text);
  font-size: var(--fs-xs);
  font-style: normal;
  font-weight: 900;
}

.prescreen-map-count-icon em {
  color: var(--muted);
  font-size: var(--fs-2xs);
  font-style: normal;
  font-weight: 800;
}

.prescreen-map-count-icon.is-highlighted span {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--layer-color) 16%, transparent), var(--shadow-lg);
  transform: translateY(-1px);
}

.prescreen-map-place-icon {
  background: transparent;
  border: 0;
}

.prescreen-map-place-icon span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--layer-color);
  box-shadow: 0 1px 5px rgba(17, 24, 39, 0.24);
  color: #ffffff;
  font-size: var(--fs-2xs);
  font-weight: 900;
  line-height: 1;
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}

.prescreen-map-place-icon--threshold span {
  border-radius: 5px;
}

.prescreen-map-place-icon.is-highlighted span {
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--layer-color) 24%, transparent), 0 3px 12px rgba(17, 24, 39, 0.28);
  transform: scale(1.2);
}

.prescreen-map-center-icon {
  background: transparent;
  border: 0;
}

.prescreen-map-center-icon span {
  display: block;
  width: 1.8rem;
  height: 1.8rem;
  filter: drop-shadow(0 2px 4px rgba(17, 24, 39, 0.28));
  font-size: var(--fs-2xl);
  line-height: 1;
  text-align: center;
}

/* Overview hazard cell — compact 4-up grid of risk badges */
.prescreen-cell-label {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: var(--fs-xs);
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.prescreen-hazard-summary,
.prescreen-oz-summary {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  background: #fcfcfd;
  height: 100%;
}

.prescreen-hazard-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 1.2rem;
  row-gap: 0.3rem;
  justify-content: start;
}

.prescreen-hazard-items li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.prescreen-hazard-name {
  flex: 0 0 auto;
  min-width: 4.5rem;
  color: var(--muted);
  font-weight: 500;
  font-size: var(--fs-sm);
}

.prescreen-hazard-badge {
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: 0.05rem 0.45rem;
  border-radius: 4px;
  border: 1px solid transparent;
  letter-spacing: 0.03em;
}

.prescreen-hazard-badge--go {
  background: #f0fdf4;
  color: #166534;
  border-color: #bbf7d0;
}

.prescreen-hazard-badge--caution {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.prescreen-hazard-badge--extreme-caution {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.prescreen-hazard-badge--unknown {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

/* OZ summary box — colored container, big YES/NO/UNKNOWN word */
.prescreen-oz-summary {
  align-items: flex-start;
}

.prescreen-oz-summary--go {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.prescreen-oz-summary--caution {
  background: #fffbeb;
  border-color: #fde68a;
}

.prescreen-oz-summary--unknown {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.prescreen-oz-summary strong {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
}

.prescreen-oz-summary--go strong { color: #166534; }
.prescreen-oz-summary--caution strong { color: #b45309; }
.prescreen-oz-summary--unknown strong { color: #6b7280; }

.prescreen-decision-panel {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 0.65rem;
  align-items: stretch;
}

.prescreen-final-decision {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  background: #fcfcfd;
}

.prescreen-final-decision span,
.prescreen-final-decision small {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.prescreen-final-decision strong {
  display: block;
  margin: 0.25rem 0;
  font-size: var(--fs-xl);
}

.prescreen-score-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.prescreen-score-header > div {
  display: flex;
  flex-direction: column;
}

.prescreen-score-header > div:first-child {
  flex-shrink: 0;
}

.prescreen-score-header span {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prescreen-score-header strong {
  font-size: var(--fs-3xl);
  white-space: nowrap;
  line-height: 1.1;
}

.prescreen-market-tier {
  align-items: flex-end;
  text-align: right;
  padding: 0.5rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 6px;
}

.prescreen-market-tier--go {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.prescreen-market-tier--caution {
  background: #fffbeb;
  border-color: #fde68a;
}

.prescreen-market-tier--extreme-caution {
  background: #fef2f2;
  border-color: #fecaca;
}

.prescreen-market-tier--unknown {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.prescreen-market-tier-label {
  display: inline-flex !important;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.prescreen-market-tier small {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.prescreen-factor-summary {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  column-gap: 1.5rem;
  row-gap: 0.28rem;
  justify-content: start;
  font-size: var(--fs-sm);
}

.prescreen-factor-summary li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.prescreen-factor-name {
  flex: 0 0 auto;
  min-width: 11rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.prescreen-factor-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: var(--fs-base);
  color: var(--text);
}

.prescreen-score-bar {
  position: relative;
  height: 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, #fecaca 0%, #fde68a 50%, #bbf7d0 100%);
}

.prescreen-score-bar-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 3px;
  background: #1f2937;
  border-radius: 1.5px;
  transform: translateX(-50%);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.prescreen-score-bar-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: var(--fs-2xs);
}

.prescreen-decision-detail {
  display: grid;
  gap: 0.75rem;
  height: 100%;
}

.prescreen-reason-block {
  height: 100%;
  width: fit-content;
  justify-self: start;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  background: #fcfcfd;
}

.prescreen-reason-block > span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.prescreen-decision-reasons {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.45;
}

.prescreen-decision-reasons li + li {
  margin-top: 0.35rem;
}

.prescreen-decision--good,
.prescreen-decision--pass {
  color: #166534;
}

.prescreen-decision--review {
  color: #b45309;
}

.prescreen-decision--reject {
  color: #b91c1c;
}

.prescreen-warning-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text);
}

.prescreen-warning-list li + li {
  margin-top: 0.4rem;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.dashboard-actions {
  display: flex;
  gap: 0.6rem;
}

.hotel-info-wrap {
  margin: 0.9rem 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  background: var(--surface);
}

.hotel-info-wrap h3 {
  margin: 0 0 0.55rem 0;
  font-size: var(--fs-base);
}

.hotel-info-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.hotel-info-head h3 {
  margin: 0;
}

.hotel-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 1.5rem;
}

.hotel-info-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.hotel-info-subsection {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: #fcfcfd;
}

.hotel-info-subsection h4 {
  margin: 0 0 0.55rem;
  font-size: var(--fs-sm);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.hotel-info-wrap a {
  color: var(--accent);
  text-decoration: none;
}

.hotel-info-head .btn-link {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.hotel-info-head .btn-link:hover {
  background: #f3f4f6;
}

.hotel-info-wrap a:hover {
  text-decoration: underline;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: none;
  padding: 0.5rem 0.9rem;
  font-size: var(--fs-base);
  font-weight: 500;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  transition: background 0.15s ease;
}

.btn-link:hover {
  background: var(--accent-hover);
}

.btn-link.unavailable {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.stats {
  margin: 1rem 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: var(--surface);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card strong {
  font-size: var(--fs-xl);
  font-family: var(--font-display);
  margin-top: 0.25rem;
  display: block;
}

.stat-card .label-inline > span {
  display: inline;
}

.est-rent-section {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  background: var(--surface);
}

.est-rent-section h3 {
  margin: 0 0 0.5rem;
  font-size: var(--fs-base);
  color: var(--text);
}

.est-rent-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.est-rent-head h3 {
  margin: 0;
}

.est-rent-control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 210px;
  margin-left: auto;
}

.est-rent-control .label-inline {
  justify-content: flex-start;
}

.est-rent-control select:disabled {
  opacity: 0.7;
  cursor: wait;
}

.est-rent-feedback-control .secondary-btn {
  width: 100%;
}

.est-rent-feedback-control {
  margin-left: -0.35rem;
}

/* --- rent range bar legend --- */
.rent-bar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem 1rem;
  margin-bottom: 0.75rem;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.rent-bar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.legend-swatch--class {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--muted); opacity: 0.55;
}
.legend-swatch--range {
  width: 16px; height: 8px; border-radius: 2px;
  background: rgba(19, 76, 168, 0.22);
}
.legend-swatch--blended {
  width: 8px; height: 8px; border-radius: 50%;
  background: #f59e0b;
}
.legend-swatch--final {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--accent);
}

.est-rent-error {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 6px;
  color: #b45309;
  font-size: var(--fs-sm);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

/* --- rent range bar component --- */
.est-rent-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.rent-bar-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  background: var(--surface);
}

.rent-bar-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.rent-bar-title {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rent-bar-value {
  font-size: var(--fs-xl);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
}

.rent-2b-note {
  margin: 0.5rem 0 0;
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.4;
}

.rent-2b-note--fallback {
  color: #b45309;
  font-style: italic;
}

/* Short-term / Airbnb rows in the Unit-Level table. Faint orange wash
   + italics so the user can tell at a glance which rows the rent
   estimator dropped. */
tr.row--short-term {
  background: rgba(251, 191, 36, 0.10);
  color: var(--muted);
  font-style: italic;
}
tr.row--short-term td {
  color: var(--muted);
}

.rent-bar-track {
  position: relative;
  height: 28px;
  margin-top: 2.2rem;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  overflow: visible;
}

.rent-bar-track-inner {
  position: relative;
  width: calc(100% - 16px);
  height: 100%;
  margin: 0 8px;
}

/* class avg rent dot (small grey) */
.rent-bar-dot--class {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(107, 114, 128, 0.55);
  border: 1.5px solid var(--surface);
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 2;
}

/* highlighted range band (estYb to estReno) — sits below all dots */
.rent-bar-range {
  position: absolute;
  top: 4px;
  height: 20px;
  background: rgba(19, 76, 168, 0.22);
  border-radius: 4px;
  z-index: 0;
  cursor: pointer;
  transition: background 120ms ease;
}
.rent-bar-range:hover { background: rgba(19, 76, 168, 0.35); }

/* blended est rent dot (small orange) */
.rent-bar-dot--blended {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  border: 1.5px solid var(--surface);
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 4;
}

/* final est rent dot (large, prominent) */
.rent-bar-dot--final {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid var(--surface);
  box-shadow: 0 0 0 2.5px var(--accent);
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 5;
}

/* floating value label above the final dot */
.rent-bar-val-label {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  white-space: nowrap;
  pointer-events: none;
  z-index: 6;
}
.rent-bar-val-label::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--surface);
}

/* hide the right-aligned value when inline label is active */
.rent-bar-value--inline { display: none; }

/* hover tooltip */
.rent-bar-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--text);
  color: #fff;
  font-size: var(--fs-xs);
  line-height: 1.35;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
  pointer-events: none;
  z-index: 30;
}

.rent-bar-tip--left { left: 0; transform: none; }
.rent-bar-tip--right { left: auto; right: 0; transform: none; }

/* wider tooltip for final dot breakdown table */
.rent-bar-tip--wide {
  white-space: normal;
  width: 600px;
  line-height: 1.4;
}

.rent-bar-dot--class:hover .rent-bar-tip,
.rent-bar-dot--final:hover .rent-bar-tip,
.rent-bar-dot--blended:hover .rent-bar-tip,
.rent-bar-range:hover .rent-bar-tip {
  opacity: 1;
  visibility: visible;
}

/* raise hovered non-final elements above the final dot's stacking context
   so their tooltips paint over the floating val-label (which lives inside z-index:5) */
.rent-bar-dot--class:hover,
.rent-bar-dot--blended:hover,
.rent-bar-dot--core:hover {
  z-index: 10;
}

/* v2 uncertainty band (±5yr core perturbation) */
.rent-bar-band--uncertainty {
  position: absolute;
  top: 50%;
  height: 14px;
  transform: translateY(-50%);
  background: rgba(245, 158, 11, 0.14);
  border: 1px dashed rgba(245, 158, 11, 0.55);
  border-radius: 3px;
  z-index: 2;
  cursor: help;
}

/* v2 core estimate marker */
.rent-bar-dot--core {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #f59e0b;
  border: 1.5px solid var(--surface);
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.rent-bar-dot--core:hover .rent-bar-tip,
.rent-bar-band--uncertainty:hover .rent-bar-tip {
  opacity: 1;
  visibility: visible;
}

/* v2 tooltip variant — share the existing --wide layout, just mark for targeting */
.rent-bar-tip--v2 {
  width: 560px;
}
.rent-bar-tip--v2 .v2-section-title {
  font-size: var(--fs-2xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #f5d491;
  margin: 0.35rem 0 0.15rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 0.35rem;
}
.rent-bar-tip--v2 .v2-section-title:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.rent-bar-tip--v2 .v2-grid {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  column-gap: 0.6rem;
  row-gap: 0.1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
}
.rent-bar-tip--v2 .v2-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.5rem;
  font-size: var(--fs-xs);
}
.rent-bar-tip--v2 .v2-accent { color: #fbbf24; font-weight: 600; }
.rent-bar-tip--v2 .v2-muted { color: rgba(255,255,255,0.55); }
.rent-bar-tip--v2 .v2-strike { text-decoration: line-through; color: rgba(255,255,255,0.55); }

/* model version badge next to section title */
.model-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.55rem;
  padding: 0.1rem 0.45rem;
  font-family: var(--font-mono);
  font-size: var(--fs-2xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  border-radius: 4px;
  vertical-align: middle;
  line-height: 1.2;
}
.model-badge--v1 {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.3);
}
.model-badge--v2 {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* scale labels */
.rent-bar-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
  font-size: var(--fs-2xs);
  color: var(--muted);
}

/* notes beneath bar */
.rent-bar-notes {
  margin-top: 0.3rem;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.rent-bar-notes .note-cap { color: #e67e22; }

.est-feedback-panel {
  margin-top: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fcfcfd;
  padding: 0.75rem;
}

.est-feedback-panel h4 {
  margin: 0 0 0.45rem;
  font-size: var(--fs-base);
}

.feedback-context {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: var(--fs-sm);
}

#estimation-feedback-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem 0.8rem;
}

#estimation-feedback-form label:last-of-type {
  grid-column: 1 / -1;
}

#estimation-feedback-form textarea {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  font: inherit;
  resize: vertical;
}

.feedback-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.feedback-status {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.1rem;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.feedback-flash {
  margin: 0.6rem 0 0;
  color: #166534;
  font-size: var(--fs-sm);
  font-weight: 500;
}

#map {
  height: 380px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.histogram-wrap {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.histogram-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.histogram-controls {
  display: flex;
  gap: 0.65rem;
}

.histogram-controls label {
  font-size: var(--fs-sm);
}

.histogram-controls select {
  font-size: var(--fs-sm);
  padding: 0.4rem 0.6rem;
}

#histogram-canvas {
  margin-top: 0.7rem;
  max-height: 320px;
}

.table-wrap {
  margin-top: 1rem;
  overflow: auto;
  max-height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.table-headline {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0.7rem;
}

.table-headline h3 {
  margin: 0;
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.table-controls button {
  padding: 0.5rem 0.9rem;
  font-size: var(--fs-base);
}

.table-controls input {
  min-width: 240px;
  padding: 0.45rem 0.55rem;
  font-size: var(--fs-base);
}

#row-count {
  color: var(--muted);
  font-size: var(--fs-base);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
  min-width: 1250px;
}

th, td {
  text-align: left;
  padding: 0.55rem;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f9fafb;
  color: var(--text);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

th.sortable {
  cursor: pointer;
}

th.sorted-asc::after { content: ' \25B2'; }
th.sorted-desc::after { content: ' \25BC'; }

#raw-filters input {
  width: 100%;
  min-width: 90px;
  padding: 0.35rem 0.45rem;
  font-size: var(--fs-sm);
}

/* AI badge */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.6rem;
  padding: 0.2rem 0.6rem;
  font-size: var(--fs-2xs);
  font-weight: 600;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid rgba(19,76,168,0.15);
  border-radius: 100px;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
}

.ai-sparkle {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  animation: sparkle-pulse 2s ease-in-out infinite;
}

.ai-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--ai-shimmer);
  animation: shimmer-sweep 3s ease-in-out infinite;
}

@keyframes sparkle-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes shimmer-sweep {
  0% { transform: translateX(-200%); }
  50%, 100% { transform: translateX(200%); }
}

/* Responsive */
@media (max-width: 900px) {
  .auth-status {
    flex-direction: column;
    align-items: flex-start;
  }

  .fields-grid { grid-template-columns: repeat(2, 1fr); }
  .fields-grid--2col { grid-template-columns: repeat(2, 1fr); }
  .hotel-info-sections { grid-template-columns: 1fr; }
  .prescreen-map-layout,
  .prescreen-decision-panel { grid-template-columns: 1fr; }
  .prescreen-map-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .panel { margin: 0.75rem; }
  #map,
  #prescreen-map { height: 300px; min-height: 300px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .prescreen-grid { grid-template-columns: 1fr; }
  .prescreen-map-side { grid-template-columns: 1fr; }
  .histogram-head,
  .table-headline { flex-direction: column; align-items: stretch; }
  .table-controls input { min-width: 150px; }
  .rent-bar-group { padding: 0.625rem 0.75rem; }
  .rent-bar-dot--final { width: 14px; height: 14px; }
  .rent-bar-val-label { font-size: var(--fs-base); }
  #estimation-feedback-form { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .fields-grid { grid-template-columns: 1fr; }
  .fields-grid--2col { grid-template-columns: 1fr; }
}

/* --- Hazard & OZ Screening --- */
.hazard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}
.hazard-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.hazard-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.hazard-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 600;
}
.hazard-desc {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.oz-card {
  border-left: 3px solid #8e44ad;
}
