:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --text: #1b2226;
  --muted: #58656d;
  --border: #d8d2c6;
  --accent: #005f73;
  --accent-soft: #d8eef1;
  --shadow: 0 14px 34px rgba(27,34,38,.08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(238,155,0,.12), transparent 28rem),
    linear-gradient(180deg, #fbfaf6 0%, var(--bg) 100%);
}
a { color: var(--accent); }
.shell {
  width: min(1200px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}
.topbar {
  display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 2rem;
}
.brand {
  display: inline-flex; align-items: center;
  font-size: .98rem; font-weight: 700; text-decoration: none; color: var(--text);
}
.nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.nav a { text-decoration: none; }

.hero, .panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow);
}
.hero { padding: 2rem; margin-bottom: 2rem; }
.hero-plan {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
  gap: 1rem; align-items: center;
}
.hero h1 { margin: 0 0 .75rem; font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.05; }
.panel { padding: 1.4rem; margin-bottom: 1.6rem; }
.section-title { margin: 0 0 .3rem; font-size: 1.4rem; }
.section-desc { color: var(--muted); margin: 0 0 1rem; font-size: .95rem; }

.hero p, .panel p, .plan-meta, .eyebrow, .empty-state, .footer-note { color: var(--muted); }

/* stat strip */
.hero-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 1.5rem; }
.stat { background: var(--panel-strong); border: 1px solid var(--border); border-radius: 16px; padding: 1rem; }
.stat strong { display: block; font-size: 1.5rem; color: var(--text); }
.stat span { font-size: .85rem; color: var(--muted); }
.hero-thumb {
  justify-self: end; width: 100%; max-width: 190px;
  background: var(--panel-strong); border: 1px solid var(--border);
  border-radius: 10px; padding: .45rem;
}
.hero-thumb svg { display: block; width: 100%; height: auto; }
.hero-thumb svg line { stroke: var(--border); stroke-width: 1; }
.plan-thumb {
  width: 100%; max-width: 190px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: .35rem; margin-top: .75rem;
}
.plan-thumb svg { display: block; width: 100%; height: auto; }
.plan-thumb svg line { stroke: var(--border); stroke-width: 1; }
.plot-thumb {
  width: 100%; max-width: 220px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: .3rem; margin: .1rem 0;
}
.plot-thumb svg { display: block; width: 100%; height: auto; }
.plot-thumb svg line { stroke: var(--border); stroke-width: 1; }

/* code pill */
.code-pill {
  display: inline-flex; align-items: center;
  border-radius: 999px; font-weight: 600;
  padding: .3rem .75rem; font-size: .85rem;
}
.pill-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }

/* plan grid */
.plan-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 1rem; }
.plan-card {
  background: var(--panel-strong); border: 1px solid var(--border);
  border-radius: 18px; padding: 1rem;
}
.plan-card h3 { margin: 0 0 .5rem; }
.plan-card h3 a { overflow-wrap: anywhere; }
.plan-card .plan-meta { font-size: .85rem; }

/* code registry cards */
.code-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 1rem; }
.code-card {
  background: var(--panel-strong); border: 1px solid var(--border);
  border-radius: 16px; padding: 1rem;
  border-top: 4px solid var(--accent);
}
.code-card h3 { margin: 0 0 .3rem; font-size: 1rem; }
.code-card .muted { color: var(--muted); font-size: .85rem; }
.version-list { margin: .7rem 0 0; display: grid; gap: .25rem; }
.version-row { display: grid; grid-template-columns: 6.5rem 1fr; gap: .5rem; font-size: .8rem; }
.version-row dt { color: var(--muted); }
.version-row dd { margin: 0; overflow-wrap: anywhere; }

