* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: #f4f6f8;
  color: #222;
}
header {
  background: #263544;
  color: #fff;
  padding: 16px 24px;
}
header h1 { margin: 0; font-size: 1.4rem; }
header p { margin: 4px 0 0; color: #aebccb; font-size: 0.9rem; }

.page-title {
  margin: 0 0 4px;
  font-size: 1.5rem;
  color: #263544;
}

.page-subtitle {
  margin: 0 0 18px;
  color: #667085;
  font-size: 0.95rem;
}

main.legal {
  max-width: 780px;
}

.legal h2 {
  margin: 1.8em 0 0.5em;
  font-size: 1.25rem;
  color: #263544;
}

.legal h3 {
  margin: 1.4em 0 0.4em;
  font-size: 1.05rem;
  color: #263544;
}

.legal p,
.legal li {
  line-height: 1.75;
  color: #333;
}

.legal ul {
  margin: 0.6em 0;
  padding-left: 1.4em;
}

.legal a { color: #167a52; }

.legal hr {
  border: 0;
  border-top: 1px solid #e5e5e5;
  margin: 2em 0;
}

.legal .legal-updated {
  color: #667085;
  font-size: 0.95rem;
  margin: 0 0 1.5em;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #f0b85a;
  color: #263544;
  font-weight: 900;
}
.auth-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 12%, rgba(240, 184, 90, 0.22), transparent 28%),
    linear-gradient(135deg, #edf5f0 0%, #f8f2e8 54%, #edf2f6 100%);
  color: #263544;
}
.auth-shell {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 460px);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.auth-story {
  min-height: min(720px, calc(100vh - 88px));
  padding: clamp(24px, 4vw, 44px);
  border-radius: 8px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(22, 84, 67, 0.92), rgba(38, 53, 68, 0.80)),
    url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=1600&q=80') center/cover;
  box-shadow: 0 24px 80px rgba(31, 46, 56, 0.20);
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 850;
}
.auth-kicker {
  margin: 0 0 12px;
  color: #f0b85a;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-story h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.15rem);
  line-height: 1;
  letter-spacing: 0;
}
.auth-story p:not(.auth-kicker) {
  max-width: 560px;
  margin: 22px 0 0;
  color: rgba(255,255,255,0.80);
  font-size: 1.08rem;
  line-height: 1.55;
}
.auth-proof-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 34px;
}
.auth-proof-grid span {
  min-height: 74px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 7px;
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.88);
  font-size: 0.86rem;
  font-weight: 750;
}
.auth-card {
  width: 100%;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(38, 53, 68, 0.10);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 38px);
  box-shadow: 0 18px 55px rgba(33, 45, 55, 0.14);
}
.auth-card-header h2 {
  margin: 0;
  color: #263544;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.08;
}
.auth-subtitle {
  margin: 10px 0 0;
  color: #61717c;
  line-height: 1.5;
}
.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}
.auth-form label {
  display: grid;
  gap: 7px;
  color: #43535e;
  font-size: 0.9rem;
  font-weight: 760;
}
.auth-form input {
  width: 100%;
  min-height: 50px;
  border: 2px solid #d6e1dc;
  border-radius: 7px;
  padding: 0 14px;
  background: #fbfdfc;
  color: #263544;
  font: inherit;
}
.auth-form input:focus {
  border-color: #167a52;
  outline: 3px solid rgba(22, 122, 82, 0.16);
}
.auth-form .auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  color: #43535e;
  font-size: 0.9rem;
}
.auth-form .auth-consent input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: #167a52;
}
.auth-form .auth-consent a { color: #167a52; }
.auth-submit {
  min-height: 52px;
  margin-top: 4px;
  background: #167a52;
  font-weight: 850;
  box-shadow: 0 12px 24px rgba(22, 122, 82, 0.18);
}
.auth-submit:hover {
  background: #0e6240;
}
.auth-status {
  min-height: 18px;
  margin: 0;
}
.auth-status.is-error,
.hint.is-error {
  color: #b42318;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 14px;
  color: #7c8a93;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #dce5e0;
}
.oauth-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.btn-oauth {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #d8e1dc;
  border-radius: 7px;
  background: #fff;
  color: #263544;
  font-weight: 800;
  cursor: pointer;
}
.btn-oauth svg {
  width: 19px;
  height: 19px;
}
.btn-oauth.is-disabled,
.btn-oauth:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}
.auth-switch {
  margin: 24px 0 0;
  color: #61717c;
  text-align: center;
}
.auth-switch a {
  color: #167a52;
  font-weight: 850;
  text-decoration: none;
}
.auth-switch a:hover {
  text-decoration: underline;
}
.welcome-dialog {
  width: min(420px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 26px;
  text-align: center;
  color: #263544;
}
.welcome-dialog::backdrop { background: rgba(20, 30, 40, 0.55); }
.welcome-dialog h2 { margin: 0 0 10px; color: #167a52; }
.welcome-dialog p { color: #61717c; line-height: 1.55; }
.welcome-dialog .primary-btn { margin-top: 10px; }
.captcha-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe6e1;
  border-radius: 7px;
  background: #f5f8f6;
}
.captcha-question {
  color: #263544;
  font-weight: 850;
}

main {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

section.panel {
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

section.panel h2 {
  margin-top: 0;
  font-size: 1.1rem;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 8px;
}

.form-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}
.form-row[hidden] { display: none !important; }
.form-row label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: #555;
  gap: 4px;
}
.form-row input, .form-row select, .form-row textarea {
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}
.form-row textarea {
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}
.readonly-display {
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.95rem;
  background: #eee;
  color: #888;
}

.cadastre-table tr.row-match {
  background: #d8f3cd;
  font-weight: 600;
}
.cadastre-table tr.row-match td {
  border-top: 2px solid #4c9a2a;
  border-bottom: 2px solid #4c9a2a;
}
.match-legend {
  color: #2f6b17;
  font-weight: 600;
}

.cadastre-table .score-cell {
  white-space: nowrap;
  cursor: help;
  font-size: 1.05rem;
}
.cadastre-table .score-cell .hint {
  font-size: 0.75rem;
}
.cadastre-table tr.score-high {
  background: #d8f3cd;
}
.cadastre-table tr.score-high .score-cell {
  color: #2f6b17;
  border-left: 4px solid #4c9a2a;
}
.cadastre-table tr.score-mid {
  background: #fdf6d8;
}
.cadastre-table tr.score-mid .score-cell {
  color: #8a6d00;
  border-left: 4px solid #d4b106;
}
.cadastre-table tr.score-low .score-cell {
  color: #8c8c8c;
  border-left: 4px solid #d9d9d9;
}

.views-grid {
  display: block;
}

.tabs-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 0;
}
.tab-btn {
  border: 1px solid #e0e0e0;
  border-bottom: none;
  background: #eef1f4;
  color: #444;
  padding: 9px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  position: relative;
  top: 2px;
}
.tab-btn.active {
  background: #fff;
  color: #2c7be5;
  font-weight: bold;
  border-color: #e0e0e0;
  border-bottom: 2px solid #fff;
}
.tab-btn .tab-count {
  display: inline-block;
  margin-left: 6px;
  background: #2c7be5;
  color: #fff;
  border-radius: 10px;
  font-size: 0.7rem;
  padding: 1px 6px;
}
.tab-btn.active .tab-count { background: #1a5fc4; }

.view-card {
  display: none;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  background: #fafbfc;
}
.view-card.active-tab { display: block; }
.view-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.view-card .toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cat-btn {
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  color: #fff;
  opacity: 0.85;
}
.cat-btn.active { border-color: #222; opacity: 1; font-weight: bold; }
.cat-btn.hidden-cat { opacity: 0.35; text-decoration: line-through; }
/* Les couleurs de catégorie sont appliquées en inline style depuis CATEGORIES (js/polygonEditor.js) */

.action-btn {
  border: 1px solid #999;
  background: #eee;
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}
.action-btn:hover { background: #ddd; }
.floor-btn.active { background: #2c7be5; color: #fff; border-color: #1a5fc4; }
.shape-btn.active { background: #2c7be5; color: #fff; border-color: #1a5fc4; }
#btn-edit-toggle.active { background: #e0a800; border-color: #c18e00; color: #fff; }
.edit-mode-btn { display: none; }
.edit-mode-btn.active { background: #2c7be5; color: #fff; border-color: #1a5fc4; }
#edit-toolbar { margin-bottom: 8px; align-items: center; }

.canvas-wrap {
  position: relative;
  width: 100%;
  overflow: auto;
  background: #eee repeating-linear-gradient(45deg, #ddd 0 10px, #eee 10px 20px);
  border-radius: 4px;
  max-height: 75vh;
}
canvas {
  display: block;
  max-width: 100%;
  cursor: crosshair;
}

.polygon-list {
  margin-top: 8px;
  font-size: 0.8rem;
}
.polygon-list .poly-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  margin: 2px 4px 2px 0;
  color: #fff;
}
.polygon-list .poly-item button {
  border: none;
  background: rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  cursor: pointer;
  line-height: 1;
}
.polygon-list .poly-item.poly-hidden { opacity: 0.4; }

.primary-btn {
  background: #2c7be5;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 10px 18px;
  font-size: 0.95rem;
  cursor: pointer;
}
.primary-btn:hover { background: #1a5fc4; }

.listing-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: #d9e0e6;
  border: 1px solid #d9e0e6;
}
.listing-details-grid div { background: #f8fafb; padding: 10px; min-height: 58px; }
.listing-details-grid span { display: block; color: #66717d; font-size: 0.78rem; margin-bottom: 4px; }
.listing-details-grid strong { color: #263544; font-size: 0.95rem; }
.listing-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.source-link { color: #1a5fc4; border: 1px solid #9dbce5; border-radius: 4px; padding: 5px 8px; font-size: 0.85rem; }
.listing-gallery { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; margin-top: 16px; }
.listing-gallery-main { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: #eef1f4; cursor: zoom-in; min-height: 360px; }
.listing-gallery-main img { display: block; width: 100%; height: 100%; max-height: 520px; object-fit: cover; }
.listing-gallery-thumbs { display: grid; gap: 8px; max-height: 520px; overflow: auto; padding-right: 3px; }
.listing-gallery-thumb { padding: 0; border: 3px solid transparent; border-radius: 7px; overflow: hidden; background: #eef1f4; cursor: pointer; min-height: 82px; }
.listing-gallery-thumb.active { border-color: #167a52; }
.listing-gallery-thumb img { display: block; width: 100%; height: 82px; object-fit: cover; }
.photo-lightbox { width: min(1100px, calc(100vw - 28px)); height: min(760px, calc(100vh - 28px)); border: 0; border-radius: 8px; padding: 0; background: #101820; overflow: hidden; }
.photo-lightbox::backdrop { background: rgba(8, 15, 20, 0.82); }
.photo-lightbox img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-lightbox .dialog-close { position: absolute; right: 14px; top: 10px; color: #fff; z-index: 3; }
.photo-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 72px; border: 0; background: rgba(255,255,255,0.16); color: #fff; font-size: 3rem; cursor: pointer; z-index: 2; }
.photo-nav:hover { background: rgba(255,255,255,0.26); }
.photo-prev { left: 0; }
.photo-next { right: 0; }

#status-msg {
  font-size: 0.85rem;
  color: #2c7be5;
  margin-left: 12px;
}

.recon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
#three-canvas-wrap, #top-canvas-wrap {
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f0f2f4;
}
#three-canvas-wrap { height: 480px; position: relative; overflow: hidden; }
#top-canvas { width: 100%; height: auto; background: #fff; }

.dim-label {
  position: absolute;
  transform: translate(-50%, -50%);
  background: #ff3355;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
}

.hint {
  font-size: 0.78rem;
  color: #777;
  margin-top: 4px;
}

.cadastre-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 760px;
  font-size: 0.85rem;
  margin-top: 8px;
}
.cadastre-table th, .cadastre-table td {
  border: 1px solid #e0e0e0;
  padding: 6px 10px;
  text-align: left;
}
.cadastre-table th {
  background: #f4f6f8;
}

.cadastre-results { margin-top: 14px; overflow-x: auto; }
.manual-address-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 12px; align-items: end; margin: 18px 0 0; padding: 16px; border: 1px solid #dce5e0; border-radius: 8px; background: #f8fafb; }
.manual-address-form label { display: grid; gap: 7px; color: #43535e; font-size: 0.9rem; font-weight: 760; }
.manual-address-form input { min-height: 44px; border: 2px solid #d6e1dc; border-radius: 7px; padding: 0 12px; font: inherit; }
.manual-address-form input:focus { border-color: #167a52; outline: 3px solid rgba(22, 122, 82, 0.16); }
.manual-address-form .hint { grid-column: 1 / -1; margin: 0; }
.widen-search-btn { display: none; margin-top: 10px; }
.new-search-link { margin-top: 16px; }

.candidate-vote-btn { white-space: nowrap; }
.search-progress { height: 4px; overflow: hidden; background: #dbe4ea; margin: 8px 0; }
.search-progress span { display: block; width: 35%; height: 100%; background: #2c7be5; animation: search-progress 1.1s ease-in-out infinite; }
@keyframes search-progress { from { transform: translateX(-120%); } to { transform: translateX(360%); } }
.find-home-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 22px; border: 0; border-radius: 6px; background: #167a52; color: #fff; font-size: 1.05rem; font-weight: 700; cursor: pointer; box-shadow: 0 2px 5px rgba(10, 78, 50, 0.24); }
.find-home-btn:hover { background: #0e6240; }
.find-home-btn span { font-size: 1.6rem; line-height: 1; }
.candidate-count { margin: 0 0 16px; color: #167a52; font-weight: 850; }
.candidate-actions { display: flex; gap: 12px; align-items: stretch; justify-content: center; flex-wrap: wrap; margin: 18px 0 20px; }
.candidate-actions .find-home-btn { min-width: min(100%, 340px); justify-content: center; }
.manual-address-btn, .certain-home-btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 56px; padding: 12px 18px; border: 0; border-radius: 6px; background: #f0b85a; color: #263544; font-size: 1rem; font-weight: 850; cursor: pointer; box-shadow: 0 2px 5px rgba(98, 70, 20, 0.18); }
.manual-address-btn:hover, .certain-home-btn:hover { background: #ffca70; }
.manual-address-btn span, .certain-home-btn span { font-size: 1.25rem; line-height: 1; }
.admin-known-listing-btn { min-height: 56px; padding: 10px 18px; border: 2px solid #9b1c1c; border-radius: 6px; background: #fff2f2; color: #7f1d1d; font-size: 0.88rem; font-weight: 700; line-height: 1.2; cursor: pointer; }
.admin-known-listing-btn:hover { background: #fee2e2; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.admin-nav a { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 11px; border-radius: 6px; background: #263544; color: #fff; text-decoration: none; font-weight: 700; font-size: 0.86rem; }
.admin-nav a:hover { background: #167a52; }
.admin-entry-link { background: #9b1c1c !important; }
.admin-entry-link:hover { background: #7f1d1d !important; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.admin-stat-grid article { padding: 14px; border: 1px solid #dbe4ea; border-radius: 7px; background: #f8fafb; }
.admin-stat-grid strong { display: block; color: #167a52; font-size: 1.7rem; }
.admin-stat-grid span { color: #61717c; font-size: 0.86rem; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.admin-toolbar input[type="search"] { flex: 1 1 220px; min-height: 40px; border: 1px solid #ccc; border-radius: 6px; padding: 0 12px; font: inherit; }
#table-wrap { overflow-x: auto; }
.admin-users-table { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 0.85rem; }
.admin-users-table th, .admin-users-table td { border: 1px solid #e0e0e0; padding: 8px 10px; text-align: left; }
.admin-users-table th { background: #f4f6f8; }
.role-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e7edf2; color: #4d5c68; font-size: 0.76rem; font-weight: 700; }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; }
.status-active { background: #dcf3e6; color: #14603f; }
.status-suspended { background: #fdecc8; color: #7c4a03; }
.status-disabled { background: #f9d7d4; color: #8a1f1f; }
.oauth-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.oauth-tags span { padding: 2px 7px; border-radius: 999px; background: #eef1f4; color: #61717c; font-size: 0.72rem; }
.admin-user-dialog { width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; border: 0; border-radius: 8px; padding: 22px; color: #222; }
.admin-user-dialog::backdrop { background: rgba(20, 30, 40, 0.65); }
.admin-user-dialog dl { display: grid; grid-template-columns: 1fr 2fr; gap: 6px 14px; margin: 0; }
.admin-user-dialog dt { color: #61717c; font-size: 0.82rem; }
.admin-user-dialog dd { margin: 0; }

/* Historique des fiches maison */
.history-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.history-card { position: relative; display: flex; flex-direction: column; border: 1px solid #dbe4ea; border-radius: 9px; background: #fff; overflow: hidden; box-shadow: 0 1px 4px rgba(20, 40, 60, 0.08); transition: box-shadow 0.15s ease, transform 0.15s ease; }
.history-card:hover { box-shadow: 0 6px 16px rgba(20, 40, 60, 0.16); transform: translateY(-2px); }
.history-card-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.history-thumb { display: flex; align-items: center; justify-content: center; height: 168px; background: #eef2f5; color: #8a99a4; font-size: 0.85rem; }
.history-thumb img { width: 100%; height: 100%; object-fit: cover; }
.history-card-body { padding: 12px 14px 14px; }
.history-card-body h3 { margin: 0 0 4px; font-size: 1rem; line-height: 1.3; }
.history-price { margin: 0 0 10px; color: #167a52; font-size: 1.15rem; font-weight: 800; }
.history-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 10px; padding: 0; list-style: none; }
.history-facts li { display: flex; flex-direction: column; gap: 2px; }
.history-facts span { color: #7d8b95; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.02em; }
.history-facts strong { font-size: 0.9rem; }
.history-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.history-date { color: #7d8b95; font-size: 0.78rem; }
.history-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; }
.history-badge.is-valid { background: #dcf3e6; color: #14603f; }
.history-badge.is-warning { background: #fdecc8; color: #7c4a03; }
.history-badge.is-pending { background: #e7edf2; color: #4d5c68; }
.history-badge.is-rejected { background: #f9d7d4; color: #8a1f1f; }
.history-delete { position: absolute; right: 8px; top: 8px; padding: 5px 10px; font-size: 0.76rem; background: rgba(255, 255, 255, 0.92); }
.admin-house-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.history-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; padding: 11px 14px; border-radius: 7px; font-weight: 600; }
.history-notice.is-valid { background: #dcf3e6; color: #14603f; }
.history-notice.is-warning { background: #fdecc8; color: #7c4a03; }
.history-notice.is-pending { background: #e7edf2; color: #4d5c68; }
.known-listing-dialog label { min-width: min(100%, 260px); }
.known-listing-dialog label:first-child { flex: 1 1 100%; }
.candidate-vote-dialog { width: min(1400px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; border: 0; border-radius: 8px; padding: 22px; color: #222; }
.candidate-vote-dialog::backdrop { background: rgba(20, 30, 40, 0.65); }
.candidate-vote-dialog h2 { margin-top: 0; }
.dialog-close { float: right; border: 0; background: transparent; font-size: 1.8rem; cursor: pointer; }
.candidate-compare-grid { display: grid; gap: 16px; }
.map-view-grid { display: grid; grid-template-columns: repeat(2, minmax(260px, 1fr)); gap: 10px; }
.candidate-map .map-view-grid iframe, .candidate-map .tile-map-viewport { min-height: 460px; }
.map-view-grid iframe, .tile-map-viewport { width: 100%; min-height: 330px; border: 0; border-radius: 4px; }
.tile-map { position: relative; min-width: 0; }
.tile-map-toolbar { position: absolute; z-index: 3; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.tile-map-toolbar button, .tile-map-toolbar a { min-height: 32px; padding: 6px 10px; border: 1px solid rgba(38, 53, 68, .20); border-radius: 5px; background: rgba(255,255,255,.92); color: #263544; font: inherit; font-size: .82rem; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 0 3px 8px rgba(20,30,40,.16); }
.tile-map-toolbar button[aria-pressed="true"] { background: #167a52; border-color: #167a52; color: #fff; }
.tile-map-viewport { position: relative; overflow: hidden; background: #dbe4ea; cursor: grab; touch-action: none; }
.tile-map.is-panning .tile-map-viewport { cursor: grabbing; }
.tile-map-viewport img { position: absolute; width: 256px; height: 256px; max-width: none; -webkit-user-select: none; user-select: none; transform: translateZ(0); }
.tile-map-overlay { opacity: .9; }
.tile-map-marker { position: absolute; left: 50%; top: 50%; z-index: 2; width: 18px; height: 18px; border: 3px solid #fff; border-radius: 999px; background: #b42318; box-shadow: 0 0 0 2px #b42318, 0 8px 16px rgba(20,30,40,.28); transform: translate(-50%, -50%); }
.tile-map-tiles { position: absolute; inset: 0; z-index: 1; transform-origin: 50% 50%; }
.tile-map-marker-label { position: absolute; z-index: 3; padding: 2px 6px; border-radius: 4px; background: #b42318; color: #fff; font-size: .7rem; font-weight: 700; white-space: nowrap; pointer-events: none; transform: translate(-50%, 0); box-shadow: 0 2px 6px rgba(20,30,40,.25); }
.vote-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.vote-panel {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 46px;
  padding: 16px 20px;
  margin-top: 4px;
  border: 1px solid #e2e9ef;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(20, 30, 40, 0.06);
}
.vote-decision-col {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: 1 1 auto;
}
.vote-decision-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 300px;
  min-height: 118px;
  border: 0;
  border-radius: 14px;
  padding: 14px 24px;
  color: #fff;
  font-weight: 850;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(20, 30, 40, 0.18);
  transition: filter .15s ease, transform .08s ease, box-shadow .15s ease;
}
.vote-decision-btn:hover { filter: brightness(1.06); box-shadow: 0 10px 22px rgba(20, 30, 40, 0.24); }
.vote-decision-btn:active { transform: translateY(1px); }
.vote-thumb { font-size: 2.1rem; line-height: 1; }
.vote-text { font-size: 0.95rem; text-align: center; }
.yes-home-btn { background: linear-gradient(135deg, #23a86f 0%, #158057 100%); }
.no-home-btn { background: linear-gradient(135deg, #d64942 0%, #b42318 100%); }
.reject-link-btn { align-self: stretch; font-weight: 750; }
.vote-sure-zone {
  display: flex;
  align-items: center;
  justify-content: center;
}
.certain-decision-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 150px;
  height: 118px;
  border: 2px dashed #e0b24f;
  border-radius: 14px;
  padding: 12px;
  background: #fff8e7;
  color: #8a6116;
  font-weight: 850;
  font-size: .8rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background .15s ease, transform .08s ease;
}
.certain-decision-btn:hover { background: #ffefc2; border-color: #d3a13c; }
.certain-decision-btn:active { transform: scale(.97); }
.certain-star { font-size: 2rem; line-height: 1; }
@media (max-width: 700px) {
  .vote-panel { justify-content: center; gap: 30px; padding: 14px 14px; }
  .vote-decision-col { width: 100%; }
  .vote-decision-btn { max-width: none; min-width: 0; }
  .vote-sure-zone { width: 100%; }
  .certain-decision-btn { width: 170px; }
  .reject-link-btn { width: 100%; }
}
.candidate-compare-grid .vote-actions { justify-content: flex-end; }
.candidate-details { columns: 2; column-gap: 28px; padding-top: 2px; }
.candidate-details p { break-inside: avoid; margin: 0 0 8px; }
.candidate-vote-dialog.is-fullscreen { width: 100vw; max-width: none; height: 100vh; max-height: none; border-radius: 0; padding: 28px; }
.candidate-vote-dialog.is-fullscreen .candidate-map .map-view-grid iframe { height: calc(100vh - 250px); min-height: 500px; }
.candidate-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-top: 18px; }
.candidate-photos img { width: 100%; height: 110px; object-fit: cover; border-radius: 4px; }
.confirmed-home { max-width: 1400px; margin: 0 auto 22px; }
.no-home-found { max-width: 900px; margin: 0 auto 22px; border-left: 6px solid #f0b85a; }
.no-home-found p { color: #4f5d66; line-height: 1.55; }
.confirmed-home .map-view-grid iframe, .confirmed-home .tile-map-viewport { height: min(68vh, 680px); }
.house-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0; }
.house-detail-grid > section, .house-market, .house-map-section { border: 1px solid #dbe3df; border-radius: 8px; background: #fff; padding: 18px; }
.house-detail-grid h3, .house-market h3, .house-map-section h3 { margin: 0 0 14px; color: #263544; font-size: 1.05rem; }
.house-detail-grid h4 { margin: 18px 0 8px; color: #167a52; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.house-data-list { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.house-data-list div { border-left: 3px solid #dcefe6; padding-left: 9px; min-width: 0; }
.house-data-list dt { color: #61717c; font-size: .78rem; }
.house-data-list dd { margin: 3px 0 0; color: #263544; font-weight: 700; overflow-wrap: anywhere; }
.house-market { margin: 18px 0; }
.price-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.price-panel { border: 1px solid #dbe3df; border-radius: 8px; background: #fff; padding: 16px; }
.price-panel h4 { margin: 0 0 16px; color: #167a52; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.price-bar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: end; }
.price-bar { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.price-bar-track { position: relative; display: flex; align-items: flex-end; justify-content: center; height: 150px; width: 48px; max-width: 100%; background: #eef1f4; border-radius: 6px; overflow: hidden; }
.price-bar-fill { display: block; width: 100%; border-radius: 6px 6px 0 0; transition: height .35s ease; }
.price-bar.is-above .price-bar-fill { background: #d64550; }
.price-bar.is-fair .price-bar-fill { background: #e9b949; }
.price-bar.is-deal .price-bar-fill { background: #2f9e6b; }
.price-bar.is-ref .price-bar-fill { background: #6c93c2; }
.price-bar-verdict { min-height: 20px; display: flex; align-items: center; justify-content: center; color: #263544; font-size: .78rem; font-weight: 700; text-align: center; line-height: 1.15; }
.price-bar-value { color: #263544; font-size: 1rem; font-weight: 700; text-align: center; }
.price-bar-label { color: #61717c; font-size: .78rem; text-align: center; min-height: 34px; }
.house-map-section { margin-top: 18px; }
@media (max-width: 900px) { .map-view-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .house-detail-grid, .price-comparison { grid-template-columns: 1fr; } .price-bar-label { min-height: 0; } }
@media (max-width: 900px) { .recon-grid { grid-template-columns: 1fr; } #three-canvas-wrap { height: 340px; } }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; align-items: stretch; } .auth-story { min-height: 420px; } }
@media (max-width: 700px) { .auth-shell { padding: 0; gap: 0; } .auth-story, .auth-card { border-radius: 0; box-shadow: none; } .auth-story { min-height: 350px; } .auth-story h1 { font-size: 2.15rem; } .auth-proof-grid { grid-template-columns: 1fr; } .oauth-buttons { grid-template-columns: 1fr; } .listing-gallery { grid-template-columns: 1fr; } .listing-gallery-main { min-height: 240px; } .listing-gallery-thumbs { grid-template-columns: repeat(4, 1fr); max-height: none; overflow: visible; } .listing-gallery-thumb { min-height: 64px; } .listing-gallery-thumb img { height: 64px; } .manual-address-form { grid-template-columns: 1fr; } .map-view-grid iframe, .candidate-map .map-view-grid iframe, .tile-map-viewport, .candidate-map .tile-map-viewport { min-height: 260px; } .candidate-details { columns: 1; } .candidate-vote-dialog.is-fullscreen { padding: 16px; } .candidate-vote-dialog.is-fullscreen .candidate-map .map-view-grid iframe, .candidate-vote-dialog.is-fullscreen .candidate-map .tile-map-viewport { height: 55vh; min-height: 320px; } }
@media (max-width: 700px) { .house-data-list { grid-template-columns: 1fr; } .form-row label { flex: 1 1 100%; } .form-row input, .form-row select, .form-row textarea { width: 100%; } header { padding: 12px 16px; } header h1 { font-size: 1.2rem; } .tabs-bar { flex-wrap: nowrap; overflow-x: auto; } .admin-nav a { flex: 1 1 auto; justify-content: center; text-align: center; font-size: 0.8rem; padding: 6px 8px; } .admin-user-dialog dl { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .price-bar-grid { gap: 8px; } .price-bar-label { font-size: 0.72rem; } }
