:root {
  --ink: #122029;
  --muted: #4d5f6d;
  --paper: #eef3f5;
  --paper-deep: #dce7ec;
  --accent: #0d6e6e;
  --accent-dark: #0a4f4f;
  --accent-soft: #b7d9d6;
  --line: #c5d2d8;
  --ok: #1b6b3a;
  --warn: #8a5a00;
  --err: #8b1e1e;
  --radius: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --header-h: 68px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 90% 55% at 0% -5%, #cfe0e8 0%, transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, #d5e8e4 0%, transparent 50%),
    var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  min-height: var(--header-h);
  border-bottom: 1px solid rgba(197, 210, 216, 0.7);
  background: rgba(238, 243, 245, 0.88);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; color: var(--accent-dark); }
.nav { display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--ink); font-weight: 500; font-size: 0.92rem; }
.nav a.nav-dash {
  font-weight: 700;
  color: var(--accent-dark);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(13, 110, 110, 0.1);
}
.logout-form { display: inline; margin: 0; }

.site-footer {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 2rem;
  padding: 2.5rem 1.5rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  background: linear-gradient(180deg, transparent, rgba(220, 231, 236, 0.55));
}
.footer-brand strong {
  display: block;
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
}
.footer-brand p { margin: 0; max-width: 28rem; line-height: 1.5; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.footer-cols h4 {
  margin: 0 0 0.6rem;
  color: var(--ink);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer-cols a {
  display: block;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
@media (max-width: 800px) {
  .site-footer { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
}

.flash-wrap { max-width: 960px; margin: 1rem auto 0; padding: 0 1rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  border: 1px solid var(--line);
  background: #fff;
}
.flash-success { border-color: #9dceb0; color: var(--ok); }
.flash-error { border-color: #e0a8a8; color: var(--err); }
.flash-warning { border-color: #e0c98a; color: var(--warn); }
.flash-info {
  border-color: #a8c9e0;
  color: #1a4a66;
  background: #eef6fb;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.2s ease, filter 0.2s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none !important; transform: translateY(-1px); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.875rem; }
.btn-lg { padding: 0.9rem 1.35rem; font-size: 1.02rem; }
.btn-secondary { background: var(--ink); }
.btn-outline {
  background: transparent;
  color: var(--ink) !important;
  border: 1px solid var(--line);
}
.btn-ghost {
  background: rgba(255,255,255,0.12);
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(6px);
}
.btn-accent { background: var(--accent-dark); }
.btn-danger {
  background: #c62828;
  color: #fff;
}
.btn-danger:hover { background: #b71c1c; }

.input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.checkbox { width: 1.1rem; height: 1.1rem; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.wrap-narrow { max-width: 480px; margin: 0 auto; padding: 2.5rem 1.25rem; }

/* —— Landing hero full-bleed —— */
.page-landing .site-header {
  position: absolute;
  inset: 0 0 auto 0;
  background: transparent;
  border-bottom-color: transparent;
  color: #fff;
}
.page-landing .site-header .brand,
.page-landing .nav a { color: #f4fafa; }
.page-landing .nav a.nav-dash {
  color: #081c22;
  background: rgba(244, 250, 250, 0.95);
}
.page-landing .nav .btn-outline {
  color: #fff !important;
  border-color: rgba(255,255,255,0.4);
}

.hero-bleed {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #f4fafa;
}
.hero-bleed__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bleed__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
  display: block;
  animation: heroZoom 22s ease-in-out infinite alternate;
}
.hero-bleed__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(105deg, rgba(8, 28, 34, 0.88) 0%, rgba(8, 28, 34, 0.72) 42%, rgba(8, 28, 34, 0.28) 100%),
    linear-gradient(0deg, rgba(8, 28, 34, 0.55) 0%, transparent 45%);
}
.hero-bleed__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: calc(var(--header-h) + 4rem) 1.5rem 4.5rem;
}
.hero-brand {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}
.hero-bleed h1,
.seo-hero h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 5.2vw, 3.55rem);
  line-height: 1.06;
  margin: 0 0 1rem;
  letter-spacing: -0.025em;
  font-weight: 700;
  max-width: 16ch;
}
.hero-lead {
  font-size: 1.15rem;
  line-height: 1.55;
  margin: 0 0 1.75rem;
  max-width: 34rem;
  color: rgba(244, 250, 250, 0.86);
}
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.center-row { justify-content: center; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: riseIn 0.8s ease forwards;
}
.reveal-delay-1 { animation-delay: 0.12s; }
.reveal-delay-2 { animation-delay: 0.24s; }
.reveal-delay-3 { animation-delay: 0.36s; }

@keyframes riseIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.section {
  padding: 4.5rem 1.5rem;
}
.section-alt {
  background:
    linear-gradient(180deg, rgba(220, 231, 236, 0.55), rgba(220, 231, 236, 0.2));
}
.section-cta {
  background:
    radial-gradient(ellipse 70% 80% at 50% 100%, rgba(13, 110, 110, 0.12), transparent 60%);
}
.section-inner { max-width: 1040px; margin: 0 auto; }
.section-inner.center { text-align: center; }
.section h2 {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.section-lead {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
  margin: 0 0 2rem;
  max-width: 38rem;
}
.center .section-lead { margin-left: auto; margin-right: auto; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
}
.steps li { min-width: 0; }
.step-num {
  display: block;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.steps h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}
.steps p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
@media (max-width: 800px) {
  .steps { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-bleed__content { padding-bottom: 3rem; }
  .page-landing .site-header { position: sticky; background: rgba(8, 28, 34, 0.92); }
}

.split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 800px) {
  .split { grid-template-columns: 1fr; }
}
.feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.feature-list li {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
}
.feature-list li:first-child { border-top: 1px solid var(--line); }

/* SEO pages */
.seo-page { max-width: 820px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.seo-hero {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.seo-hero .hero-brand { color: var(--accent-dark); }
.seo-hero h1 {
  max-width: none;
  color: var(--ink);
}
.seo-hero .hero-lead {
  color: var(--muted);
}
.seo-body {
  line-height: 1.7;
  font-size: 1.05rem;
}
.seo-body h2 {
  font-family: var(--display);
  font-size: 1.55rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}
.seo-body ul, .seo-body ol { padding-left: 1.2rem; }
.seo-body li { margin-bottom: 0.35rem; }
.seo-related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.seo-related h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}
.seo-related ul { margin: 0; padding-left: 1.1rem; }
.seo-related li { margin-bottom: 0.35rem; }

.price-rows { display: flex; flex-direction: column; gap: 0.75rem; margin: 1.5rem 0; }
.price-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.price-row h3 { margin: 0; font-family: var(--display); font-size: 1.25rem; }
.price-row__price {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  line-height: 1.15;
}
.price-row__was {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: line-through;
}
@media (max-width: 600px) {
  .price-row { grid-template-columns: 1fr; gap: 0.5rem; }
}

.panel {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
}
.panel h2, .panel h3 { margin-top: 0; font-family: var(--display); }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 860px) {
  .grid-2 { grid-template-columns: 1.2fr 0.8fr; }
}

.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 0.85rem; }
.label { font-size: 0.875rem; font-weight: 600; display: block; margin-bottom: 0.3rem; }

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.pack {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.pack .price {
  font-family: var(--display);
  font-size: 1.8rem;
  margin: 0.25rem 0;
}
.legal { max-width: 720px; margin: 0 auto; padding: 2rem 1.25rem 3rem; line-height: 1.6; }
.legal h1 { font-family: var(--display); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
}
.stat strong { display: block; font-size: 1.6rem; font-family: var(--display); }

/* Legacy hero (auth pages etc.) */
.hero {
  min-height: calc(100vh - 140px);
  display: grid;
  align-items: center;
  padding: 3rem 1.5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* —— One-shot landing —— */
.hero-oneshot {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + 1.5rem) 1.25rem 2.5rem;
  overflow: hidden;
  color: #f4fafa;
}
.hero-oneshot__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-oneshot__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroZoom 22s ease-in-out infinite alternate;
}
.hero-oneshot__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(160deg, rgba(8, 28, 34, 0.9) 0%, rgba(8, 28, 34, 0.72) 50%, rgba(8, 28, 34, 0.55) 100%);
}
.hero-oneshot__panel {
  position: relative;
  z-index: 2;
  width: min(560px, 100%);
  text-align: center;
}
.hero-oneshot__panel h1 {
  font-family: var(--display);
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  line-height: 1.08;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}
.hero-oneshot .hero-lead {
  margin-left: auto;
  margin-right: auto;
}
.btn-block { width: 100%; }

.dropzone {
  margin: 1.25rem 0 0.85rem;
  border: 1.5px dashed rgba(255,255,255,0.45);
  border-radius: 16px;
  padding: 1.75rem 1.25rem;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  text-align: left;
}
.dropzone:hover, .dropzone.is-drag {
  border-color: #9fd0d0;
  background: rgba(255,255,255,0.14);
  transform: translateY(-1px);
}
.dropzone__idle {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: center;
  text-align: center;
  color: rgba(244,250,250,0.9);
}
.dropzone__idle strong { font-size: 1.05rem; }
.dropzone__idle span { font-size: 0.9rem; color: rgba(244,250,250,0.65); }
.dropzone.has-files .dropzone__idle { display: none; }
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow: auto;
}
.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 0.9rem;
}
.file-list button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
}
.file-list button:hover { opacity: 1; }
.drop-error {
  color: #ffb4b4;
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

/* Modal auth */
body.modal-open { overflow: hidden; }
.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 28, 0.65);
  backdrop-filter: blur(3px);
}
.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #f7fafb;
  color: var(--ink);
  border-radius: 16px;
  padding: 1.5rem 1.35rem 1.35rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  animation: riseIn 0.35s ease;
}
.modal__dialog h2 {
  font-family: var(--display);
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
}
.modal__close {
  position: absolute;
  top: 0.55rem;
  right: 0.7rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}
