/* i4Q Repertory Grid – Gestaltung im i4Q-Stil (Blau/Grau, klare Linien, DIN-artige Überschriften) */
@font-face { font-family: "Barlow SC"; src: url("../fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url("../fonts/barlow-semi-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Open Sans"; src: url("../fonts/open-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --blue: #0b4ea2;
  --blue-strong: #083f86;
  --blue-light: #1f7ae0;
  --blue-wash: #eef4fc;
  --blue-wash-2: #dbe7f8;
  --grey: #5c6670;
  --grey-dark: #3d454d;
  --grey-mid: #8a949e;
  --grey-line: #d7dde3;
  --grey-wash: #f4f6f8;
  --orange: #c4692b;
  --green: #2e8b57;
  --green-wash: #e8f5ee;
  --red: #c8372d;
  --red-wash: #fbeceb;
  --amber: #c58a12;
  --white: #fff;
  --bg: #fbfcfd;
  --shadow: 0 1px 2px rgba(20, 40, 70, .06), 0 4px 16px rgba(20, 40, 70, .06);
  --radius: 4px;
  --font-head: "Barlow SC", "DIN Next", "DIN", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar: 236px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: var(--grey-dark);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--blue); font-weight: 600; letter-spacing: .01em; margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
h3 { font-size: 18px; }
h4 { font-size: 15px; color: var(--grey-dark); }
p { margin: 0 0 .8em; }
code { font-size: 12.5px; background: var(--grey-wash); padding: 1px 5px; border-radius: 3px; }
.muted { color: var(--grey-mid); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Überschrift mit Doppellinie wie in den i4Q-Folien */
.rule-title { position: relative; padding-bottom: 10px; margin-bottom: 18px; }
.rule-title::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(var(--blue) 0 2px, transparent 2px 3px, var(--grey) 3px 6px); }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 13px/1 var(--font-body);
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--grey-line);
  background: var(--white);
  color: var(--grey-dark);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  text-decoration: none !important;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--blue-light); outline-offset: 1px; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-strong); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--blue); padding: 7px 9px; }
