:root {
  /* Ruhige Arbeitsflächen, klare Typografie; funktionale Akzente. */
  --bg: #F4F5F6;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --surface-3: #EBEDEF;
  --text: #15171A;
  --muted: #606874;
  --line: #DDE0E3;
  --brand: #1647DD;
  --brand-strong: #123BBB;
  --brand-soft: #E9EEFF;
  --on-brand: #FFFFFF;
  --accent: #8A5A1E;
  --accent-soft: #F5E9D3;
  --danger: #A5392B;
  --danger-soft: #F8E4DF;
  --info: #2F4E70;
  --info-soft: #E5ECF4;
  --night: #141B28;
  --night-2: #1D2634;
  --shadow: 0 1px 2px rgba(20, 27, 40, .035), 0 6px 20px -14px rgba(20, 27, 40, .16);
  --radius: 10px;
  --radius-sm: 8px;
  --max: 1440px;
  --focus: 0 0 0 3px rgba(22, 71, 221, .24);
  --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-head: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@font-face { font-family: "Archivo"; src: url("../assets/fonts/archivo-latin-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Source Sans 3"; src: url("../assets/fonts/source-sans-3-latin-variable.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }

* { box-sizing: border-box; }
html { min-width: 0; background: var(--bg); }
body {
  margin: 0;
  min-width: 0;
  color: var(--text);
  background: var(--bg);
  font: 16px/1.5 var(--font-body);
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--brand); }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand-text strong, .stat strong { font-family: var(--font-head); }
h1 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
h3 { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.topbar__inner, .page { width: min(100% - 32px, var(--max)); margin-inline: auto; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--night); color: #E8EDF6; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.topbar__inner { min-height: 72px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: #E8EDF6; background: rgba(255, 255, 255, .08); }
.brand-mark svg { width: 30px; height: 30px; }
.brand-text { display: grid; line-height: 1.05; }
.brand-text strong { font-size: 1.02rem; letter-spacing: .02em; }
.brand-text span { color: #93A2B9; font-size: .74rem; }
.topnav { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; }
.topnav a { min-height: 44px; position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 8px; color: #AAB6C9; font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; }
.topnav a:hover { color: #FFFFFF; background: rgba(255, 255, 255, .06); }
.topnav a.active { color: #FFFFFF; background: rgba(255, 255, 255, .05); }
.topnav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; background: #B8C4D2; }
.nav-count { min-width: 20px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #E8EDF6; font-size: .7rem; font-weight: 700; }
.topbar__tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-link { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 9px; color: #AAB6C9; background: transparent; }
.icon-link svg { width: 20px; height: 20px; }
.icon-link:hover, .icon-link.active { color: #FFFFFF; background: rgba(255, 255, 255, .08); }
.icon-badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border-radius: 999px; background: #5CC8FF; color: var(--night); font-size: .66rem; font-weight: 800; }
.user-switch { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 3px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; }
.user-switch select { max-width: 210px; border: 0; background: transparent; color: #E8EDF6; font-size: .86rem; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.user-switch select option { color: #15171A; }
.user-session { display: flex; align-items: center; gap: 8px; max-width: 320px; padding: 3px 3px 3px 3px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; color: #E8EDF6; font-size: .86rem; font-weight: 600; }
.user-session__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-session__abmelden.btn { flex: none; min-height: 28px; padding: 3px 12px; border-radius: 999px; }
.auth-session { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.avatar { width: 30px; height: 30px; display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: #1647DD; color: #FFFFFF; font-size: .74rem; font-weight: 800; letter-spacing: .02em; }
.avatar-sm { width: 24px; height: 24px; font-size: .64rem; }
.avatar-empty { background: var(--surface-3); color: var(--muted); }
.assignee { display: inline-flex; align-items: center; gap: 6px; }
.assignee-select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: .82rem; }

.page { padding-block: 32px 56px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-head h1 { margin-bottom: 7px; }
.eyebrow { color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 7px; }
.lede, .muted { color: var(--muted); }
.lede { max-width: 680px; margin-bottom: 0; font-size: 1rem; }
.stack { display: grid; gap: 18px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; border: 1px solid transparent; border-radius: 9px; padding: 8px 14px;
  text-decoration: none; font-weight: 700; background: var(--brand); color: var(--on-brand);
}
.btn:hover { background: var(--brand-strong); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-secondary { background: var(--surface); color: var(--brand); border-color: var(--line); }
.btn-secondary:hover { background: var(--brand-soft); }
.btn-quiet { color: var(--muted); background: transparent; border-color: var(--line); }
.btn-quiet:hover { color: var(--text); background: var(--surface-2); }
.btn-danger-text { color: var(--danger); }
.btn-danger { color: #FFFFFF; background: var(--danger); }
.btn-danger:hover { background: #8A2F23; }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: .85rem; }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover, .icon-btn.is-active { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--focus); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.count { min-width: 25px; height: 25px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: .78rem; font-weight: 800; }
.ticket-card { display: block; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); text-decoration: none; background: var(--surface); }
.ticket-card:hover { border-color: var(--brand); }
.ticket-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .76rem; margin-bottom: 8px; }
.ticket-title { font-weight: 780; line-height: 1.3; margin-bottom: 10px; overflow-wrap: anywhere; }
.ticket-footer { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; color: var(--muted); font-size: .78rem; }
.ticket-footer span:first-child { overflow-wrap: anywhere; }
.ticket-status-group { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px; text-align: right; }
.ticket-read-hint { display: inline-flex; align-items: center; width: fit-content; margin: 0; color: var(--brand); font-size: .72rem; font-weight: 750; line-height: 1.25; }
.empty { padding: 22px 10px; text-align: center; color: var(--muted); font-size: .88rem; }

.badge { display: inline-flex; align-items: center; max-width: 100%; border-radius: 999px; padding: 4px 8px; font-size: .72rem; font-weight: 800; line-height: 1.2; background: var(--surface-3); color: var(--muted); }
.badge-rueckfrage { color: var(--accent); background: var(--accent-soft); }
.badge-freigabe { color: var(--info); background: var(--info-soft); }
.badge-live { color: var(--brand); background: var(--brand-soft); }
.badge-mensch, .badge-besprechen { color: var(--danger); background: var(--danger-soft); }
.badge-in_arbeit, .badge-eingegangen { color: var(--muted); background: var(--surface-3); }
.badge-kleinigkeit { color: var(--brand); background: var(--brand-soft); }
.badge-klein { color: var(--info); background: var(--info-soft); }

.form-card { padding: clamp(18px, 4vw, 30px); }
.field { display: grid; gap: 7px; min-width: 0; }
.field label, .field-label { font-weight: 760; font-size: .9rem; }
.field-help { color: var(--muted); font-size: .82rem; }
input[type="text"], input[type="search"], input[type="url"], input[type="number"], input[type="email"], input[type="password"], textarea, select {
  width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; background: var(--surface); color: var(--text);
}
textarea { min-height: 120px; resize: vertical; }
input[type="file"] { max-width: 100%; color: var(--muted); }
.file-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 8px; background: var(--surface-3); font-size: .82rem; overflow-wrap: anywhere; }
.mark-card { border: 1px solid var(--brand); background: var(--brand-soft); border-radius: 8px; padding: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mark-card strong { display: block; }
.mark-card small { color: var(--muted); overflow-wrap: anywhere; }

.notice { border-radius: 6px; border: 1px solid var(--line); border-left: 3px solid var(--brand); padding: 12px 14px; background: var(--surface-2); }
.notice-info { color: var(--text); background: var(--surface-2); border-color: var(--line); border-left-color: var(--brand); }

.ticket-detail { display: grid; gap: 20px; }
.timeline { padding: 22px; }
.messages { display: grid; gap: 15px; }
.message { max-width: min(78%, 680px); display: grid; gap: 4px; }
.message-kunde { margin-left: auto; }
.message-head { display: flex; gap: 8px; align-items: baseline; color: var(--muted); font-size: .74rem; }
.message-kunde .message-head { justify-content: flex-end; }
.bubble { padding: 11px 14px; border-radius: 6px; background: var(--surface-3); white-space: pre-wrap; overflow-wrap: anywhere; }
.message-kunde .bubble { color: white; background: var(--brand); border-radius: 6px; }
.message-betreiber .bubble { background: var(--info-soft); border: 1px solid #c8d8ee; }
.message-system { max-width: 100%; margin-inline: auto; text-align: center; }
.message-system .message-head { justify-content: center; }
.message-system .bubble { padding: 7px 12px; color: var(--muted); background: transparent; border: 1px dashed var(--line); border-radius: 999px; }
.composer { display: grid; gap: 10px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }

.preview-shell { padding: 22px; }
.preview-shell small { overflow-wrap: anywhere; }
.preview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.device-preview { min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.device-label { padding: 8px 11px; color: var(--muted); background: var(--surface-3); font-size: .77rem; font-weight: 750; }
.before-after { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.stats-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { padding: 14px; }
.stat strong { display: block; font-size: 1.55rem; line-height: 1; margin-bottom: 6px; }
.stat span { color: var(--muted); font-size: .82rem; }
.section-card { padding: 16px; min-width: 0; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.data-table th, .data-table td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: var(--muted); background: var(--surface-2); font-size: .7rem; letter-spacing: .02em; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td:not(:first-child) { font-variant-numeric: tabular-nums; }
.data-table a { color: var(--text); text-decoration: none; }
.data-table a:hover { color: var(--brand); text-decoration: underline; }
.data-table small { display: block; margin-top: 3px; }
.ticket-seen-state { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 750; white-space: nowrap; }
.ticket-seen-state.is-seen { color: var(--brand); }
.ticket-seen-state.is-unseen { color: var(--accent); }
.ticket-seen-state.is-empty { min-width: 1px; }
.setting-grid { display: grid; gap: 11px; }
.setting-readonly { padding: 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.check-row { display: flex; align-items: flex-start; gap: 9px; }
.check-row input { margin-top: 4px; accent-color: var(--brand); }
.customer-tabs { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.customer-tabs a { margin-bottom: -1px; padding: 9px 12px; color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none; font-weight: 700; }
.customer-tabs a:hover { color: var(--text); }
.customer-tabs a[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.customer-tabpanel { min-width: 0; }
.customer-settings-form { max-width: 980px; }
.settings-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.demo-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.connections-card { margin-top: 20px; }
.connections-head, .connection-panel__head, .ive-ticket__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.connections-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.connection-panel { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.connection-panel h3 { margin-bottom: 0; }
.badge-simulation { color: var(--info); background: var(--info-soft); }
.connection-status { color: var(--brand); font-size: .78rem; font-weight: 750; white-space: nowrap; }
.connection-mails { display: grid; gap: 8px; padding: 0; margin: 15px 0 0; list-style: none; }
.connection-mails li { display: grid; gap: 3px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.connection-mails strong { overflow-wrap: anywhere; font-size: .88rem; }
.connection-mails small, .connection-mail__meta time { color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.connection-mail__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mail-direction { display: inline-flex; border-radius: 999px; padding: 2px 7px; font-size: .68rem; font-weight: 800; }
.mail-direction-eingehend { color: var(--info); background: var(--info-soft); }
.mail-direction-ausgehend { color: var(--brand); background: var(--brand-soft); }
.ive-list { display: grid; gap: 10px; margin-top: 15px; }
.ive-ticket { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.ive-ticket__head { margin-bottom: 10px; }
.ive-ticket__head a { min-width: 0; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.ive-ticket__head a:hover { color: var(--brand); }
.ive-ticket__head small { color: var(--muted); text-align: right; }
.ive-ticket__stages { min-width: 0; overflow-x: auto; padding-bottom: 2px; }
.ive-steps { display: grid; grid-template-columns: repeat(5, minmax(62px, 1fr)); min-width: 340px; padding: 0; margin: 0; list-style: none; }
.ive-steps li { display: grid; justify-items: center; align-content: start; gap: 4px; position: relative; color: var(--muted); text-align: center; font-size: .65rem; font-weight: 800; }
.ive-steps li:not(:last-child)::after { content: ""; position: absolute; top: 10px; left: calc(50% + 12px); width: calc(100% - 24px); height: 2px; background: var(--line); }
.ive-step__marker { position: relative; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); }
.ive-step__label { display: grid; gap: 1px; }
.ive-step__label small { color: inherit; font-size: .6rem; font-weight: 650; }
.ive-steps .is-complete { color: var(--brand); }
.ive-steps .is-complete .ive-step__marker { color: var(--surface); border-color: var(--brand); background: var(--brand); }
.ive-steps .is-complete::after { background: var(--brand); }
.ive-steps .is-current { color: var(--text); }
.ive-steps .is-current .ive-step__marker { color: var(--surface); border-color: var(--brand); background: var(--brand); box-shadow: var(--focus); }
.connections-note { margin: 14px 0 0; color: var(--muted); font-size: .8rem; }

.mail-layout { display: grid; grid-template-columns: minmax(260px, .42fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mail-sidebar { min-width: 0; overflow: hidden; }
.mail-tools { display: grid; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.mail-list { max-height: 720px; overflow-y: auto; }
.mail-list-entry { display: grid; border-bottom: 1px solid var(--line); }
.mail-list-entry:last-child { border-bottom: 0; }
.mail-item { width: 100%; display: grid; gap: 3px; text-align: left; padding: 14px 14px 8px; color: var(--text); background: transparent; border: 0; }
.mail-item:hover, .mail-item.active { background: var(--brand-soft); }
.mail-item strong { overflow-wrap: anywhere; font-weight: 600; }
.mail-list-entry.is-unread .mail-item strong { font-weight: 850; }
.mail-item small { color: var(--muted); }
.mail-item__meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.unread-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.mail-read-toggle { justify-self: start; margin: 0 14px 9px; padding: 2px 0; color: var(--brand); background: transparent; border: 0; font-size: .72rem; font-weight: 700; }
.mail-read-toggle:hover { text-decoration: underline; }
.mail-preview { min-width: 0; overflow: hidden; }
.mail-head { padding: 20px; border-bottom: 1px solid var(--line); }
.mail-head h2 { overflow-wrap: anywhere; }
.mail-head__title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mail-head__title h2 { margin-bottom: 12px; }
.mail-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; color: var(--muted); font-size: .84rem; }
.mail-facts dd, .mail-facts dt { margin: 0; overflow-wrap: anywhere; }
.mail-body { padding: clamp(20px, 5vw, 42px); background: var(--surface-2); }
.mail-paper { max-width: 680px; margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.mail-brand { padding: 20px 24px; color: white; background: var(--brand); font-weight: 850; letter-spacing: -.02em; }
.mail-content { padding: clamp(20px, 5vw, 34px); }
.mail-content p, .mail-content li { overflow-wrap: anywhere; }
.mail-content ul { padding-left: 20px; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.mail-foot { padding: 15px 24px; color: var(--muted); background: var(--surface-2); font-size: .76rem; }

.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 18px; background: rgba(31, 35, 40, .72); overflow-y: auto; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 36px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 60px rgba(0,0,0,.24); }
.modal-wide { width: min(1040px, 100%); }
.modal-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; background: var(--surface); border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 20px; }
.modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--line); }
.app-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 60px rgba(0,0,0,.28); overflow: auto; }
.app-dialog::backdrop { background: rgba(31, 35, 40, .72); backdrop-filter: blur(2px); }
.app-dialog__form { display: grid; }
.app-dialog__body { padding: 22px; }
.app-dialog__body h2 { margin-bottom: 8px; }
.app-dialog__body > p { margin-bottom: 18px; }
.app-dialog__error { min-height: 1.3em; margin: 0; color: var(--danger); font-size: .8rem; }
.app-dialog__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.parse-list { display: grid; gap: 11px; }
.parse-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.parse-item .field { grid-column: 1 / -1; }
.loading { display: grid; place-items: center; min-height: 210px; text-align: center; }
.spinner { width: 38px; height: 38px; margin: 0 auto 15px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--brand); animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.marker-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 12px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--surface-3); }
.segmented button { border: 0; border-radius: 7px; padding: 7px 11px; color: var(--muted); background: transparent; }
.segmented button.active { color: var(--text); background: var(--surface); box-shadow: 0 2px 7px rgba(0,0,0,.08); }
.marker-stage { padding: 18px; border-radius: 8px; background: #dce2df; overflow: hidden; }
.mini-site { width: 100%; margin: 0 auto; color: #252a27; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 12px 25px rgba(0,0,0,.12); transition: max-width .2s ease; }
.mini-site.is-phone { max-width: 360px; }
.mini-site * { box-sizing: border-box; }
.mini-web-head { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; color: white; background: #263f34; }
.mini-web-head strong { font-size: .87rem; }
.mini-web-head nav { display: flex; flex-wrap: wrap; gap: 9px; font-size: .66rem; }
.mini-hero { padding: 40px 22px; background: #eef2ef; }
.mini-hero h2 { font: 700 1.45rem Georgia, serif; margin-bottom: 6px; }
.mini-web-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; padding: 20px; }
.mini-web-card { padding: 15px; border: 1px solid #dce2df; border-radius: 7px; font-size: .73rem; }
.mini-web-card h3 { font-size: .8rem; margin-bottom: 7px; }
.mini-web-foot { padding: 15px 20px; color: white; background: #263f34; font-size: .7rem; }
.mini-site.is-phone .mini-web-head, .mini-site.is-phone .mini-web-grid { display: grid; grid-template-columns: 1fr; }
.mini-site.is-phone .mini-web-head nav { margin-top: 4px; }
.mini-site.marking [data-markable]:hover { outline: 3px solid var(--brand); outline-offset: -3px; cursor: crosshair; }

.toast-root { position: fixed; z-index: 60; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(360px, calc(100% - 32px)); }
.toast { padding: 13px 15px; color: #E8EDF6; background: var(--night); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); animation: toast-in .18s ease-out; }
.toast.error { background: #843030; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Anmeldung */
.auth-shell { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 50% 0, var(--brand-soft), transparent 44%), var(--bg); }
.auth-card { width: min(440px, 100%); padding: clamp(22px, 6vw, 34px); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.auth-brand > div { display: grid; line-height: 1.05; }
.auth-brand strong { font: 800 1.15rem/1 var(--font-head); letter-spacing: .03em; }
.auth-brand span { color: var(--muted); font-size: .78rem; }
.auth-logo { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; color: #E8EDF6 !important; background: var(--night); }
.auth-logo svg { width: 40px; height: 40px; }
.auth-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; margin: -10px 0 24px; padding: 4px; border-radius: 9px; background: var(--surface-3); }
.auth-tabs button { padding: 8px 10px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-weight: 750; }
.auth-tabs button.active { color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.auth-copy h1 { margin-bottom: 10px; }
.auth-copy .muted { margin-bottom: 22px; }
.auth-form { display: grid; gap: 16px; }
.auth-form .btn { width: 100%; margin-top: 2px; }
.auth-link { width: fit-content; margin: -3px auto 0; padding: 3px; border: 0; color: var(--brand); background: transparent; font-weight: 700; }
.auth-link:hover { text-decoration: underline; }
.auth-message { margin: 0 0 16px; padding: 11px 13px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 6px; background: var(--brand-soft); }
.auth-message.auth-error { border-left-color: var(--danger); background: var(--danger-soft); }
.auth-message p { margin-bottom: 10px; }
.auth-loading { min-height: 110px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); }

/* Freischaltung und Zugangsverwaltung */
.access-error { margin-bottom: 14px; border-left-color: var(--danger); background: var(--danger-soft); }
.access-section { margin-top: 14px; }
.access-list { display: grid; gap: 10px; }
.access-card { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(150px, .8fr) minmax(110px, .55fr); gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.access-person { display: grid; min-width: 0; }
.access-person strong, .access-person span, .access-person small, .access-card > div > span { overflow-wrap: anywhere; }
.access-person span, .access-person small { color: var(--muted); }
.access-person small { margin-top: 3px; }
.access-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.access-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.access-action-form { display: flex; flex: 1 1 340px; align-items: flex-end; gap: 8px; }
.access-action-form label { flex: 1 1 180px; }
.access-action-form .btn { flex: none; }
.access-card-approved { grid-template-columns: minmax(180px, .7fr) minmax(0, 2fr); align-items: center; }
.access-edit-form { display: grid; grid-template-columns: repeat(3, minmax(125px, 1fr)) auto; gap: 9px; align-items: end; }
.access-edit-form .field { gap: 4px; }
.access-edit-form .field > span { font-size: .76rem; font-weight: 750; }
.access-edit-buttons { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }


/* Übersicht */
.stat-link { color: var(--text); text-decoration: none; }
.stat-link:hover { border-color: var(--brand); }
.stat-link.is-attention strong { color: var(--danger); }
.stats + .section-card, .section-card + .section-card { margin-top: 14px; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; }
.todo-list li + li { border-top: 1px solid var(--line); }
.todo-list a { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto 150px; gap: 10px; align-items: center; padding: 10px 4px; color: var(--text); text-decoration: none; }
.todo-list a:hover { background: var(--surface-2); }
.todo-num { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .85rem; }
.todo-main { display: grid; min-width: 0; }
.todo-main strong { overflow-wrap: anywhere; }
.todo-main small { color: var(--muted); }
/* Offene Registrierungen in „Zu tun“: Badge in der letzten Spalte wie bei Tickets. */
@media (min-width: 801px) { .todo-list a.todo-registrierung > .badge { grid-column: 5; justify-self: end; } }
.todo-registrierung .todo-num { color: var(--danger); font-weight: 800; }
.access-card-unbestaetigt { border-style: dashed; }
.access-rolle-fest { display: flex; align-items: center; min-height: 36px; color: var(--muted); }
.access-hinweis { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .86rem; }
.access-hinweis .btn { margin-left: 4px; }
/* Zugang aus der Admin-Mail: hervorgehoben und oben. */
.access-card-ziel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.access-ziel { border: 2px solid var(--brand); }
.access-ziel form { margin: 8px 0; flex-wrap: wrap; align-items: end; }
/* Ticketliste mit Reitern */
.filter-tabs { display: flex; flex-wrap: nowrap; gap: 4px; margin-bottom: 12px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.filter-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px; margin-bottom: -1px; color: var(--muted); font-size: .88rem; font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.filter-tab:hover { color: var(--text); }
.filter-tab.active { color: var(--text); border-bottom-color: var(--brand); }
.filter-tab .count { min-width: 22px; height: 20px; font-size: .72rem; }
.filter-tab.active .count { background: var(--brand-soft); color: var(--brand); }
.filter-tabs-mobile { display: none; margin-bottom: 12px; }
.ticket-table td { vertical-align: middle; }
.ticket-table .cell-sub { font-size: .75rem; }
.status-select { min-width: 170px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: .82rem; font-weight: 600; cursor: pointer; }
.status-select-rueckfrage { border-color: var(--accent); }
.status-select-freigabe { border-color: var(--info); }
.status-select-mensch, .status-select-besprechen { border-color: var(--danger); }

/* Größe und Steckbrief */
.size-badge { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 4px; font-size: .72rem; font-weight: 800; border: 1px solid var(--line); color: var(--muted); background: var(--surface-2); }
.size-L { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.size-S { color: var(--brand); border-color: var(--brand-soft); background: var(--brand-soft); }
.brief-meter { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.brief-meter__bar { width: 42px; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.brief-meter__bar span { display: block; height: 100%; background: var(--brand); }
.brief-meter.is-missing .brief-meter__bar span { background: var(--accent); }
.brief-list { margin: 0; display: grid; }
/* Mehrzeilige Angaben (z. B. „Text:“ mit Zeilen darunter) behalten ihre Zeilenumbrüche. */
.brief-list dd { white-space: pre-line; }
.brief-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 52px; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.brief-row dt { font-weight: 700; font-size: .86rem; }
.brief-row dt small { display: block; color: var(--muted); font-weight: 500; font-size: .7rem; }
.brief-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: .9rem; }
.brief-row.is-missing { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.brief-state { font-size: .72rem; font-weight: 800; }
.brief-state.is-missing { color: var(--accent); }
.brief-vague { color: var(--accent); font-weight: 700; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.brief-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.brief-edit { margin-top: 12px; }
.brief-edit summary { cursor: pointer; font-weight: 700; font-size: .88rem; color: var(--brand); }
.brief-edit form { margin-top: 10px; }
.brief-card .notice { margin-bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* Ticketseite */
.back-link { font-size: .88rem; text-decoration: none; }
.ticket-footer > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.ticket-main, .ticket-side { display: grid; gap: 20px; min-width: 0; }
.ticket-side .timeline { padding: 16px; }
.help-card p { margin-bottom: 10px; }

/* Dialoge */
.app-dialog-wide { width: min(760px, calc(100% - 32px)); }
.json-preview { max-height: 55vh; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); font-size: .78rem; line-height: 1.45; white-space: pre; }

/* Einstellungen */
.settings-mobile-nav { display: none; margin-bottom: 12px; }
.settings-shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 18px; align-items: start; }
.settings-subnav { position: sticky; top: 16px; display: grid; gap: 2px; }
.settings-nav-link { padding: 7px 10px; border-radius: 6px; color: var(--text); font-size: .9rem; text-decoration: none; }
.settings-nav-link:hover { background: var(--surface-2); }
.settings-nav-link.active { color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.settings-content { min-width: 0; }
.settings-form { display: grid; gap: 14px; }
.settings-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.settings-save, .settings-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 12px; border-top: 1px solid var(--line); }
.field-error { min-height: 0; margin: 0; color: var(--danger); font-size: .8rem; }
.field-error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.template-heading h3 { margin-bottom: 2px; }
.template-heading p { margin: 0; font-size: .85rem; }
.template-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.template-group h3 { font-size: .9rem; color: var(--muted); }
.team-list { display: grid; gap: 8px; }
.team-row { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.2fr) 90px auto auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.team-add { display: grid; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 6px; }
.team-add h3 { margin: 0; }
.pflicht-set { grid-column: 1 / -1; display: grid; gap: 6px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.pflicht-set legend { padding: 0 4px; font-weight: 700; font-size: .9rem; }
.pflicht-set p { margin: 0 0 4px; }
.safety-rule { grid-column: 1 / -1; }
.integration-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.integration-list > div { display: grid; gap: 2px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.mail-direction-intern { color: var(--muted); background: var(--surface-3); }
.mail-content blockquote { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--brand); background: var(--surface-2); }
.settings-form input[type="text"], .settings-form input[type="email"], .settings-form input[type="number"], .settings-form input[type="url"], .settings-form select, .settings-form textarea,
.customer-settings-form input, .customer-settings-form select, .customer-settings-form textarea, .brief-edit input, .brief-edit textarea, .composer textarea, .composer input[type="text"] { width: 100%; }

@media (max-width: 940px) {
  .topbar__inner { flex-wrap: wrap; gap: 8px 16px; padding-block: 8px; }
  .topnav { order: 3; width: 100%; }
  .global-search input { width: 170px; }
  .topnav a.active::after { bottom: -4px; }
  .connections-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.due { display: inline-grid; gap: 1px; font-size: .84rem; white-space: nowrap; }
.due small { color: var(--muted); font-size: .72rem; }
.due-over { color: var(--danger); font-weight: 700; }
.due-over small { color: var(--danger); }
.due-soon { color: var(--accent); font-weight: 600; }
.due-none, .due-done { color: var(--muted); }
.due-input { min-height: 32px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.ticket-due { margin-top: 6px; font-size: .8rem; color: var(--muted); display: flex; gap: 6px; align-items: baseline; }
.ticket-due .due { display: inline-flex; gap: 6px; }
.todo-list a > .badge { justify-self: end; }
.form-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ticket-table .status-select + .ticket-seen-state { display: block; margin-top: 4px; }
.customer-page-head { margin-top: 8px; }

.avatar-ki { background: var(--night) !important; color: #5CC8FF; font-size: .6rem; }

.evidence { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .84rem; }
.evidence li { display: grid; gap: 1px; }
.evidence a { color: var(--text); font-weight: 600; text-decoration: none; }
.evidence a:hover { color: var(--brand); text-decoration: underline; }
/* Lösungsweg */
.solution-card { border-left: 4px solid var(--brand); }
.solution { margin: 0; display: grid; gap: 12px; }
.solution div { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; }
.solution dt { font-weight: 700; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.solution dd { margin: 0; }
.solution ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.solution-meta { margin: 12px 0 0; font-size: .82rem; }

/* Wissen */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kb-card { display: grid; gap: 8px; padding: 16px; color: var(--text); text-decoration: none; }
.kb-card:hover { border-color: var(--brand); }
.kb-card strong { font-family: var(--font-head); font-size: 1.02rem; line-height: 1.3; }
.kb-meta { color: var(--brand); font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.kb-excerpt { color: var(--muted); font-size: .86rem; }
.kb-foot { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; }
.kb-article { max-width: 820px; padding: clamp(18px, 4vw, 32px); }
.kb-article h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 6px; }
.kb-article h2 { margin: 22px 0 6px; font-size: 1rem; }
.kb-article p { margin: 0; }
.kb-steps { padding-left: 20px; display: grid; gap: 6px; margin: 0; }
.kb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px !important; }
.kb-tags span { padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: .74rem; }

/* Kunden-Startseite */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: 24px; align-items: end; padding: clamp(20px, 4vw, 34px); margin-bottom: 14px; background: linear-gradient(135deg, var(--surface), var(--brand-soft)); }
.hero h1 { margin-bottom: 10px; }
.hero-actions { margin-top: 18px; }
.hero-search { display: grid; gap: 6px; }
.hero-search input { flex: 1 1 180px; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.start-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.start-columns .section-card + .section-card { margin-top: 0; }
.todo-list-simple a { grid-template-columns: 44px minmax(0, 1fr) auto; }
.how { margin-top: 14px; }
.how-steps { list-style: none; counter-reset: schritt; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.how-steps li { counter-increment: schritt; display: grid; gap: 4px; padding-top: 38px; position: relative; }
.how-steps li::before { content: counter(schritt); position: absolute; top: 0; left: 0; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 800; font-size: .82rem; }
.how-steps span { color: var(--muted); font-size: .86rem; }

/* Kunden-Ticketliste */
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 600; font-size: .86rem; }
.filter-chip:hover { border-color: var(--brand); }
.filter-chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.filter-chip .count { min-width: 20px; height: 20px; font-size: .7rem; }
.filter-chip.active .count { background: rgba(255, 255, 255, .22); color: inherit; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }

.global-search { position: relative; display: flex; align-items: center; }
.global-search svg { position: absolute; left: 10px; width: 16px; height: 16px; color: #93A2B9; pointer-events: none; }
.global-search input { width: 240px; min-height: 36px; padding: 6px 10px 6px 32px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px; background: rgba(255, 255, 255, .06); color: #E8EDF6; font-size: .86rem; }
.global-search input::placeholder { color: #93A2B9; }
.global-search input:focus { background: rgba(255, 255, 255, .1); border-color: #5CC8FF; outline: none; box-shadow: 0 0 0 3px rgba(92, 200, 255, .25); }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

.role-badge { display: inline-flex; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .76rem; font-weight: 700; }
.role-badge-kunde { background: var(--surface-3); color: var(--muted); }
.perm-table td:not(:first-child), .perm-table th:not(:first-child) { text-align: center; width: 110px; }
.perm-yes { color: var(--brand); font-weight: 800; }
.perm-no { color: var(--muted); }
.settings-form h3 { margin: 6px 0 0; }

.message.is-internal .bubble { border: 1px dashed var(--line); background: var(--surface-2); color: var(--muted); }

.prio { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; font-size: .7rem; font-weight: 800; vertical-align: middle; white-space: nowrap; }
.prio-hoch { color: #FFFFFF; background: var(--danger); }
.prio-niedrig { color: var(--muted); background: var(--surface-3); }
.urgent-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.urgent-row input:checked + span strong { color: var(--danger); }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-hint { font-size: .78rem; }
.rating-card { display: grid; gap: 10px; }
.rating-card .eyebrow, .rating-card h2 { margin: 0; }
.rating-result { margin: 0; font-size: 1.05rem; font-weight: 700; }
.rating-card blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--surface-2); }
.rating-schlecht { border-left: 4px solid var(--danger); }
.rating-gut { border-left: 4px solid var(--brand); }
.rating-btn { min-width: 150px; }
.snippet-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }

.scope { display: inline-flex; width: fit-content; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.scope-all { background: var(--brand-soft); color: var(--brand); }
.kb-scope { max-width: 360px; margin: 10px 0 14px; }
.kb-scope select { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.hint-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.hint-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; background: var(--surface-2); }
.hint-add input { flex: 1 1 260px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.hint-evidence li { padding-left: 10px; border-left: 3px solid var(--accent); }

.agent-line { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.agent-line div { display: grid; flex: 1; min-width: 0; }
.agent-line small { font-size: .78rem; }
.ki-log { margin-top: 14px; }
.ki-log ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ki-log li { display: grid; gap: 2px; padding: 8px 10px; border-radius: 8px; border-left: 3px solid var(--brand); background: var(--surface-2); }
.ki-log li.is-error { border-left-color: var(--danger); }
.ki-log li span { color: var(--muted); font-size: .86rem; }
.ki-log li a { color: inherit; text-decoration: none; }
.ki-log li a:hover { text-decoration: underline; }

.art { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 999px; font-size: .7rem; font-weight: 800; vertical-align: middle; white-space: nowrap; }
.art-stoerung { color: var(--danger); background: var(--danger-soft); }
.art-frage { color: var(--info); background: var(--info-soft); }
.art-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; border: 0; }
.art-choices legend { margin-bottom: 8px; }
.art-choice { position: relative; display: grid; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.art-choice input { position: absolute; opacity: 0; pointer-events: none; }
.art-choice span { color: var(--muted); font-size: .84rem; }
.art-choice.active { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.art-choice:focus-within { box-shadow: var(--focus); }
.sichtbarkeit-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sichtbarkeit-choice strong { display: inline-flex; align-items: center; gap: 6px; }
.sichtbarkeit-choice strong svg, .sichtbarkeit-karte h2 svg, .sichtbarkeit-hinweis svg { width: 1em; height: 1em; flex: none; }
.sichtbarkeit-karte h2 { display: flex; align-items: center; gap: 8px; }
.sichtbarkeit-hinweis { display: flex; align-items: center; gap: 8px; }
/* Schloss bei privaten Tickets (js/sichtbarkeit.js) */
.privat-marke { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 4px; color: var(--muted); }
.privat-marke svg { width: 14px; height: 14px; }
.privat-badge { gap: 4px; }
.privat-badge svg { width: 12px; height: 12px; }
.kollegen-rolle { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.system-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.system-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.system-card small { display: block; color: var(--muted); }
.system-dot { width: 10px; height: 10px; border-radius: 50%; background: #1a9e6f; box-shadow: 0 0 0 4px rgba(26, 158, 111, .15); }
.system-card.is-stoerung { border-color: var(--danger); }
.system-card.is-stoerung .system-dot { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.system-card.is-warnung { border-color: var(--accent); }
.system-card.is-warnung .system-dot { background: #D39A2C; box-shadow: 0 0 0 4px var(--accent-soft); }
.system-card.is-aus .system-dot { background: var(--muted); box-shadow: none; }
.uptime-line { display: flex !important; align-items: center; gap: 6px; margin-top: 4px; font-size: .72rem; }
.uptime-bars { display: inline-flex; gap: 1px; align-items: flex-end; height: 14px; }
.uptime-bar { width: 3px; height: 100%; border-radius: 1px; background: #1a9e6f; }
.uptime-bar.uptime-warnung { background: #D39A2C; }
.uptime-bar.uptime-stoerung { background: var(--danger); }
.ampel { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .82rem; white-space: nowrap; }
.ampel__dot { width: 9px; height: 9px; border-radius: 50%; background: #1a9e6f; }
.ampel-warnung .ampel__dot { background: #D39A2C; }
.ampel-stoerung { color: var(--danger); }
.ampel-stoerung .ampel__dot { background: var(--danger); }
.ampel-aus { color: var(--muted); }
.ampel-aus .ampel__dot { background: var(--muted); }
.check-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .8rem; color: var(--muted); }
.check-mini li span { color: var(--text); font-weight: 600; }
.check-mini li::before { content: "●"; margin-right: 5px; color: #1a9e6f; font-size: .6rem; vertical-align: middle; }
.check-mini li.is-warnung::before { color: #D39A2C; }
.check-mini li.is-stoerung::before { color: var(--danger); }
.check-mini li.is-aus { opacity: .55; }
.check-mini li.is-aus::before { color: var(--muted); }
.cell-sub { display: block; }
.nav-count-warn { background: var(--danger); color: #fff; }
.system-add select, .system-add input { min-height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.system-add input { flex: 1 1 200px; }
.confirm-card { display: grid; gap: 10px; border-left: 4px solid var(--brand); }
.confirm-card .eyebrow, .confirm-card h2, .confirm-card p { margin: 0; }

.flat-badge { display: inline-flex; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .78rem; font-weight: 800; }
.no-flat { max-width: 720px; margin: 40px auto; padding: clamp(20px, 4vw, 36px); display: grid; gap: 10px; }
.no-flat h1, .no-flat p { margin: 0; }
.tip { margin: 0 0 14px; }

/* Ticketseite: Kopf, Eigenschaften, nächster Schritt */
.ticket-head { padding: 18px 20px 0; }
.ticket-head__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ticket-head__title { min-width: 0; }
.ticket-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.ticket-kicker .kick + .kick::before { content: "·"; margin-right: 8px; color: var(--muted); }
.ticket-head h1 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.75rem); overflow-wrap: anywhere; }
.ticket-sub { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.ticket-status-box { display: grid; gap: 4px; justify-items: end; flex: none; }
.prop-bar { display: flex; flex-wrap: wrap; gap: 0; margin: 16px -20px 0; border-top: 1px solid var(--line); }
.prop { display: grid; gap: 3px; padding: 10px 20px; border-right: 1px solid var(--line); min-width: 0; }
.prop:last-child { border-right: 0; }
.prop-label { color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.prop-value { display: flex; align-items: center; gap: 6px; font-size: .9rem; min-height: 30px; }
.prop-value .due { display: inline-flex; gap: 6px; align-items: baseline; }
.prop-select, .prop .assignee-select, .prop .due-input { min-height: 30px; padding: 3px 8px; border: 1px solid transparent; border-radius: 7px; background: var(--surface-2); font-size: .88rem; }
.prop-select:hover, .prop .assignee-select:hover, .prop .due-input:hover { border-color: var(--line); }
.next-step { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); border-left: 4px solid var(--info); background: var(--surface); }
.next-step p { margin: 0; color: var(--muted); font-size: .88rem; }
.next-step strong { display: block; font-size: 1rem; }
.next-step .next-step__label { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.next-step .btn { flex: none; }
.next-step-ok { border-left-color: var(--brand); }
.next-step-warn { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 55%); }
.next-step-muted { border-left-color: var(--line); }
.brief-card .section-heading { align-items: center; }
.brief-card .brief-row { grid-template-columns: 170px minmax(0, 1fr); }
.brief-row .brief-state.is-missing { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); }
.brief-more { margin-top: 6px; }
.brief-more summary, .ki-more summary { cursor: pointer; color: var(--muted); font-size: .84rem; font-weight: 600; }
.small { font-size: .82rem; }
.ki-card { display: grid; gap: 10px; }
.ki-card .section-heading { margin-bottom: 0; }
.suggest-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.ki-more { border-top: 1px solid var(--line); padding-top: 8px; }
.ki-more summary { display: flex; align-items: center; gap: 6px; }
.ki-more .count { min-width: 20px; height: 20px; font-size: .7rem; }
.ki-more[open] summary { margin-bottom: 8px; }

.agent-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--text); font-size: .84rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.agent-chip:hover { outline: 1px solid var(--brand); }
.agent-chip small { color: var(--muted); font-weight: 600; }
.agent-chip.is-none { padding: 2px 10px; background: var(--surface-3); color: var(--muted); font-weight: 600; }
.prop-value .assignee + .agent-chip { margin-left: 2px; }

.sla-chip { display: inline-flex; padding: 1px 7px; border-radius: 999px; font-size: .68rem; font-weight: 800; cursor: help; white-space: nowrap; }
.sla-ki { background: var(--brand-soft); color: var(--brand); }
.sla-standard { background: var(--surface-3); color: var(--muted); }
.sla-manuell { background: var(--info-soft); color: var(--info); }
.sla-card { margin-top: 14px; }
.sla-card .stats { margin: 10px 0 14px; }

/* Filter in einer Zeile */
.filter-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow-x: auto; }
.filter-search { position: relative; display: flex; align-items: center; flex: 1 1 240px; min-width: 180px; }
.filter-search svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.filter-search input { width: 100%; min-height: 34px; padding: 6px 10px 6px 32px; border: 0; border-radius: 8px; background: transparent; font-size: .9rem; }
.filter-search input:focus { background: var(--surface-2); outline: none; }
.filter-select { flex: none; }
.filter-select select { max-width: 150px; min-height: 32px; padding: 4px 24px 4px 12px; text-overflow: ellipsis; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: .84rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.filter-select select:hover { color: var(--text); border-color: var(--muted); }
.filter-select.is-active select { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.filter-reset { flex: none; padding: 6px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: .84rem; font-weight: 600; text-decoration: underline; }
.filter-reset:hover { color: var(--text); }

.ki-status { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: .88rem; }
.ki-status__dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; animation: ki-puls 1.6s ease-in-out infinite; }
.ki-status.is-paused { background: var(--accent-soft); color: var(--accent); }
.ki-status.is-paused .ki-status__dot { animation: none; }
@keyframes ki-puls { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .ki-status__dot { animation: none; } }
.pause-row { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }

.parse-status { font-size: .8rem; font-weight: 700; }
.parse-status.is-open { color: var(--accent); }
.parse-status.is-ready { color: var(--brand); }
.parse-known { grid-column: 1 / -1; margin: 0; font-size: .88rem; white-space: pre-line; }
.parse-questions { grid-column: 1 / -1; display: grid; gap: 10px; padding: 12px; border-radius: 9px; background: var(--accent-soft); }
.parse-questions .field-label { margin: 0; }
.parse-questions input[type="text"] { width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.parse-questions input[type="file"] { font-size: .8rem; }
.modal-foot [data-analyse-gesamt] { margin-right: auto; align-self: center; font-size: .86rem; }

/* Monitoring und System-Log */
.monitoring-card { overflow: hidden; }
.monitoring-table { min-width: 760px; }
.monitoring-url { overflow-wrap: anywhere; }
.monitoring-fehler { color: var(--danger); }
.monitoring-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; white-space: nowrap; }
.monitoring-status > span { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent); }
.monitoring-status.is-ok { color: var(--brand); }
.monitoring-status.is-error { color: var(--danger); }
.monitoring-status.is-unknown { color: var(--muted); }
.monitoring-ticket { font-weight: 700; white-space: nowrap; }
.monitor-table .cell-actions { text-align: right; white-space: nowrap; }
.monitor-table tr.is-open td { border-bottom-color: transparent; }
.monitor-edit td { background: var(--surface-2); }
.monitor-form { display: grid; gap: 12px; padding: 6px 2px; }
.monitor-checks { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.monitor-checks legend { margin-bottom: 4px; }
.monitor-new { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.monitor-new__submit { align-self: end; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 4px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.chip.active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.log-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.log-filter select, .log-filter input[type="search"] { min-width: 200px; flex: 1 1 200px; }
.sl-liste, .system-log-klein ul { list-style: none; margin: 0; padding: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); max-height: 520px; overflow: auto; }
.system-log-klein ul { max-height: 220px; margin-top: 6px; }
.sl-liste li, .system-log-klein li { display: flex; gap: 10px; align-items: baseline; padding: 5px 10px; border-top: 1px solid var(--line); }
.sl-liste li:first-child, .system-log-klein li:first-child { border-top: 0; }
.sl-zeit { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sl-level { min-width: 64px; font-weight: 700; color: var(--muted); }
.sl-error .sl-level { color: var(--danger); }
.sl-warn .sl-level { color: #D39A2C; }
.sl-ok .sl-level { color: #1a9e6f; }
.sl-error { background: color-mix(in srgb, var(--danger-soft) 55%, transparent); }
.sl-system { font-weight: 600; white-space: nowrap; }
.sl-quelle { color: var(--info); white-space: nowrap; min-width: 70px; }
.sl-ki .sl-quelle { color: var(--brand); font-weight: 700; }
.sl-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Feedback und Agenda */
.danger-zone h2 { color: var(--danger); }
.agenda-h { margin: 18px 0 6px; font-size: .95rem; }
.agenda-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.feedback-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 4px; }
.stimmung { flex: none; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.stimmung-mittel { background: var(--accent-soft); color: var(--accent); }
.stimmung-schlecht { background: var(--danger-soft); color: var(--danger); }
.feedback-hint { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.feedback-hint h2 { margin: 0 0 4px; }

/* Nachgestellte Screenshots */
.shot { margin: 0; min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; color: #222; font-size: .72rem; display: flex; flex-direction: column; }
.shot-handy { max-width: 170px; justify-self: center; width: 100%; border-radius: 14px; }
.shot-bar { display: flex; align-items: center; gap: 6px; padding: 5px 8px; background: #EEF0F3; border-bottom: 1px solid #DDE1E6; }
.shot-dots { display: inline-flex; gap: 3px; }
.shot-dots i { width: 6px; height: 6px; border-radius: 50%; background: #C9CED6; }
.shot-handy .shot-dots { display: none; }
.shot-url { flex: 1; min-width: 0; padding: 1px 8px; border-radius: 999px; background: #fff; color: #5B6470; font-size: .64rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-page { padding: 6px 8px; }
.shot-nav { display: flex; align-items: center; gap: 6px; }
.shot-nav b { font-size: .66rem; margin-right: auto; color: #1d2a3a; }
.shot-nav i { width: 22px; height: 4px; border-radius: 2px; background: #D5DAE0; }
.shot-nav .shot-burger { width: 12px; height: 8px; background: repeating-linear-gradient(#9AA3AE 0 2px, transparent 2px 3px); }
.shot-hero { height: 26px; margin: 6px 0; border-radius: 4px; background: linear-gradient(90deg, #D7E6F2, #E9EEF3); }
.shot-lines { display: grid; gap: 4px; }
.shot-lines i { height: 4px; border-radius: 2px; background: #E4E7EB; }
.shot-lines i:nth-child(2n) { width: 80%; }
.shot-mark { margin: 2px 8px; padding: 6px 8px; border-radius: 5px; line-height: 1.35; overflow-wrap: anywhere; }
.shot-mark small { display: block; font-size: .6rem; color: #6A7380; margin-bottom: 2px; }
.shot-vorher { background: #FDECEA; outline: 2px solid #E08A7E; }
.shot-nachher { background: #E6F5EE; outline: 2px solid #3FB283; }
.shot figcaption { margin-top: auto; padding: 5px 8px; border-top: 1px solid #E4E7EB; background: #F7F8FA; color: #5B6470; font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.shots-card .preview-grid { margin-top: 8px; }

@media (max-width: 640px) {
  .sl-liste li { flex-wrap: wrap; gap: 2px 8px; }
  .sl-text { flex-basis: 100%; }
}

@media (max-width: 1000px) {
  .ticket-columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 800px) {
  .settings-mobile-nav, .filter-tabs-mobile { display: grid; }
  .settings-shell { grid-template-columns: minmax(0, 1fr); }
  .settings-subnav, .filter-tabs { display: none; }
  .todo-list a { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .todo-list a > .badge { grid-column: 2; justify-self: start; }
  .team-row { grid-template-columns: 1fr 1fr; }
  .table-wrap { overflow: visible; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }
  .data-table tbody { display: grid; gap: 9px; }
  .data-table tr { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
  .data-table td { display: grid; grid-template-columns: minmax(125px, .8fr) minmax(0, 1.2fr); gap: 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 700; }
  .data-table tbody tr:last-child td:not(:last-child), .data-table td:not(:last-child) { border-bottom: 1px solid var(--line); }
  .data-table td:last-child { border-bottom: 0; }
}

@media (max-width: 680px) {
  .topbar__inner, .page { width: min(100% - 24px, var(--max)); }
  .brand-text span { display: none; }
  .user-switch select { max-width: 150px; }
  .topbar__tools { flex-wrap: wrap; justify-content: flex-end; }
  .global-search { order: 5; width: 100%; }
  .global-search input { width: 100%; }
  .page { padding-top: 25px; }
  .page-head { align-items: stretch; flex-direction: column; }
  .preview-grid, .before-after { grid-template-columns: 1fr; }
  .message { max-width: 92%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mail-layout { grid-template-columns: 1fr; }
  .mail-list { max-height: 360px; }
  .mail-head__title { display: grid; }
  .mail-head__title .btn { justify-self: start; }
  .settings-form-grid, .template-columns, .integration-list { grid-template-columns: 1fr; }
  .status-select { width: 100%; }
  .team-row { grid-template-columns: 1fr; }
  .todo-list a { grid-template-columns: 40px minmax(0, 1fr); }
  .todo-list a > .badge, .todo-list a > .due { grid-column: 2; justify-self: start; }
  .form-pair { grid-template-columns: 1fr; }
  .filter-bar { flex-wrap: wrap; }
  .filter-search { flex-basis: 100%; }
  .ticket-head__top { flex-direction: column; }
  .ticket-status-box { justify-items: start; }
  .prop { flex: 1 1 50%; border-bottom: 1px solid var(--line); }
  .next-step { flex-direction: column; align-items: flex-start; }
  .brief-card .brief-row { grid-template-columns: 1fr; }
  .art-choices { grid-template-columns: 1fr; }
  .snippet-row { grid-template-columns: 1fr; }
  .hero, .start-columns { grid-template-columns: 1fr; }
  .how-steps { grid-template-columns: 1fr 1fr; }
  .solution div { grid-template-columns: 1fr; gap: 2px; }
  .settings-columns, .demo-settings { grid-template-columns: 1fr; }
  .customer-tabs { flex-wrap: wrap; }
  .customer-tabs a { flex: 1 1 auto; text-align: center; }
  .mini-web-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; place-items: stretch; }
  .modal { width: 100%; min-height: 100%; max-height: 100vh; border-radius: 0; }
  .modal-head { padding: 15px; }
  .modal-body { padding: 15px; }
  .modal-foot { padding: 12px 15px; }
}

@media (max-width: 400px) {
  .stats { grid-template-columns: 1fr; }
  .approval-actions .btn, .page-head > .btn { width: 100%; }
  .parse-item { grid-template-columns: 1fr; }
  .parse-item .field { grid-column: auto; }
  .app-dialog { width: min(100% - 16px, 520px); }
  .app-dialog__body { padding: 18px; }
  .app-dialog__actions { padding: 12px; }
  .app-dialog__actions .btn { flex: 1 1 130px; }
  .connection-panel { padding: 12px; }
  .connection-panel__head, .ive-ticket__head { display: grid; }
  .connection-status { white-space: normal; }
  .ive-ticket__head small { text-align: left; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141B28;
    --surface: #1A202B;
    --surface-2: #1D2634;
    --surface-3: #28313E;
    --text: #E8EDF6;
    --muted: #93A2B9;
    --line: #343D49;
    --brand: #A8BDFF;
    --brand-strong: #CAD7FF;
    --brand-soft: #233253;
    --on-brand: #141B28;
    --accent: #E3CFA8;
    --accent-soft: #3A2E1A;
    --danger: #FF9A8B;
    --danger-soft: #3A1F22;
    --info: #A9BDD8;
    --info-soft: #1B2A45;
    --night: #070C17;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -18px rgba(0, 0, 0, .6);
    --focus: 0 0 0 3px rgba(92, 200, 255, .3);
  }
  .btn-danger { background: #B4432F; }
  .btn-danger:hover { background: #943726; }
  .avatar:not(.avatar-empty):not(.avatar-ki) { background: #1C6E84; }
  .avatar-ki { background: #22314F !important; }
  .filter-chip.active .count { background: rgba(11, 18, 32, .2); }
  .brief-state.is-missing, .brief-vague, .due-soon { color: #E3CFA8; }
  .size-L { border-color: #6E2B2B; }
  .size-S { border-color: #1F5C7A; }
  .marker-stage { background: #1A2440; }
  .mini-site { color: #252a27; }
  .user-switch select option { color: #E8EDF6; background: #121B2E; }
}

/* Eigene Dropdowns (js/dropdown.js) */
select.dd-native { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; overflow: hidden; clip: rect(0 0 0 0); border: 0 !important; opacity: 0; pointer-events: none; }
.dd-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; max-width: 100%; min-height: 36px; padding: 6px 10px 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s, color .15s, box-shadow .15s; }
.dd-button:hover { border-color: var(--muted); }
.dd-button:focus-visible { outline: none; box-shadow: var(--focus); }
.dd-button.is-open { border-color: var(--brand); box-shadow: var(--focus); }
.dd-button:disabled { opacity: .55; cursor: default; }
.dd-button.dd-block { display: flex; width: 100%; padding: 9px 10px 9px 12px; border-radius: 6px; }
.dd-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-chevron { flex: none; width: 14px; height: 14px; color: var(--muted); transition: transform .18s ease; }
.dd-button.is-open .dd-chevron { transform: rotate(180deg); color: var(--brand); }

/* Pillen in der Filterleiste */
.filter-select .dd-button { max-width: 170px; min-height: 32px; padding: 4px 10px 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: .84rem; font-weight: 600; color: var(--muted); }
.filter-select .dd-button:hover { color: var(--text); }
.filter-select.is-active .dd-button { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.filter-select.is-active .dd-chevron { color: var(--brand); }
/* Ticket-Eigenschaften und Zuständig */
.dd-button.prop-select, .prop .dd-button.assignee-select { min-height: 30px; padding: 3px 8px; border-color: transparent; border-radius: 7px; background: var(--surface-2); font-size: .88rem; }
.dd-button.prop-select:hover, .prop .dd-button.assignee-select:hover { border-color: var(--line); }
.dd-button.assignee-select { min-height: 32px; padding: 4px 8px; font-size: .82rem; }
.dd-button.status-select { min-height: 36px; font-size: .82rem; font-weight: 600; }
/* Nutzerwechsel in der dunklen Kopfzeile */
.user-switch .dd-button { max-width: 230px; min-height: 30px; padding: 4px 6px; border: 0; background: transparent; color: #E8EDF6; font-size: .86rem; font-weight: 600; }
.user-switch .dd-button .dd-chevron { color: #AAB6C9; }
.user-switch .dd-button.is-open { box-shadow: none; }

.dd-menu { position: fixed; z-index: 1000; min-width: 160px; max-width: min(360px, calc(100vw - 16px)); overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 14px 34px -12px rgba(15, 20, 30, .38), 0 2px 6px rgba(15, 20, 30, .08); opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top left; transition: opacity .13s ease, transform .13s ease; }
.dd-menu.is-up { transform-origin: bottom left; transform: translateY(4px) scale(.98); }
.dd-menu.is-visible { opacity: 1; transform: none; }
.dd-option { display: flex; align-items: center; gap: 8px; padding: 7px 10px 7px 8px; border-radius: 8px; font-size: .88rem; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-option span { overflow: hidden; text-overflow: ellipsis; }
.dd-option.is-active { background: var(--surface-3); }
.dd-option.is-selected { color: var(--brand); font-weight: 700; }
.dd-check { flex: none; width: 14px; height: 14px; opacity: 0; }
.dd-option.is-selected .dd-check { opacity: 1; }
.dd-option.is-disabled { color: var(--muted); cursor: default; opacity: .6; }
@media (prefers-reduced-motion: reduce) { .dd-menu, .dd-chevron { transition: none; } }

/* Meine Tickets: Ansicht umschalten (Karten, Liste, Board) */
.view-toggle { display: inline-flex; gap: 2px; margin: 0 0 12px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.view-toggle button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: .84rem; font-weight: 600; cursor: pointer; }
.view-toggle button svg { width: 16px; height: 16px; }
.view-toggle button:hover { color: var(--text); }
.view-toggle button.active { background: var(--brand-soft); color: var(--brand); }
.view-toggle button:focus-visible { outline: none; box-shadow: var(--focus); }
.kunden-liste td a { text-decoration: none; }
.kunden-liste .badge { margin-left: 4px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.kanban-col { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); max-height: calc(100vh - 290px); overflow-y: auto; }
.kanban-head { display: flex; align-items: center; justify-content: space-between; }
.kanban-head h2 { margin: 0; font-size: .95rem; }
.kanban-col.is-attention .kanban-head h2 { color: var(--accent); }
.kanban-card { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.kanban-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.kanban-card small { color: var(--muted); }
.kanban-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr; } .kanban-col { max-height: none; } .view-toggle button span { display: none; } }
@media (max-width: 900px) {
  .access-card, .access-card-approved { grid-template-columns: 1fr; }
  .access-edit-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .access-action-form, .access-edit-form { display: grid; grid-template-columns: 1fr; width: 100%; }
  .access-action-form .btn, .access-edit-buttons .btn { width: 100%; }
  .access-edit-buttons { display: grid; }
}
.fehler-par { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 4px; }

/* Zugänge: Kunde einladen */
.access-invite-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.access-invite-form .btn { justify-self: start; }

/* Kunden-Einstellungen: KI-Agent (Schlüssel je Firma) */
.ki-agent { display: grid; gap: 14px; }
.ki-agent-stand { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 0; }
.ki-agent-stand dt { color: var(--muted); font-size: .82rem; }
.ki-agent-stand dd { margin: 2px 0 0; }
.ki-agent-klartext { display: grid; gap: 10px; }
.ki-agent-klartext p { margin: 0; }
.ki-agent-wert { flex: 1 1 320px; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Anhänge im Ticket (echte Dateien, js/anhaenge.js) */
.anhang-karte h2 { margin-top: 0; }
.anhang-liste { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.anhang { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.anhang-ohne-datei { opacity: .75; }
.anhang-vorschau { width: 56px; height: 56px; flex: 0 0 56px; object-fit: cover; border-radius: 6px; background: var(--surface-3); }
.anhang-symbol { width: 56px; flex: 0 0 56px; text-align: center; font-size: 1.4rem; }
.anhang-text { display: grid; gap: 2px; min-width: 0; }
.anhang-text > * { overflow-wrap: anywhere; }
.btn-link { padding: 0; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 700; text-align: left; cursor: pointer; text-decoration: underline; }
.btn-link:hover, .btn-link:focus-visible { color: var(--text); }
.anhang-hochladen { display: grid; gap: 6px; }
.anhang-hochladen input[type="file"] { max-width: 100%; }

/* Änderungsprotokoll (nur Admins, js/protokoll.js) */
.protokoll-karte summary { cursor: pointer; list-style: revert; }
.protokoll-karte summary h2 { display: inline; margin: 0; font-size: 1rem; }
.protokoll-liste { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: .86rem; }
.protokoll-liste li { display: grid; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }

/* Konto löschen (Zugänge, js/kontoloeschen.js) */
.konto-loeschen { display: grid; gap: 10px; width: 100%; padding: 12px; border: 1px solid var(--danger); border-radius: var(--radius-sm); background: var(--surface); }
.konto-loeschen p { margin: 0; overflow-wrap: anywhere; }

/* Datenexport (Kunden-Einstellungen, js/datenexport.js) */
.export-karte { margin-top: 14px; }
.export-karte h2 { margin-top: 0; }

/* Frage der KI (Rückfrage), js/rueckfrage.js: deutlich statt nur im Hinweisbanner */
.ki-frage { padding: 18px; border: 2px solid var(--accent); border-left-width: 6px; background: linear-gradient(180deg, var(--accent-soft), var(--surface) 140px); min-width: 0; }
.ki-frage__kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ki-frage__kopf > div { min-width: 0; }
.ki-frage__icon { position: relative; flex: 0 0 auto; width: 40px; height: 34px; border-radius: 12px; background: var(--accent); }
.ki-frage__icon::before { content: "?"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--surface); font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; line-height: 1; }
.ki-frage__icon::after { content: ""; position: absolute; left: 8px; bottom: -7px; border-width: 8px 8px 0 0; border-style: solid; border-color: var(--accent) transparent transparent transparent; }
.ki-frage__label { margin: 0 0 2px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.ki-frage h2 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.ki-frage__text { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); }
.ki-frage__einleitung { margin: 0; color: var(--muted); }
.ki-frage__frage { margin: 0; font-size: 1.2rem; font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.ki-frage__liste { margin: 0; padding-left: 1.6em; display: grid; gap: 8px; font-size: 1.15rem; font-weight: 600; line-height: 1.4; }
.ki-frage__liste li { overflow-wrap: anywhere; }
.ki-frage__liste li::marker { color: var(--accent); font-weight: 800; }
.ki-frage__antwort .composer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--accent); }
.ki-frage__antwort .field label, .ki-frage__antwort .field-label { font-weight: 700; color: var(--text); }
.ki-frage.is-admin { border-width: 1px; border-left-width: 6px; }
.ki-frage-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--accent); color: var(--surface); font-size: .74rem; font-weight: 800; white-space: nowrap; vertical-align: middle; }
.ki-frage-badge__icon::before { content: "?"; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); color: var(--accent); font-size: .68rem; line-height: 1; }
.ticket-meta .ki-frage-badge { margin-left: auto; }
.ticket-card.has-ki-frage { border-color: var(--accent); border-left: 4px solid var(--accent); }
.kanban-meta .ki-frage-badge { margin-left: 4px; }
.kunden-liste td .ki-frage-badge { margin-top: 4px; }
.ki-frage-start { margin: 14px 0; }
.ki-frage-start__liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ki-frage-start__liste a { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
.ki-frage-start__liste a:hover, .ki-frage-start__liste a:focus-visible { border-color: var(--accent); }
.ki-frage-start__liste strong, .ki-frage-start__liste small { overflow-wrap: anywhere; }
.ki-frage-start__liste small { color: var(--muted); }
.ki-frage-start__los { color: var(--accent); font-weight: 700; font-size: .86rem; }
@media (max-width: 480px) {
  .ki-frage { padding: 14px 12px; border-left-width: 4px; }
  .ki-frage__text { padding: 12px; }
  .ki-frage__frage { font-size: 1.08rem; }
  .ki-frage__liste { font-size: 1.04rem; padding-left: 1.4em; }
  .ki-frage__icon { width: 34px; height: 30px; }
}

/* Genaue Angaben in getrennten Kästchen (js/angaben.js): Anlege-Dialog und Rückfrage-Formular. */
.angaben { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.angaben legend { padding: 0; margin-bottom: 4px; font-weight: 760; font-size: .9rem; }
.angaben .field-help { margin: 0; }
.angaben-reihe { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.angaben-feld { display: grid; gap: 5px; flex: 1 1 160px; min-width: 0; }
.angaben-feld label { font-weight: 650; font-size: .85rem; }
.angaben textarea { min-height: 70px; }
.angaben input[type="text"], .angaben input[type="url"], .angaben input[type="date"], .angaben input[type="time"], .angaben textarea { width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.angaben-einheit { display: flex; align-items: center; gap: 6px; }
.angaben-einheit > span { font-weight: 700; color: var(--muted); }
.angaben-check { align-items: center; min-height: 40px; }
.angaben-check input { margin-top: 0; width: 20px; height: 20px; }
.angaben-zeiten { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) minmax(0, 1fr) 2.4em; gap: 6px 8px; align-items: center; }
.angaben-zeiten__kopf { font-size: .78rem; font-weight: 700; color: var(--muted); }
.angaben-zeiten__tag { font-weight: 700; }
.angaben-zeiten input[type="checkbox"] { width: 22px; height: 22px; justify-self: center; accent-color: var(--brand); }
.angaben .btn-sm { justify-self: start; }
@media (max-width: 400px) {
  .angaben-zeiten { gap: 6px 4px; grid-template-columns: 1.9em minmax(0, 1fr) minmax(0, 1fr) 2em; }
  .angaben-zeiten input[type="time"] { padding: 4px 4px; }
}
