/* ============================================================
   Gap-Analyse Odoo Community 18.0 — Stylesheet
   Editorial, druckfreundlich, ohne externe Abhängigkeiten.
   ============================================================ */

:root {
  --paper: #fbfaf7;
  --paper-2: #f3f0ea;
  --ink: #15181b;
  --ink-2: #2c3238;
  --muted: #626a74;
  --line: #e2ded4;
  --line-strong: #cfc9bc;
  --accent: #a4232b;
  --accent-soft: #f4e6e5;
  --ok: #256b4a;
  --ok-soft: #e6efe9;
  --warn: #8a6414;
  --warn-soft: #f6eeda;
  --bad: #a4232b;
  --bad-soft: #f7e7e6;
  --blue: #1f4f6b;
  --maxw: 1180px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Hero ---------- */

.hero {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1200px 380px at 15% -60%, #f0ece2 0%, transparent 70%),
    var(--paper);
  padding: 92px 0 56px;
}

.hero .kicker {
  font-size: 12px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 26px;
  max-width: none;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.3rem, 5.2vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  margin: 0 0 28px;
  max-width: 20ch;
}

.hero .lede {
  font-family: var(--serif);
  font-size: clamp(1.08rem, 1.6vw, 1.32rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0 0 34px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}

.chips li {
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 7px 13px;
  font-size: 13px;
  color: var(--ink-2);
  background: #fff;
}

.chips b {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 650;
}

.hero-note {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  max-width: 70ch;
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 64px;
  padding-top: 56px;
  padding-bottom: 40px;
  align-items: start;
}

/* ---------- TOC ---------- */

.toc {
  position: sticky;
  top: 24px;
  font-size: 13.5px;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.toc-title {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 10.5px;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 600;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
}

.toc li { counter-increment: toc; margin: 0; }

.toc a {
  display: block;
  padding: 5px 0 5px 26px;
  color: var(--ink-2);
  text-decoration: none;
  position: relative;
  border-radius: 2px;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  top: 7px;
}

.toc a:hover { color: var(--accent); }
.toc a.active { color: var(--accent); font-weight: 600; }
.toc a.active::before { color: var(--accent); }

.toc-foot {
  margin: 22px 0 0;
  padding-left: 26px;
  font-size: 12px;
}

.toc-foot a { color: var(--muted); text-decoration: none; }
.toc-foot a:hover { color: var(--accent); }

/* ---------- Sections ---------- */

main { min-width: 0; }

section {
  padding-bottom: 64px;
  margin-bottom: 64px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 24px;
}

section:last-of-type { border-bottom: 0; }

.sec-num {
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin: 0 0 8px;
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.85rem, 3.4vw, 2.6rem);
  letter-spacing: -.015em;
  line-height: 1.1;
  margin: 0 0 26px;
}

h3 {
  font-size: 1.06rem;
  font-weight: 650;
  letter-spacing: -.005em;
  margin: 40px 0 14px;
  color: var(--ink);
}

h3.sub { margin-top: 52px; }

p { margin: 0 0 18px; max-width: 74ch; }

p, li, dd, td { overflow-wrap: break-word; }

p code, li code, dd code { white-space: normal; overflow-wrap: anywhere; }

.lead {
  font-size: 1.1rem;
  color: var(--ink-2);
  max-width: 68ch;
  margin-bottom: 30px;
}

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }

code {
  font-family: var(--mono);
  font-size: .855em;
  background: var(--paper-2);
  padding: 1.5px 5px;
  border-radius: 2px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 50; }

/* ---------- KPI ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
  margin: 0 0 44px;
}

.kpi {
  padding: 22px 20px 24px;
  border-right: 1px solid var(--line);
}

.kpi:last-child { border-right: 0; }

.kpi-val {
  display: block;
  font-family: var(--serif);
  font-size: 1.9rem;
  line-height: 1.1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.kpi-lab {
  display: block;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Claims ---------- */

.claims {
  list-style: none;
  counter-reset: claim;
  padding: 0;
  margin: 0 0 12px;
}

.claims li {
  counter-increment: claim;
  position: relative;
  padding: 22px 0 22px 58px;
  border-top: 1px solid var(--line);
}

.claims li:last-child { border-bottom: 1px solid var(--line); }

.claims li::before {
  content: counter(claim);
  position: absolute;
  left: 0;
  top: 22px;
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.claims h3 { margin: 0 0 8px; font-size: 1.08rem; }
.claims p { margin: 0; color: var(--ink-2); font-size: .975rem; max-width: 72ch; }

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin: 8px 0 18px;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table { margin: 0; }

.table-wrap.dense table { font-size: 12.5px; }

.table-wrap.dense th,
.table-wrap.dense td { padding: 7px 8px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 8px 0 18px;
  background: #fff;
  border: 1px solid var(--line);
}

thead th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper-2);
  vertical-align: bottom;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfbf8; }