/* plot card grid */
.plot-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.plot-card {
  background: var(--panel-strong); border: 1px solid var(--border);
  border-radius: 14px; padding: .9rem 1rem;
  display: flex; flex-direction: column; gap: .6rem;
}
.plot-card h3 { margin: 0; font-size: .95rem; font-weight: 600; }
.plot-card .plot-link {
  display: inline-flex; align-items: center; gap: .35rem;
  border: 1px solid var(--border); border-radius: 999px;
  padding: .3rem .8rem; font-size: .85rem;
  color: var(--accent); text-decoration: none; background: #fff;
  width: fit-content;
}
.plot-card .plot-link:hover { background: var(--accent-soft); }
.plot-card .missing { color: var(--muted); font-size: .8rem; font-style: italic; }
.result-notes {
  position: relative;
  margin: .1rem 0 0; padding: .55rem .75rem .55rem 2.1rem;
  border: 1px solid #ead7a0; border-radius: 8px;
  background: #fff8e6; color: #5d4a13;
  list-style: none;
  font-size: .8rem; line-height: 1.35;
}
.result-notes::before {
  content: "!";
  position: absolute; left: .7rem; top: .58rem;
  display: grid; place-items: center;
  width: .95rem; height: .95rem; border-radius: 50%;
  background: #d08a00; color: white;
  font-size: .68rem; font-weight: 800; line-height: 1;
}
.result-note-icon { display: none; }
.result-notes li + li { margin-top: .35rem; }
.plot-subsection { margin-top: 1rem; }
.plot-subsection:first-child { margin-top: 0; }
.plot-subsection-title {
  margin: 0 0 .7rem; padding-left: .65rem;
  border-left: 4px solid var(--accent);
  font-size: 1rem; font-weight: 700;
  color: var(--text);
}

/* PDF download button */
.btn-pdf {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--accent); color: #fff; border-radius: 6px;
  padding: .45rem 1rem; font-size: .9rem; font-weight: 600;
  text-decoration: none; margin-top: 1rem;
}
.btn-pdf:hover { opacity: .85; }

/* download links */
.dl-row { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .1rem; }
.dl-label { font-size: .75rem; color: var(--muted); margin-right: .2rem; white-space: nowrap; }
.dl-link {
  display: inline-flex; align-items: center; gap: .2rem;
  border: 1px solid var(--border); border-radius: 999px;
  padding: .15rem .55rem; font-size: .75rem;
  color: var(--muted); text-decoration: none; background: #fff;
  white-space: nowrap;
}
.dl-link:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* back link */
.back-link {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border); border-radius: 999px;
  padding: .3rem .8rem; font-size: .85rem;
  color: var(--text); text-decoration: none; background: #fff;
  margin-bottom: 1rem;
}

/* preview images (2D maps) */
.preview-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.preview-card {
  background: var(--panel-strong); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}
.preview-card img { display: block; width: 100%; object-fit: cover; background: #f1f1f1; }
.preview-card .preview-label {
  padding: .5rem .8rem; display: flex; align-items: center;
  gap: .45rem; flex-wrap: wrap;
}
.preview-card .preview-file { font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }

.footer-note { margin-top: 2rem; font-size: .9rem; }
.site-footer {
  margin-top: 2rem; padding: 1rem 0 0;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 1rem; color: var(--muted); font-size: .86rem;
}
.footer-main { display: grid; gap: .65rem; }
.footer-main p { margin: 0; max-width: 42rem; }
.footer-brand-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.footer-mark {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .3rem;
  min-height: 2rem; border: 1px solid var(--border); border-radius: 7px;
  padding: .35rem .7rem; background: var(--panel-strong);
  color: var(--text); text-decoration: none; font-weight: 800;
  letter-spacing: 0; line-height: 1;
}
.footer-mark:hover { border-color: var(--accent); color: var(--accent); }
.footer-mark-dcpt { border-left: 5px solid #006b54; }
.footer-mark-eurados { border-left: 5px solid #d83933; }
.footer-links { display: flex; gap: .85rem; flex-wrap: wrap; justify-content: flex-end; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .shell { width: min(100vw - 1rem, 100%); }
  .topbar { flex-direction: column; align-items: flex-start; }
  .hero, .panel { padding: 1rem; }
  .hero-plan { grid-template-columns: 1fr; }
  .hero-thumb { justify-self: stretch; max-width: none; }
  .site-footer { flex-direction: column; align-items: flex-start; }
  .footer-links { justify-content: flex-start; }
}
