:root {
  --ewe-yellow: #FFD700; --ewe-yellow-hover: #FFF3B2; --ewe-yellow-active: #F5D000; --ewe-yellow-soft: #FFFBE5;
  --ewe-anthracite: #393E41; --ewe-anthracite-dark: #303437;
  --ewe-grey: #7B7F7F; --ewe-grey-mid: #BDBFBF; --ewe-grey-light: #EDEEEE;
  --ewe-focus: #0773DC; --ok: #2E7D32; --bad: #C62828;
  --radius-brand: 1.875rem 1.875rem 1.875rem 0; --radius: 4px;
  --page: 46rem; --header-h: 4.5rem; --logo-w: 6.125rem;
  --font: "Volte", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 1rem; line-height: 1.5; color: var(--ewe-anthracite); background: #fff; min-height: 100vh; display: flex; flex-direction: column; hyphens: auto; }
.page { max-width: var(--page); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 3rem); width: 100%; }
h1, h2, h3 { font-weight: 700; line-height: 1.25; }
a { color: var(--ewe-anthracite); }

/* Header */
.site-header { background: var(--ewe-anthracite-dark); color: #fff; position: sticky; top: 0; z-index: 2; }
.site-header .page { max-width: none; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: var(--header-h); flex-wrap: nowrap; }
.brand { display: flex; align-items: center; gap: 1rem; white-space: nowrap; flex: 0 1000 auto; min-width: var(--logo-w); }
.logo { width: var(--logo-w); height: 2.0625rem; color: var(--ewe-yellow); flex: none; }
.site-header h1 { font-size: 1.25rem; margin: 0; padding-left: 1rem; border-left: 1px solid var(--ewe-grey); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tag { font-size: .75rem; font-weight: 600; background: var(--ewe-yellow); color: var(--ewe-anthracite); padding: .1rem .55rem; border-radius: .75rem .75rem .75rem 0; vertical-align: middle; margin-left: .3rem; }
.tools { display: flex; align-items: center; gap: .5rem; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.tools button { flex: none; }
.tools nav { display: flex; gap: .5rem; }
.site-header button { color: #fff; border-color: #fff; margin-right: 0; }
.site-header button:hover { background: rgba(255,255,255,.12); }
.site-header button[aria-pressed="true"] { background: var(--ewe-yellow); border-color: var(--ewe-yellow); color: var(--ewe-anthracite); }


/* Layout */
.layout { flex: 1; padding-top: 1.5rem; padding-bottom: 2.5rem; }
body.split .page { max-width: none; }
body.split .layout { display: grid; grid-template-columns: minmax(0, var(--page)) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
#reqlog { position: sticky; top: calc(var(--header-h) + 1rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow: auto; border-left: 1px solid var(--ewe-grey-mid); padding-left: 1rem; }
.site-footer { background: var(--ewe-anthracite); color: #fff; padding: 1.5rem 0; font-size: .9rem; }
.site-footer .page::before { content: ""; display: inline-block; width: .6rem; height: .6rem; background: var(--ewe-yellow); border-radius: .3rem .3rem .3rem 0; margin-right: .6rem; }

/* Buttons */
button { font: inherit; font-weight: 600; margin-right: .5rem; padding: .45rem 1.25rem; cursor: pointer; color: var(--ewe-anthracite); background: transparent; border: 2px solid var(--ewe-anthracite); border-radius: var(--radius-brand); transition: background-color 250ms cubic-bezier(.4,0,.2,1), color 250ms; }
button:hover { background: var(--ewe-grey-light); }
button[type="submit"] { background: var(--ewe-yellow); border-color: var(--ewe-yellow); padding: .875rem 2rem; font-size: 1.125rem; line-height: 1.25rem; }
button[type="submit"]:hover { background: var(--ewe-yellow-hover); border-color: var(--ewe-yellow-hover); }
button[type="submit"]:active { background: var(--ewe-yellow-active); }
button[aria-pressed="true"] { background: var(--ewe-yellow-hover); }
button:disabled { color: var(--ewe-grey); border-color: var(--ewe-grey-mid); background: var(--ewe-grey-light); cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--ewe-focus); outline-offset: 2px; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--ewe-grey-mid); border-radius: var(--radius); padding: .5rem .7rem; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--ewe-anthracite); }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--ewe-anthracite); }
form button[type="submit"] { margin-top: .5rem; }

/* Content */
section.sec { border-left: 4px solid var(--ewe-yellow); padding-left: .9rem; margin: 1rem 0; }
.fact { display: flex; gap: .5rem; } .fact dt { font-weight: 600; min-width: 12rem; }
.field { margin: 1rem 0; } .field label.prompt, .field .prompt { display: block; font-weight: 600; margin-bottom: .3rem; }
.err { color: var(--bad); margin: .8rem 0; } .status-SUCCESSFUL { color: var(--ok); } .status-FAILED { color: var(--bad); }
.meta { color: var(--ewe-grey); font-size: .9em; }
li.nested { margin-left: 1.5rem; }
.reqlog-head { display: flex; justify-content: space-between; align-items: center; } .reqlog-head h2 { margin: .3rem 0; font-size: 1.25rem; }
details.xchg { border-bottom: 1px solid var(--ewe-grey-light); padding: .3rem 0; font-size: .9em; } details.xchg summary { cursor: pointer; }
details.xchg pre { background: var(--ewe-grey-light); padding: .5rem; overflow: auto; margin: .2rem 0 .6rem; font-size: .85em; border-radius: var(--radius); }
.st-ok { color: var(--ok); } .st-redir { color: var(--ewe-grey); } .st-err { color: var(--bad); font-weight: 600; }
details.sec-box { border: 1px solid var(--ewe-grey-mid); border-radius: var(--radius); margin: .6rem 0; padding: 0 .8rem; }
details.sec-box[open] { border-left: 4px solid var(--ewe-yellow); }
details.sec-box > summary { cursor: pointer; font-weight: 600; padding: .5rem 0; }
.tabs { border: 1px solid var(--ewe-grey-mid); border-radius: var(--radius); margin: .6rem 0; padding: 0 .8rem .5rem; }
.tabbar { display: flex; border-bottom: 1px solid var(--ewe-grey-mid); margin: 0 -.8rem .5rem; }
.tabbar button { margin: 0; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: .5rem 1rem; font-weight: 400; }
.tabbar button:hover { background: var(--ewe-grey-light); }
.tabbar button[aria-selected="true"] { border-bottom-color: var(--ewe-yellow); font-weight: 600; }
table.grid { border-collapse: collapse; width: 100%; } table.grid td { padding: .1rem .5rem .1rem 0; vertical-align: top; }
table.grid td > p { margin: 0; } img.img, .md img { max-width: 100%; height: auto; display: block; margin: .4rem 0; }
.field textarea, .field select { display: block; min-width: 16rem; } .field input[type=range] { width: 12rem; vertical-align: middle; }
.hint { font-size: .85em; } label.switch { display: inline-flex; gap: .3rem; align-items: center; }

@media (max-width: 40rem) {
  .header-inner { gap: .5rem; }
  .brand { gap: .5rem; }
  :root { --logo-w: 4.5rem; } .logo { height: 1.5rem; }
  .site-header h1 { font-size: 1.05rem; padding-left: 0; border-left: 0; }
  .tools, .tools nav { gap: .35rem; }
  .site-header button { font-size: .85rem; padding: .3rem .6rem; }
  .fact { flex-direction: column; gap: 0; } .fact dt { min-width: 0; }
}
@media (max-width: 36rem) {
  .site-header h1 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
@media (max-width: 30rem) {
  :root { --logo-w: 3.5rem; } .logo { height: 1.2rem; }
  .tools, .tools nav { gap: .25rem; }
  .site-header button { font-size: .8rem; padding: .25rem .45rem; }
}

/* KI-Assistent */
.chat { position: fixed; right: 1rem; bottom: 1rem; width: min(26rem, calc(100vw - 2rem)); height: min(40rem, calc(100vh - var(--header-h) - 2rem)); z-index: 3;
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--ewe-grey-mid); border-radius: 1rem 1rem 1rem 0; box-shadow: 0 6px 24px rgba(0,0,0,.18); overflow: hidden; }
.chat[hidden] { display: none; }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: .5rem .8rem; background: var(--ewe-anthracite-dark); color: #fff; border-bottom: 3px solid var(--ewe-yellow); }
.chat-head button { margin: 0 0 0 .3rem; padding: .1rem .7rem; color: #fff; border-color: #fff; }
.chat-head button:hover { background: rgba(255,255,255,.12); }
.chat-log { flex: 1; overflow-y: auto; padding: .6rem .8rem; }
.msg { margin: .5rem 0; padding: .5rem .8rem; border-radius: 1rem 1rem 1rem 0; max-width: 92%; overflow-wrap: anywhere; }
.msg p { margin: .3rem 0; } .msg h3, .msg h4 { margin: .5rem 0 .2rem; font-size: 1em; }
.msg-user { background: var(--ewe-yellow-hover); margin-left: auto; white-space: pre-wrap; border-radius: 1rem 1rem 0 1rem; }
.msg-assistant { background: var(--ewe-grey-light); }
.msg.streaming .msg-body::after { content: '▍'; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.thinking { color: var(--ewe-grey); font-style: italic; }
.tools-trace { display: flex; flex-wrap: wrap; gap: .3rem; }
.tool { font-size: .8em; padding: .1rem .5rem; border-radius: 1rem; background: var(--ewe-grey-light); color: var(--ewe-anthracite); }
.tool.running { background: var(--ewe-yellow-soft); } .tool.ok { background: #e3f4e3; color: var(--ok); } .tool.failed { background: #fbe3e3; color: var(--bad); }
.chat-form { display: flex; gap: .4rem; padding: .5rem; border-top: 1px solid var(--ewe-grey-mid); align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; } .chat-form button { margin: 0; padding: .6rem 1.2rem; font-size: 1rem; }
.chat-toggle { margin-right: 0; }
/* Sprach-Assistent */
.chat.voice { width: min(34rem, calc(100vw - 2rem)); }
.voice-ctl { display: flex; align-items: center; gap: .5rem; padding: .5rem .8rem; border-bottom: 1px solid #ccd; }
.voice-ctl button, .voice-ctl select { margin: 0; }
.voice-state { font-size: .9em; color: #666; } .voice-state.on { color: #070; } .voice-state.speak { color: #335; font-weight: 600; }
.voice-state.busy { color: #8a6d00; } .voice-state.err { color: #b00; }
.voice-level { flex: 1; height: 6px; background: #eee; border-radius: 3px; overflow: hidden; } .voice-level-bar { height: 100%; width: 0; background: #6a8; }
.voice-body { flex: 1; overflow-y: auto; padding: .5rem .8rem; }
.step-card { border: 1px solid #ccd; border-radius: 6px; padding: .4rem .7rem; margin-bottom: .6rem; background: #fafbff; }
.step-card h3 { margin: .3rem 0; font-size: 1em; } .step-q ul { margin: .2rem 0 .4rem; padding-left: 1.2rem; }
.msg.partial { opacity: .75; } .voice-hint { padding: 0 .8rem .4rem; font-size: .8em; }

/* ---------------------------------------------------------------- Assistenten (Feinschliff) */
.chat { border: 0; border-radius: 1.25rem 1.25rem 1.25rem 0; box-shadow: 0 12px 40px rgba(48,52,55,.28); animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.chat-head { padding: .65rem .8rem .65rem 1rem; border-bottom-width: 4px; }
.chat-title { display: flex; align-items: center; gap: .6rem; }
.chat-title strong { display: block; line-height: 1.1; }
.chat-status { display: block; font-size: .75rem; color: var(--ewe-grey-mid); }
.avatar { flex: none; display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50% 50% 50% 0;
  background: var(--ewe-yellow); color: var(--ewe-anthracite); font-weight: 700; font-size: .8rem; }
.avatar.sm { width: 1.6rem; height: 1.6rem; font-size: .65rem; margin-top: .15rem; }
.chat-log, .voice-body { background: linear-gradient(#fafafa, #f4f5f5); scroll-behavior: smooth; }
.chat-log { padding: .8rem; }
.row { display: flex; gap: .45rem; align-items: flex-start; margin: .55rem 0; }
.row-user { justify-content: flex-end; }
.row .msg { margin: 0; }
.msg { padding: .6rem .9rem; max-width: 85%; line-height: 1.45; font-size: .95rem; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.msg-assistant { background: #fff; border: 1px solid var(--ewe-grey-light); }
.msg-user { background: var(--ewe-yellow); }
.msg .md p:first-child { margin-top: 0; } .msg .md p:last-child { margin-bottom: 0; }
.msg ol, .msg ul { margin: .3rem 0; padding-left: 1.3rem; } .msg li { margin: .15rem 0; }
.msg img.img { border-radius: .6rem; border: 1px solid var(--ewe-grey-light); margin: .5rem 0; }
.thinking { display: inline-flex; gap: .25rem; padding: .3rem 0; font-style: normal; }
.thinking i { width: .45rem; height: .45rem; border-radius: 50%; background: var(--ewe-grey); animation: dot 1.2s infinite ease-in-out; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.tools-trace:not(:empty) { margin-bottom: .4rem; }
.tool { font-size: .75rem; font-weight: 600; padding: .15rem .6rem; border: 1px solid transparent; }
.tool.running { border-color: var(--ewe-yellow); position: relative; padding-left: 1.4rem; }
.tool.running::before { content: ''; position: absolute; left: .45rem; top: 50%; width: .55rem; height: .55rem; margin-top: -.3rem;
  border: 2px solid var(--ewe-anthracite); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.quick { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .6rem 2.05rem; }
.quick button { margin: 0; padding: .3rem .85rem; font-size: .85rem; font-weight: 600; background: #fff; border: 2px solid var(--ewe-anthracite); border-radius: 1rem 1rem 1rem 0; }
.quick button:hover { background: var(--ewe-yellow-hover); border-color: var(--ewe-yellow); }
.chat-form { padding: .6rem; gap: .5rem; background: #fff; border-top: 1px solid var(--ewe-grey-light); align-items: center; }
.chat-form textarea { border-radius: 1.2rem; padding: .55rem .9rem; max-height: 8rem; background: var(--ewe-grey-light); border-color: transparent; }
.chat-form textarea:focus { background: #fff; border-color: var(--ewe-anthracite); }
.chat-form button[type="submit"] { margin: 0; padding: .55rem 1.1rem; font-size: .95rem; }

/* Sprach-Assistent */
.voice-ctl { display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; padding: .9rem 1rem; border-bottom: 1px solid var(--ewe-grey-light); align-items: center; }
.voice-ctl button.mic { position: relative; width: 4.2rem; height: 4.2rem; padding: 0; border-radius: 50%; font-size: 0; background: var(--ewe-yellow); border-color: var(--ewe-yellow); }
.voice-ctl button.mic::before { content: ''; position: absolute; inset: 0; margin: auto; width: 1.6rem; height: 1.6rem; background: var(--ewe-anthracite);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.9V21h2v-2.1A7 7 0 0 0 19 12z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v6a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.9V21h2v-2.1A7 7 0 0 0 19 12z'/%3E%3C/svg%3E") center/contain no-repeat; }
.voice[data-state="on"] button.mic, .voice[data-state="speak"] button.mic, .voice[data-state="busy"] button.mic { background: var(--ewe-anthracite); border-color: var(--ewe-anthracite); }
.voice[data-state="on"] button.mic::before, .voice[data-state="speak"] button.mic::before, .voice[data-state="busy"] button.mic::before {
  background: #fff; -webkit-mask: none; mask: none; width: 1.1rem; height: 1.1rem; border-radius: .2rem; }
.voice[data-state="on"] button.mic { animation: ring 1.6s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255,215,0,.7); } 100% { box-shadow: 0 0 0 1rem rgba(255,215,0,0); } }
.voice-meta { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.voice-state { font-weight: 600; color: var(--ewe-grey); display: flex; align-items: center; gap: .4rem; }
.voice-state::before { content: ''; width: .55rem; height: .55rem; border-radius: 50%; background: var(--ewe-grey-mid); flex: none; }
.voice-state.on { color: var(--ok); } .voice-state.on::before { background: var(--ok); }
.voice-state.speak { color: var(--ewe-anthracite); } .voice-state.speak::before { background: var(--ewe-yellow); animation: dot 1s infinite; }
.voice-state.busy { color: #8a6d00; } .voice-state.busy::before { background: transparent; border: 2px solid #8a6d00; border-right-color: transparent; animation: spin .8s linear infinite; }
.voice-state.err { color: var(--bad); } .voice-state.err::before { background: var(--bad); }
.voice-level { height: .4rem; background: var(--ewe-grey-light); border-radius: .2rem; }
.voice-level-bar { background: var(--ewe-yellow); transition: width 80ms linear; }
.voice-sel { display: flex; flex-direction: column; font-size: .75rem; color: var(--ewe-grey); gap: .15rem; }
.voice-sel select { padding: .25rem .4rem; font-size: .85rem; }
.voice-body { padding: .6rem 1rem 1rem; }
.voice-sub { margin: .6rem 0 .35rem; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ewe-grey); }
.voice-steps .empty { margin: 0; padding: .9rem; border: 1px dashed var(--ewe-grey-mid); border-radius: .8rem; text-align: center; }
.step-card { position: relative; background: #fff; border: 0; border-left: 4px solid var(--ewe-yellow); border-radius: 0 .8rem .8rem 0; padding: .7rem .9rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.step-card h3 { font-size: 1.05rem; margin: 0 0 .4rem; }
.step-card img.img { border-radius: .6rem; }
.step-card.done { border-left-color: var(--ok); }
.step-q { margin-top: .6rem; padding-top: .5rem; border-top: 1px solid var(--ewe-grey-light); }
ul.opts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; margin: .4rem 0 0; }
ul.opts li { padding: .2rem .7rem; border: 1px solid var(--ewe-grey-mid); border-radius: 1rem 1rem 1rem 0; font-size: .85rem; background: var(--ewe-yellow-soft); }
.voice[data-state="busy"] .step-card { opacity: .55; transition: opacity .2s; }
.voice[data-state="busy"] .voice-steps { position: relative; }
.voice[data-state="busy"] .voice-steps::after { content: 'Der Assistent schaut nach …'; position: absolute; top: .5rem; right: .6rem; font-size: .75rem; font-weight: 600;
  background: var(--ewe-anthracite); color: #fff; padding: .15rem .6rem; border-radius: 1rem 1rem 1rem 0; }
.voice-log .msg { font-size: .9rem; }
.voice-hint { margin: 0; padding: .45rem 1rem .6rem; background: #fff; border-top: 1px solid var(--ewe-grey-light); }
@media (max-width: 40rem) { .chat, .chat.voice { right: .5rem; left: .5rem; bottom: .5rem; width: auto; } }
@media (prefers-reduced-motion: reduce) { .chat, .thinking i, .tool.running::before, .voice[data-state="on"] button.mic, .voice-state::before { animation: none !important; } }
/* Assistent + Maßnahmen-Ansicht links daneben */
.assist { position: fixed; right: 1rem; bottom: 1rem; z-index: 3; display: flex; gap: .8rem; align-items: flex-end; max-width: calc(100vw - 2rem); }
.assist[hidden] { display: none; }
.assist > .chat { position: static; flex: none; }
.step-side { width: min(30rem, calc(100vw - 30rem)); height: min(40rem, calc(100vh - var(--header-h) - 2rem)); display: flex; flex-direction: column;
  background: #fff; border-radius: 1.25rem; box-shadow: 0 12px 40px rgba(48,52,55,.28); overflow: hidden; animation: pop .18s ease-out; }
.step-side-head { display: flex; justify-content: space-between; align-items: baseline; padding: .75rem 1rem; background: var(--ewe-anthracite-dark); color: #fff; border-bottom: 4px solid var(--ewe-yellow); }
.step-side-head small { color: var(--ewe-grey-mid); }
.step-side-body { flex: 1; overflow-y: auto; padding: .8rem 1rem; }
.step-side-body .step-card { border: 0; background: none; padding: 0; margin: 0; }
.step-side-body .img { max-width: 100%; border-radius: .5rem; }
@media (max-width: 60rem) {
  .assist { flex-direction: column-reverse; align-items: stretch; }
  .step-side { width: auto; height: 30vh; }
  .assist > .chat { height: min(30rem, 55vh); width: auto; }
}
