:root {
  --bg: #1f1f1f;
  --sidebar-bg: #181818;
  --surface: #202020;
  --surface-raised: #262626;
  --surface-soft: rgba(255, 255, 255, 0.045);
  --fg: #cccccc;
  --fg-strong: #f2f2f2;
  --dim: #9ba3b0;
  --border: #333333;
  --border-strong: #414141;
  --accent: #0078d4;
  --accent-hover: #1689dd;
  --accent-soft: rgba(0, 120, 212, 0.16);
  --row-hover: #2b2b2b;
  --success: #2ea043;
  --danger: #f85149;
  --warning: #d29922;
  --purple: #a371f7;
  --card: rgba(204, 204, 204, 0.04);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --content-max: 1120px;
  --session-max: 1320px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-width: 280px;
  min-height: 100%;
  background: var(--sidebar-bg);
}

body {
  color: var(--fg);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body.sheet-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button,
.pressable {
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 84%, white);
  outline-offset: 2px;
}

.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;
}

.lucide-icon {
  display: block;
  flex: none;
  pointer-events: none;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  isolation: isolate;
}

.page-layer {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  min-width: 0;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  padding-top: env(safe-area-inset-top);
  background: rgba(24, 24, 24, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: saturate(145%) blur(18px);
  -webkit-backdrop-filter: saturate(145%) blur(18px);
}

.topbar-shell {
  width: min(100%, var(--session-max));
  min-height: 56px;
  margin: 0 auto;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--fg-strong);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.topbar-title-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  line-height: 1.25;
}

.topbar-title-stack > span:first-child {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-subtitle {
  max-width: 100%;
  overflow: hidden;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.035);
}

.conn-dot.on {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(46, 160, 67, 0.12);
}

.conn-dot.off {
  background: var(--dim);
}

.iconbtn {
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: transparent;
  color: var(--dim);
  transition: color 150ms ease, background 150ms ease, transform 100ms ease;
}

.iconbtn:hover {
  color: var(--fg-strong);
  background: var(--surface-soft);
}

.iconbtn:active,
.btn:active:not(:disabled),
.session-row:active,
.attention-chip:active,
.quick-key:active {
  transform: scale(0.98);
}

.backbtn {
  color: var(--fg);
}

.status-pill-lg {
  min-height: 24px;
  max-width: 116px;
  padding: 3px 9px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Offline + Attention */
.offline-note {
  padding: 8px max(14px, env(safe-area-inset-left));
  background: rgba(210, 153, 34, 0.13);
  color: #e2b449;
  text-align: center;
  font-size: 12.5px;
  border-bottom: 1px solid rgba(210, 153, 34, 0.2);
}

.attention-strip {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 12px 12px 2px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-padding-inline: 12px;
  scrollbar-width: none;
}

.attention-strip::-webkit-scrollbar,
#quick::-webkit-scrollbar {
  display: none;
}

.attention-chip {
  min-height: 38px;
  max-width: min(78vw, 340px);
  flex: none;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 5px 18px rgba(0, 0, 0, 0.18);
  font-size: 12.5px;
  font-weight: 700;
}

.attention-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* List shell, device and project cards */
.list-main {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 10px 10px calc(28px + env(safe-area-inset-bottom));
}

.device-block + .device-block {
  margin-top: 18px;
}

.device-head {
  min-height: 32px;
  margin: 4px 6px 7px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.device-head .device-icon {
  color: #aeb5c0;
}

.device-head .device-state {
  overflow: hidden;
  font-weight: 450;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.project-card {
  min-width: 0;
  padding: 5px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.1);
}

.project-head {
  min-height: 38px;
  padding: 6px 8px 5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--fg-strong);
  font-size: 13px;
  font-weight: 650;
}

.project-head .project-icon {
  color: var(--dim);
}

.project-head .project-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-head .count {
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 450;
  white-space: nowrap;
}

.project-head .count-pill {
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--warning);
  color: #000;
  font-size: 10.5px;
  font-weight: 800;
}

.rows {
  margin-left: 10px;
  padding-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border);
}

.session-row {
  width: 100%;
  min-height: 48px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--status-tint, transparent);
  color: inherit;
  text-align: left;
  transition: background 130ms ease, transform 100ms ease;
}

.session-row:not(:disabled):hover {
  background: color-mix(in srgb, var(--status-tint, transparent) 72%, var(--row-hover));
}