.modal__dialog--danger {
  text-align: center;
  padding-top: 1.75rem;
}
.delete-modal__icon {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  background: rgba(198, 40, 40, 0.12);
  color: #c62828;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 3rem;
}
.delete-modal__lead {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
}
.delete-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 1.35rem;
}
.delete-modal__actions .btn { width: 100%; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 1rem 0;
  background: var(--paper-deep);
  padding: 0.25rem;
  border-radius: 10px;
}
.auth-tab {
  border: none;
  background: transparent;
  padding: 0.55rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.auth-tab.is-active {
  background: #fff;
  color: var(--ink);
}
.auth-error {
  color: var(--err);
  font-size: 0.9rem;
  margin: 0;
}
/* .stack { display:flex } écrase sinon l'attribut HTML hidden */
.auth-pane[hidden] {
  display: none !important;
}

/* Result dashboard */
.result-wrap { max-width: 860px; }
.result-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  gap: 1.5rem;
  align-items: start;
}
.result-main { min-width: 0; }
@media (max-width: 1180px) {
  .result-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .history-col { grid-column: 1 / -1; order: 3; }
}
@media (max-width: 720px) {
  .result-layout { grid-template-columns: 1fr; }
  .dpe-scale-col { order: -1; }
  .history-col { order: 3; }
}

