/* Datenblatt-Generator — Kähler-CI: Teal #2EA1BE, Dunkelgrau #313942. Ruhig, klar, große Knöpfe. */
:root {
  --teal: #2ea1be;
  --teal-dark: #1f7f97;
  --teal-light: #e6f4f8;
  --grey: #313942;
  --grey-mid: #5f6b76;
  --grey-light: #eef0f2;
  --line: #d5dade;
  --bg: #f6f7f8;
  --white: #ffffff;
  --green: #2e7d4f;
  --green-light: #e7f4ec;
  --red: #b3261e;
  --red-light: #fbeceb;
  --amber-light: #fff6dc;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--grey);
  font-family: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

[hidden] { display: none !important; }

a { color: var(--teal-dark); }

.topbar {
  background: var(--white);
  border-bottom: 4px solid var(--teal);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.topbar img { height: 42px; width: auto; }
.topbar .title { font-size: 20px; font-weight: 600; flex: 1; }
.topbar .user { color: var(--grey-mid); font-size: 15px; }

.devbanner {
  background: #b3261e;
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: 8px 16px;
  letter-spacing: 0.02em;
}

main { max-width: 1040px; margin: 0 auto; padding: 28px 20px 60px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.card h1 { font-size: 26px; margin: 0 0 6px; font-weight: 600; }
.card h2 { font-size: 21px; margin: 0 0 14px; font-weight: 600; }
.lead { color: var(--grey-mid); margin: 0 0 22px; }

.step { margin: 26px 0 0; }
.step-label { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 19px; margin-bottom: 12px; }
.step-no {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teal); color: #fff; font-size: 17px; font-weight: 700;
}

.dropzone {
  display: block;
  border: 3px dashed var(--teal);
  border-radius: var(--radius);
  background: var(--teal-light);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.dropzone:hover, .dropzone.drag { background: #d3ecf3; }
.dropzone:focus-within { outline: 3px solid var(--teal-dark); outline-offset: 2px; }
.dropzone .big { font-size: 20px; font-weight: 600; display: block; }
.dropzone .small { color: var(--grey-mid); font-size: 15px; display: block; margin-top: 6px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.chosen-file {
  display: flex; align-items: center; gap: 14px;
  border: 2px solid var(--teal); border-radius: var(--radius);
  padding: 14px 18px; background: var(--white);
}
.chosen-file .name { font-weight: 600; flex: 1; word-break: break-all; }

select, .btn { font: inherit; }
select {
  width: 100%; max-width: 520px;
  padding: 13px 14px; font-size: 18px;
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--grey);
}
select:focus { border-color: var(--teal); outline: none; }

.choices { display: flex; flex-wrap: wrap; gap: 12px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: block; padding: 12px 20px; border: 2px solid var(--line); border-radius: var(--radius);
  cursor: pointer; background: var(--white); font-weight: 500;
}
.choice input:checked + span { border-color: var(--teal); background: var(--teal-light); }
.choice input:focus-visible + span { outline: 3px solid var(--teal-dark); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 30px;
  border: 0; border-radius: var(--radius);
  font-size: 19px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-primary:disabled { background: #a9d4e0; cursor: not-allowed; }
.btn-secondary { background: var(--grey-light); color: var(--grey); }
.btn-secondary:hover { background: #e1e5e8; }
.btn-small { min-height: 40px; font-size: 16px; padding: 0 16px; }
.btn-link { background: none; border: 0; color: var(--teal-dark); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.hint {
  background: var(--amber-light); border-left: 5px solid #e0b100;
  padding: 14px 18px; border-radius: 6px; margin-top: 14px;
}
.error-box {
  background: var(--red-light); border-left: 5px solid var(--red);
  padding: 14px 18px; border-radius: 6px; margin-top: 16px;
}

.progress { height: 14px; background: var(--grey-light); border-radius: 7px; overflow: hidden; margin: 16px 0 10px; }
.progress .bar { height: 100%; background: var(--teal); width: 0; transition: width 0.4s; }
.progress.indeterminate .bar { width: 35%; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.muted { color: var(--grey-mid); font-size: 15px; }

.status {
  display: flex; gap: 16px; align-items: flex-start;
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px;
}
.status .icon {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; font-weight: 700;
}
.status h2 { margin: 0 0 4px; }
.status p { margin: 4px 0; }
.status.ok { background: var(--green-light); border: 2px solid var(--green); }
.status.ok .icon { background: var(--green); }
.status.bad { background: var(--red-light); border: 2px solid var(--red); }
.status.bad .icon { background: var(--red); }
.status ul { margin: 8px 0; padding-left: 22px; }

.filename {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--grey-light); border-radius: 6px; padding: 10px 14px;
  word-break: break-all; font-size: 16px; display: block; margin: 6px 0 0;
}

details { margin-top: 12px; }
details summary { cursor: pointer; color: var(--grey-mid); }
details pre { white-space: pre-wrap; font-size: 14px; background: var(--white); padding: 10px; border-radius: 6px; }

.pages {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 10px;
}
.page { margin: 0; }
.page img {
  width: 100%; height: auto; display: block; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(49, 57, 66, 0.12);
}
.page a { display: block; }
.page figcaption { text-align: center; color: var(--grey-mid); font-size: 14px; margin-top: 6px; }

.joblist { list-style: none; padding: 0; margin: 0; }
.joblist li { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grey-light); }
.joblist li:last-child { border-bottom: 0; }
.joblist .what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.badge { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; }
.badge.ok { background: var(--green-light); color: var(--green); }
.badge.bad { background: var(--red-light); color: var(--red); }
.badge.run { background: var(--teal-light); color: var(--teal-dark); }

/* Anmeldeseite */
.login-wrap { max-width: 520px; margin: 60px auto; padding: 0 20px; }
.login-wrap .card { text-align: center; padding: 40px 36px; }
.login-wrap img { height: 64px; margin-bottom: 18px; }
.login-wrap .btn { width: 100%; margin-top: 18px; }
.devform { margin-top: 28px; padding-top: 22px; border-top: 2px dashed var(--red); text-align: left; }
.devform label { display: block; font-weight: 600; margin-bottom: 6px; }
.devform input { width: 100%; padding: 12px; font: inherit; border: 2px solid var(--line); border-radius: var(--radius); }
.devform .btn { background: var(--red); color: #fff; }

@media (max-width: 640px) {
  .card { padding: 20px 18px; }
  .topbar { padding: 10px 14px; }
  .topbar .user { display: none; }
  .topbar .title { font-size: 17px; }
  .topbar img { height: 34px; }
  .joblist li { flex-wrap: wrap; }
  .joblist .what { flex-basis: 100%; order: 2; }
  .joblist .btn { order: 3; }
  .status { flex-direction: column; padding: 16px 14px; gap: 10px; }
  .contact-row .btn, .status .actions .btn { width: 100%; }
  .btn { text-align: center; white-space: normal; }
  .lb-stage { padding: 6px; }
}
.actions.tight { margin-top: 0; }
.preview-title { margin-top: 36px; }

/* --- Runde 2: Rot-Meldung, Kontakt, Vorschau, Großansicht --- */
.grow { flex: 1; min-width: 0; }
.status .label { font-weight: 700; margin: 14px 0 4px; }
.status .action { font-size: 18px; font-weight: 600; margin: 0 0 10px; }
.contact-box { background: var(--white); border-radius: 8px; padding: 14px 16px; margin: 12px 0; border: 1px solid var(--line); }
.contact-box p { margin: 4px 0; }
.contact-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 6px; }
.ok-text { color: var(--green); font-weight: 600; }
.draft-name { color: var(--grey-mid); font-size: 15px; margin-top: 12px; }
.draft-name span { text-decoration: line-through; overflow-wrap: anywhere; }
.contact-footer { text-align: center; color: var(--grey-mid); font-size: 15px; padding: 8px 0 0; }
.contact-footer a { margin-left: 8px; }

.pages { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.page-btn { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.page-btn:focus-visible { outline: 3px solid var(--teal-dark); outline-offset: 3px; }
.page-btn:hover img { box-shadow: 0 4px 14px rgba(46, 161, 190, 0.45); border-color: var(--teal); }
.zoom-tag {
  position: absolute; right: 10px; bottom: 10px; background: var(--teal); color: #fff;
  font-size: 14px; font-weight: 600; padding: 5px 10px; border-radius: 6px;
}

body.noscroll { overflow: hidden; }
.lightbox { position: fixed; inset: 0; background: rgba(30, 35, 40, 0.97); z-index: 50; display: flex; flex-direction: column; }
.lb-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--grey); color: #fff; }
.lb-bar #lb-caption { font-weight: 600; font-size: 18px; }
.lb-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.lb-tools .btn:disabled { opacity: 0.45; cursor: default; }
.lb-stage { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: 16px; }
.lb-stage img { max-height: calc(100vh - 110px); max-width: 100%; height: auto; width: auto; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,0.5); }
.lb-stage.full img { max-height: none; width: 100%; max-width: 1400px; }

/* --- Runde 3: Erkennung, Warnung, fehlender Kontakt --- */
.detect-note { border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; font-weight: 500; }
.detect-note.found { background: var(--green-light); border-left: 5px solid var(--green); }
.detect-note.none { background: var(--grey-light); border-left: 5px solid var(--grey-mid); }
.warn-box { background: #fff1d6; border: 2px solid #d98a00; border-radius: 8px; padding: 14px 18px; margin-top: 14px; }
.warn-box strong { color: #8a5300; font-size: 18px; }
.warn-box p { margin: 6px 0; }
.btn-warn { background: #d98a00; color: #fff; }
.btn-warn:hover { background: #b87400; }
.suggest { background: var(--white); border: 2px solid var(--teal); border-radius: 8px; padding: 12px 14px; margin: 10px 0; }
.suggest p { margin: 0 0 8px; }
.contact-missing { background: var(--red-light); color: var(--red); border-radius: 6px; padding: 8px 12px; font-size: 15px; font-weight: 600; }
.detect-note.weak { background: var(--grey-light); border-left: 5px solid var(--teal); }
.detect-note.kaehler { background: var(--teal-light); border-left: 5px solid var(--teal-dark); }
#retry-doctypes { margin: 8px 0; }
#retry-doctypes p { flex-basis: 100%; margin: 0; font-weight: 600; }
#retry-select { margin: 8px 0; }
#jobs-more { margin-top: 12px; }
#retry-candidates { margin: 6px 0; }

/* Profil-Assistent */
.assistant-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-row { margin: 12px 0; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-row input[type=text] { width: 100%; max-width: 420px; padding: 10px 12px; font: inherit; border: 2px solid var(--line); border-radius: var(--radius); }
.form-row input[type=text]:focus { border-color: var(--teal); outline: none; }
.badge.wait { background: var(--amber-light); color: #7a5600; }
.topbar a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* Admin-Seite */
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--grey-light); vertical-align: top; }
.admin-table tr.sel td { background: var(--teal-light); }
.admin-table button { white-space: nowrap; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 10px 0 16px; }
.kv dt { color: var(--grey-mid); }
.kv dd { margin: 0; font-weight: 600; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.compare h3 { font-size: 16px; margin: 0 0 8px; }
.compare img { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
pre.yaml { background: var(--grey-light); padding: 12px; border-radius: 8px; font-size: 13px; max-height: 520px; overflow: auto; white-space: pre; }
.findings li.err { color: var(--red); }
.costbar { font-size: 15px; color: var(--grey-mid); }
@media (max-width: 700px) { .compare { grid-template-columns: 1fr; } }
.red-confirm { background: var(--red-light); border: 2px solid var(--red); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; }
.red-confirm ul { margin: 8px 0 12px; padding-left: 22px; color: var(--red); }
.red-confirm label { display: block; margin-bottom: 6px; }
.red-confirm input { padding: 8px 10px; font: inherit; border: 2px solid var(--red); border-radius: 8px; width: 260px; max-width: 100%; }
.terms { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.terms li { background: var(--grey-light); border-radius: 8px; padding: 6px 10px; font-size: 15px; }
.terms li b { font-weight: 700; }
.terms li .kind { color: var(--grey-mid); font-size: 13px; margin-left: 6px; }
.terms li.warn { background: var(--amber-light); border: 1px solid #e0b100; }
.terms li .why { display: block; font-size: 13px; color: #7a5600; }