.session-row.static-row {
  color: var(--dim);
  cursor: default;
}

.session-row .title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--fg);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-row .title.reply {
  color: var(--success);
  font-weight: 700;
}

.session-row .row-chevron {
  color: #737b88;
}

.history-row {
  opacity: 0.76;
}

.pill {
  min-height: 20px;
  max-width: 148px;
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtime {
  flex: none;
  color: var(--dim);
  font-size: 10.5px;
  white-space: nowrap;
}

.sicon {
  width: 20px;
  height: 20px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sicon .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.sicon .pulse {
  animation: pulse 1.6s ease-in-out infinite;
}

.sicon .spinner,
.spin {
  animation: spin 0.9s linear infinite;
}

.agent-icon {
  width: 17px;
  height: 17px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agent-icon::before {
  width: 12px;
  height: 12px;
  content: "";
  background: var(--agent-color);
  -webkit-mask: var(--agent-mask) center / contain no-repeat;
  mask: var(--agent-mask) center / contain no-repeat;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.48; } 50% { opacity: 1; } }

.history-toggle {
  width: calc(100% - 14px);
  min-height: 38px;
  margin: 4px 7px 0;
  padding: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 7px;
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  text-align: left;
}

.history-toggle:hover {
  background: var(--surface-soft);
}

.history-toggle .chev {
  transition: transform 160ms ease;
}

.history-toggle .chev.open {
  transform: rotate(90deg);
}

/* Push promo and empty/loading states */
.push-card {
  margin: 2px 2px 14px;
  padding: 13px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0, 120, 212, 0.3);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0, 120, 212, 0.17), rgba(0, 120, 212, 0.07));
}

.push-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent-soft);
  color: #65b9f3;
}

.push-card-copy {
  min-width: 0;
}

.push-card-copy strong {
  display: block;
  color: var(--fg-strong);
  font-size: 13px;
}

.push-card-copy span {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 11.5px;
}

.push-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.empty-card {
  min-height: 180px;
  margin: 10px 2px;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 0%, rgba(0, 120, 212, 0.09), transparent 55%), var(--card);
  text-align: center;
}

.empty-visual {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--dim);
}

.empty-card h2,
.empty-card h3 {
  margin: 0;
  color: var(--fg-strong);
  font-size: 17px;
  letter-spacing: -0.015em;
}

.hint {
  color: var(--dim);
  font-size: 12.5px;
}

.skeleton-stack {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.skeleton-card {
  height: 118px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #292929 25%, #363636 45%, #292929 65%);
  background-size: 260% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

.skeleton-line.short { width: 42%; }
.skeleton-line.medium { width: 68%; }
.skeleton-line.row { height: 38px; width: 100%; border-radius: 8px; }

@keyframes shimmer { to { background-position: -160% 0; } }

.steps {
  width: min(100%, 360px);
  margin: 2px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  font-size: 13.5px;
}

.step .step-icon,
.step .n {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: #6bbcf2;
  font-size: 12px;
  font-weight: 800;
}

/* Buttons */
.btn {
  min-height: 44px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-raised);
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  transition: background 140ms ease, border-color 140ms ease, transform 100ms ease, opacity 140ms ease;
}

.btn:hover:not(:disabled) {
  background: #303030;
  border-color: var(--border-strong);
}

.btn.primary {
  border-color: #1689dd;
  background: linear-gradient(180deg, #1689dd, var(--accent));
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 120, 212, 0.21);
}

.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #2698e9, #087fda);
}

.btn.compact {
  min-height: 38px;
  padding: 7px 11px;
  font-size: 12px;
}

/* Bottom sheet */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in 180ms ease-out both;
}

.sheet {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  z-index: 41;
  width: min(100%, 520px);
  padding: 8px 9px calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: rgba(31, 31, 31, 0.96);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: sheet-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sheet .grabber {
  width: 38px;
  height: 4px;
  margin: 2px auto 9px;
  border-radius: 999px;
  background: #505050;
}

.sheet-item {
  width: 100%;
  min-height: 58px;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 11px;
  background: transparent;
  color: var(--fg);
  text-align: left;
}

.sheet-item:hover,
.sheet-item:active {
  background: var(--row-hover);
}

.sheet-item-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--dim);
}

.sheet-item-label {
  display: block;
  color: var(--fg-strong);
  font-size: 14px;
  font-weight: 650;
}