/* Étiquettes DPE Énergie + GES */
.dpe-scale-col {
  position: sticky;
  top: 1.25rem;
}
.dpe-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.dpe-scale {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.75rem 0.65rem 0.9rem;
  box-shadow: 0 1px 2px rgba(15, 35, 45, 0.04);
}
.dpe-scale__label {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.dpe-scale__bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dpe-bar {
  position: relative;
  display: flex;
  align-items: center;
  height: 26px;
  border-radius: 2px;
  padding: 0 0.45rem;
  font-weight: 800;
  font-size: 0.88rem;
  opacity: 0.38;
  transition: opacity 0.2s ease, transform 0.2s ease;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%);
}
.dpe-bar.is-active {
  opacity: 1;
  transform: scaleX(1.06);
  transform-origin: left center;
  box-shadow: 0 0 0 2px rgba(15, 35, 45, 0.2);
  z-index: 1;
}
.dpe-bar__letter { line-height: 1; }

/* Énergie — vert → rouge */
.dpe-bar--ep-a { background: #319a31; color: #fff; width: 58%; }
.dpe-bar--ep-b { background: #33cc31; color: #123; width: 66%; }
.dpe-bar--ep-c { background: #cbfc34; color: #123; width: 74%; }
.dpe-bar--ep-d { background: #fbfe06; color: #123; width: 82%; }
.dpe-bar--ep-e { background: #fbcc05; color: #123; width: 90%; }
.dpe-bar--ep-f { background: #f66733; color: #fff; width: 96%; }
.dpe-bar--ep-g { background: #ed0205; color: #fff; width: 100%; }

/* Climat / GES — violet officiel */
.dpe-bar--ges-a { background: #f2e8f9; color: #3a2450; width: 58%; }
.dpe-bar--ges-b { background: #e4d0f0; color: #3a2450; width: 66%; }
.dpe-bar--ges-c { background: #d5b8e8; color: #3a2450; width: 74%; }
.dpe-bar--ges-d { background: #c79fdf; color: #2d1a40; width: 82%; }
.dpe-bar--ges-e { background: #b887d7; color: #fff; width: 90%; }
.dpe-bar--ges-f { background: #a96ecf; color: #fff; width: 96%; }
.dpe-bar--ges-g { background: #8b3db0; color: #fff; width: 100%; }

.dpe-scale__meta { margin-top: 0.7rem; }
.dpe-scale__class {
  margin: 0;
  font-size: 0.88rem;
}
.dpe-scale__value {
  margin: 0.2rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.dpe-scale__unit {
  margin: 0.15rem 0 0;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.25;
}
.dpe-scale__error {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  line-height: 1.35;
}
.dpe-ref-lots {
  margin-top: 0.85rem;
  padding: 0.65rem 0.7rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--line);
  max-width: 16rem;
}
.dpe-ref-lots__title {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dpe-ref-lots__values {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}
.dpe-ref-lots__hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
}
@media (max-width: 720px) {
  .dpe-dual { max-width: 360px; }
}
.result-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}
.result-header--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
}
.result-title-edit {
  width: 100%;
  max-width: 40rem;
}
.result-name {
  font-family: var(--display);
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  cursor: text;
  border-radius: 8px;
  outline: none;
  display: inline-block;
  max-width: 100%;
  word-break: break-word;
}
.result-name:hover,
.result-name:focus-visible {
  background: rgba(13, 110, 110, 0.08);
  box-shadow: inset 0 0 0 1px rgba(13, 110, 110, 0.25);
}
.result-name-input {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 700;
  width: 100%;
  max-width: 40rem;
  margin: 0;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
}
.result-name-hint {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
}
.result-header--stack .result-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  width: auto;
  max-width: 100%;
}
.result-header--stack .result-actions form {
  display: inline;
  margin: 0;
}
.result-pay-hint {
  font-size: 0.85rem;
  margin: 0;
}
.result-meta {
  margin: 0.15rem 0 0;
}
.dpe-kind-bar {
  margin: 0 0 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
}
.dpe-kind-bar__label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.dpe-kind-bar__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.dpe-kind-opt {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  margin: 0;
}
.dpe-kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.dpe-kind-opt span {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.dpe-kind-opt:hover span {
  border-color: var(--accent-soft);
}
.dpe-kind-opt.is-active span,
.dpe-kind-opt input:checked + span {
  border-color: var(--accent-dark);
  background: rgba(13, 110, 110, 0.1);
  color: var(--accent-dark);
}
.dpe-kind-bar--locked .dpe-kind-opt:not(.is-active) span {
  opacity: 0.45;
}
.dpe-kind-bar--locked .dpe-kind-opt {
  cursor: default;
}
.pay-info {
  margin: 0.75rem 0 1.1rem;
  font-size: 0.95rem;
  line-height: 1.45;
}
.pay-info ul {
  margin: 0.65rem 0;
  padding-left: 1.2rem;
}
.pay-info li { margin: 0.25rem 0; }
.pay-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}
.recalc-box--locked {
  border-style: solid;
  background: rgba(238, 246, 251, 0.7);
}
.vent-choice-bar {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e0c98a;
  border-radius: 12px;
  background: #fff8e8;
}
.vent-choice-bar__head { margin-bottom: 0.55rem; }
.vent-choice-bar__hint { margin: 0.25rem 0 0; font-size: 0.88rem; }
.vent-choice-bar__options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.vent-opt {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0;
  cursor: pointer;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
}
.vent-opt input { margin-top: 0.2rem; }
.vent-opt span { font-size: 0.9rem; line-height: 1.35; }
.vent-opt span small { color: var(--muted); }
.vent-opt.is-active,
.vent-opt:has(input:checked) {
  border-color: var(--accent-dark);
  background: rgba(13, 110, 110, 0.08);
}
.vent-choice-bar--locked {
  border-color: var(--line);
  background: rgba(238, 246, 251, 0.7);
}
.result-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.recalc-box {
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(255,255,255,0.55);
}
.recalc-box__title {
  margin: 0 0 0.75rem;
  font-weight: 600;
}
.add-dropzone {
  border: 1px dashed var(--accent-soft);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.add-dropzone strong { color: var(--ink); }
.add-dropzone.is-drag {
  border-color: var(--accent);
  background: rgba(13, 110, 110, 0.06);
}
.add-file-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  text-align: left;
}
.add-file-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  color: var(--ink);
}
.add-file-list button {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
}
.recalc-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.source-names {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.source-names__item {
  font-size: 0.8rem;
  background: var(--paper-deep);
  padding: 0.2rem 0.35rem 0.2rem 0.55rem;
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.source-names__form { display: inline; margin: 0; }
.source-names__remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 0.2rem;
  border-radius: 999px;
}
.source-names__remove:hover {
  color: #8b1e1e;
  background: rgba(139, 30, 30, 0.08);
}
.lot-remove-form {
  display: inline-flex;
  margin: 0 0 0 0.35rem;
  vertical-align: middle;
}
.lot-remove {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
}
.lot-remove:hover {
  color: #8b1e1e;
  border-color: #c98a8a;
  background: rgba(139, 30, 30, 0.06);
}
.history-col {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.78);
  padding: 1rem 1rem 1.15rem;
}
.history-col h2 {
  font-family: var(--display);
  font-size: 1.2rem;
  margin: 0 0 0.25rem;
}
.history-hint { margin: 0 0 0.55rem; font-size: 0.85rem; }
.history-search { display: block; margin: 0 0 0.75rem; }
.history-search__input {
  width: 100%;
  font-size: 0.85rem;
  padding: 0.45rem 0.65rem;
}
.history-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  max-height: 55vh;
  overflow: auto;
}
.history-list li { margin-bottom: 0.35rem; }
.history-row {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
  border-radius: 8px;
  border: 1px solid transparent;
}
.history-row__link {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.5rem 0.55rem 0.65rem;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px 0 0 8px;
}
.history-row__link:hover {
  background: var(--paper);
  text-decoration: none;
}
.history-row__link strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}
.history-row__link span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}
.history-row__link .history-addr {
  color: var(--ink);
  opacity: 0.75;
  margin-bottom: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-list li.is-current .history-row {
  border-color: var(--accent-soft);
  background: rgba(13, 110, 110, 0.08);
}
.history-row .history-del {
  align-self: center;
  margin-right: 0.2rem;
  flex-shrink: 0;
}
.history-del {
  appearance: none;
  border: 0;
  background: transparent;
  color: #c62828;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.history-del:hover {
  background: rgba(198, 40, 40, 0.12);
  color: #b71c1c;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.result-header h1 {
  font-family: var(--display);
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}
.eyebrow {
  margin: 0;
  font-family: var(--display);
  color: var(--accent-dark);
  font-weight: 700;
}
.result-header--stack .result-name {
  color: var(--accent-dark);
  font-weight: 700;
}
.result-section { margin-bottom: 2rem; }
.result-section h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  margin: 0 0 0.85rem;
}
.lot-stack { display: flex; flex-direction: column; gap: 0.55rem; }
.lot-acc {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.75);
  overflow: hidden;
}
.lot-acc > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 2.4rem 0.95rem 1.1rem;
  position: relative;
}
.lot-acc > summary::-webkit-details-marker { display: none; }
.lot-acc > summary::after {
  content: "";
  position: absolute;
  right: 1.15rem;
  top: 50%;
  width: 0.48rem;
  height: 0.48rem;
  margin-top: -0.38rem;
  border-right: 2px solid #6a7a84;
  border-bottom: 2px solid #6a7a84;
  transform: rotate(45deg);
  transition: transform 0.15s ease, margin-top 0.15s ease;
  pointer-events: none;
}
.lot-acc[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: -0.08rem;
}
.lot-acc__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
}
.lot-acc__titles {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.lot-acc__title { font-weight: 700; }
.lot-ademe {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: #0b5f4b;
  background: #e7f5ef;
  border: 1px solid #b7dccb;
  border-radius: 999px;
  vertical-align: middle;
}
.lot-ademe:hover {
  background: #d5efe3;
  color: #084536;
}
.lot-acc__sub { color: var(--muted); font-size: 0.92rem; }
.lot-acc__notes {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.lot-note-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.lot-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 6px;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  color: #123;
  flex-shrink: 0;
}
.lot-note-val {
  display: flex;
  flex-direction: column;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}
.lot-note-val small {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
}
.lot-note--ep.lot-note--a { background: #319a31; color: #fff; }
.lot-note--ep.lot-note--b { background: #33cc31; }
.lot-note--ep.lot-note--c { background: #cbfc34; }
.lot-note--ep.lot-note--d { background: #fbfe06; }
.lot-note--ep.lot-note--e { background: #fbcc05; }
.lot-note--ep.lot-note--f { background: #f66733; color: #fff; }
.lot-note--ep.lot-note--g { background: #ed0205; color: #fff; }
.lot-note--ges.lot-note-ges--a { background: #f2e8f9; color: #3a2450; }
.lot-note--ges.lot-note-ges--b { background: #e4d0f0; color: #3a2450; }
.lot-note--ges.lot-note-ges--c { background: #d5b8e8; color: #3a2450; }
.lot-note--ges.lot-note-ges--d { background: #c79fdf; color: #2d1a40; }
.lot-note--ges.lot-note-ges--e { background: #b887d7; color: #fff; }
.lot-note--ges.lot-note-ges--f { background: #a96ecf; color: #fff; }
.lot-note--ges.lot-note-ges--g { background: #8b3db0; color: #fff; }
.lot-acc[open] summary { border-bottom: 1px solid var(--line); }
.kv {
  margin: 0;
  padding: 0.85rem 1.1rem 1.1rem;
  display: grid;
  gap: 0.55rem;
}
.kv > div {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: 0.75rem;
  font-size: 0.95rem;
}
.kv dt { color: var(--muted); margin: 0; }
.kv dd { margin: 0; font-weight: 500; }
@media (max-width: 600px) {
  .kv > div { grid-template-columns: 1fr; gap: 0.15rem; }
}
.result-footer-cta {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}

.lot-acc__inner { padding: 0.75rem 1rem 1.1rem; }

.comp-stack { display: flex; flex-direction: column; gap: 0.45rem; }
.comp-acc {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.comp-acc > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 2.1rem 0.7rem 0.9rem;
  font-weight: 600;
  position: relative;
}
.comp-acc > summary::-webkit-details-marker { display: none; }
.comp-acc > summary::after {
  content: "";
  position: absolute;
  right: 0.95rem;
  top: 50%;
  width: 0.42rem;
  height: 0.42rem;
  margin-top: -0.34rem;
  border-right: 2px solid #6a7a84;
  border-bottom: 2px solid #6a7a84;
  transform: rotate(45deg);
  transition: transform 0.15s ease, margin-top 0.15s ease;
  pointer-events: none;
}
.comp-acc[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: -0.06rem;
}
.comp-acc__count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: rgba(13, 110, 110, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.comp-acc__body {
  padding: 0 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border-top: 1px solid var(--line);
}
.comp-item {
  border: 1px solid var(--paper-deep);
  border-radius: 8px;
  background: var(--paper);
}
.comp-item > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.55rem 1.9rem 0.55rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  position: relative;
}
.comp-item > summary::-webkit-details-marker { display: none; }
.comp-item > summary::after {
  content: "";
  position: absolute;
  right: 0.8rem;
  top: 50%;
  width: 0.38rem;
  height: 0.38rem;
  margin-top: -0.3rem;
  border-right: 2px solid #6a7a84;
  border-bottom: 2px solid #6a7a84;
  transform: rotate(45deg);
  transition: transform 0.15s ease, margin-top 0.15s ease;
  pointer-events: none;
}
.comp-item[open] > summary::after {
  transform: rotate(-135deg);
  margin-top: -0.04rem;
}
.comp-item[open] > summary {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.65);
}
.kv-compact { padding: 0.55rem 0.75rem 0.75rem; gap: 0.35rem; }
.kv-compact > div { grid-template-columns: 12rem 1fr; font-size: 0.88rem; }
@media (max-width: 600px) {
  .kv-compact > div { grid-template-columns: 1fr; }
}

/* Dashboard mes DPE */
.dash-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3.5rem;
}
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.dash-header h1 {
  font-family: var(--display);
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}
.dash-search {
  display: block;
  margin: 0 0 1rem;
}
.dash-search .input { width: 100%; }
.dash-addr {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
  opacity: 0.8;
  margin-top: 0.15rem;
}
.dash-empty-filter {
  margin: 0.5rem 0 0;
  text-align: center;
}
.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.dash-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dash-del-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
}
.dash-card:hover {
  border-color: var(--accent-soft);
  box-shadow: 0 2px 10px rgba(15, 35, 45, 0.06);
}
.dash-card__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  color: inherit;
  text-decoration: none;
}
.dash-card__main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.dash-card__main strong {
  font-size: 1.02rem;
}
.dash-card__meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}
.dash-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #123;
}
.dash-badge--a { background: #319a31; color: #fff; }
.dash-badge--b { background: #33cc31; }
.dash-badge--c { background: #cbfc34; }
.dash-badge--d { background: #fbfe06; }
.dash-badge--e { background: #fbcc05; }
.dash-badge--f { background: #f66733; color: #fff; }
.dash-badge--g { background: #ed0205; color: #fff; }
.dash-badge-ges--a { background: #f2e8f9; color: #3a2450; }
.dash-badge-ges--b { background: #e4d0f0; color: #3a2450; }
.dash-badge-ges--c { background: #d5b8e8; color: #3a2450; }
.dash-badge-ges--d { background: #c79fdf; color: #2d1a40; }
.dash-badge-ges--e { background: #b887d7; color: #fff; }
.dash-badge-ges--f { background: #a96ecf; color: #fff; }
.dash-badge-ges--g { background: #8b3db0; color: #fff; }
.dash-status {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.dash-status--paid { color: var(--accent-dark); }
.dash-card__arrow { color: var(--muted); font-size: 1.1rem; }
.dash-empty {
  text-align: center;
  padding: 2.5rem 1.25rem;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.6);
}
.dash-empty p { margin: 0 0 1rem; color: var(--muted); }
