@font-face { font-family: 'DM Sans'; font-weight: 400; font-display: swap; src: url(/fonts/dm-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 500; font-display: swap; src: url(/fonts/dm-sans-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 600; font-display: swap; src: url(/fonts/dm-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-weight: 700; font-display: swap; src: url(/fonts/dm-sans-latin-700-normal.woff2) format('woff2'); }

:root {
  --navy: #060A12; --petrol: #0C2233; --light: #F5F8FB; --line: #E3E8EF;
  --ink: #0B1220; --mute: #5B6472; --blue: #2563EB; --blue-d: #1D4ED8; --cyan: #46C8DC;
  --tile: #E6F7FA; --teal: #0E7C8C; --red: #B42318;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'DM Sans', system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--light); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--blue); }
a:hover { color: var(--blue-d); }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-14 { display: flex; flex-direction: column; gap: 14px; }
.muted { margin: 0; color: var(--mute); font-size: 15px; }
.h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 700; }
.h2 { margin: 0; font-size: 20px; font-weight: 700; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 1px 2px rgba(11,18,32,.04), 0 8px 24px rgba(11,18,32,.06); }

.btn { background: var(--blue); color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; border: 0; border-radius: 999px; min-height: 48px; padding: 0 26px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(37,99,235,.35); cursor: pointer; }
.btn:hover { background: var(--blue-d); color: #fff; }
.btn[disabled] { opacity: .55; cursor: default; box-shadow: none; }
.btn-outline { font-size: 15px; font-weight: 600; color: var(--blue); background: #fff; border: 1.5px solid var(--blue); border-radius: 999px; min-height: 44px; padding: 0 18px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn-outline:hover { background: #EFF4FF; }
.link-btn { background: none; border: 0; color: var(--blue); font-size: 15px; font-weight: 500; cursor: pointer; min-height: 44px; padding: 0 4px; text-decoration: underline; }
.link-light { background: none; border: 0; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: underline; min-height: 44px; }
.danger { color: var(--red); }
.danger-bg { background: var(--red); box-shadow: none; }
.danger-bg:hover { background: #912018; }
.error { margin: 0; color: var(--red); font-size: 14px; font-weight: 500; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input, .field textarea, .field select { font-family: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid #C7D0DC; border-radius: 12px; min-height: 48px; color: var(--ink); background: #fff; width: 100%; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); outline: 2px solid rgba(37,99,235,.25); }
.hint { font-size: 13px; color: var(--mute); }
.code-input { font-size: 24px !important; letter-spacing: 6px; }

/* Login */
.login-bg { min-height: 100vh; background: radial-gradient(900px 420px at 50% -10%, rgba(37,99,235,.40), transparent 65%), var(--navy); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-wrap { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 22px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.login-brand-name { color: #fff; font-weight: 700; font-size: 20px; }
.login-card { padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.login-foot { margin: 0; font-size: 13px; line-height: 1.6; color: #C9D3E0; text-align: center; }
.logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--blue), var(--cyan)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; box-shadow: 0 0 18px rgba(70,200,220,.45); flex: none; }
.logo-lg { width: 52px; height: 52px; border-radius: 15px; font-size: 16px; box-shadow: 0 0 24px rgba(70,200,220,.5); }

/* Kopfzeile */
.topbar { background: var(--navy); border-bottom: 1px solid #1B2433; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 14px 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; }
.brand-sub { color: var(--cyan); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.back { color: #fff; font-size: 15px; font-weight: 500; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.back:hover { color: var(--cyan); }
.topbar-right { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.quota { display: flex; flex-direction: column; gap: 6px; min-width: 190px; font-size: 13px; color: #C9D3E0; }
.quota-bar { height: 6px; border-radius: 3px; background: #1B2433; }
.quota-fill { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--blue), var(--cyan)); width: 0; }
.who { font-size: 14px; color: #C9D3E0; overflow-wrap: anywhere; }

/* Hero */
.hero { background: radial-gradient(1200px 300px at 70% -40%, rgba(37,99,235,.45), transparent 60%), var(--navy); padding: 40px 24px 48px; }
.hero-inner { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.hero-title { margin: 0; color: #fff; font-size: 34px; line-height: 1.2; font-weight: 700; }
.hero-sub { margin: 0; color: #C9D3E0; font-size: 17px; max-width: 640px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.eyebrow-dark { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }

.main { max-width: 1120px; margin: 0 auto; padding: 0 24px 56px; display: flex; flex-direction: column; gap: 24px; }
.main-up { margin-top: -24px; }
.main-lib { margin-top: 28px; gap: 30px; }

/* Agenten-Karten */
.agents { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.agent { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.agent h2 { margin: 0; font-size: 19px; font-weight: 700; }
.agent p { margin: 0; font-size: 15px; color: var(--mute); flex: 1; }
.agent .btn { width: 100%; }
.agent-icon { width: 76px; height: 76px; flex: none; border-radius: 20px; background: linear-gradient(160deg, #EAF8FB, #D6F0F5); display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.agent-icon img { width: 88%; height: 88%; object-fit: contain; display: block; }
.soon { font-size: 13px; color: var(--mute); text-align: center; }

.lib-strip { padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 14px; background: var(--light); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.chip b { font-weight: 700; }

/* Bibliothek */
.lib-sec { display: flex; flex-direction: column; gap: 12px; }
.lib-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.lib-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.lib-help { margin: -4px 0 0; font-size: 14px; color: var(--mute); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.item { padding: 20px; display: flex; gap: 16px; align-items: flex-start; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; }
.item:hover { border-color: #B9C6D6; }
.item-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.item-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.item-meta { font-size: 14px; color: var(--mute); overflow-wrap: anywhere; }
.item-edit { font-size: 14px; color: var(--blue); font-weight: 600; flex: none; }
.cover { width: 48px; height: 66px; flex: none; border-radius: 6px; background: linear-gradient(160deg, var(--petrol), var(--blue)); box-shadow: 0 6px 14px rgba(11,18,32,.18); }
.badge { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 999px; padding: 3px 10px; width: fit-content; }
.badge-ok { background: var(--tile); color: var(--teal); }
.badge-plan { background: #FDF1DC; color: #7A4B00; }
.empty { padding: 22px; border: 1.5px dashed #C7D0DC; border-radius: 16px; color: var(--mute); font-size: 15px; background: #fff; }

/* Dialoge */
.dlg { border: 0; padding: 0; border-radius: 20px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 60px rgba(6,10,18,.35); color: var(--ink); }
.dlg-wide { width: min(640px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(6,10,18,.75); }
.dlg-form { padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.dlg-actions-right { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.confirm { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: #FEF3F2; border-radius: 14px; padding: 14px; }
.confirm span { flex: 1; min-width: 180px; font-weight: 600; }
.ob-icons { display: flex; gap: 8px; }
.ob-icons .agent-icon { width: 52px; height: 52px; border-radius: 14px; }
.ob-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.ob-steps li { display: flex; gap: 14px; align-items: flex-start; }
.ob-steps .num { flex: none; width: 34px; height: 34px; border-radius: 17px; background: var(--tile); color: var(--teal); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ob-steps div { display: flex; flex-direction: column; gap: 3px; }
.ob-steps b { font-size: 17px; }
.ob-steps div span { font-size: 15px; color: var(--mute); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; box-shadow: 0 10px 30px rgba(6,10,18,.3); z-index: 50; }
.noscript { padding: 24px; }

@media (max-width: 640px) {
  .hero-title { font-size: 27px; }
  .topbar-right { gap: 10px; }
  .quota { min-width: 150px; }
  .dlg-form { padding: 22px; }
  .login-card { padding: 24px; }
}

/* ---------- Agenten ---------- */
.stack-4 { display: flex; flex-direction: column; gap: 4px; }
.stack-18 { display: flex; flex-direction: column; gap: 18px; }
.stack-22 { display: flex; flex-direction: column; gap: 22px; }
.pad { padding: 24px; }
.h3 { margin: 0; font-size: 18px; font-weight: 700; }
.main-narrow { max-width: 880px; }
.main-run { margin-top: 32px; }
.hero-agent { padding: 32px 24px 48px; }
.hero-row { flex-direction: row; align-items: center; gap: 18px; max-width: 880px; }
.agent-icon-lg { width: 84px; height: 84px; border-radius: 22px; }
.agent .btn { text-decoration: none; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { font-size: 15px; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 999px; min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; text-decoration: none; box-shadow: 0 1px 2px rgba(11,18,32,.04); }
.tab[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.tile { text-align: left; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; min-height: 76px; }
.tile:hover { border-color: #B9C6D6; }
.tile[aria-pressed="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.tile b { font-size: 15px; }
.tile span { font-size: 13px; color: var(--mute); }

.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { font: inherit; font-size: 15px; color: var(--ink); background: #fff; border: 1.5px solid #C7D0DC; border-radius: 999px; min-height: 42px; padding: 0 16px; cursor: pointer; }
.pick[aria-pressed="true"] { background: #EFF4FF; border-color: var(--blue); color: var(--blue-d); font-weight: 600; }
.qlabel { font-size: 15px; font-weight: 600; }
.qopt { font-weight: 400; color: var(--mute); }
.bib-missing { font-size: 14px; color: var(--mute); }

.submit-row { display: flex; justify-content: flex-end; align-items: center; gap: 16px; flex-wrap: wrap; }
.cost-line { font-size: 14px; color: var(--mute); }

.recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.recent li { border-top: 1px solid #EEF2F6; }
.recent li:first-child { border-top: 0; }
.recent a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; color: var(--ink); text-decoration: none; font-size: 15px; }
.recent a:hover .r-label { color: var(--blue); }
.r-meta { color: var(--mute); font-size: 13px; flex: none; }

.run-wait { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 40px 24px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid #DCE6F5; border-top-color: var(--blue); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.run-steps { list-style: none; margin: 6px 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.run-steps li { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--light); color: var(--mute); }
.run-steps li.on { background: var(--tile); color: var(--teal); font-weight: 600; }
.run-steps li.done { background: #E8F5EC; color: #1E6B3A; }

.result-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.result { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.result h2 { font-size: 20px; margin: 30px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.result h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.result h3 { font-size: 17px; margin: 22px 0 8px; }
.result p { margin: 0 0 14px; }
.result ul, .result ol { margin: 0 0 14px; padding-left: 22px; }
.tw { overflow-x: auto; margin: 0 0 16px; }
.result table { border-collapse: collapse; width: 100%; font-size: 14px; }
.result th:first-child, .result td:first-child { white-space: nowrap; }
.result th, .result td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.result th { background: var(--light); }
.result blockquote { margin: 18px 0; padding: 12px 16px; background: #FFF8E6; border-left: 4px solid #E3A008; border-radius: 8px; font-size: 14px; }
.result blockquote p { margin: 0; }
.copy-btn { font: inherit; font-size: 14px; font-weight: 600; color: var(--blue); background: #fff; border: 1.5px solid var(--blue); border-radius: 999px; min-height: 36px; padding: 0 14px; cursor: pointer; flex: none; }
.copy-btn:hover { background: #EFF4FF; }
.field textarea.tall { min-height: 220px; }
.result h3 { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.result li .copy-btn, .result p .copy-btn { margin-left: 6px; vertical-align: middle; min-height: 30px; font-size: 13px; }
a.copy-btn { display: inline-flex; align-items: center; text-decoration: none; }

.foot { max-width: 1120px; margin: 0 auto; padding: 8px 24px 32px; display: flex; gap: 18px; justify-content: center; font-size: 13px; }
.foot a { color: var(--mute); }
.login-links a { color: #C9D3E0; }