.sheet-item-note {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--dim);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-item.danger .sheet-item-icon,
.sheet-item.danger .sheet-item-label {
  color: var(--danger);
}

.sheet-separator {
  height: 1px;
  margin: 5px 10px;
  background: var(--border);
}

.sheet-heading {
  min-height: 54px;
  padding: 6px 10px 10px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--fg-strong);
}

.sheet-heading-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--accent);
}

.sheet-heading strong,
.sheet-heading small {
  display: block;
}

.sheet-heading strong {
  font-size: 15px;
}

.sheet-heading small {
  margin-top: 2px;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 450;
}

.create-agent-item {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.create-agent-item:disabled {
  opacity: 0.7;
}

.agent-create-icon .agent-icon {
  width: 18px;
  height: 18px;
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, 22px); } }

/* Login */
.auth-main {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(28px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, rgba(0, 120, 212, 0.18), transparent 34%),
    radial-gradient(circle at 82% 78%, rgba(46, 160, 67, 0.08), transparent 30%),
    var(--sidebar-bg);
}

.auth-main::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
}

form.login {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: rgba(31, 31, 31, 0.82);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.brand {
  margin-bottom: 5px;
  text-align: center;
}

.brand .logo {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  display: block;
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0, 37, 68, 0.42);
}

.brand h1 {
  margin: 13px 0 3px;
  color: var(--fg-strong);
  font-size: 22px;
  letter-spacing: -0.025em;
}

.brand p {
  margin: 0;
}

.field {
  position: relative;
}

.field > .lucide-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  color: var(--dim);
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 11px 42px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(16, 16, 16, 0.65);
  color: var(--fg-strong);
  font-size: 16px;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field input::placeholder {
  color: #777f8a;
}

.field input:focus {
  border-color: var(--accent);
  background: #171717;
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
}

.notice {
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid rgba(0, 120, 212, 0.35);
  border-radius: 9px;
  background: var(--accent-soft);
  color: #b9ddf7;
  font-size: 13px;
}

.error {
  min-height: 1.3em;
  color: #ff7770;
  font-size: 12.5px;
}

/* Pairing */
.pair-main {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 18px 12px calc(32px + env(safe-area-inset-bottom));
}

.paircode {
  min-width: min(100%, 310px);
  min-height: 64px;
  padding: 10px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(0, 120, 212, 0.42);
  border-radius: 14px;
  background: rgba(0, 120, 212, 0.1);
  color: #65b9f3;
  font: 750 clamp(24px, 9vw, 34px)/1 ui-monospace, Menlo, monospace;
  letter-spacing: 0.14em;
}

code {
  padding: 2px 6px;
  border: 1px solid #292929;
  border-radius: 6px;
  background: #101010;
  color: #d7d7d7;
  font: 12px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
}

/* Session view */
.session-main {
  width: min(100%, var(--session-max));
  margin: 0 auto;
  padding: 0 8px 10px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#banner {
  width: min(100%, var(--session-max));
  margin: 0 auto;
  /* Sicherheitsnetz. `#banner` ist `flex: none` zwischen fixer Kopfzeile und
     dem scrollenden `main` — ohne Grenze wuchs es unbegrenzt, drueckte den Chat
     zusammen und konnte nie scrollen. Das war der Grund, warum ein Plan mit 211
     Zeilen unlesbar war
     (docs/22-bugfixes/2026-08-24-plan-in-der-freigabe-ist-nicht-lesbar/).
     Der Inhalt lebt jetzt im Chat und im Leseblatt; diese Grenze sorgt dafuer,
     dass das Banner auch bei kuenftigen Inhalten nie wieder den Platz frisst. */
  max-height: 28vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Das schlanke Banner: eine Zeile, die sagt WAS ansteht und wohin man kommt. */
.banner-slim .banner-line {
  display: flex; align-items: baseline; gap: 8px; min-width: 0;
}
.banner-slim .banner-what {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; color: var(--dim);
}
.banner-slim .banner-title { flex: none; }

.banner {
  margin: 10px 10px 0;
  padding: 12px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--banner-color, var(--border));
  border-radius: 12px;
  background: var(--banner-bg, var(--card));
  font-size: 13.5px;
}

.banner-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--banner-color, var(--dim)) 16%, transparent);
  color: var(--banner-color, var(--dim));
}

.banner-copy {
  min-width: 0;
}

.banner-title {
  color: var(--fg-strong);
  font-weight: 700;
}