.btn-ghost:hover { background: var(--blue-wash); border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); color: var(--red); background: var(--red-wash); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- Formulare */
.form { display: grid; gap: 14px; }
.form label, label.field { display: grid; gap: 5px; font-weight: 600; font-size: 12.5px; color: var(--grey); }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  font: 14px/1.4 var(--font-body);
  color: var(--grey-dark);
  padding: 8px 10px;
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  background: #fff;
  width: 100%;
}
textarea { resize: vertical; min-height: 80px; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-light); outline: none; box-shadow: 0 0 0 3px rgba(31,122,224,.15); }
fieldset { border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; }
legend { font-family: var(--font-head); color: var(--blue); font-weight: 600; font-size: 15px; padding: 0 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
label.check, label.radio { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; color: var(--grey-dark); cursor: pointer; }
.radio-row { display: flex; gap: 18px; flex-wrap: wrap; }
input[type=checkbox], input[type=radio] { accent-color: var(--blue); width: 16px; height: 16px; }

.notice { padding: 10px 12px; border-radius: var(--radius); border-left: 3px solid var(--blue); background: var(--blue-wash); font-size: 13.5px; margin-bottom: 12px; }
.notice.ok { border-color: var(--green); background: var(--green-wash); }
.notice.bad { border-color: var(--red); background: var(--red-wash); }
.notice.warn { border-color: var(--amber); background: #fdf5e4; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--grey-mid); }
.dot.ok { background: var(--green); }
.dot.bad { background: var(--red); }
.dot.mid { background: var(--amber); }

/* ---------------------------------------------------------------- Login / Installer */
body.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: #fff; position: relative; overflow-x: hidden;
}
/* linker Rand: Farbverlauf + graue Leiste (wie Titelfolie) */
body.auth::after { content: ""; position: fixed; left: 0; top: 0; bottom: 0; width: 16px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, #0064e4 0, #0092fc 10px, #5c6670 10px, #5c6670 16px); }
/* Hintergrund: Globus als neuronales Netz, nur schwach sichtbar */
body.auth::before { content: ""; position: fixed; z-index: 0; pointer-events: none; width: 1100px; height: 1100px; right: -260px; top: 50%;
  transform: translateY(-50%); opacity: .13; background: url("../img/globe-net.svg") center / contain no-repeat; }
body.auth > * { position: relative; z-index: 1; }
@media (max-width: 900px) { body.auth::before { width: 760px; height: 760px; right: -320px; opacity: .1; } }
.auth-card { width: 100%; max-width: 410px; background: rgba(255,255,255,.92); backdrop-filter: blur(3px); padding: 34px 32px 28px; border: 1px solid var(--grey-line); border-radius: 6px; box-shadow: var(--shadow); }
.auth-card.wide { max-width: 720px; }
.auth-logo { height: 54px; margin-bottom: 18px; }
.auth-card h1 { font-size: 26px; }
.auth-foot { margin: 22px 0 0; text-align: center; color: var(--grey); font-size: 13px; letter-spacing: .02em; }
.checks { border-collapse: collapse; margin-bottom: 16px; font-size: 13px; }
.checks td { padding: 3px 8px 3px 0; }

/* ---------------------------------------------------------------- App-Rahmen */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #fff;
  border-right: 1px solid var(--grey-line);
  display: flex; flex-direction: column;
  box-shadow: inset 5px 0 0 var(--blue), inset 9px 0 0 var(--grey);
}
.sidebar-logo { padding: 22px 20px 16px 28px; display: block; }
.sidebar-logo img { height: 40px; display: block; }
.sidebar-sub { font-family: var(--font-head); color: var(--grey); font-size: 13.5px; padding: 0 20px 14px 28px; margin-top: -6px; letter-spacing: .02em; }
.nav { display: grid; gap: 2px; padding: 8px 10px 8px 18px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); color: var(--grey-dark); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.nav a svg { width: 18px; height: 18px; color: var(--grey-mid); flex: none; }
.nav a:hover { background: var(--grey-wash); }
.nav a.active { background: var(--blue-wash); color: var(--blue); }
.nav a.active svg { color: var(--blue); }
.nav-sep { height: 1px; background: var(--grey-line); margin: 10px 18px 10px 28px; }
.nav-head { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--grey-mid); padding: 4px 12px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 14px 16px 18px 28px; border-top: 1px solid var(--grey-line); font-size: 12.5px; }
.sidebar-foot .who { font-weight: 600; color: var(--grey-dark); }
.sidebar-foot .role { color: var(--grey-mid); }
.sidebar-foot form { margin: 8px 0 0; }
.claim { margin-top: 10px; color: var(--grey-mid); font-size: 12px; letter-spacing: .02em; }

