:root {
  --paper: #F6F3EC;
  --ink: #212B24;
  --ink-soft: #4A544C;
  --line: #D9D3C4;
  --card: #FFFFFF;

  --kel: #5B7385; /* kritisches Eltern-Ich - kühles Slate-Blau */
  --fel: #6E8F6B; /* fürsorgliches Eltern-Ich - Salbei */
  --er:  #2B2F2C; /* Erwachsenen-Ich - Tinte */
  --nk:  #C99A3E; /* natürliches Kindheits-Ich - warmes Gold */
  --ak:  #B57A7A; /* angepasstes Kindheits-Ich - gedämpftes Rosa */

  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.wrap-admin { max-width: 860px; }
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.15;
  margin: 0 0 14px;
}
p.lead {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 24px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 20px;
}
label.field-label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
input[type=text] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
}
input[type=text]:focus { outline: 2px solid var(--er); outline-offset: 1px; }
input[readonly] { opacity: 0.75; }

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 18px 0 6px;
  line-height: 1.5;
}
.consent input { margin-top: 3px; }

button {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 13px 22px;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
button:active { transform: scale(0.98); }
button.primary { background: var(--er); color: var(--paper); }
button.primary:disabled { opacity: 0.35; cursor: not-allowed; }
button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
button:focus-visible { outline: 2px solid var(--er); outline-offset: 2px; }
button.small { padding: 6px 10px; font-size: 12px; }

.progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 26px;
}
.progress-fill {
  height: 100%;
  background: var(--er);
  width: 0%;
  transition: width 0.25s ease;
}

.statement {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.statement:last-child { border-bottom: none; }
.section-header {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
  padding: 22px 0 6px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
}
.section-header:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.statement-text { font-size: 15px; line-height: 1.45; flex: 1; }
.toggle { display: flex; gap: 6px; flex-shrink: 0; }
.toggle button {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 17px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.toggle button.active-plus { background: var(--er); color: var(--paper); border-color: var(--er); }
.toggle button.active-minus { background: var(--ak); color: var(--paper); border-color: var(--ak); }

.footer-bar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, transparent, var(--paper) 30%);
  padding: 20px 0 4px;
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}
.save-state { font-size: 12px; color: var(--ink-soft); min-height: 18px; }

/* Chart */
.chart {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  height: 220px;
  padding: 20px 10px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar {
  width: 100%;
  max-width: 52px;
  border-radius: 6px 6px 0 0;
  height: 0%;
  transition: height 0.9s cubic-bezier(.2,.8,.2,1);
}
.bar-value { font-family: var(--serif); font-size: 15px; margin-bottom: 6px; }
.legend { display: flex; justify-content: space-between; padding: 0 10px; margin-bottom: 26px; }
.legend-item { flex: 1; text-align: center; font-size: 11px; color: var(--ink-soft); line-height: 1.3; }
.legend-code { font-weight: 700; color: var(--ink); display: block; font-size: 13px; }

.interp { font-size: 14px; line-height: 1.65; color: var(--ink-soft); }
.interp strong { color: var(--ink); }
.blocks p { margin: 0 0 14px; }
.blocks .divider { border-top: 1px solid var(--line); margin: 18px 0; }
.blocks .note { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
th.col-actions, td.col-actions { width: 120px; }
td.col-actions { white-space: nowrap; text-align: right; }
td.col-actions .ghost { margin-left: 4px; }

.hidden { display: none !important; }
.note { font-size: 12px; color: var(--ink-soft); margin-top: 18px; line-height: 1.5; }
.error-screen { text-align: center; padding-top: 60px; }

/* Admin */
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.link-box {
  display: flex; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; font-size: 13px; word-break: break-all; margin-bottom: 20px;
}
.form-row { margin-bottom: 16px; }
select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; font-family: var(--sans); background: var(--paper); color: var(--ink);
}
.status-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink-soft);
}
.status-pill.completed { background: var(--fel); border-color: var(--fel); color: #fff; }
.status-pill.started { background: var(--nk); border-color: var(--nk); color: #fff; }
.status-pill.expired, .status-pill.invited { color: var(--ink-soft); }
.score-chip { font-family: var(--serif); font-size: 12px; margin-right: 6px; white-space: nowrap; }
.topnav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }

/* Likert-Antwortformat */
.toggle button.likert-btn { width: 38px; font-size: 14px; }
.toggle[data-fmt="likert5"] button.active-plus {
  background: var(--er); color: var(--paper); border-color: var(--er);
}
.likert-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); padding: 4px 2px 0; }

/* Achsen-Diagramm (bipolar) — Block-Layout, eine Achse pro Zeile */
.axes-chart { display: block; width: 100%; }
.axis-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.axis-row:last-child { border-bottom: none; }
.axis-pole { flex: 0 0 110px; font-size: 11px; color: var(--ink-soft); line-height: 1.3; }
.axis-high { text-align: left; }
.axis-low { text-align: right; }
.axis-track {
  position: relative; flex: 1; height: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  overflow: visible;
}
.axis-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 50%; opacity: 0.35; border-radius: 999px 0 0 999px;
  transition: width 0.9s cubic-bezier(.2,.8,.2,1);
}
.axis-marker {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--er);
  transition: left 0.9s cubic-bezier(.2,.8,.2,1);
}
.axis-value {
  flex: 0 0 34px; text-align: right;
  font-family: var(--serif); font-size: 15px;
}