.banner-detail {
  margin-top: 3px;
  color: var(--dim);
}

.banner-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.banner-actions.single {
  grid-template-columns: minmax(0, 1fr);
}

.banner-actions .btn {
  min-height: 48px;
}

.btn.allow {
  border-color: #42ad58;
  background: var(--success);
  color: #fff;
}

.btn.deny {
  border-color: #ff6861;
  background: var(--danger);
  color: #fff;
}

#termwrap,
#readview {
  margin-top: 10px;
  overflow: auto;
  border: 1px solid #343434;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
  -webkit-overflow-scrolling: touch;
}

#termwrap {
  min-height: 240px;
}

#readview {
  display: none;
  flex: 1;
  min-height: 240px;
  max-height: calc(100dvh - 248px);
  overflow-y: auto;
}

#readview .readhint {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  background: rgba(24, 24, 24, 0.94);
  color: var(--dim);
  font-size: 11px;
  backdrop-filter: blur(12px);
}

#readview .readtext {
  margin: 0;
  padding: 12px 13px 18px;
  color: var(--fg);
  font: 12px/1.55 ui-monospace, "SF Mono", Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

#inputbar {
  position: sticky;
  bottom: 0;
  z-index: 18;
  width: 100%;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  background: rgba(24, 24, 24, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.inputbar-shell {
  width: min(100%, var(--session-max));
  margin: 0 auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#quick {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-padding-inline: 2px;
  scrollbar-width: none;
}

.quick-key {
  min-width: 42px;
  min-height: 38px;
  padding: 7px 11px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border);
  border-bottom-color: #484848;
  border-radius: 8px;
  background: #262626;
  color: var(--fg);
  box-shadow: 0 2px 0 #111;
  font: 600 12px/1 ui-monospace, "SF Mono", Menlo, monospace;
}

#inputrow {
  display: flex;
  gap: 8px;
}

#inputrow input {
  min-width: 0;
  min-height: 46px;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #202020;
  color: var(--fg-strong);
  font: 16px/1.3 ui-monospace, "SF Mono", Menlo, monospace;
}

#inputrow input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

#sendbtn {
  min-width: 50px;
}

/* Toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(88vw, 420px);
  padding: 10px 15px;
  display: none;
  transform: translateX(-50%);
  border: 1px solid #4a5360;
  border-radius: 11px;
  background: rgba(51, 60, 72, 0.96);
  color: #f1f5f9;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.36);
  font-size: 13.5px;
  text-align: center;
  backdrop-filter: blur(14px);
}

/* Responsive layout */
@media (min-width: 700px) {
  body {
    background: #121212;
  }

  #app {
    background: var(--sidebar-bg);
  }

  .list-main {
    padding: 16px 18px 40px;
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skeleton-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .push-card {
    margin-inline: 0;
  }

  .session-main {
    padding-inline: 14px;
  }

  .banner {
    margin-inline: 14px;
  }

  form.login {
    padding: 28px;
  }
}

@media (min-width: 1180px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .topbar-shell {
    padding-inline: 8px;
    gap: 4px;
  }

  .status-pill-lg {
    max-width: 86px;
  }

  .push-card {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 11px;
  }

  .push-card-icon {
    width: 34px;
    height: 34px;
  }

  .push-card .btn-label,
  #sendbtn .btn-label {
    display: none;
  }

  .project-head .count {
    display: none;
  }
}

