:root {
  --bg: #f4f7fb;
  --card-bg: #ffffff;
  --primary: #1e40af;
  --primary-hover: #1d4ed8;
  --accent: #0ea5e9;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html,
body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
}

.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff;
  padding: 1.35rem 0;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.subtitle {
  color: #cbd5e1;
  font-size: 0.94rem;
  margin-top: 0.25rem;
}

.header-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.mobile-access-badge {
  background: rgba(14, 165, 233, 0.22);
  border: 1px solid rgba(125, 211, 252, 0.45);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.83rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #f0f9ff;
}

.mobile-access-badge a {
  color: #7dd3fc;
  font-weight: 700;
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.mobile-access-badge a:hover {
  text-decoration: underline;
}

.security-pin-badge {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(110, 231, 183, 0.45);
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #ecfdf5;
}

.security-pin-badge strong {
  color: #6ee7b7;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.08rem;
}

.security-pin-badge a.logout-link {
  color: #fde68a;
  font-weight: 700;
  text-decoration: none;
}

.security-pin-badge a.logout-link:hover {
  text-decoration: underline;
}

.btn-pin-rotate {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-pin-rotate:hover {
  background: rgba(255, 255, 255, 0.28);
}

.data-source-badge {
  background: rgba(255, 255, 255, 0.12);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dot.live {
  width: 9px;
  height: 9px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #22c55e;
}

.dot.loading {
  background-color: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

.main-grid {
  display: grid;
  grid-template-columns: 355px 1fr;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.2rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.form-panel {
  align-self: start;
  position: sticky;
  top: 1rem;
}

@media (max-width: 1024px) {
  .form-panel {
    position: static;
  }
}

.form-panel h2 {
  font-size: 1.12rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.building-box {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.95rem;
}

.building-box-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 0.55rem;
}

.building-box .form-group:last-child {
  margin-bottom: 0;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

label {
  display: block;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 0.28rem;
  color: #334155;
}

.label-hint {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--primary);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 0.54rem 0.68rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #ffffff;
  transition: border-color 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
}

.amenities-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin: 0.85rem 0 1rem;
  padding: 0.7rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  margin-bottom: 0;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 0.82rem 1rem;
  font-size: 0.96rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

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

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.results-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.sources-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  padding: 0.85rem;
}

@media (max-width: 820px) {
  .sources-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

.source-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.source-pill strong {
  display: block;
  font-size: 0.83rem;
  color: var(--text-main);
}

.source-pill span {
  color: var(--text-muted);
}

.source-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.source-pill.tax .source-dot {
  background-color: #2563eb;
}

.source-pill.govmap .source-dot {
  background-color: #0ea5e9;
}

.source-pill.renewal .source-dot {
  background-color: #16a34a;
}

.source-pill.housing .source-dot {
  background-color: #9333ea;
}

.loading-banner {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
}

.hidden {
  display: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 680px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.kpi-card.highlight {
  background: linear-gradient(135deg, #1e40af 0%, #0284c7 100%);
  color: #fff;
  border: none;
}

.kpi-card.highlight .kpi-label,
.kpi-card.highlight .kpi-sub {
  color: #e0f2fe;
}

.kpi-label {
  font-size: 0.83rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 1.52rem;
  font-weight: 800;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-valuation-breakdown {
  margin-top: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  font-size: 0.81rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.btn-valuation-breakdown:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.65);
}

.btn-valuation-breakdown[aria-expanded="true"] {
  background: #ffffff;
  color: #1e3a8a;
  border-color: #ffffff;
}

.breakdown-chevron {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 0.9rem;
}

.btn-valuation-breakdown[aria-expanded="true"] .breakdown-chevron {
  transform: rotate(180deg);
}

/* Detailed Valuation Breakdown Panel */
.valuation-breakdown-card {
  border: 1.5px solid #93c5fd;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 28%);
}

.breakdown-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.btn-close-breakdown {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-close-breakdown:hover {
  background: #e2e8f0;
}

.breakdown-section {
  margin-bottom: 1.25rem;
}

.breakdown-section:last-child {
  margin-bottom: 0;
}

.breakdown-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.breakdown-note-pill {
  font-size: 0.76rem;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}

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

.comp-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.comp-card.is-final {
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  border: 1.5px solid #3b82f6;
}

.comp-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.comp-card.is-final .comp-title {
  color: #1e3a8a;
}

.comp-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.comp-sub {
  font-size: 0.76rem;
  color: #64748b;
}

.comp-diff {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.comp-diff.pos {
  color: #15803d;
}

.comp-diff.neg {
  color: #b91c1c;
}

.comp-diff.neutral {
  color: #1e40af;
}

.gap-explainer-box {
  margin-top: 0.7rem;
  padding: 0.65rem 0.85rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 0.83rem;
  color: #78350f;
  line-height: 1.55;
}

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

.proposed-card {
  border-radius: 10px;
  padding: 0.8rem 0.85rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.proposed-card.conservative {
  background: #f0fdf4;
  border-color: #86efac;
}

.proposed-card.recommended {
  background: #eff6ff;
  border: 1.5px solid #60a5fa;
}

.proposed-card.optimistic {
  background: #fefce8;
  border-color: #fde047;
}

.proposed-card.wide-range {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.proposed-badge {
  font-size: 0.74rem;
  font-weight: 700;
  color: #334155;
}

.proposed-card.conservative .proposed-badge {
  color: #166534;
}

.proposed-card.recommended .proposed-badge {
  color: #1e40af;
}

.proposed-card.optimistic .proposed-badge {
  color: #854d0e;
}

.proposed-price {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

.proposed-sub {
  font-size: 0.76rem;
  color: #475569;
}

.dispersion-visual-wrap {
  margin-top: 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem 0.7rem;
}

.dispersion-visual-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.55rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.dispersion-visual-bar {
  position: relative;
  height: 16px;
  background: #e2e8f0;
  border-radius: 999px;
  margin: 1.45rem 0 1.55rem;
}

.dispersion-core-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  border-radius: 999px;
  opacity: 0.85;
}

.dispersion-marker {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 26px;
  border-radius: 2px;
  transform: translateX(-50%);
}

.dispersion-marker.est {
  background: #1e3a8a;
  box-shadow: 0 0 0 2px #ffffff;
}

.dispersion-marker.naive {
  background: #f59e0b;
}

.dispersion-marker.naive .dispersion-marker-label {
  top: 28px;
}

.dispersion-marker.asking {
  background: #dc2626;
}

.dispersion-marker-label {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0 4px;
}

.dispersion-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #475569;
  font-weight: 600;
}

.breakdown-tables-stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.breakdown-step-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  background: #ffffff;
}

.breakdown-step-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.45rem;
}

.breakdown-step-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.breakdown-step-table th,
.breakdown-step-table td {
  padding: 0.45rem 0.5rem;
  text-align: right;
  border-bottom: 1px solid #f1f5f9;
}

.breakdown-step-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

.breakdown-step-table tr:last-child td {
  border-bottom: none;
}

.breakdown-step-table tr.is-summary-row td {
  background: #eff6ff;
  font-weight: 700;
  color: #1e3a8a;
  border-top: 1px solid #bfdbfe;
}

@media (max-width: 960px) {
  .comparison-cards-grid,
  .proposed-values-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Specific Building & 3-Ring Comparison Card */
.building-analysis-card {
  border-color: #bfdbfe;
}

.building-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.meta-chip {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  color: #475569;
}

.meta-chip strong {
  color: var(--text-main);
}

.rings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

@media (max-width: 760px) {
  .rings-grid {
    grid-template-columns: 1fr;
  }
}

.ring-card {
  border-radius: 10px;
  padding: 0.9rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ring-card.ring-1 {
  background: #eff6ff;
  border-color: #93c5fd;
}

.ring-card.ring-2 {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.ring-card.ring-3 {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.ring-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e3a8a;
}

.ring-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.ring-sub {
  font-size: 0.79rem;
  color: #475569;
}

/* Interactive Visual Map Card */
.map-card {
  border-color: #cbd5e1;
}

.map-subtitle {
  font-size: 0.79rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

.map-external-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  font-size: 0.82rem;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.map-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-map {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.3rem 0.68rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
}

.btn-map:hover {
  background: #e2e8f0;
}

.btn-map.btn-recenter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  border-color: #93c5fd;
  background: #eff6ff;
}

.btn-map.btn-recenter:hover {
  background: #dbeafe;
}

.map-layer-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-size: 0.81rem;
}

.map-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0;
  font-weight: 500;
  cursor: pointer;
}

.map-viewport {
  position: relative;
  width: 100%;
  height: 390px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #e8eef5;
}

#buildingMapCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#buildingMapCanvas:active {
  cursor: grabbing;
}

.map-legend {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.76rem;
  color: #1e293b;
  pointer-events: none;
}

.leg-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.leg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.leg-dot.target {
  background: #dc2626;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #dc2626;
}

.leg-dot.parcel {
  background: #f59e0b;
}

.leg-dot.govmap {
  background: #0284c7;
}

.map-pin-info {
  margin-top: 0.65rem;
  padding: 0.6rem 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.84rem;
  color: #334155;
}

.intel-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
}

@media (max-width: 820px) {
  .intel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.intel-item {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.intel-label {
  font-size: 0.77rem;
  color: var(--text-muted);
}

.intel-val {
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.chart-legend-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
}

.badge {
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.79rem;
  font-weight: 600;
}

.badge.building-badge {
  background: #dbeafe;
  color: #1e3a8a;
}

.badge.tax-badge {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.govmap-badge {
  background: #e0f2fe;
  color: #0284c7;
}

.badge.renewal-badge {
  background: #dcfce7;
  color: #15803d;
}

.badge.housing-badge {
  background: #f3e8ff;
  color: #7e22ce;
}

.dual-gov-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

@media (max-width: 960px) {
  .dual-gov-grid {
    grid-template-columns: 1fr;
  }
}

.table-responsive {
  overflow-x: auto;
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.tx-table th,
.tx-table td {
  padding: 0.65rem 0.55rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.tx-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

.tx-table tr:hover {
  background-color: #f8fafc;
}

.ring-tag {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
}

.ring-tag.bld {
  background: #dbeafe;
  color: #1e40af;
}

.ring-tag.str {
  background: #e0f2fe;
  color: #0369a1;
}

.btn-mini {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 0.28rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-mini:hover {
  background: #dbeafe;
}

.ext-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.5rem;
}

.ext-link:hover {
  text-decoration: underline;
}

.verdict-good {
  color: var(--success);
}

.verdict-fair {
  color: var(--warning);
}

.verdict-high {
  color: var(--danger);
}

.form-panel,
.results-panel,
.card {
  min-width: 0;
}

.unified-search-box {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border: 1.5px solid #93c5fd;
}

.quick-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.quick-label {
  font-size: 0.76rem;
  color: #475569;
  font-weight: 600;
}

.quick-chip {
  background: #ffffff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.quick-chip:hover {
  background: #dbeafe;
}

.resolved-location-strip {
  margin-top: 0.65rem;
  padding: 0.48rem 0.65rem;
  background: #ffffff;
  border: 1px dashed #93c5fd;
  border-radius: 8px;
  font-size: 0.79rem;
  color: #1e3a8a;
  font-weight: 600;
  line-height: 1.4;
}

.similar-params-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem;
  margin-bottom: 0.85rem;
}

.similar-params-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.55rem;
}

.similar-params-box .form-group:last-child {
  margin-bottom: 0;
}

.optional-details {
  margin-bottom: 0.9rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
}

.optional-details summary {
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
  color: #334155;
  list-style: none;
}

.optional-details[open] summary {
  margin-bottom: 0.5rem;
}

.similar-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: linear-gradient(90deg, #f0fdf4 0%, #ffffff 100%);
  border-color: #86efac;
  padding: 0.9rem 1.1rem;
}

.similar-bar-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.similar-bar-info strong {
  color: #166534;
  font-size: 0.93rem;
}

.similar-bar-info span {
  font-size: 0.81rem;
  color: #475569;
}

.similar-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0;
  background: #ffffff;
  border: 1px solid #86efac;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #166534;
  cursor: pointer;
}

.sim-badge {
  display: inline-block;
  margin-top: 0.2rem;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  border-radius: 999px;
  padding: 0.1rem 0.48rem;
  font-size: 0.71rem;
  font-weight: 700;
}

tr.row-similar {
  background-color: #f0fdf4;
}

tr.row-similar:hover {
  background-color: #dcfce7;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Mobile-First Responsive Adjustments */
@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }

  .app-header {
    padding: 0.9rem 0;
    margin-bottom: 1rem;
  }

  .app-header h1 {
    font-size: 1.38rem;
  }

  .subtitle {
    font-size: 0.82rem;
  }

  .header-badges {
    width: 100%;
    gap: 0.45rem;
  }

  .data-source-badge,
  .mobile-access-badge,
  .security-pin-badge {
    width: 100%;
    justify-content: space-between;
    font-size: 0.78rem;
    padding: 0.42rem 0.75rem;
  }

  .main-grid {
    gap: 1rem;
    padding-bottom: 2rem;
  }

  .card {
    padding: 0.95rem;
    border-radius: 10px;
  }

  /* 16px prevents iOS/Android Safari zoom-on-focus */
  input[type="text"],
  input[type="number"],
  select {
    font-size: 16px;
    padding: 0.6rem 0.7rem;
  }

  .btn-primary {
    padding: 0.85rem;
    font-size: 1rem;
  }

  .sources-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    padding: 0.75rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .map-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .map-zoom-controls {
    justify-content: space-between;
  }

  .map-zoom-controls .btn-map {
    flex: 1;
    padding: 0.48rem 0.6rem;
  }

  .map-viewport {
    height: 310px;
  }

  .map-legend {
    font-size: 0.7rem;
    gap: 0.45rem;
    padding: 0.28rem 0.5rem;
    max-width: calc(100% - 16px);
  }

  .chart-container {
    height: 220px;
  }

  .tx-table {
    font-size: 0.8rem;
  }

  .tx-table th,
  .tx-table td {
    padding: 0.5rem 0.42rem;
  }
}

@media (max-width: 480px) {
  .sources-bar {
    grid-template-columns: 1fr;
  }

  .intel-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    gap: 0.55rem;
  }

  .quick-chip {
    font-size: 0.73rem;
    padding: 0.28rem 0.55rem;
  }

  .comparison-cards-grid,
  .proposed-values-grid {
    grid-template-columns: 1fr;
  }

  .breakdown-step-table {
    font-size: 0.76rem;
  }
}
