:root {
  color-scheme: light;
  --ink: #16211b;
  --muted: #607066;
  --paper: #f5f6f1;
  --surface: #ffffff;
  --surface-soft: #fafbf8;
  --line: #dfe4dc;
  --line-strong: #c8d2ca;
  --accent: #145c42;
  --accent-hover: #0d4632;
  --header: #10271d;
  --live: #d9f1e6;
  --live-ink: #0b5037;
  --warning: #fff3c7;
  --warning-line: #d7ac26;
  --error: #fde3e3;
  --blue: #e5efff;
  --blue-ink: #214b87;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-size: 16px; line-height: 1.5; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
button, input, select, textarea { font: inherit; }

.site-header {
  min-height: 70px;
  padding: 13px max(24px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #fff;
  background: var(--header);
  border-bottom: 1px solid rgb(255 255 255 / 8%);
}
.brand-wrap { display: flex; align-items: center; gap: 11px; min-width: max-content; }
.eu-flag {
  width: 39px;
  height: 26px;
  display: block;
  flex: 0 0 auto;
  border: 1px solid rgb(255 255 255 / 28%);
  border-radius: 5px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
}
.brand { color: #fff; font-size: 1.2rem; font-weight: 800; text-decoration: none; }
.brand-note { display: block; color: #b8cabe; font-size: .76rem; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.header-actions a {
  padding: 8px 9px;
  border-radius: 8px;
  color: #dbe8df;
  font-size: .88rem;
  text-decoration: none;
}
.header-actions a:hover, .header-actions a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / 10%); }
.logout { margin-left: 5px; border: 1px solid #668375; }

.prototype-strip {
  padding: 8px 16px;
  color: #5b4700;
  background: #ffeaa1;
  border-bottom: 1px solid #e3c85e;
  font-size: .84rem;
  font-weight: 700;
  text-align: center;
}
.page-shell { width: min(1180px, calc(100% - 32px)); margin: 36px auto 64px; }
.page-heading, .detail-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.page-heading { margin-bottom: 24px; }
h1, h2, h3 { line-height: 1.18; }
h1 { margin: 3px 0 10px; font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -.025em; }
h2 { margin: 0 0 12px; font-size: 1.18rem; }
h3 { margin: 20px 0 8px; font-size: 1rem; }
p { margin-top: 0; }
.eyebrow { margin: 0; color: var(--accent); font-size: .76rem; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.muted, .address { color: var(--muted); }
.narrow { max-width: 760px; }
.count, .badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: #e4ece7; font-size: .78rem; font-weight: 780; white-space: nowrap; }
.badge.demo { color: #644e00; background: var(--warning); }
.badge.live { color: var(--live-ink); background: var(--live); }
.badge.info { color: var(--blue-ink); background: var(--blue); }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }

.message { margin: 20px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.message.warning { border-color: var(--warning-line); background: var(--warning); }
.message.error { border-color: #e6adad; background: var(--error); }
.message.compact { margin: 12px 0; }

.filter-panel, .settings-form, .form-card {
  margin: 22px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; }
.field label, .filter-grid label { display: block; margin: 0 0 6px; font-size: .82rem; font-weight: 750; }
input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #aebbb2;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 108px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { color: #637068; background: #f4f6f3; opacity: 1; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; color: var(--muted); }
.checkbox-row input { width: 20px; min-height: 20px; margin-top: 2px; }
.form-actions, .inline-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-actions { margin-top: 14px; }
button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 15px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
  font-weight: 760;
  text-decoration: none;
}
button[disabled], .button-link.disabled { cursor: not-allowed; opacity: .52; }
.secondary-link { border: 1px solid #668375; color: var(--accent); background: transparent; }

.lot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.lot-card, .detail-card, .panel, .metric {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(30 50 40 / 5%);
}
.lot-card { padding: 22px; border-radius: 18px; }
.lot-card h2 { margin-top: 12px; font-size: 1.22rem; }
.lot-meta { margin-top: 14px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .82rem; }
.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 670; }
.facts.compact { margin-top: 18px; }
.price { margin: 6px 0 18px; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }

.detail-card { overflow: hidden; border-radius: 18px; }
.detail-card > section, .detail-heading { padding: 26px; border-bottom: 1px solid var(--line); }
.detail-card > section:last-child { border-bottom: 0; }
.section-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 14px 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 8px 20px rgb(30 50 40 / 5%);
}
.section-nav a { flex: 0 0 auto; padding: 7px 9px; border-radius: 7px; text-decoration: none; }
.section-nav a:hover { background: #eef2ed; }
.document-analysis { margin: 12px 0; padding: 14px; border-left: 3px solid var(--line-strong); background: var(--surface-soft); }
blockquote { margin: 8px 0; padding: 9px 12px; border-left: 3px solid #9fb5a8; color: #34483d; background: #f1f5f2; }
.timeline { margin: 0; padding-left: 22px; }
.timeline li + li { margin-top: 12px; }
.back-link { text-decoration: none; }

.status-grid { margin: 20px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.metric { padding: 18px; border-radius: 12px; box-shadow: none; }
.metric strong, .metric span { display: block; }
.metric strong { font-size: 1.55rem; }
.metric span { margin-top: 2px; color: var(--muted); font-size: .88rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: #fafbf8; font-size: .78rem; }
tbody tr:last-child td { border-bottom: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.form-card { margin: 0; padding: 22px; }
.empty-state { padding: 42px; border: 1px dashed var(--line-strong); border-radius: 14px; color: var(--muted); text-align: center; background: rgb(255 255 255 / 46%); }

.map-shell { position: relative; min-height: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background-color: #e8eee7; background-image: linear-gradient(25deg, transparent 46%, rgb(122 143 129 / 20%) 47%, rgb(122 143 129 / 20%) 50%, transparent 51%), linear-gradient(115deg, transparent 46%, rgb(122 143 129 / 16%) 47%, rgb(122 143 129 / 16%) 50%, transparent 51%), linear-gradient(rgb(255 255 255 / 50%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 50%) 1px, transparent 1px); background-size: 140px 140px, 170px 170px, 36px 36px, 36px 36px; }
.map-label { position: absolute; padding: 5px 8px; border-radius: 6px; color: #607066; background: rgb(255 255 255 / 72%); font-size: .75rem; }
.marker { position: absolute; width: 24px; height: 24px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50% 50% 50% 0; color: #fff; background: var(--accent); box-shadow: 0 4px 10px rgb(20 60 44 / 25%); transform: rotate(-45deg); }
.marker span { font-size: .66rem; font-weight: 800; transform: rotate(45deg); }
.map-card { position: absolute; right: 18px; bottom: 18px; width: min(350px, calc(100% - 36px)); padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgb(255 255 255 / 96%); box-shadow: 0 14px 30px rgb(30 50 40 / 16%); }
.map-card h2 { font-size: 1rem; }

.progress { height: 8px; overflow: hidden; border-radius: 999px; background: #e3e8e2; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.stat-line { display: flex; justify-content: space-between; gap: 16px; margin: 8px 0 5px; font-size: .86rem; }
code { font-size: .88em; word-break: break-all; }
details { margin-top: 12px; }
summary { color: var(--accent); font-weight: 700; cursor: pointer; }
.footer { width: min(1180px, calc(100% - 32px)); margin: -20px auto 34px; color: var(--muted); font-size: .8rem; }

@media (max-width: 1040px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  .header-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .page-shell { margin-top: 24px; }
  .page-heading, .detail-heading { display: block; }
  .page-heading .count, .detail-heading .badge { margin-top: 10px; }
  .lot-grid, .form-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .detail-card > section, .detail-heading { padding: 20px; }
  .map-shell { min-height: 460px; }
}
@media (max-width: 560px) {
  .site-header { padding-inline: 16px; }
  .brand-note { display: none; }
  .header-actions { gap: 2px; }
  .header-actions a { padding: 7px; font-size: .82rem; }
  .logout { margin-left: 0; }
  .page-shell { width: min(100% - 22px, 1180px); }
  .lot-card { padding: 18px; }
  .filter-grid { grid-template-columns: 1fr; }
  .form-actions > *, .inline-form > * { width: 100%; }
  th, td { min-width: 135px; }
  .section-nav { margin-inline: -3px; }
}


/* Live catalogue additions */
.prototype-strip.live-strip { color: #dff5ea; background: #184e3b; border-bottom-color: #266b52; }
.filter-query { grid-column: span 2; }
.full-span { grid-column: 1 / -1; }
.table-note { display: block; max-width: 480px; margin-top: 5px; color: var(--muted); line-height: 1.35; }
@media (max-width: 760px) { .filter-query { grid-column: auto; } }