@media (max-width: 340px) {
  .pill {
    max-width: 98px;
  }

  form.login {
    padding: 20px 16px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .auth-main {
    place-items: start center;
    overflow-y: auto;
  }

  form.login {
    margin-block: 8px;
  }

  .brand .logo {
    width: 44px;
    height: 44px;
  }

  .brand h1 {
    margin-top: 8px;
    font-size: 19px;
  }

  #readview {
    max-height: calc(100dvh - 190px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .sicon .spinner,
  .spin {
    animation: spin 1.8s linear infinite !important;
  }
}

@supports (view-transition-name: root) {
  ::view-transition-old(root) {
    animation: 130ms ease both fade-out;
  }

  ::view-transition-new(root) {
    animation: 180ms ease both fade-in;
  }

  @keyframes fade-out { to { opacity: 0; transform: translateX(-5px); } }
}

/* Cockpit-Shell 2026-07-21 -------------------------------------------------
   Die Sidebar folgt jetzt der nativen Hierarchie. Diese Regeln stehen
   absichtlich nach der ehemaligen Karten-Ansicht und lösen sie vollständig
   ab, ohne Auth-/Pairing-/Terminal-Komponenten zu duplizieren. */

.cockpit-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  overflow: hidden;
  background: var(--bg);
}

.cockpit-sidebar {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template:
    "offline" auto
    "header" auto
    "scroll" minmax(0, 1fr)
    "tray" auto
    "footer" auto
    / minmax(0, 1fr);
  overflow: hidden;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}

.cockpit-workspace {
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  display: none;
  overflow: hidden;
  background: var(--bg);
}

.cockpit-shell.has-session .cockpit-sidebar {
  display: none;
}

.cockpit-shell.has-session .cockpit-workspace {
  display: flex;
}

.cockpit-sidebar > .offline-note {
  grid-area: offline;
}

.sidebar-header {
  grid-area: header;
  min-height: calc(52px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 7px 0 12px;
  flex: none;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--sidebar-bg);
}

.sidebar-header h1 {
  min-width: 0;
  margin: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--fg-strong);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.navbar-app-icon {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
}

.sidebar-header h1 .conn-dot {
  margin-left: 1px;
}

.sidebar-scroll {
  grid-area: scroll;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 5px 6px 12px;
  overflow-x: hidden;
  overflow-y: scroll;
  overflow-anchor: none;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-color: #4a4a4a transparent;
  scrollbar-width: thin;
}

.cockpit-sidebar .device-block + .device-block {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.cockpit-sidebar .device-head {
  min-height: 30px;
  margin: 0 6px 2px;
  color: #aeb5c0;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.cockpit-sidebar .device-head .device-state {
  margin-left: auto;
  color: var(--dim);
  font-size: 10px;
}

.project-section {
  min-width: 0;
}

.project-section + .project-section {
  margin-top: 2px;
}

.project-head-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.cockpit-sidebar .project-head {
  min-width: 0;
  flex: 1;
  min-height: 40px;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  text-align: left;
}

.cockpit-sidebar .project-head:hover,
.cockpit-sidebar .project-section.active > .project-head-row .project-head {
  background: var(--surface-soft);
  color: var(--fg);
}

.project-create {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
}

.project-create:hover,
.project-create:focus-visible {
  background: var(--surface-soft);
  color: var(--fg-strong);
}

.project-chevron {
  flex: none;
  transition: transform 140ms ease;
}

.project-chevron.open {
  transform: rotate(90deg);
}

.cockpit-sidebar .project-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #080808;
  font-size: 10px;
  font-weight: 800;
}

.project-badge.warning { background: var(--warning); }
.project-badge.success { background: var(--success); color: #fff; }
.project-badge.followup { background: var(--purple); color: #fff; }

.project-working {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 999px;
  background: var(--accent);
}

.cockpit-sidebar .rows {
  margin: 0 0 3px 11px;
  padding: 0 0 1px 6px;
  gap: 1px;
  border-left-color: var(--border);
}

.cockpit-sidebar .session-row {
  min-height: 44px;
  padding: 4px 6px;
  gap: 6px;
  border-radius: 5px;
}

.cockpit-sidebar .session-row.selected {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--status-tint, transparent) 68%, var(--row-hover));
}

.cockpit-sidebar .session-row .title {
  font-size: 12.5px;
}

.cockpit-sidebar .session-row .pill {
  max-width: 118px;
}

.cockpit-sidebar .history-toggle {
  width: calc(100% - 6px);
  min-height: 34px;
  margin: 2px 3px 0;
  font-size: 11px;
}

.sidebar-note {
  margin: 3px 9px 7px;
  color: var(--dim);
  font-size: 11px;
}

.sidebar-loading {
  padding: 18px 9px;
  display: grid;
  gap: 10px;
}

.sidebar-loading span {
  height: 35px;
  border-radius: 5px;
  background: linear-gradient(90deg, #242424 25%, #303030 45%, #242424 65%);
  background-size: 240% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}

.sidebar-empty {
  min-height: 60vh;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.sidebar-empty h2,
.sidebar-empty p {
  margin: 0;
}

.sidebar-empty h2 { color: var(--fg-strong); font-size: 16px; }
.sidebar-empty p { max-width: 270px; color: var(--dim); font-size: 12px; }

.parked-tray {
  grid-area: tray;
  max-height: 190px;
  padding: 4px 6px 5px;
  flex: none;
  overflow: auto;
  border-top: 1px solid var(--border);
  background: var(--sidebar-bg);
}

.tray-toggle {
  width: 100%;
  min-height: 36px;
  padding: 5px 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-align: left;
}

.tray-toggle:hover { background: var(--surface-soft); }

.tray-projects {
  display: grid;
  gap: 1px;
}

.tray-project-row {
  min-height: 34px;
  padding: 5px 9px 5px 25px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--dim);
  font-size: 11.5px;
}

.tray-project-row > span:first-child {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-footer {
  grid-area: footer;
  min-height: calc(44px + env(safe-area-inset-bottom));
  padding: 4px 8px env(safe-area-inset-bottom);
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--border);
  background: var(--sidebar-bg);
}

.sidebar-footer-action {
  min-height: 34px;
  padding: 5px 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  background: transparent;
  color: var(--dim);
  font-size: 11.5px;
}

.sidebar-footer-action:hover { background: var(--surface-soft); color: var(--fg); }

.sidebar-connection {
  margin-left: auto;
  padding-right: 4px;
  color: var(--dim);
  font-size: 10.5px;
}

.workspace-welcome {
  align-items: center;
  justify-content: center;
}

.workspace-welcome-inner {
  max-width: 390px;
  padding: 30px;
  text-align: center;
}

.workspace-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--dim);
}

