@font-face { font-family: "Mulish"; src: url("fonts/mulish-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Mulish"; src: url("fonts/mulish-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Mulish"; src: url("fonts/mulish-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --red: #c50e1f;
  --ink: #1d1d1f;
  --muted: #6b6b70;
  --line: #e6e6e9;
  --soft: #f6f6f7;
  --ok: #1a7f37;
  --warn: #b35900;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: #fff; color: var(--ink); }
body { font: 15px/1.55 "Mulish", system-ui, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-size: 13px; background: var(--soft); padding: 1px 4px; border-radius: 3px; }
.muted { color: var(--muted); }

.top { display: flex; align-items: center; gap: 20px; padding: 18px 32px; border-bottom: 1px solid var(--line); }
.logo { height: 42px; width: auto; }
.brand { border-left: 1px solid var(--line); padding-left: 20px; }
.brand-chair { font-weight: 700; font-size: 16px; }
.brand-tool { color: var(--muted); font-size: 14px; }
.limits-btn { margin-left: auto; position: relative; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid transparent; background: none; border-radius: 8px; color: var(--muted); cursor: pointer; }
.limits-btn:hover { border-color: var(--line); color: var(--ink); }
.limits-btn.changed::after { content: ""; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.limits-btn + .logout { margin-left: 16px; }
.logout { margin-left: auto; color: var(--muted); font-size: 14px; }

.app { display: grid; grid-template-columns: 380px 1fr; min-height: calc(100vh - 79px); }
.left { padding: 28px 28px 28px 32px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.right { padding: 28px 40px 60px; min-width: 0; }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .left { border-right: 0; border-bottom: 1px solid var(--line); }
  .top, .left, .right { padding-left: 16px; padding-right: 16px; }
}

.spacer { flex: 1; min-height: 28px; }
.steps { margin: 0; padding: 20px 0 0; border-top: 1px solid var(--line); list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-left: 32px; margin-bottom: 8px; font-size: 14px; color: var(--muted); }
.steps li b { color: var(--ink); font-weight: 600; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 21px; height: 21px; border-radius: 50%; border: 1px solid var(--line); font-size: 12px; font-weight: 700; display: grid; place-items: center; color: var(--ink); }

.list { list-style: none; margin: 16px 0 0; padding: 0; }
.item { display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 8px; cursor: pointer; }
.item + .item { margin-top: 2px; }
.item:hover { background: var(--soft); }
.item.active { background: var(--soft); box-shadow: inset 3px 0 0 var(--red); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #cfcfd4; }
.dot.busy { background: var(--warn); animation: pulse 1s infinite; }
.dot.done { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.error { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.item-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-x { border: 0; background: none; color: #aaa; font-size: 18px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.item-x:hover { color: var(--red); }

.actions { display: flex; gap: 8px; margin-top: 18px; }
.demo { margin-top: 22px; font-size: 13px; color: var(--warn); }

.btn { border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 7px; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn:hover { border-color: #bbb; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { padding: 4px 10px; font-size: 13px; }

.empty { max-width: 460px; margin-top: 60px; }
.empty p:first-child { font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.d-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.d-meta { flex: 1; min-width: 240px; }
.d-name { font-size: 20px; font-weight: 700; margin: 0; }
.d-sub { color: var(--muted); font-size: 14px; }
.d-controls { display: flex; gap: 8px; align-items: center; }
select { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: #fff; }

.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 3px; margin: 26px 0 22px; }
.lang button { border: 0; background: none; padding: 5px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; color: var(--muted); }
.lang button.on { background: var(--ink); color: #fff; }

.field { margin-bottom: 28px; max-width: 680px; }
.field-top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.field-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.count { font-size: 13px; color: var(--muted); }
.count.good { color: var(--ok); }
.count.bad { color: var(--warn); font-weight: 600; }
.field-top .btn { margin-left: auto; }

.measure { position: absolute; left: -9999px; top: 0; visibility: hidden; width: 320px; font: 400 24px/32px "Mulish", system-ui, sans-serif; overflow-wrap: break-word; } /* Karte der TU-Seite bei 1440 px Fensterbreite; an 38 Headlines der Seite geprüft */
.headline { font-size: 20px; line-height: 32px; font-weight: 400; padding: 0; margin: 0; outline: none; border-bottom: 1px dashed transparent; }
.headline:focus, .headline:hover { border-bottom-color: #cfcfd4; }

.teaser { width: 100%; min-height: 150px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.teaser:focus, .source:focus { outline: none; border-color: #bbb; }

.official { font-size: 13.5px; color: var(--muted); max-width: 680px; margin-top: 4px; }
.status { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.status.err { color: var(--red); }

details.src { margin-top: 30px; max-width: 680px; border-top: 1px solid var(--line); padding-top: 14px; }
details.src summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.source { width: 100%; min-height: 260px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.5; resize: vertical; }

.login { display: grid; place-items: center; padding: 80px 16px; }
.login-box { width: 300px; display: grid; gap: 12px; }
.login-box h1 { font-size: 20px; margin: 0 0 4px; }
.login-box input { border: 1px solid var(--line); border-radius: 7px; padding: 9px 12px; }
.err { color: var(--red); margin: 0; font-size: 14px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 8px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

dialog.notice { border: 0; border-radius: 12px; padding: 26px 28px 22px; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.18); color: var(--ink); }
dialog.notice::backdrop { background: rgba(20,20,25,.28); }
dialog.notice h3 { margin: 0 0 8px; font-size: 17px; }
dialog.notice p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
dialog.notice ul { margin: 0 0 18px; padding-left: 18px; font-size: 14px; }
dialog.notice form { display: flex; justify-content: flex-end; }

dialog.notice.limits form { display: block; }
dialog.notice .grid { display: grid; grid-template-columns: 1fr 90px 90px; gap: 10px 12px; align-items: center; margin: 4px 0 20px; font-size: 14px; }
dialog.notice .grid .h { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
dialog.notice .grid input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
dialog.notice .row { display: flex; gap: 8px; justify-content: flex-end; }
dialog.notice .row .reset { margin-right: auto; }

.manual { display: grid; gap: 14px; margin-top: 12px; }
.manual label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.manual label .muted { font-weight: 400; }
.manual input, .manual select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-weight: 400; background: #fff; }
.manual input:focus, .manual select:focus { outline: none; border-color: #bbb; }
.manual .source { margin-top: 0; font-size: 14px; min-height: 220px; font-weight: 400; }
.manual-row { display: grid; grid-template-columns: 1fr 180px; gap: 12px; }
@media (max-width: 600px) { .manual-row { grid-template-columns: 1fr; } }

.btn.wide { width: 100%; padding: 10px 14px; }
.form-wrap { max-width: 680px; margin-top: 26px; }
.manual-row { grid-template-columns: 1fr 170px 90px; }
.hint-err { margin: -6px 0 0; font-size: 13px; color: var(--red); }
@media (max-width: 600px) { .manual-row { grid-template-columns: 1fr; } }
.manual-row > label { min-width: 0; } .manual input, .manual select { width: 100%; min-width: 0; }

.missing { margin: 0; font-size: 13px; color: var(--muted); min-height: 1em; }
.manual select.placeholder { color: var(--muted); }
.manual select option { color: var(--ink); }

/* Einstellungen: Prompt */
dialog.notice.limits { max-width: 760px; }
.prompt-head { display: flex; align-items: baseline; gap: 8px; font-size: 14px; margin-top: 4px; }
.prompt-head .linkbtn { margin-left: auto; padding: 0; background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.prompt-head .linkbtn:hover { color: var(--ink); }
dialog.notice p.small { font-size: 12.5px; margin: 4px 0 8px; }
.prompt-edit { width: 100%; height: 42vh; min-height: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; margin-bottom: 12px; }
.prompt-edit:focus { outline: none; border-color: #bbb; }

dialog.notice .model-select { width: 100%; margin: 8px 0 20px; }

/* Längenübersicht (unter den Texten) */
.lengths { max-width: 680px; margin: 4px 0 0; padding: 12px 14px 10px; border-radius: 8px; background: var(--soft); }
.len-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.len-head .muted { font-weight: 400; letter-spacing: 0; text-transform: none; }
.len-sum { font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ok); }
.has-bad .len-sum { color: var(--warn); }
.len-row { display: grid; grid-template-columns: 88px 1fr 132px; gap: 12px; align-items: center; height: 22px; font-size: 12.5px; }
.len-label { color: var(--muted); }
.len-track { position: relative; height: 6px; border-radius: 3px; background: #e2e2e6; }
.len-zone { position: absolute; top: 0; bottom: 0; background: #bfe3c8; border-left: 1px solid var(--ok); border-right: 1px solid var(--ok); }
.len-mark { position: absolute; top: -4px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--ok); }
.len-row.bad .len-mark { background: var(--warn); }
.len-mark.off-left, .len-mark.off-right { width: 0; height: 0; background: none !important; top: -2px; border: 5px solid transparent; }
.len-mark.off-left { margin-left: 0; border-right-color: var(--warn); border-left-width: 0; }
.len-mark.off-right { margin-left: -5px; border-left-color: var(--warn); border-right-width: 0; }
.len-val { white-space: nowrap; }
.len-row.ok .len-val b { color: var(--ok); }
.len-row.bad .len-val b { color: var(--warn); }
.len-lines { color: var(--warn); font-weight: 600; }
.len-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12.5px; }
.len-foot .btn { flex-shrink: 0; }
@media (max-width: 600px) { .len-row { grid-template-columns: 76px 1fr 104px; gap: 8px; } .len-foot { flex-direction: column; align-items: flex-start; } }
.btn.subtle { border-color: transparent; background: none; color: var(--muted); font-weight: 600; }
.btn.subtle:hover { color: var(--ink); border-color: var(--line); }
.btn.refine-btn { background: #fff; border-color: #c9c9cf; color: var(--ink); padding: 5px 12px; }
.btn.refine-btn:hover { border-color: var(--ink); }

/* Einstellungen: Abschnitte im Wechsel hell/grau */
dialog.notice.limits { padding: 0; overflow: hidden; }
dialog.notice.limits form { max-height: calc(100vh - 140px); overflow-y: auto; }
.set-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 20px 28px 16px; border-bottom: 1px solid var(--line); }
.set-title h3 { margin: 0 !important; }
.set-title .muted { font-size: 13px; }
.set-sec { padding: 16px 28px 18px; border-bottom: 1px solid var(--line); }
.set-sec:nth-of-type(odd) { background: #f3f3f5; }
.set-sec .prompt-head { margin-top: 0; }
.set-sec .model-select { margin: 8px 0 0 !important; background: #fff; }
.set-sec .grid { margin: 6px 0 0 !important; }
.set-sec .grid input, .set-sec .prompt-edit { background: #fff; }
.set-sec .prompt-edit { margin-bottom: 0 !important; height: 34vh; }
.set-foot { padding: 14px 28px 16px; }
.set-foot .err { margin: 0 0 10px; }
.prompt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.prompt-row .small { margin: 0; }
dialog.notice.prompt-dlg { padding: 0; max-width: 860px; overflow: hidden; }
.prompt-dlg .pd-body { padding: 14px 28px 4px; }
.prompt-dlg .prompt-edit { height: 60vh; margin-bottom: 8px; }
.prompt-dlg .row { align-items: center; }
.prompt-dlg .pd-state { margin-right: auto; font-size: 13px; }
.linkbtn { padding: 0; background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; font-family: inherit; }
.linkbtn:hover { color: var(--ink); }
.prompt-row .small { font-size: 12.5px; }