.main { min-width: 0; padding: 28px 34px 60px; background: var(--bg) url("../img/waves.svg") right top / 1100px auto no-repeat; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.crumbs { font-size: 12.5px; color: var(--grey-mid); margin-bottom: 4px; }
.crumbs a { color: var(--grey); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--grey-line); margin: 0 0 22px; overflow-x: auto; scrollbar-width: thin; }
.tabs a, .tabs button { flex: none; padding: 10px 14px; font: 600 13.5px var(--font-body); color: var(--grey); border: 0; background: none; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; text-decoration: none; }
.tabs a:hover, .tabs button:hover { color: var(--blue); }
.tabs a.active, .tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.subtabs button { font: 600 12.5px var(--font-body); padding: 7px 12px; border: 1px solid var(--grey-line); background: #fff; color: var(--grey); border-radius: var(--radius); cursor: pointer; }
.subtabs button:hover { color: var(--blue); border-color: var(--blue); }
.subtabs button.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------------------------------------------------------------- Karten, Boxen */
.card { background: #fff; border: 1px solid var(--grey-line); border-radius: 6px; padding: 18px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.box-blue { border: 1px solid var(--blue); border-radius: 2px; background: #fff; }
.box-blue > .box-title { background: var(--blue); color: #fff; padding: 10px 14px; font-family: var(--font-head); font-size: 16px; font-weight: 500; text-align: center; }
.box-blue > .box-body { padding: 14px 16px; }
.cols { display: grid; gap: 18px; align-items: start; }
.cols > .card + .card, .stack > .card + .card { margin-top: 0; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main-side { grid-template-columns: minmax(0, 1fr) 360px; }
.stack { display: grid; gap: 18px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--grey-line); border-top: 3px solid var(--blue); border-radius: 4px; padding: 12px 14px; }
.stat .v { font-family: var(--font-head); font-size: 28px; color: var(--blue); font-weight: 600; line-height: 1.1; }
.stat .l { font-size: 12px; color: var(--grey); }

.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 8px; background: rgba(255,255,255,.95); border: 1px solid var(--grey-line); border-left: 4px solid var(--blue); border-radius: 4px; padding: 16px 18px; box-shadow: var(--shadow); color: inherit; text-decoration: none !important; transition: transform .12s, box-shadow .12s; }
.project-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(20,40,70,.12); }
.project-card h3 { margin: 0; font-size: 19px; }
.project-card .meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--grey); flex-wrap: wrap; }
.project-card .desc { color: var(--grey); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.project-card.archived { border-left-color: var(--grey-mid); opacity: .75; }
.progress { height: 6px; background: var(--grey-wash); border-radius: 3px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--blue); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 3px; background: var(--grey-wash); color: var(--grey); }
.tag.blue { background: var(--blue-wash); color: var(--blue); }
.tag.green { background: var(--green-wash); color: var(--green); }
.tag.red { background: var(--red-wash); color: var(--red); }
.tag.amber { background: #fdf5e4; color: #8a5f00; }

/* ---------------------------------------------------------------- Tabellen */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--grey); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--grey-line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--grey-line); vertical-align: middle; }
.table tr:hover td { background: #fafcff; }
.table .actions { text-align: right; white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Pole-Darstellung */
.pole-l { color: var(--grey-dark); }
.pole.pos { color: var(--green); font-weight: 600; }
.pole.neg { color: var(--red); }
.pref-toggle { display: inline-flex; border: 1px solid var(--grey-line); border-radius: var(--radius); overflow: hidden; }
.pref-toggle button { border: 0; background: #fff; font: 600 12px var(--font-body); color: var(--grey); padding: 6px 9px; cursor: pointer; }
.pref-toggle button + button { border-left: 1px solid var(--grey-line); }
.pref-toggle button.on { background: var(--blue); color: #fff; }

.list-edit { display: grid; gap: 8px; }
.list-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 8px 10px; }
.list-row .idx { font-family: var(--font-head); color: var(--blue); font-weight: 700; text-align: center; }
.list-row .title { font-weight: 600; }
.list-row .sub { font-size: 12.5px; color: var(--grey-mid); }
.construct-row { grid-template-columns: 26px minmax(0, 1fr) auto; row-gap: 6px; }
.construct-row > .idx { grid-row: 1 / span 2; }
.construct-row > .pref-toggle { grid-column: 2; grid-row: 2; justify-self: start; }
.construct-row > .btn-row { grid-column: 3; grid-row: 1 / span 2; }
.construct-poles { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.construct-poles .vs { color: var(--grey-mid); font-size: 12px; }

/* ---------------------------------------------------------------- Dialog */
dialog { border: 0; border-radius: 6px; padding: 0; width: min(620px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(10,30,60,.3); color: var(--grey-dark); }
dialog::backdrop { background: rgba(20, 35, 55, .45); backdrop-filter: blur(2px); }
.dlg-head { padding: 16px 20px 0; }
.dlg-head h2 { margin: 0; }
.dlg-body { padding: 16px 20px; max-height: 70vh; overflow-y: auto; }
.dlg-foot { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--grey-line); }
.choice-grid { display: grid; gap: 10px; }
.choice { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; border: 1px solid var(--grey-line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; font-weight: 400 !important; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); }
.choice b { display: block; color: var(--grey-dark); font-size: 14px; }
.choice span { font-size: 12.5px; color: var(--grey); }

/* ---------------------------------------------------------------- Toast */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 1000; }
.toast { background: var(--grey-dark); color: #fff; padding: 10px 14px; border-radius: var(--radius); font-size: 13.5px; box-shadow: var(--shadow); animation: toast-in .2s ease-out; max-width: 380px; }
.toast.bad { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------------------------------------------------------------- Grid-Eingabe (Interview) */
.grid-entry { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.grid-entry th, .grid-entry td { border-bottom: 1px solid var(--grey-line); padding: 0; }
.grid-entry thead th { position: sticky; top: 0; background: #fff; z-index: 2; }
.grid-entry .el-head { writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 4px; height: 170px; font-weight: 600; color: var(--blue); font-size: 12.5px; text-align: left; max-width: 46px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-entry .pole-cell { padding: 6px 10px; min-width: 150px; max-width: 220px; }
.grid-entry .pole-cell.left { text-align: right; }
.grid-entry .pole-cell.pref { color: var(--green); font-weight: 600; }
.grid-entry .pole-cell.unpref { color: var(--red); }
.grid-entry .personal td { background: #fcfbf4; }
.cell-input { width: 46px; height: 38px; border: 0; border-left: 1px solid var(--grey-line); text-align: center; font: 600 15px var(--font-body); color: var(--grey-dark); background: transparent; border-radius: 0; padding: 0; }
.cell-input:focus { background: var(--blue-wash); box-shadow: inset 0 0 0 2px var(--blue-light); }
.cell-input.filled { background: rgba(11,78,162, calc(var(--a, .1))); }
.cell-input.invalid { background: var(--red-wash); }
.save-state { font-size: 12.5px; color: var(--grey-mid); }

/* ---------------------------------------------------------------- Analyse */
.analysis-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--grey-line); border-radius: 6px; padding: 10px 12px; margin-bottom: 14px; box-shadow: var(--shadow); }
.analysis-bar select { width: auto; min-width: 260px; }
.chart-box { background: #fff; border: 1px solid var(--blue); border-radius: 2px; padding: 12px; position: relative; }
.chart-box svg { display: block; width: 100%; height: auto; }
.interp { border: 1px solid var(--blue); border-radius: 2px; background: #fff; padding: 16px 18px; font-size: 14px; }
.interp h3 { font-size: 16px; margin-top: 14px; }
.interp h3:first-child { margin-top: 0; }
.interp p { color: var(--grey-dark); }
.interp ul { margin: 0; padding-left: 18px; }
.interp li { margin-bottom: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px 18px; font-size: 12.5px; color: var(--grey); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Globus */
.globe-wrap { position: relative; height: min(72vh, 680px); min-height: 420px; background: radial-gradient(circle at 50% 45%, #fff 0%, #f6f8fb 70%, #eef2f7 100%); border: 1px solid var(--blue); border-radius: 2px; overflow: hidden; }
.globe-wrap canvas { display: block; }
.globe-label { font: 600 12px var(--font-body); white-space: nowrap; pointer-events: auto; cursor: default; padding: 1px 4px; border-radius: 2px; transition: opacity .2s; }
.globe-label.c-pos { color: var(--green); }
.globe-label.c-neg { color: var(--red); }
.globe-label.c-neu { color: var(--grey); font-weight: 400; }
.globe-label.el { color: #4f6c8f; font-weight: 600; font-size: 12.5px; background: rgba(255,255,255,.75); }
.globe-label.scenario { color: var(--orange); font-weight: 700; background: rgba(255,255,255,.85); }
.globe-label.dim { opacity: .18; }
.globe-label.hl { background: #fff; box-shadow: 0 0 0 1px currentColor; }
.globe-tools { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 5; }
.globe-tools .btn { background: rgba(255,255,255,.9); }
.globe-info { position: absolute; right: 10px; bottom: 10px; max-width: 320px; background: rgba(255,255,255,.95); border: 1px solid var(--grey-line); border-radius: 4px; padding: 10px 12px; font-size: 12.5px; z-index: 5; box-shadow: var(--shadow); }
.globe-info h4 { margin: 0 0 4px; color: var(--blue); }
.globe-var { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--grey); z-index: 5; background: rgba(255,255,255,.8); padding: 3px 6px; border-radius: 3px; }
.toggle-list { display: grid; gap: 6px; }
.scenario-panel { display: grid; gap: 8px; }
.scenario-row { display: grid; gap: 2px; }
.scenario-row .poles { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--grey); gap: 8px; }
.scenario-row .poles span:last-child { text-align: right; }
.scenario-row input[type=range] { width: 100%; accent-color: var(--orange); }
.scenario-row .poles .pref { color: var(--green); font-weight: 600; }

/* Heatmap-Tabellen */
.heat { border-collapse: collapse; font-size: 12px; }
.heat th { font-weight: 600; color: var(--grey); padding: 4px 6px; text-align: right; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.heat thead th { text-align: left; vertical-align: bottom; }
.heat thead th .rot { writing-mode: vertical-rl; transform: rotate(180deg); max-height: 160px; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.heat td { width: 40px; min-width: 40px; height: 30px; text-align: center; font-variant-numeric: tabular-nums; border: 1px solid #fff; }

/* Wordcloud */
.wc-grid { display: grid; grid-template-columns: minmax(140px, 220px) 1fr 1fr; border: 1px solid var(--blue); border-radius: 2px; background: #fff; }
.wc-grid > div { border-bottom: 1px solid var(--grey-line); padding: 10px 12px; min-height: 80px; }
.wc-grid > div:nth-last-child(-n+3) { border-bottom: 0; }
.wc-grid .wc-h { background: var(--blue); color: #fff; font-family: var(--font-head); font-size: 15px; min-height: 0; text-align: center; }
.wc-grid .wc-el { font-size: 12px; color: var(--grey); font-weight: 600; border-right: 1px solid var(--grey-line); }
.wc-grid .wc-cell { display: flex; flex-wrap: wrap; align-content: center; gap: 2px 10px; }
.wc-grid .wc-cell + .wc-cell { border-left: 1px solid var(--grey-line); }
.wc-word { line-height: 1.15; }
.wc-pos { color: var(--green); }
.wc-neg { color: var(--red); }

/* Dilemmata */
.dilemma { display: grid; grid-template-columns: 1fr 90px 1fr; gap: 10px; align-items: center; border: 1px solid var(--grey-line); border-radius: 4px; padding: 12px 14px; background: #fff; }
.dilemma + .dilemma { margin-top: 10px; }
.dilemma .side { font-size: 13px; }
.dilemma .side b { display: block; font-size: 14px; }
.dilemma .mid { text-align: center; color: var(--orange); font-weight: 700; font-family: var(--font-head); }

/* ---------------------------------------------------------------- Befragung */
body.survey { background: #fff url("../img/waves.svg") center top / 1600px auto no-repeat; min-height: 100vh; border-left: 8px solid var(--blue); }
.survey-bar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.94); backdrop-filter: blur(4px); border-bottom: 1px solid var(--grey-line); display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; align-items: center; padding: 10px 22px 0; }
.survey-logo { height: 30px; }
.survey-title { font-family: var(--font-head); color: var(--blue); font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.survey-progress { grid-column: 1 / -1; height: 4px; background: var(--grey-wash); margin: 8px -22px 0; }
.survey-progress-fill { height: 100%; width: 0; background: var(--blue); transition: width .3s; }
.survey-main { max-width: 860px; margin: 0 auto; padding: 28px 20px 80px; }
.survey-card { background: rgba(255,255,255,.96); border: 1px solid var(--grey-line); border-radius: 6px; padding: 24px 26px; box-shadow: var(--shadow); }
.survey-step { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--grey-mid); font-weight: 700; margin-bottom: 4px; }
.survey-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.poles-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 12px 0 18px; padding: 14px 16px; background: var(--blue-wash); border-radius: 4px; }
.poles-head .l { text-align: right; font-weight: 700; font-size: 16px; color: var(--grey-dark); }
.poles-head .r { font-weight: 700; font-size: 16px; color: var(--grey-dark); }
.poles-head .vs { font-family: var(--font-head); color: var(--blue); }
.rate-row { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grey-line); }
.rate-row .name { font-weight: 600; }
.rate-row .name small { display: block; font-weight: 400; color: var(--grey-mid); font-size: 12px; }
.scale { display: flex; gap: 4px; }
.scale button { flex: 1; min-width: 34px; height: 38px; border: 1px solid var(--grey-line); background: #fff; border-radius: 3px; font: 600 14px var(--font-body); color: var(--grey); cursor: pointer; }
.scale button:hover { border-color: var(--blue); color: var(--blue); }
.scale button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.scale-ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--grey-mid); margin-top: 2px; }
.triad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.triad div { border: 1px solid var(--blue); border-radius: 3px; padding: 14px; text-align: center; font-weight: 600; color: var(--blue); background: #fff; }
.triad div small { display: block; font-weight: 400; color: var(--grey); margin-top: 4px; }
.statement-block { border-top: 1px solid var(--grey-line); padding: 14px 0; }
.statement-block h3 { margin-bottom: 8px; }

/* ---------------------------------------------------------------- Bericht (Druck) */
.report { max-width: 1050px; margin: 0 auto; padding: 30px; background: #fff; }
.report-page { page-break-after: always; break-after: page; padding: 10px 0 30px; }
.report-page:last-child { page-break-after: auto; }
.report-cover { min-height: 640px; display: flex; flex-direction: column; justify-content: center; border-left: 10px solid var(--blue); box-shadow: inset 6px 0 0 var(--grey); padding-left: 60px; background: url("../img/waves.svg") center / cover no-repeat; }
.report-cover img { height: 90px; width: auto; margin-bottom: 30px; align-self: flex-start; }
.report-cover h1 { font-size: 46px; color: var(--grey); font-weight: 500; font-family: var(--font-body); }
.report-foot { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--grey-mid); border-top: 1px solid var(--grey-line); padding-top: 6px; margin-top: 18px; }
.report-foot img { height: 20px; }
.print-bar { position: sticky; top: 0; background: var(--blue); color: #fff; padding: 10px 20px; display: flex; gap: 10px; align-items: center; justify-content: space-between; z-index: 5; }
.print-bar .btn { background: #fff; }
/* Berichtsvorlage: Textseiten, Kontaktseite, Bearbeitungsmodus */
.report-text { font-size: 15px; line-height: 1.7; max-width: 1000px; }
.report-text ul { padding-left: 22px; }
.report-contact { padding: 0 0 30px; }
.report-contact .contact-band { background: var(--blue); color: #fff; display: flex; align-items: center; gap: 40px; padding: 50px 60px; min-height: 300px; }
.report-contact .contact-band img { height: 90px; width: auto; background: #fff; padding: 12px 16px; border-radius: 3px; }
.report-contact .contact-band h2 { color: #fff; font-size: 40px; font-weight: 500; margin: 0; }
.report-contact .contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px; padding: 50px 40px; text-align: center; border-bottom: 14px solid var(--blue); }
.report-contact .contact-l { color: var(--orange); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.report-contact .contact-v { color: var(--blue); font-size: 18px; }
.report.editing [data-k], .report.editing .report-text, .report.editing li { outline: 1px dashed rgba(31,122,224,.45); outline-offset: 2px; }
.report.editing [data-k]:focus { outline: 2px solid var(--blue-light); background: #fffdf3; }
.print-bar .btn[disabled] { opacity: .6; }
@media print {
  .report.editing [data-k], .report.editing li { outline: none; }
  .print-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .report { padding: 0; max-width: none; }
  .chart-box, .interp, .box-blue { break-inside: avoid; }
  @page { size: A4 landscape; margin: 12mm; }
}

/* ---------------------------------------------------------------- Responsiv */
.menu-btn { display: none; }
@media (max-width: 1100px) {
  .cols-main-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.2); }
  .app.nav-open .sidebar { transform: none; }
  .menu-btn { display: inline-flex; position: fixed; top: 12px; right: 12px; z-index: 60; }
  .main { padding: 20px 16px 50px; }
  .cols-2, .cols-3, .grid2, .grid3 { grid-template-columns: 1fr; }
  .rate-row { grid-template-columns: 1fr; gap: 6px; }
  .wc-grid { grid-template-columns: 1fr; }
  .wc-grid .wc-h:nth-child(1) { display: none; }
  .dilemma { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
  .poles-head { grid-template-columns: 1fr; text-align: center; }
  .poles-head .l, .poles-head .r { text-align: center; }
}
/* Bericht: kompaktere Tabellen, Überschriften nicht vom Inhalt trennen */
.report .table td, .report .table th { padding: 4px 8px; font-size: 12px; }
.report .wc-grid > div { min-height: 0; padding: 6px 10px; }
.report-page h2 { break-after: avoid; page-break-after: avoid; }
.form label.btn { display: inline-flex; font-size: 12px; color: var(--grey-dark); }
input[type=color] { width: 100%; cursor: pointer; border: 1px solid var(--grey-line); border-radius: var(--radius); background: #fff; }
/* Bericht für Berater: kein Markieren/Kopieren, kein Browser-Druck (PDF nur als Bild) */
.print-blocked { display: none; }
body.report-protected .report { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.report-protected .report img { pointer-events: none; -webkit-user-drag: none; }
@media print {
  body.report-protected .report, body.report-protected .print-bar { display: none !important; }
  body.report-protected .print-blocked { display: block !important; font: 16px sans-serif; padding: 40px; }
}
/* gedrehte Spaltenköpfe ohne writing-mode (für die Bild-PDF-Erzeugung) */
.report .heat thead th { height: 130px; vertical-align: bottom; position: relative; padding: 0; }
.report .heat thead th .rot { writing-mode: horizontal-tb; transform: none; position: absolute; left: 50%; bottom: 4px; width: 125px; max-height: none;
  transform-origin: 0 100%; transform: rotate(-90deg) translateY(50%); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
/* Testzugang: Wasserzeichen im Bericht */
.report-page { position: relative; }
.watermark { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 20; overflow: hidden; }
.watermark { font: 700 120px/1 var(--font-head); color: rgba(200, 55, 45, .13); transform: rotate(-24deg); letter-spacing: .08em; }
/* Testzugang */
.demo-band { position: fixed; top: 0; left: var(--sidebar); right: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 9px 34px; background: linear-gradient(90deg, rgba(196,105,43,.95), rgba(214,130,60,.92)); color: #fff; font-size: 13.5px; }
.demo-band .btn { background: #fff; color: var(--orange); border-color: #fff; }
body.is-demo .main { padding-top: 70px; }
.lock-wrap { position: relative; border: 1px solid var(--grey-line); border-radius: 6px; overflow: hidden; background: #fff; min-height: 380px; }
.lock-wrap.compact { min-height: 300px; }
.lock-preview { filter: blur(6px) saturate(.8); opacity: .55; padding: 24px; pointer-events: none; user-select: none; }
.lock-card { position: absolute; inset: 0; margin: auto; width: min(460px, 90%); height: fit-content; background: rgba(255,255,255,.94); border: 1px solid var(--grey-line);
  border-top: 4px solid var(--orange); border-radius: 6px; padding: 22px 24px; text-align: center; box-shadow: var(--shadow); }
.lock-wrap.compact .lock-card { padding: 16px 18px; }
.lock-card h3 { margin: 6px 0 8px; }
.lock-card p { color: var(--grey); font-size: 13.5px; }
.lock-icon svg { width: 30px; height: 30px; color: var(--orange); }
.lock-line { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; background: #fdf5ee; border: 1px dashed rgba(196,105,43,.5); border-radius: 4px; color: #8a4a1c; font-size: 12.5px; }
.lock-line svg { width: 16px; height: 16px; flex: none; }
body.report-demo .report-page { overflow: hidden; }
@media (max-width: 900px) { .demo-band { left: 0; padding: 8px 60px 8px 16px; } body.is-demo .main { padding-top: 90px; } }
.lock-preview .heat { width: 100%; }

/* Abschlussseite nach i4Q-Vorlage (wie PowerPoint): Logo + Claim links, Kontakt rechts, Verlaufsleiste unten */
.report-contact { min-height: 560px; display: flex; flex-direction: column; justify-content: center; position: relative; padding: 0 0 40px; }
.report-contact .contact-row { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 0 50px; flex-wrap: wrap; }
.report-contact .contact-brand { display: flex; align-items: center; gap: 24px; }
.report-contact .contact-brand img { height: 80px; width: auto; }
.report-contact .contact-brand h2 { color: var(--grey); font-family: var(--font-body); font-weight: 400; font-size: 32px; margin: 0; }
.report-contact .contact-lines { color: var(--grey); font-size: 15px; line-height: 1.5; min-width: 220px; }
.report-contact .contact-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: linear-gradient(90deg, #0064e4, #0092fc); }