.workspace-welcome h2 { margin: 0; color: var(--fg-strong); font-size: 18px; }
.workspace-welcome p { margin: 7px 0 0; color: var(--dim); font-size: 12.5px; }

.session-workspace {
  height: 100%;
  flex-direction: column;
}

.session-workspace > .topbar,
.session-workspace > #banner,
.session-workspace > #inputbar {
  flex: none;
}

.session-workspace .topbar,
.session-workspace #inputbar,
.session-workspace #readview .readhint {
  background: var(--sidebar-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.session-workspace .session-main {
  width: 100%;
  min-height: 0;
  padding: 0 8px 8px;
  flex: 1;
  overflow: hidden;
}

.session-workspace #termwrap,
.session-workspace #readview {
  min-height: 0;
  flex: 1;
}

/* Stabiles Menü: dauerhaft im DOM, opak, keine Blur-/Transition-Layer. */
.menu-layer[hidden] {
  display: none !important;
}

.menu-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  isolation: isolate;
  contain: strict;
}

.menu-layer .sheet-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
}

.menu-layer .sheet {
  z-index: 1;
  border-color: #4a4a4a;
  background: #222222;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.62);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: none;
  contain: paint;
}

body.sheet-open .spin,
body.sheet-open .pulse,
body.sheet-open .sidebar-loading span {
  animation-play-state: paused !important;
}

@media (min-width: 860px) {
  .cockpit-shell {
    display: grid;
    grid-template-columns: 304px minmax(0, 1fr);
  }

  .cockpit-shell .cockpit-sidebar,
  .cockpit-shell.has-session .cockpit-sidebar {
    display: grid;
  }

  .cockpit-shell .cockpit-workspace,
  .cockpit-shell.has-session .cockpit-workspace {
    display: flex;
  }

  .cockpit-sidebar .project-head {
    min-height: 32px;
  }

  .project-create {
    width: 32px;
    height: 32px;
  }

  .cockpit-sidebar .session-row {
    min-height: 38px;
  }

  .session-workspace .backbtn {
    display: none;
  }

  .menu-layer .sheet {
    top: 58px;
    bottom: auto;
    left: 12px;
    right: auto;
    width: 280px;
    padding: 7px;
    transform: none;
    border: 1px solid #4a4a4a;
    border-radius: 12px;
  }

  .menu-layer .sheet .grabber {
    display: none;
  }
}

@media (max-width: 859px) {
  .workspace-welcome {
    display: none;
  }

  .session-workspace #readview {
    max-height: none;
  }
}

/* Laufzeit einer arbeitenden Session in der Status-Pill. Etwas zurueckgenommen,
   damit der Status die Hauptaussage bleibt und der Zaehler daneben nur mitlaeuft.
   Feste Ziffernbreite, sonst zappelt die Pill bei jedem Sekundenwechsel. */
.status-pill-lg .pill-time {
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}

/* ---------------------------------------------------------- Chat-Ansicht --
   Der neue Weg: Markdown-Text statt Terminalinhalt. Alles bricht auf die
   VERFUEGBARE Breite um — schmal auf dem Handy, breit auf dem grossen Schirm.
   Nur Tabellen und Codebloecke scrollen fuer sich, damit sie lesbar bleiben,
   ohne die Seite mitzunehmen. */