table.compact td { padding: 8px 12px; font-size: 13.5px; }

tr.focus { background: #fdf8f0; }
tr.focus:hover { background: #fbf4e9; }

tr.bad-row td { background: var(--bad-soft); }
tr.bad-row:hover td { background: #f3dedd; }

td.pos { color: var(--ok); font-weight: 600; white-space: nowrap; }
td.neg { color: var(--bad); font-weight: 600; white-space: nowrap; }

.matrix td:nth-child(1) { width: 34%; }
.matrix td:nth-child(4) { white-space: nowrap; }
.matrix td:last-child { white-space: nowrap; }

.tco td:nth-child(n+4) { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Status dots ---------- */

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}

.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }

/* ---------- Callouts ---------- */

.callout {
  border-left: 3px solid var(--ink);
  background: #fff;
  padding: 18px 22px;
  margin: 26px 0;
  font-size: .96rem;
}

.callout p:last-child { margin-bottom: 0; }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.bad { border-left-color: var(--bad); background: var(--bad-soft); }

.note {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: -6px;
  max-width: 76ch;
}

/* ---------- Code ---------- */

.codeblock {
  background: #171a1d;
  color: #e6e3dc;
  border-radius: 3px;
  padding: 20px 22px;
  margin: 22px 0;
  overflow-x: auto;
}

.codeblock-title {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8f979f;
  margin: 0 0 12px;
}

.codeblock pre { margin: 0; }

.codeblock code {
  background: none;
  border: 0;
  padding: 0;
  color: #e6e3dc;
  font-size: 12.8px;
  line-height: 1.7;
  white-space: pre;
}

.codeblock-note {
  color: #8f979f;
  font-size: 12px;
  margin: 12px 0 0;
}

/* ---------- Scenarios ---------- */

.scenarios {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.card {
  background: #fff;
  padding: 24px 24px 20px;
}

.card.rec {
  background: #fdfaf5;
  box-shadow: inset 3px 0 0 var(--accent);
}

.card header { margin-bottom: 12px; }

.card h3 {
  margin: 6px 0 0;
  font-size: 1.02rem;
  line-height: 1.35;
}

.tag {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.card p { font-size: .94rem; color: var(--ink-2); margin-bottom: 12px; }

.card ul {
  margin: 0;
  padding-left: 17px;
  font-size: .9rem;
  color: var(--ink-2);
}

.card li { margin-bottom: 5px; }

/* ---------- Decision ---------- */

.decision {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  font-size: 13px;
  margin-bottom: 10px;
}

.d-step {
  flex: 1 1 190px;
  background: #fff;
  padding: 16px 16px 14px;
}

.d-step span {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--ink);
}

.d-step em {
  font-style: normal;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.d-arrow {
  flex: 0 0 auto;
  background: var(--accent);
  color: #fff;
  padding: 16px;
  font-weight: 650;
  display: flex;
  align-items: center;
  letter-spacing: .02em;
}

/* ---------- Split ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 18px 0 10px;
}

.split h3 { margin-top: 0; }

.have {
  border-top: 2px solid var(--ok);
  padding-top: 12px;
}

.have.not { border-top-color: var(--bad); }

.tight { padding-left: 18px; margin: 0 0 18px; font-size: .95rem; }
.tight li { margin-bottom: 6px; }

/* ---------- Quote ---------- */

.quote {
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 24px;
  margin: 28px 0;
}

.quote p {
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 10px;
}

.quote cite {
  font-style: normal;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- Bars ---------- */

.bars {
  margin: 26px 0 10px;
  font-size: 12.5px;
}

.bar-row {
  display: grid;
  grid-template-columns: 132px 1fr 96px;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.bar-lab { color: var(--ink-2); }

.bar-track {
  background: var(--paper-2);
  height: 20px;
  border-radius: 1px;
  overflow: hidden;
}

.bar { height: 100%; }
.bar.ent { background: var(--accent); }
.bar.com { background: var(--ok); }

.bar-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Gate ---------- */

.gate {
  border: 1px solid var(--line-strong);
  background: #fff;
  padding: 22px 24px;
  margin: 20px 0;
}

.gate p { margin-bottom: 12px; }

.gate ul {
  margin: 0 0 14px;
  padding-left: 18px;
  font-size: .95rem;
}

.gate li { margin-bottom: 4px; }

.gate-note {
  font-size: .92rem;
  color: var(--muted);
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

/* ---------- Rules ---------- */

.rules {
  counter-reset: r;
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
}

.rules li {
  counter-increment: r;
  position: relative;
  padding: 10px 0 10px 34px;
  border-bottom: 1px solid var(--line);
  font-size: .96rem;
}

.rules li::before {
  content: counter(r);
  position: absolute;
  left: 0;
  top: 10px;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 650;
}

/* ---------- Diagramme ---------- */

.diagram {
  border: 1px solid var(--line);
  background: #fff;
  padding: 22px 22px 14px;
  margin: 24px 0;
  overflow-x: auto;
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 760px;
  margin: 0 auto;
}

.diagram-list {
  display: none;
  margin: 0 0 4px;
  padding-left: 20px;
  font-size: 13.5px;
  line-height: 1.5;
}

.diagram-list li { margin-bottom: 6px; }

.diagram-cap {
  font-size: 12.5px;
  color: var(--muted);
  margin: 12px auto 0;
  max-width: 66ch;
  text-align: center;
  line-height: 1.5;
}

table.raci td:first-child { width: 38%; }
table.raci td:nth-child(2) { font-weight: 600; }

/* ---------- Sources / Glossar ---------- */

.sources {
  font-size: 13.5px;
  color: var(--ink-2);
  padding-left: 20px;
  margin: 0 0 20px;
}

.sources li { margin-bottom: 8px; }

.glossar {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 2px 20px;
  font-size: 14px;
  margin: 0 0 24px;
}

.glossar dt {
  font-weight: 650;
  color: var(--ink);
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.glossar dd {
  margin: 0;
  color: var(--ink-2);
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.colophon {
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 32px;
}

/* ---------- Footer ---------- */

.site-foot {
  border-top: 1px solid var(--line);
  padding: 30px 0 60px;
  font-size: 13px;
  color: var(--muted);
}

.site-foot .wrap {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.site-foot p { margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 32px; }
  .toc {
    position: static;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 20px;
    margin-bottom: 36px;
  }
  .toc ol { columns: 2; column-gap: 28px; }
  .toc a { padding-left: 24px; }
  .toc-foot { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(2) { border-right: 0; }
  .kpi:nth-child(1), .kpi:nth-child(2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .diagram { padding: 14px 14px 10px; }
  .diagram svg { display: none; }
  .diagram-list { display: block; }
  .diagram-cap { text-align: left; }
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .hero { padding: 60px 0 40px; }
  .scenarios { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; gap: 10px; }
  .toc ol { columns: 1; }
  .kpis { grid-template-columns: 1fr; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi:last-child { border-bottom: 0; }
  table { font-size: 13px; }
  th, td { padding: 8px 9px; }
  td code, th code { white-space: normal; }
  .codeblock code { font-size: 11.5px; }
  .bar-row { grid-template-columns: 96px 1fr 76px; gap: 8px; }
  .glossar { grid-template-columns: 1fr; gap: 0; }
  .glossar dd { border-top: 0; padding-top: 0; }
  h2 { font-size: 1.65rem; }
  .d-step { flex: 1 1 100%; }
}

@media (max-width: 520px) {
  .bar-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "lab val"
      "track track";
    gap: 3px 10px;
    margin-bottom: 14px;
  }
  .bar-lab { grid-area: lab; font-size: 12.5px; }
  .bar-val { grid-area: val; font-size: 12.5px; }
  .bar-track { grid-area: track; height: 14px; }
}

/* ---------- Print ---------- */

@media print {
  body { background: #fff; font-size: 10.5pt; }
  .toc, .site-foot, .skip { display: none; }
  .layout { display: block; padding: 0; }
  .hero { padding: 0 0 20pt; }
  section { page-break-inside: avoid; border-bottom: 0; margin-bottom: 18pt; padding-bottom: 0; }
  h2 { page-break-after: avoid; }
  table, .callout, .codeblock, .card { page-break-inside: avoid; }
  .codeblock { background: #f4f2ed; color: #111; }
  .codeblock code { color: #111; }
  a { color: inherit; text-decoration: none; }
}