.chat-view {
  /* `flex: 1` allein genuegt nicht: Ohne `min-height: 0` waechst ein
     Flex-Kind nur bis zu seinem Inhalt und laesst den Rest der Hoehe leer —
     genau das war im Screenshot zu sehen. */
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 10px;
  padding: 12px 14px 20px;
  border: 1px solid #343434;
  border-radius: 12px;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}
.chat-view > * { flex: 0 0 auto; }
.chat-empty { color: var(--dim); padding: 24px 4px; line-height: 1.55; }
.chat-more {
  display: block; width: 100%; margin: 0 0 14px;
  padding: 9px 12px; border-radius: 8px;
  background: var(--sidebar); color: var(--fg);
  border: 1px solid var(--border); font: inherit; cursor: pointer;
}
.chat-msg { margin: 0 0 16px; }
.chat-who {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 4px;
}
.chat-user .chat-who { color: var(--accent); }
.chat-body { overflow-wrap: anywhere; line-height: 1.55; }
.chat-body > *:first-child { margin-top: 0; }
.chat-body > *:last-child { margin-bottom: 0; }
.chat-body p { margin: 0 0 10px; }
.chat-body h4, .chat-body h5, .chat-body h6 { margin: 14px 0 6px; font-size: 1em; }
.chat-body ul, .chat-body ol { margin: 0 0 10px; padding-left: 22px; }
.chat-body code {
  background: rgba(255,255,255,0.07); border-radius: 4px;
  padding: 1px 4px; font-size: 0.92em;
}
/* Eigener Scrollkasten — der Text drumherum bleibt schmal. */
.md-code {
  margin: 0 0 10px; padding: 10px 12px; border-radius: 8px;
  background: var(--sidebar); border: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.md-code code { background: none; padding: 0; }
.md-tablewrap {
  margin: 0 0 12px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border); border-radius: 8px;
}
.md-tablewrap table { border-collapse: collapse; width: max-content; min-width: 100%; }
.md-tablewrap th, .md-tablewrap td {
  padding: 7px 11px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.md-tablewrap th { background: var(--sidebar); font-weight: 600; }
.md-tablewrap tr:last-child td { border-bottom: none; }
.chat-tools {
  margin: 0 0 14px; padding: 6px 10px; border-radius: 6px;
  background: rgba(255,255,255,0.04); color: var(--dim); font-size: 13px;
}

/* Entscheidungsabfrage: die Frage, die den Agenten anhaelt. Sie bekommt
   bewusst mehr Gewicht als eine gewoehnliche Nachricht — sie ist der Grund,
   warum gerade nichts weitergeht
   (docs/22-bugfixes/2026-08-14-entscheidungen-fehlen-im-web-chat/). */
.decision-card {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.04);
}
.decision-card.is-live {
  border-color: rgba(210,153,34,0.55); background: rgba(210,153,34,0.10);
}
.decision-head {
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 6px;
}
.decision-question { font-size: 15px; line-height: 1.45; }
/* Der Vorspann: was der Agent unmittelbar ueber dem Kasten geschrieben hat.
   Bewusst zurueckhaltender als die Frage — er erklaert sie, er ist sie nicht.
   Umgebrochen wird NICHT (`pre-wrap` statt `pre`): Der Text kommt schon auf
   Terminalbreite umbrochen an, ein zweiter Umbruch macht ihn nicht besser,
   aber ein Seitwaerts-Scroll auf dem Handy unlesbar. */
.decision-lead {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 6px;
  border-left: 2px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.03);
}
.decision-lead-head {
  display: block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 4px;
}
.decision-lead-cut { text-transform: none; letter-spacing: 0; font-style: italic; }
.decision-lead pre {
  margin: 0; font: inherit; font-size: 13px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
/* Werkzeug und Befehl, so wie sie im Terminal stehen — Monospace, damit ein
   Pfad oder ein Befehl lesbar bleibt, und scrollbar statt umgebrochen. */
.decision-context, .banner-question + .decision-context {
  margin: 0 0 8px; padding: 8px 10px; border-radius: 6px;
  background: rgba(0,0,0,0.25); color: var(--dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.4; white-space: pre; overflow-x: auto;
}
.banner-question { font-size: 14px; line-height: 1.4; }
.decision-hint { margin-top: 4px; font-size: 12px; color: var(--dim); }
.decision-options { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.decision-option {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: var(--sidebar); color: inherit;
  font: inherit;
}
.decision-option:hover { border-color: rgba(210,153,34,0.55); }
.decision-option.is-selected { border-color: rgba(210,153,34,0.75); }
.decision-num {
  flex: none; min-width: 22px; height: 22px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08); font-size: 12px; font-weight: 600;
}
.decision-text { display: flex; flex-direction: column; gap: 2px; }
.decision-label { font-size: 14px; line-height: 1.35; }
.decision-desc { font-size: 12px; color: var(--dim); line-height: 1.35; }
/* Die Vorschau — der Inhalt, fuer den man im Terminal waagerecht scrollen muss.
   Hier bekommt er einen EIGENEN Seitwaerts-Scroll, damit ein Dateibaum nicht
   umgebrochen wird und die Seite trotzdem nie quer scrollt. */
.decision-choice { display: flex; flex-direction: column; gap: 0; }
.decision-preview { margin: -2px 0 0; }
.decision-preview > summary {
  cursor: pointer; padding: 6px 12px; font-size: 12px; color: var(--dim);
  list-style: none;
}
.decision-preview > summary::-webkit-details-marker { display: none; }
.decision-preview > summary::before { content: '▸ '; }
.decision-preview[open] > summary::before { content: '▾ '; }
.decision-preview > pre {
  margin: 0 0 4px; padding: 8px 10px; border-radius: 6px;
  background: rgba(0,0,0,0.25); color: var(--dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; line-height: 1.4; white-space: pre; overflow-x: auto;
}
/* Der Auszug der letzten Meldung im Banner: hoechstens drei Zeilen, damit die
   Kopfzeile nicht den halben Bildschirm einnimmt. */
.banner-last {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Eine bereits beantwortete Frage aus dem Verlauf: sichtbar, aber nicht
   anklickbar — Knoepfe fuer eine erledigte Frage waeren ein Fehlklick. */
.decision-options[data-answered] .decision-option { cursor: default; opacity: .72; }
.decision-options[data-answered] .decision-option:hover { border-color: var(--border); }
/* Dieselben Knoepfe im Freigabe-Banner. */
.banner-decision { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }

/* „Agent arbeitet" unten im Chat. Bewusst ruhig: ein pulsierender Punkt statt
   eines Spinners, damit die Aufmerksamkeit beim Text bleibt. */
.chat-activity {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 0; padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.04); color: var(--dim); font-size: 13px;
}
.chat-activity-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex: 0 0 auto;
  animation: pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .chat-activity-dot { animation: none; }
}

/* --- Leseblatt fuer Plaene (BUG-2026-08-24-001) -------------------------- */
/* Ein Plan ist ein Dokument: im Median 211 Zeilen. Er braucht eine Flaeche,
   auf der man liest — und Antwortknoepfe, die man am Ende noch erreicht, ohne
   die Lesestelle zu verlieren. */
.plan-layer .plansheet {
  display: flex; flex-direction: column;
  width: min(100%, 820px); max-height: 92vh; max-height: 92dvh;
}
.plansheet-head {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--dim);
}
.plansheet-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px; font-size: 15px; line-height: 1.55;
}
.plansheet-body pre, .plansheet-body table { overflow-x: auto; }
/* Der Fuss bleibt stehen. Wer 211 Zeilen gelesen hat, darf nicht zurueck
   scrollen muessen, um zu antworten — sonst entscheidet er doch wieder blind. */
.plansheet-actions {
  flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px; border-top: 1px solid var(--border);
  background: var(--sidebar-bg);
}
.plansheet-actions .decision-choice { width: 100%; }

/* Die Planvorschau in der Karte: Anfang zeigen, ins Leseblatt fuehren. */
.decision-plan {
  margin: 0 0 10px; padding: 10px; border-radius: 8px;
  border: 1px solid var(--border); background: rgba(0,0,0,0.18);
}
.decision-plan-head {
  display: block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 6px;
}
.decision-plan-peek {
  font-size: 13px; line-height: 1.5;
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent);
  mask-image: linear-gradient(to bottom, #000 62%, transparent);
}
.decision-plan-peek > :first-child { margin-top: 0; }
.btn.plan-open { margin-top: 6px; width: 100%; justify-content: center; }
