/* ─── Design tokens ────────────────────────────────────────────────────────
   Seit 12.11.2026 zeigen ARTis Variablen auf die Tokens von Last Crumb (Foodforecast
   Design System, vendor/last-crumb/dist/tokens.css). So übernimmt jede Regel, die noch
   eine --ff-*-Variable nutzt, Farben und Flächen von Last Crumb — auch Darkmode-fähig.
   Lachsrot ist in Last Crumb Markenfarbe, keine Aktionsfarbe: Aktionen sind Teal. */
:root {
  --ff-navy:        var(--text-heading);
  --ff-teal:        var(--action-primary);
  --ff-teal-mid:    var(--text-muted);
  --ff-teal-soft:   var(--border-default);   /* Rahmen */
  --ff-mint:        var(--bg-selected);      /* Auswahl, aktiv */
  --ff-mint-soft:   var(--bg-subtle);
  --ff-cream:       var(--bg-hover);         /* Hover */
  --ff-coral:       var(--action-primary);   /* Aktionen (Senden, Primär) */
  --ff-coral-dark:  var(--action-primary-hover);
  --ff-coral-soft:  var(--status-error-bg);
  --ff-line:        var(--border-default);
  --ff-table-border: var(--border-default);
  --ff-table-line:   var(--border-row);
  --ff-cream-50:    var(--bg-subtle);        /* Karten-/Tabellenkopf */
  --ff-cream-200:   var(--bg-pressed);
  --ff-muted-2:     var(--text-secondary);   /* Captions */
  --ff-ink:         var(--text-primary);
  --ff-muted:       var(--text-muted);
  --ff-shadow-sm:   none;                    /* Last Crumb: Flächen mit Rahmen statt Schatten */
  --ff-shadow-md:   var(--shadow-popover);
  --ff-bg:          var(--bg-page);
  --ff-bg-bottom:   var(--bg-surface);
  --ff-bg-gradient: var(--bg-page);
}

* { box-sizing: border-box; }

/* ─── Standalone shell: the panel IS the app, full viewport ──────────────── */
html, body { height: 100%; }
body.arti-standalone {
  margin: 0;
  min-height: 100vh;
  background: var(--ff-mint-soft);
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ff-ink);
}

/* ─── Panel — fills the whole window ─────────────────────────────────── */
#arti-panel {
  position: relative;
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ff-mint-soft);
  overflow: hidden;
}

/* ─── Pill buttons (shared by editor, schedules, widgets) ───────────────── */
.arti-newchat-form { margin: 0; }
.arti-pillbtn {
  border: 1px solid var(--ff-teal-soft);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  color: var(--ff-teal);
  border-radius: 9999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(20, 48, 59, 0.06);
  transition: border-color .12s, color .12s, background .12s;
}
.arti-pillbtn:hover {
  border-color: var(--ff-coral);
  color: var(--ff-coral-dark);
  background: var(--ff-coral-soft);
}
.arti-pillbtn-primary {
  background: var(--ff-coral);
  border-color: var(--ff-coral);
  color: var(--text-on-action);
}
.arti-pillbtn-primary:hover {
  background: var(--ff-coral-dark);
  border-color: var(--ff-coral-dark);
  color: var(--text-on-action);
}

/* ─── Handbook source editor (/editor) ───────────────────────────────── */
.arti-editor {
  width: 100%;
  max-width: 1040px;
  align-self: flex-start;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.arti-editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.arti-editor-eyebrow { font-size: 11px; font-weight: 500; color: var(--ff-coral); }
.arti-editor-head h1 { margin: 2px 0 0; font-size: 20px; color: var(--ff-navy); font-family: ui-monospace, Menlo, monospace; }
.arti-editor-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arti-editor-actions a, .arti-editor-actions form { text-decoration: none; }
.arti-editor-actions form { margin: 0; }
.arti-editor-user { font-size: 13px; color: var(--ff-muted); }
.arti-editor-login { background: var(--bg-surface); border: 1px solid var(--ff-teal-soft); border-radius: 14px; padding: 18px 20px; font-size: 14px; line-height: 1.5; max-width: 640px; }
.arti-editor-login p { margin: 0 0 12px; }
.arti-editor-muted { color: var(--ff-muted); font-size: 13px; }
.arti-editor-body { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.arti-editor-tree {
  background: var(--bg-surface); border: 1px solid var(--ff-teal-soft); border-radius: 12px;
  padding: 6px; max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
}
.arti-editor-file {
  display: block; padding: 6px 10px; border-radius: 8px; font-size: 12px; line-height: 1.4;
  font-family: ui-monospace, Menlo, monospace; color: var(--ff-ink); text-decoration: none;
  white-space: normal; overflow-wrap: anywhere;   /* full path, wraps instead of truncating */
}
.arti-editor-file:hover { background: var(--ff-mint); }
.arti-editor-file.is-active { background: var(--ff-teal); color: var(--text-on-action); }

/* Folder tree */
.arti-tree-dir {
  cursor: pointer;
  list-style: none;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ff-teal);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.arti-tree-dir::-webkit-details-marker { display: none; }
.arti-tree-dir::before {
  content: "▸";
  font-size: 10px;
  color: var(--ff-muted);
  transition: transform .12s;
}
details[open] > .arti-tree-dir::before { transform: rotate(90deg); }
.arti-tree-dir:hover { background: var(--ff-mint); }
.arti-tree-children {
  margin-left: 11px;
  padding-left: 8px;
  border-left: 1px solid var(--ff-teal-soft);
}
.arti-editor-pane { min-width: 0; }
.arti-editor-form { display: flex; flex-direction: column; gap: 10px; }
.arti-editor-path { font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--ff-teal); }
.arti-editor-text {
  width: 100%; min-height: 60vh; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.55;
  padding: 14px; border: 1px solid var(--ff-teal-soft); border-radius: 12px; background: var(--bg-surface);
  color: var(--ff-ink); outline: none; tab-size: 2;
}
.arti-editor-text:focus { border-color: var(--ff-teal-mid); box-shadow: 0 0 0 3px rgba(47,75,82,.12); }
.arti-editor-commit { display: flex; gap: 10px; align-items: center; }
.arti-editor-msg {
  flex: 1; font: inherit; font-size: 13px; padding: 9px 12px;
  border: 1px solid var(--ff-teal-soft); border-radius: 9999px; background: var(--bg-surface); outline: none;
}
.arti-editor-msg:focus { border-color: var(--ff-teal-mid); box-shadow: 0 0 0 3px rgba(47,75,82,.12); }
.arti-flash { padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.arti-flash-sub { margin-top: 6px; font-size: 12.5px; color: var(--ff-muted); }
.arti-editor-flow {
  margin: 2px 0 0;
  padding: 10px 12px;
  background: var(--ff-mint);
  border: 1px solid var(--ff-teal-soft);
  border-left: 3px solid var(--ff-teal);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ff-teal);
}
.arti-editor-flow code { background: var(--ff-mint-soft); }
.arti-flash-ok { background: var(--ff-mint); border: 1px solid var(--ff-teal-soft); color: var(--ff-navy); }
.arti-flash-err { background: var(--ff-coral-soft); border: 1px solid var(--status-error-border); color: var(--status-error-fg); }
@media (max-width: 720px) { .arti-editor-body { grid-template-columns: 1fr; } }

/* ─── Body (scroll area) + centered readable content column ───────────── */
#arti-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--ff-mint-soft);
}
.arti-content {
  width: 100%;
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#arti-messages { display: flex; flex-direction: column; gap: 4px; }

/* ─── Hero ───────────────────────────────────────────────────────────── */
.arti-hero { display: flex; justify-content: center; margin: 4px 0 10px; }
.arti-hero-logo {
  width: 48px; height: 48px;
  border-radius: 9999px;
  object-fit: cover;
  background: var(--bg-surface);
  box-shadow: 0 4px 12px rgba(20, 48, 59, 0.12), 0 1px 3px rgba(20, 48, 59, 0.06);
  user-select: none; -webkit-user-drag: none;
}

/* ─── Bubbles ────────────────────────────────────────────────────────── */
.arti-bubble {
  padding: 11px 14px;
  border-radius: 16px;
  line-height: 1.5;
  font-size: 14px;
  max-width: 90%;
  word-wrap: break-word;
  white-space: pre-wrap;
  margin: 0;
}
.arti-greeting {
  background: var(--bg-surface);
  color: var(--ff-navy);
  border: 1px solid var(--ff-teal-soft);
  box-shadow: 0 1px 2px rgba(20, 48, 59, 0.04);
}
.arti-greeting p { margin: 0; }

/* Tighter stacking within a turn, more room at turn boundaries. */
#arti-messages > * + .arti-bubble.arti-user,
#arti-messages > .arti-bubble.arti-user + * { margin-top: 10px; }

.arti-user {
  background: var(--ff-teal);
  color: var(--text-on-action);
  margin-left: auto;
  border-bottom-right-radius: 5px;
  box-shadow: 0 1px 2px rgba(20, 48, 59, 0.08);
}
.arti-assistant {
  background: var(--bg-surface);
  color: var(--ff-ink);
  border: 1px solid var(--ff-teal-soft);
  border-bottom-left-radius: 5px;
  white-space: normal;
  box-shadow: 0 1px 2px rgba(20, 48, 59, 0.04);
}
.arti-error {
  background: var(--ff-coral-soft);
  color: var(--status-error-fg);
  border: 1px solid var(--status-error-border);
}

/* ─── Assistant markdown ─────────────────────────────────────────────── */
.arti-assistant p { margin: 0 0 8px; }
.arti-assistant p:last-child { margin-bottom: 0; }
.arti-assistant ul, .arti-assistant ol { margin: 6px 0; padding-left: 22px; }
.arti-assistant li { margin: 3px 0; line-height: 1.5; }
.arti-assistant li::marker { color: var(--ff-coral); }
.arti-assistant strong { font-weight: 500; color: var(--ff-navy); }
.arti-assistant em { font-style: italic; color: #374151; }
.arti-assistant a { color: var(--ff-coral-dark); text-decoration: underline; }
.arti-assistant code {
  background: var(--ff-mint);
  padding: 1px 6px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ff-teal);
}
.arti-assistant pre {
  background: var(--ff-mint);
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 8px 0;
}
.arti-assistant pre code { background: none; padding: 0; }
.arti-assistant h1, .arti-assistant h2, .arti-assistant h3 { font-size: 15px; font-weight: 500; margin: 6px 0 4px; color: var(--ff-navy); }
.arti-assistant h4, .arti-assistant h5 { font-size: 14px; font-weight: 500; margin: 6px 0 4px; color: var(--ff-navy); }
.arti-assistant blockquote {
  margin: 8px 0; padding: 6px 12px;
  border-left: 3px solid var(--ff-teal); background: var(--ff-mint);
  border-radius: 6px; color: var(--ff-navy);
}

/* Tables (commonmarker emits plain <table>) — styled like the mockup. */
.arti-assistant table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  overflow: hidden;
}
.arti-assistant th, .arti-assistant td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--bg-subtle);
  vertical-align: top;
}
.arti-assistant th {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: #6b7280;
  background: var(--bg-subtle);
  border-bottom-color: var(--border-default);
}
.arti-assistant tbody tr:last-child td { border-bottom: 0; }
.arti-assistant tbody tr:nth-child(even) { background: var(--bg-subtle); }

/* ─── Chips ──────────────────────────────────────────────────────────── */
#arti-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.arti-chip {
  padding: 7px 14px;
  border-radius: 9999px;
  background: var(--bg-surface);
  border: 1px solid var(--ff-teal-soft);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ff-navy);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.arti-chip:hover {
  border-color: var(--ff-coral);
  color: var(--ff-coral-dark);
  background: var(--ff-coral-soft);
}
/* Distinct dark-green chip for the standardized waste-analysis skill (run_skill). */
.arti-chip-waste {
  background: var(--status-success-fg);
  border-color: var(--status-success-fg);
  color: var(--text-on-action);
  font-weight: 500;
}
.arti-chip-waste:hover {
  background: var(--status-success-fg);
  border-color: var(--status-success-fg);
  color: var(--text-on-action);
}

/* ─── Thinking indicator (inside the assistant bubble) ───────────────── */
.arti-thinking {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ff-teal);
  font-size: 14px;
}
.arti-spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--ff-teal-soft);
  border-top-color: var(--ff-coral);
  animation: arti-spin 0.8s linear infinite;
}
@keyframes arti-spin { to { transform: rotate(360deg); } }
/* "Neuer Chat" transition: blank the conversation + a centered larger spinner */
.arti-newchat-loading { flex: 1; display: grid; place-items: center; min-height: 240px; padding: 40px 0; }
.arti-newchat-loading .arti-spinner { width: 30px; height: 30px; border-width: 3px; }

/* ─── Live activity status line (spinner + "what's running" + elapsed) ─── */
.arti-activity { margin: 2px 0 6px; padding: 2px 2px; }
.arti-activity-elapsed { color: var(--ff-muted); font-size: 12.5px; }
/* The answer bubble is appended empty and only shown once the first token
   arrives — so no empty grey blob sits under the status line. */
.arti-bubble:empty { display: none; }

/* ─── Composer ───────────────────────────────────────────────────────── */
#arti-composer {
  display: block;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--ff-teal-soft);
  background: var(--ff-mint-soft);
}
.arti-composer-inner {
  position: relative;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}
#arti-input {
  display: block;
  width: 100%;
  resize: none;
  padding: 14px 56px 14px 20px;
  border: 1px solid var(--ff-teal-soft);
  border-radius: 9999px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ff-ink);
  outline: none;
  background: var(--bg-surface);
  box-shadow: 0 1px 3px rgba(20, 48, 59, 0.04);
  transition: border-color .12s, box-shadow .12s, background .12s;
  max-height: 220px;
  overflow-y: auto;
}
#arti-input::placeholder { color: #8a9a9f; }
/* When the composer grows (e.g. a prefilled ticket), soften the pill so the
   multi-line box doesn't look like a stadium. */
#arti-input.is-multiline { border-radius: 18px; }
#arti-input:focus {
  border-color: var(--ff-teal-mid);
  box-shadow: 0 0 0 3px rgba(47, 75, 82, 0.12);
}
#arti-send {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: var(--ff-ink);
  color: var(--text-on-action);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, transform .1s, opacity .15s;
}
#arti-send:hover:not(:disabled) { background: #000; }
#arti-send:disabled { background: #c7cfd3; cursor: not-allowed; opacity: .7; }

/* ── Freshdesk ticket browser ─────────────────────────────────────────── */
.arti-ticket-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.arti-ticket-filters select, .arti-ticket-filters input {
  padding: 8px 12px; border: 1px solid var(--ff-teal-soft); border-radius: 9999px;
  font: inherit; font-size: 13px; color: var(--ff-ink); background: var(--bg-surface); outline: none;
}
.arti-ticket-filters input { width: 150px; }
.arti-ticket-filters select:focus, .arti-ticket-filters input:focus {
  border-color: var(--ff-teal-mid); box-shadow: 0 0 0 3px rgba(47,75,82,.12);
}
.arti-ticket-client { font-family: ui-monospace, Menlo, monospace; }
.arti-ticket-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.arti-ticket {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--bg-surface); border: 1px solid var(--ff-teal-soft);
  border-radius: 12px; text-decoration: none; color: inherit;
  transition: border-color .15s, background .15s, transform .1s;
}
.arti-ticket:hover { border-color: var(--ff-teal-mid); background: var(--ff-mint); transform: translateY(-1px); }
.arti-ticket-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.arti-ticket-subject { font-weight: 500; color: var(--ff-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arti-ticket-meta { font-size: 12px; color: var(--ff-muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.arti-ticket-status { font-weight: 500; }
.arti-ticket-status-2 { color: var(--ff-coral); }   /* Offen */
.arti-ticket-status-3 { color: #b8860b; }            /* Wartend */
.arti-ticket-status-4, .arti-ticket-status-5 { color: var(--ff-teal); } /* Gelöst/Geschlossen */
.arti-ticket-go { font-size: 13px; color: var(--ff-teal); white-space: nowrap; flex-shrink: 0; }
.arti-ticket-pager { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.arti-ticket-pager a { text-decoration: none; }

/* "In Freshdesk übernehmen" action under a ticket-chat answer */
.arti-adopt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 6px; }
.arti-adopt-btn {
  border: 0; border-radius: 9999px; padding: 8px 16px; cursor: pointer;
  background: var(--ff-coral); color: var(--text-on-action); font: inherit; font-size: 13px; font-weight: 500;
  transition: background .15s, transform .1s;
}
.arti-adopt-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.arti-adopt-btn.is-done { background: var(--ff-teal); cursor: default; transform: none; }
.arti-adopt-hint { font-size: 12px; color: var(--ff-muted); }

/* Ticket message bubble: shown ticket + collapsible history */
.arti-ticket-msg-main { white-space: pre-wrap; }
.arti-ticket-history { margin-top: 10px; border-top: 1px solid rgba(255,255,255,.25); padding-top: 8px; }
.arti-ticket-history > summary {
  cursor: pointer; font-size: 12px; font-weight: 500; opacity: .85;
  list-style: none; user-select: none;
}
.arti-ticket-history > summary::before { content: "▸ "; }
.arti-ticket-history[open] > summary::before { content: "▾ "; }
.arti-ticket-history-body {
  white-space: pre-wrap; margin-top: 8px; font-size: 13px; opacity: .92;
  max-height: 320px; overflow-y: auto;
}

/* ─── foodforecast login (agentic actions act as this user) ─────────────── */
.arti-login { position: relative; }
.arti-login summary { list-style: none; display: inline-block; }
.arti-login summary::-webkit-details-marker { display: none; }
.arti-login-authed { border-color: var(--border-selected); color: var(--status-success-fg); background: var(--status-success-bg); }
.arti-login-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: 300px;
  background: var(--bg-surface);
  border: 1px solid var(--ff-teal-soft);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(20, 48, 59, 0.14);
  padding: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.arti-login-panel p { margin: 0; font-size: 12px; color: var(--ff-muted); line-height: 1.45; }
.arti-login-panel form { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.arti-login-panel input {
  border: 1px solid var(--ff-teal-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
}
.arti-login-panel code { background: var(--ff-mint); border-radius: 5px; padding: 0 4px; font-size: 11px; }
.arti-login-error { text-align: start; }   /* Last Crumb `.ff-notice--error` */

/* "Deine Chats" dropdown (past chats per user) */
.arti-chats { position: relative; }
.arti-chats summary { list-style: none; display: inline-block; }
.arti-chats summary::-webkit-details-marker { display: none; }
.arti-chats-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--ff-teal-soft);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(20, 48, 59, 0.14);
  padding: 6px;
  z-index: 20;
}
.arti-chats-empty { margin: 0; padding: 10px; font-size: 12.5px; color: var(--ff-muted); }
.arti-chats-list { list-style: none; margin: 0; padding: 0; }
.arti-chats-item { margin: 0; }
.arti-chats-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ff-ink);
}
a.arti-chats-link:hover { background: var(--ff-mint); }
.arti-chats-link.is-current { background: var(--ff-mint); cursor: default; }
.arti-chats-title {
  display: block;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arti-chats-meta { display: block; font-size: 11px; color: var(--ff-muted); margin-top: 2px; }
.arti-login-hint { font-size: 11px; }

/* ─── Proposed-action confirm widget (preview → Ausführen) ──────────────── */
.arti-action {
  background: var(--bg-surface);
  border: 1px solid var(--ff-coral);
  border-radius: 16px;
  border-bottom-left-radius: 5px;
  padding: 13px 15px;
  margin: 8px 0;
  max-width: 92%;
  font-size: 13.5px;
  line-height: 1.5;
  box-shadow: 0 2px 10px rgba(225, 124, 108, 0.12);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.arti-action-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.arti-action-title { font-weight: 500; color: var(--ff-navy); }
.arti-action-state {
  font-size: 11px;
  font-weight: 500;
  color: var(--ff-coral-dark);
  background: var(--ff-coral-soft);
  border-radius: 9999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.arti-action-summary { margin: 0; color: var(--ff-ink); }
.arti-action-detail { margin: 0; color: var(--ff-muted); font-size: 12.5px; }
.arti-action-diff { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.arti-action-diff th, .arti-action-diff td { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--ff-line); }
.arti-action-diff thead th { font-size: 10.5px; color: var(--ff-muted); border-bottom: 1px solid var(--ff-teal-soft); }
.arti-action-diff tbody th { font-weight: 500; color: var(--ff-teal); white-space: nowrap; }
.arti-action-old { color: var(--ff-muted); text-decoration: line-through; }
.arti-action-arrow { color: var(--ff-coral); font-weight: 500; }
.arti-action-new { color: var(--ff-navy); font-weight: 500; }
.arti-action-meta { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; }
.arti-action-meta div { display: flex; gap: 6px; align-items: baseline; }
.arti-action-meta dt { font-size: 10.5px; color: var(--ff-muted); }
.arti-action-meta dd { margin: 0; font-size: 12.5px; font-weight: 500; color: var(--ff-ink); }
.arti-action-warning {
  margin: 0;
  font-size: 12.5px;
  color: var(--status-warning-fg);
  background: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  border-radius: 8px;
  padding: 7px 10px;
}
.arti-action-buttons { display: flex; align-items: center; gap: 8px; }
.arti-action-form { margin: 0; display: inline; }
.arti-action-done { border-color: var(--border-selected); box-shadow: 0 2px 10px rgba(46, 107, 79, 0.1); }
.arti-action-done .arti-action-title { color: var(--status-success-fg); }
.arti-action-failed { border-color: #d9a09a; background: var(--status-error-bg); }
.arti-action-failed .arti-action-title { color: var(--status-error-fg); }

/* ─── Grouped action widget: one compact row per proposed change ────────── */
.arti-action-group { max-width: 100%; }
.arti-action-rows { display: flex; flex-direction: column; }
.arti-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  border-top: 1px solid var(--ff-line);
}
.arti-action-row:first-child { border-top: none; }
.arti-action-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.arti-action-row-target { font-size: 13px; color: var(--ff-navy); }
.arti-action-row-diff { font-size: 12.5px; color: var(--ff-ink); display: flex; flex-wrap: wrap; gap: 2px 14px; }
.arti-action-row-change { white-space: nowrap; }
.arti-action-row-warning { font-size: 11.5px; color: var(--status-warning-fg); }
.arti-action-row-buttons { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.arti-action-row-buttons .arti-pillbtn { padding: 5px 11px; font-size: 12px; }
.arti-action-row-done .arti-action-row-target { color: var(--status-success-fg); font-weight: 500; }
.arti-action-row-done .arti-action-row-diff { color: var(--ff-muted); }
.arti-action-row-failed .arti-action-row-target { color: var(--status-error-fg); font-weight: 500; }

/* ── Login gate (full-page foodforecast login, plan 1b) ─────────────────── */
.arti-gate {
  max-width: 360px;
  margin: 24px auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.arti-gate p { margin: 0; font-size: var(--fs-body); color: var(--text-secondary); line-height: 1.5; }
.arti-gate-form { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 0; }
.arti-gate-form input {
  border: 1px solid var(--ff-line);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 14px;
}

/* ── Active-client chip (Mandanten-Kontext, plan §1) ────────────────────── */
.arti-client-chip {
  border-color: var(--border-selected);
  color: var(--status-info-fg);
  background: var(--status-info-bg);
}
.arti-client-chip-none { border-style: dashed; color: var(--ff-muted); background: transparent; }

/* ── Change-set widget: grouped-by-resource (plan §1/§7) ─────────────────── */
.arti-action-client {
  font-size: 11.5px;
  color: var(--status-info-fg);
  background: var(--status-info-bg);
  border: 1px solid var(--border-selected);
  border-radius: 999px;
  padding: 1px 8px;
}
.arti-action-viewlink { margin: 2px 0 8px; font-size: 12px; }
.arti-action-viewlink a { color: var(--ff-navy); }
.arti-action-groupfoot { display: flex; justify-content: flex-end; margin-top: 8px; }
.arti-action-row-scope { font-size: 11.5px; color: var(--ff-muted); margin-top: 2px; }
.arti-action-async { color: var(--status-warning-fg); margin-left: 6px; }
.arti-action-details { margin-top: 6px; }
.arti-action-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--ff-navy);
  user-select: none;
}
.arti-action-detail-dl { margin: 6px 0 0; font-size: 12px; }
.arti-action-detail-dl > div { display: flex; gap: 8px; padding: 2px 0; }
.arti-action-detail-dl dt { flex: 0 0 96px; color: var(--ff-muted); }
.arti-action-detail-dl dd { margin: 0; color: var(--ff-ink); }
.arti-action-detail-dl code { font-size: 11px; word-break: break-all; }

/* ── Persona chip (role, next to the Mandant chip) ──────────────────────── */
.arti-persona-chip {
  border-color: #d9c2a8;
  color: #7a5a2e;
  background: var(--bg-subtle);
  cursor: default;
}
.arti-client-chip {
  border-color: #b9d3d9;
  color: var(--action-primary-hover);
  background: var(--status-success-bg);
  cursor: default;
}
.arti-inline-form { display: inline; margin: 0; }

/* Explicit client picker: searchable dropdown (can be hundreds of clients) */
.arti-client-search {
  width: 100%;
  box-sizing: border-box;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid var(--ff-line);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ff-ink);
  background: var(--bg-surface);
}
.arti-client-search:focus {
  outline: none;
  border-color: #4B9DAC;
  box-shadow: 0 0 0 3px rgba(75, 157, 172, 0.15);
}
.arti-client-options {
  list-style: none;
  margin: 8px 0 0;
  padding: 4px;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--ff-line);
  border-radius: 8px;
  background: var(--bg-surface);
}
.arti-client-option { margin: 0; }
.arti-client-option button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ff-ink);
}
.arti-client-option button:hover,
.arti-client-option button:focus {
  background: var(--status-success-bg);
  color: var(--action-primary-hover);
  outline: none;
}
.arti-client-empty { margin: 8px 2px 0; font-size: 12.5px; color: var(--ff-muted); }

/* ── Analysis result (run_analysis): tables + charts ────────────────────── */
.arti-result {
  border: 1px solid var(--ff-line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.arti-result-text { margin: 0; font-size: 13px; color: var(--ff-ink); }
.arti-result-report { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.arti-result-report-hint { font-size: 11px; color: var(--ff-muted); }
.arti-result-table h4, .arti-result-chart h4 {
  margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--ff-navy);
}
.arti-result-table { overflow-x: auto; }
.arti-result-table table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.arti-result-table th, .arti-result-table td {
  border-bottom: 1px solid var(--ff-line);
  padding: 6px 9px;
  text-align: left;
  white-space: nowrap;
}
.arti-result-table th {
  color: var(--ff-muted); font-weight: 500;
  font-size: 10.5px;
  border-bottom: 2px solid var(--ff-line);
}
/* Numeric columns right-aligned with tabular figures (report look). */
.arti-result-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
/* Insights als Karten (Feedback 03.11.2026): Befund, darunter die Empfehlung, klein der feste Hinweis — umbrechend,
   statt einer breiten Tabelle mit Zellen ohne Umbruch. */
.arti-insight-cards { overflow-x: visible; display: grid; gap: 8px; }
.arti-insight-card {
  border: 1px solid var(--ff-line); border-left: 4px solid var(--ff-navy); border-radius: 8px;
  padding: 9px 12px; font-size: 13px; line-height: 1.45; color: var(--ff-ink);
}
.arti-insight-card-head { color: var(--ff-navy); margin-bottom: 2px; }
.arti-insight-card-action { margin-top: 5px; font-weight: 600; color: var(--ff-navy); }
.arti-insight-card-note { margin-top: 5px; font-size: 11.5px; color: var(--ff-muted); }
.arti-result-table tbody tr:hover { background: var(--ff-cream); }
.arti-result-chart { width: 100%; }
.arti-chart-wrap { position: relative; height: 260px; }
/* Model-authored viz (chart type "html"): sandboxed iframe, height set inline
   and adjusted by the viz-frame controller via postMessage. */
.arti-viz-frame { display: block; width: 100%; border: 0; border-radius: 8px; background: var(--bg-surface); }

/* ═══════════════════════════════════════════════════════════════════════
   FoodForecast Design-System — Restyle (überschreibt die Regeln oben)
   Approved mockup: cremefarbenes Canvas, weißer Header, kleiner Hero, Arti als
   reiner Fließtext; jede Tabelle/Result/KPI/Ranking/Callout = weiße Karte.
   Poppins: NUR 300 (Body) + 500 (Betonung/Labels/Headings). Nie fett.
   ═══════════════════════════════════════════════════════════════════════ */
.arti-content, #arti-chips, .arti-result, .arti-editor,
.arti-chats-panel, .arti-client-picker, #arti-composer, .arti-gate,
.kpi-grid, #arti-panel, body.arti-standalone {
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
/* Frischer Canvas: sanfter Mint→Weiß-Verlauf auf dem (nicht scrollenden) Panel;
   Body/Content bleiben transparent, damit der Verlauf durchscheint. */
body.arti-standalone { background: var(--ff-bg); }
#arti-panel { background: var(--ff-bg-gradient); }
#arti-body { background: transparent; }
#arti-composer { background: transparent; }

/* Inline Lucide icons: align with text, never squash */
.arti-icon { display: inline-block; vertical-align: -3px; flex: 0 0 auto; }

/* Pills that are <summary> elements (login, Deine Chats, Start-Prompt) get the
   base `details summary { display: inline-block }`, which killed the pill's
   gap → icon flush against the label. Restore the flex + gap here (declared
   after those base rules, so it wins). */
summary.arti-pillbtn, .arti-login > summary, .arti-chats > summary, .arti-oprompt > summary {
  display: inline-flex; align-items: center; gap: 6px;
}

/* ── Reading column & rhythm ─────────────────────────────────────────────── */
.arti-content { max-width: 840px; }
#arti-body { padding-top: 40px; }

/* ── Pills ───────────────────────────────────────────────────────────────── */
.arti-pillbtn {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; box-shadow: var(--ff-shadow-sm); backdrop-filter: none;
  background: var(--bg-surface); color: var(--ff-navy); border-color: var(--ff-teal-soft);
}
.arti-pillbtn:hover { border-color: var(--ff-teal-soft); background: var(--ff-cream); color: var(--ff-navy); }
.arti-login-authed { border-color: var(--border-selected); color: var(--ff-teal); background: var(--ff-mint); }
/* Primary pill — coral fill (re-declared after the generic .arti-pillbtn above) */
.arti-pillbtn-primary { background: var(--ff-coral); border-color: var(--ff-coral); color: var(--text-on-action); }
.arti-pillbtn-primary:hover { background: var(--ff-coral-dark); border-color: var(--ff-coral-dark); color: var(--text-on-action); }
/* button_to renders a <form>; keep it inline so the pill sits in the row */
.arti-newchat-form { display: inline-flex; }
/* Destructive/secondary pill — coral outline */
.arti-pillbtn-coral { background: var(--bg-surface); border-color: var(--ff-coral); color: var(--ff-coral-dark); }
.arti-pillbtn-coral:hover { background: var(--ff-coral); border-color: var(--ff-coral); color: var(--text-on-action); }
/* Read-only context (Analyst / Kunde) — plain labels, NO button chrome */
.arti-context-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--ff-muted);
  white-space: nowrap; cursor: default;
}
.arti-context-label .arti-icon { color: var(--ff-teal); }
.arti-context-client { color: var(--ff-navy); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.arti-hero { flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 4px; }
.arti-hero-avatar {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  background: var(--bg-surface); box-shadow: var(--ff-shadow-md); display: grid; place-items: center;
}
.arti-hero-logo { width: 100%; height: 100%; object-fit: cover; display: block; }
/* foodforecast-Wortmarke im Hero (ersetzt den runden Arti-Swirl) */
.arti-hero-brand { display: grid; place-items: center; }
.arti-hero-wordmark {
  width: 172px; height: auto; display: block;
  user-select: none; -webkit-user-drag: none;
}
.arti-hero-title { margin: 4px 0 0; font-size: 19px; font-weight: 500; color: var(--ff-navy); }
.arti-hero-sub { margin: 0; max-width: 420px; text-align: center; font-size: 13.5px; line-height: 1.55; color: var(--ff-muted); font-weight: 400; }

/* Mint context banner — bound client */
.arti-context-banner {
  display: inline-flex; align-items: center; gap: 8px; align-self: center;
  margin: 4px 0 12px; padding: 8px 14px; font-size: 13px; font-weight: 400;
  background: var(--ff-mint); border: 1px solid var(--ff-teal-soft);
  border-radius: 9999px; color: var(--ff-navy);
}
.arti-context-banner strong { font-weight: 500; }
.arti-context-banner .arti-icon { color: var(--ff-teal); }

/* ── User bubble (only genuine bubble) ───────────────────────────────────── */
.arti-bubble.arti-user {
  background: var(--ff-navy); color: var(--ff-cream); font-weight: 400; font-size: 15px;
  border-radius: 16px 16px 5px 16px; box-shadow: var(--ff-shadow-sm);
  padding: 12px 18px; max-width: 78%; margin-left: auto; align-self: flex-end;
}

/* ── Assistant prose — no bubble ─────────────────────────────────────────── */
.arti-bubble.arti-assistant, .arti-bubble.arti-greeting {
  background: transparent; border: 0; box-shadow: none; border-radius: 0;
  padding: 0; max-width: 100%; color: var(--ff-ink); font-size: 15px; line-height: 1.65;
}
.arti-assistant p { margin: 0 0 12px; font-size: 15px; line-height: 1.65; font-weight: 400; }
.arti-assistant strong { font-weight: 500; color: var(--ff-navy); }
.arti-assistant h1, .arti-assistant h4, .arti-assistant h5 { font-weight: 500; color: var(--ff-navy); }
.arti-assistant h2 { font-size: 24px; font-weight: 500; color: var(--ff-navy); margin: 18px 0 10px; }
/* h3 = Eyebrow (seit Last Crumb ohne Versalien) */
.arti-assistant h3 {
  font-size: 15px; font-weight: 500; letter-spacing: .03em;
  color: var(--ff-muted); margin: 16px 0 8px;
}
.arti-assistant li::marker { color: var(--ff-coral); }
.arti-assistant a { color: var(--text-link); text-decoration: underline; }
.arti-assistant a:hover { color: var(--action-primary-hover); }
.arti-assistant code { background: var(--border-default); color: var(--ff-navy); border-radius: 4px; padding: 1px 5px; }
.arti-assistant blockquote {
  border-left: 0; background: var(--ff-mint); border: 1px solid var(--ff-teal-soft);
  border-radius: 12px; padding: 12px 14px; margin: 12px 0; color: var(--ff-navy);
}

/* ── Tables inside answers = white card ──────────────────────────────────── */
.arti-assistant table {
  border: 1px solid var(--ff-table-border); border-radius: 14px; overflow: hidden;
  box-shadow: var(--ff-shadow-sm); font-size: 14px; margin: 12px 0; background: var(--bg-surface);
  border-collapse: separate; border-spacing: 0; width: 100%;
}
.arti-assistant th {
  background: transparent; color: var(--ff-muted); font-weight: 500;
  font-size: 11px;
  border-bottom: 1px solid var(--ff-table-border); padding: 8px 12px; text-align: left;
}
.arti-assistant td { border-bottom: 1px solid var(--ff-table-line); padding: 8px 12px; font-weight: 400; }
.arti-assistant tbody tr:nth-child(even) { background: transparent; }
.arti-assistant tbody tr:last-child td { border-bottom: 0; }
.arti-assistant td.delta, .arti-result-table td.delta { color: var(--ff-coral); font-weight: 500; }

/* ── Suggestion chips ────────────────────────────────────────────────────── */
.arti-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.arti-chip:hover { border-color: var(--ff-teal-soft); background: var(--ff-cream); color: var(--ff-navy); }
.arti-chip-waste { background: var(--ff-teal); border-color: var(--ff-teal); color: var(--text-on-action); }
.arti-chip-waste:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); color: var(--text-on-action); }

/* ── Result / report card ────────────────────────────────────────────────── */
/* Transparent shell — the widgets (KPIs, tables, ranking, chart) are the cards;
   no card-in-card. They float on the cream page with a 24px rhythm. */
.arti-result {
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  padding: 4px 0; gap: 24px;
}
.arti-result-head { display: flex; justify-content: flex-end; align-items: flex-start; }
.arti-result-report { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.arti-result-report-hint { font-size: 11px; color: var(--ff-muted); }
.arti-result-download { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.arti-result-download .arti-result-report-hint { text-align: left; }

/* ── File attachment (CSV upload for analysis) ───────────────────────────── */
/* Transient status line above the composer (only while loading / on error). */
.arti-attach-status {
  max-width: 840px; margin: 0 auto 6px; padding: 0 6px;
  font-size: 12.5px; color: var(--ff-muted); text-align: center;
}
.arti-attach-status[hidden] { display: none; }
.arti-attach-status.is-error { color: var(--status-error-fg); font-weight: 500; }

/* The attached file as a card IN the chat flow — a rounded rectangle with a
   file icon (right-aligned, like the user's own messages). */
.arti-file-card {
  align-self: flex-end; max-width: min(340px, 90%);
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-surface); border: 1px solid var(--ff-teal-soft); border-radius: 14px;
  box-shadow: var(--ff-shadow-sm); padding: 12px 12px 12px 14px; margin: 2px 0;
}
.arti-file-card-icon {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  background: var(--ff-mint); color: var(--ff-teal);
  display: grid; place-items: center;
}
.arti-file-card-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
/* Mit einer Frage abgeschickte Bilder: Miniaturen rechtsbündig direkt über ihrer Blase. */
.arti-msg-images {
  align-self: flex-end; margin-left: auto; max-width: 78%;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px;
}
/* Näher an die Blase als der übliche Abstand im Verlauf (gap 14px). */
#arti-messages > .arti-msg-images + .arti-bubble.arti-user { margin-top: -6px; }
.arti-msg-images a { display: block; line-height: 0; }
.arti-msg-images img {
  width: 72px; height: 72px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--ff-teal-soft); box-shadow: var(--ff-shadow-sm); background: var(--bg-surface);
}
.arti-msg-images a:hover img { border-color: var(--ff-teal); }
.arti-file-card-body { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.arti-file-card-name {
  font-weight: 500; color: var(--ff-navy); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.arti-file-card-meta { font-size: 12px; color: var(--ff-muted); }
.arti-file-card-x {
  flex: 0 0 auto; margin-left: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(30, 65, 80, .07); color: var(--ff-teal); font-size: 17px; line-height: 1;
  transition: background .12s, color .12s;
}
.arti-file-card-x:hover { background: var(--ff-coral); color: var(--text-on-action); }
.arti-result-eyebrow {
  font-size: 12px; font-weight: 500;
  color: var(--ff-muted); margin: 0 0 12px;
}
.arti-result-text { font-size: 14px; font-weight: 400; color: var(--ff-ink); margin: 0; }
.arti-result-table table {
  border: 1px solid var(--ff-table-border); border-radius: 14px; overflow: hidden;
  box-shadow: var(--ff-shadow-sm); background: var(--bg-surface); border-collapse: separate;
  border-spacing: 0; width: 100%; font-size: 14px;
}
.arti-result-table th {
  color: var(--ff-muted); font-weight: 500; font-size: 11px; border-bottom: 1px solid var(--ff-table-border); padding: 8px 12px;
}
.arti-result-table td { border-bottom: 1px solid var(--ff-table-line); padding: 8px 12px; font-weight: 400; }
.arti-result-table tbody tr:last-child td { border-bottom: 0; }
.arti-result-table tbody tr:hover { background: var(--ff-cream); }

/* ── KPI-Vergleich (neue Komponente) ─────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi-card {
  background: var(--bg-surface); border: 1px solid var(--ff-teal-soft); border-radius: 14px;
  box-shadow: var(--ff-shadow-sm); padding: 16px;
}
.kpi-card .kpi-label { font-size: 11px; color: var(--ff-muted); }
.kpi-card .kpi-now { font-size: 24px; font-weight: 500; color: var(--ff-navy); margin-top: 4px; }
.kpi-card .kpi-cmp { font-size: 12px; color: var(--ff-muted); margin-top: 2px; }
.kpi-card .kpi-delta { font-size: 12px; font-weight: 500; margin-top: 2px; }
/* Colour follows SENTIMENT, not direction: rising revenue is good (teal),
   rising waste is bad (coral). Sentiment is decided per metric server-side. */
.kpi-delta.is-good { color: var(--ff-teal); }
.kpi-delta.is-bad  { color: var(--status-error-fg); }
.kpi-delta.is-flat { color: var(--ff-muted); }

/* ── Composer — pill over a cream fade ───────────────────────────────────── */
#arti-composer {
  border-top: 0; background: linear-gradient(to top, var(--ff-bg-bottom) 62%, rgba(251,254,253,0));
  padding: 14px 16px 18px;
}
.arti-composer-inner {
  max-width: 840px; margin: 0 auto; background: var(--bg-surface);
  border: 1px solid var(--ff-teal-soft); border-radius: 20px; box-shadow: var(--ff-shadow-md);
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px;
}
#arti-input {
  border: 0; background: transparent; box-shadow: none; border-radius: 0;
  font-size: 15px; font-weight: 400; padding: 8px 0; max-height: 180px;
}
#arti-input:focus { border: 0; box-shadow: none; outline: none; }
.arti-composer-inner:focus-within { border-color: var(--ff-coral); box-shadow: 0 0 0 3px rgba(237,133,120,.35), var(--ff-shadow-md); }
#arti-send {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  background: var(--ff-coral); color: var(--text-on-action); display: grid; place-items: center; padding: 0;
  box-shadow: var(--ff-shadow-sm);
}
#arti-send:hover:not(:disabled) { background: var(--ff-coral-dark); }
#arti-send:disabled { background: #d9c3bd; opacity: .7; }

/* "+" attach button inside the composer pill (left of the input). */
.arti-composer-inner { padding-left: 8px; }
#arti-attach-plus {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 0; background: transparent; color: var(--ff-teal);
  transition: background .12s, color .12s;
}
#arti-attach-plus:hover { background: var(--ff-mint); color: var(--ff-navy); }
#arti-attach-plus:focus-visible { outline: 2px solid var(--ff-coral); outline-offset: 2px; }

/* Drag-&-drop overlay: appears while a file is dragged over the chat panel. */
#arti-panel { position: relative; }
.arti-drop-hint {
  position: absolute; inset: 12px; z-index: 40; pointer-events: none;
  display: none; place-items: center; text-align: center;
  border: 2px dashed var(--ff-coral); border-radius: 20px;
  background: rgba(249, 246, 243, 0.88);
}
#arti-panel.is-dragging .arti-drop-hint { display: grid; }
.arti-drop-hint span {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ff-navy); font-weight: 500; font-size: 16px;
}

/* ── Start-Prompt (per user+client, auto-runs on a new chat) ─────────────── */
.arti-oprompt { position: relative; }
.arti-oprompt > summary, .arti-oprompt-box > summary { list-style: none; cursor: pointer; }
.arti-oprompt > summary::-webkit-details-marker,
.arti-oprompt-box > summary::-webkit-details-marker { display: none; }
.arti-oprompt-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px;
  background: var(--bg-surface); border: 1px solid var(--ff-teal-soft); border-radius: 14px;
  box-shadow: var(--ff-shadow-md); padding: 14px; z-index: 20;
  display: flex; flex-direction: column; gap: 10px;
}
.arti-oprompt-panel form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.arti-oprompt-hint, .arti-oprompt-box p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ff-muted); font-weight: 400; }
.arti-oprompt-hint strong, .arti-oprompt-box strong { font-weight: 500; color: var(--ff-navy); }
.arti-oprompt-text {
  width: 100%; resize: vertical; min-height: 64px; font: inherit; font-size: 14px; font-weight: 400;
  border: 1px solid var(--ff-teal-soft); border-radius: 12px; padding: 10px 12px;
  background: var(--bg-surface); color: var(--ff-ink); outline: none;
}
.arti-oprompt-text:focus { border-color: var(--ff-coral); box-shadow: 0 0 0 3px rgba(237,133,120,.35); }
.arti-oprompt-actions { display: flex; align-items: center; gap: 8px; }
.arti-oprompt-remove { margin: 0; }

/* Body nudge (unset + fresh chat) — quiet by default, expands to a form */
.arti-oprompt-box { align-self: center; text-align: center; margin: 0 0 4px; background: transparent; border: 0; padding: 0; }
.arti-oprompt-box > summary {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--ff-muted); opacity: .7;
}
.arti-oprompt-box > summary:hover { color: var(--ff-teal); opacity: 1; }
.arti-oprompt-box > summary .arti-icon { width: 13px; height: 13px; }
.arti-oprompt-box[open] {
  align-self: stretch; max-width: 100%; margin: 2px 0 8px; text-align: left;
  background: var(--ff-mint-soft); border: 1px solid var(--ff-line);
  border-radius: 12px; padding: 12px 14px;
}
.arti-oprompt-box[open] > summary { margin-bottom: 8px; opacity: 1; color: var(--ff-navy); }
.arti-oprompt-box form { display: flex; flex-direction: column; gap: 10px; margin: 0; }

/* ── Memory suggestion (Arti schlägt vor → Nutzer bestätigt) ─────────────── */
.arti-memsug {
  background: var(--ff-mint); border: 1px solid var(--ff-teal-soft); border-radius: 12px;
  padding: 12px 14px; margin: 4px 0; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: 10px 16px;
}
.arti-memsug-head { display: flex; align-items: flex-start; gap: 8px; min-width: 0; flex: 1; }
.arti-memsug-icon { color: var(--ff-teal); flex: 0 0 auto; margin-top: 1px; }
.arti-memsug-label { font-size: 11px; font-weight: 500; color: var(--ff-muted); }
.arti-memsug-note { font-size: 14px; font-weight: 400; color: var(--ff-navy); }
.arti-memsug-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.arti-memsug-form { margin: 0; }

/* ── Umfang-Karte (propose_scope → Bestätigung vor einem Bericht) ─────────── */
.arti-scope {
  background: var(--ff-mint); border: 1px solid var(--ff-teal-soft); border-radius: 12px;
  padding: 14px 16px; margin: 4px 0; max-width: 720px;
}
.arti-scope-form { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.arti-scope-head { display: flex; align-items: flex-start; gap: 8px; }
.arti-scope-icon { color: var(--ff-teal); flex: 0 0 auto; margin-top: 2px; }
.arti-scope-label { font-size: 11px; font-weight: 500; color: var(--ff-muted); }
.arti-scope-title { font-size: 15px; font-weight: 500; color: var(--ff-navy); }
.arti-scope-request { font-size: 13px; font-weight: 400; color: var(--ff-navy); margin-top: 2px; }
.arti-scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 14px; }
.arti-scope-grid[hidden] { display: none; }   /* display: grid überstimmt sonst [hidden] (Kalenderfelder der Filial-Info) */
.arti-scope-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ff-muted); }
.arti-scope-field input, .arti-scope-field select, .arti-scope-search {
  font: inherit; font-size: 13px; color: var(--ff-navy); background: var(--bg-surface);
  border: 1px solid var(--ff-teal-soft); border-radius: 8px; padding: 6px 8px; min-height: 34px;
}
.arti-scope-hint { font-size: 11.5px; color: var(--ff-muted); line-height: 1.45; }
.arti-scope-stores { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.arti-scope-stores legend { font-size: 12px; color: var(--ff-muted); padding: 0; margin-bottom: 4px; width: 100%; }
.arti-scope-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ff-navy); }
/* ROI-Analyse: Analysezeitraum ab KI-Start | letzte 3 Monate | frei — Von/Bis nur bei „frei“ */
.arti-scope-roi-period { border: 0; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.arti-scope-roi-period legend { font-size: 12px; color: var(--ff-muted); margin-bottom: 4px; }
.arti-scope-roi-period > .arti-scope-hint { flex-basis: 100%; }
.arti-scope-roi-custom { display: none; flex-basis: 100%; }
.arti-scope-roi-period:has(input[value="custom"]:checked) .arti-scope-roi-custom { display: grid; }
.arti-scope-hint.is-error { color: var(--ff-danger, var(--status-error-fg)); font-weight: 500; }
.arti-scope-hint[hidden] { display: none; }
.arti-scope[hidden] { display: none; }
.arti-scope-storelist, .arti-scope-catpick { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.arti-scope-storelist[hidden], .arti-scope-catpick[hidden] { display: none; }
.arti-scope-picktools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arti-scope-tags { display: flex; flex-wrap: wrap; gap: 6px; max-height: 92px; overflow: auto; }
.arti-scope-tag {
  border: 1px solid var(--ff-teal-soft); background: var(--bg-surface); border-radius: 999px; padding: 3px 10px;
  font: inherit; font-size: 12px; color: var(--ff-navy); cursor: pointer;
}
.arti-scope-tag span { color: var(--ff-muted); }
.arti-scope-tag:hover { border-color: var(--ff-navy); }
.arti-scope-tag[aria-pressed="true"] { background: var(--ff-navy); border-color: var(--ff-navy); color: var(--text-on-action); }
.arti-scope-tag[aria-pressed="true"] span { color: rgba(255, 255, 255, .7); }
.arti-scope-storerows { max-height: 220px; overflow: auto; background: var(--bg-surface); border: 1px solid var(--ff-teal-soft); border-radius: 8px; padding: 4px 8px; }
.arti-scope-store { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ff-navy); padding: 3px 0; }
.arti-scope-store[hidden] { display: none; }   /* Suche/Schnellfilter: display: flex überstimmt sonst [hidden] */
.arti-scope-catrow { white-space: pre; }   /* Einzug der Untergruppen wie in der Job-Maske */
.arti-scope-checks { flex-direction: column; align-items: stretch; gap: 4px; }
/* Wareneinsatzanalyse: Warengruppen als aufklappbare Liste mit Häkchen */
.arti-scope-catdd { border: 1px solid var(--ff-border, #E4E7EB); border-radius: 10px; background: #fff; }
.arti-scope-catdd > summary { cursor: pointer; padding: 7px 12px; list-style: none; }
.arti-scope-catdd > summary::-webkit-details-marker { display: none; }
.arti-scope-catdd > summary::after { content: " ▾"; color: var(--ff-muted); }
.arti-scope-catdd[open] > summary::after { content: " ▴"; }
.arti-scope-catlist { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow: auto; padding: 4px 12px 10px; }
.arti-scope-cat { display: flex; align-items: center; gap: 8px; }
.arti-scope-point { align-items: flex-start; }
.arti-scope-point input { margin-top: 3px; }
.arti-scope-point .arti-scope-hint { display: block; }
.arti-scope-savechecks { margin-top: 6px; }
.arti-scope-assumptions { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ff-navy); font-weight: 400; }
.arti-scope-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.arti-scope-actions .arti-pillbtn-primary { display: inline-flex; align-items: center; gap: 6px; }

/* ── Analyst ⇄ CSM mode toggle (CSMs only) ───────────────────────────────── */
.arti-mode { display: inline-flex; align-items: center; border: 1px solid var(--ff-teal-soft); border-radius: 9999px; overflow: hidden; background: var(--bg-surface); }
.arti-mode-form { margin: 0; display: inline-flex; }
.arti-mode-opt {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent;
  color: var(--ff-muted); font: inherit; font-size: 12px; font-weight: 500; padding: 6px 12px;
  cursor: pointer; white-space: nowrap;
}
.arti-mode-opt:hover { color: var(--ff-navy); }
.arti-mode-opt.is-active { background: var(--ff-navy); color: var(--text-on-action); }

/* Legacy: a Tages-Status folded into an OLD chat's opening turn (feature removed 2026-09). */
.arti-briefing-turn-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  color: var(--ff-teal); margin-bottom: 5px;
}

/* ── "Vorgehen": collapsed inter-round process narration ─────────────────── */
.arti-steps { align-self: flex-start; max-width: 90%; margin: 0; }
.arti-steps-summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--ff-muted); padding: 3px 2px;
}
.arti-steps-summary::-webkit-details-marker { display: none; }
.arti-steps-summary::before { content: "▸"; font-size: 9px; color: var(--ff-teal); }
.arti-steps[open] .arti-steps-summary::before { content: "▾"; }
.arti-steps-count {
  font-weight: 400; font-size: 11px; color: var(--ff-teal);
}
.arti-steps-body {
  margin: 4px 0 2px; padding: 10px 12px; border-left: 2px solid var(--ff-line);
  background: var(--ff-mint-soft); border-radius: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.arti-steps-item { font-size: 13px; line-height: 1.5; color: var(--ff-muted); }
.arti-steps-item :first-child { margin-top: 0; }
.arti-steps-item :last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════════
   Mobile (≤640px) — content fitting. The shell (top bar + drawer) has its own
   rules in the Shell block below (≤900px).
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* ── Suggestion chips: one swipeable row (no wall of chips) ───────────── */
  #arti-chips {
    flex-wrap: nowrap; overflow-x: auto; margin: 6px -14px 10px; padding: 0 14px;
    scrollbar-width: none; justify-content: flex-start;
  }
  #arti-chips::-webkit-scrollbar { display: none; }
  .arti-chip { flex: 0 0 auto; min-height: 38px; white-space: nowrap; }

  /* ── Body / hero / bubbles ───────────────────────────────────────────── */
  #arti-body { padding: 16px 14px 12px; }
  .arti-hero-wordmark { width: 148px; }
  .arti-bubble { font-size: 14.5px; }

  /* ── Widgets fit the narrow viewport ─────────────────────────────────── */
  .arti-assistant table { display: block; overflow-x: auto; white-space: nowrap; }
  .arti-chart-wrap { height: 200px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card .kpi-now { font-size: 21px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Shell — Redesign 2026-09 („Arti Chat 1"): weiße Topbar (Marke + Titel +
   gebundener Kunde, Menüs rechts), dunkle Sidebar darunter, Teiggrau-Canvas.
   Poppins 300 (Body) + 500 (Betonung). Ordner/Umbenennen/Löschen aus dem
   Mockup sind bewusst NICHT gebaut (kein Backend).
   ═══════════════════════════════════════════════════════════════════════ */
.arti-app {
  display: flex; flex-direction: column; height: 100vh; width: 100%; overflow: hidden;
  background: var(--ff-cream); color: var(--ff-navy);
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 400;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */

/* Round icon button / account pill (top bar + modal close) */
.arti-iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 999px; border: 1px solid var(--ff-teal-soft); background: var(--bg-surface); color: var(--ff-navy);
  cursor: pointer; padding: 0; list-style: none; transition: background .14s;
}
.arti-iconbtn:hover { background: var(--ff-cream); }
.arti-iconbtn::-webkit-details-marker { display: none; }
.arti-iconbtn-plain { border: 0; width: 32px; height: 32px; color: var(--ff-muted); }

/* ── Dropdown menus (<details class="arti-menu">) ─────────────────────────── */
@keyframes arti-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.arti-menu { position: relative; }
.arti-menu > summary { list-style: none; }
.arti-menu > summary::-webkit-details-marker { display: none; }
.arti-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px;
  background: var(--bg-surface); color: var(--ff-navy); border: 1px solid var(--ff-teal-soft); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(30, 65, 80, .12), 0 4px 10px rgba(30, 65, 80, .05);
  padding: 6px; z-index: 40; animation: arti-in .22s cubic-bezier(.22, .61, .36, 1);
  font-size: 13px; font-weight: 400; text-align: left;
}
.arti-menu-label { padding: 8px 12px 4px; font-size: 11px; font-weight: 500; color: var(--ff-muted-2); }
.arti-menu-head { padding: 10px 12px 8px; }
.arti-menu-head-title { font-size: 13px; font-weight: 500; }
.arti-menu-head-sub { font-size: 11.5px; color: var(--ff-muted); line-height: 1.45; margin-top: 2px; }
.arti-menu-divider { height: 1px; background: var(--ff-teal-soft); margin: 6px 8px; }
.arti-menu-form { margin: 0; display: block; }
.arti-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px;
  border: 0; border-radius: 8px; background: transparent; color: var(--ff-navy);
  font: inherit; font-size: 13px; font-weight: 400; line-height: 1.3; text-align: left; text-decoration: none; cursor: pointer;
  transition: background .12s;
}
.arti-menu-item:hover { background: var(--ff-cream); }
.arti-menu-item .arti-icon { color: var(--ff-navy); flex: 0 0 auto; }
.arti-menu-item.is-active { background: var(--ff-mint); font-weight: 500; }
.arti-menu-meta { margin-left: auto; font-size: 11px; color: var(--ff-muted-2); white-space: nowrap; }

/* ── Shell: sidebar + panel ──────────────────────────────────────────────── */
.arti-shell { flex: 1 1 auto; display: flex; min-height: 0; width: 100%; }
#arti-panel { flex: 1 1 auto; min-width: 0; width: auto; height: 100%; background: var(--ff-cream); }



/* „Automatische Läufe“ unter „Geplante Jobs“ (Feedback 27.10.2026; vorher unter Insights). */

/* Turbo-Stream replace targets keep their old ids/classes — neutral wrappers here. */

/* ── Main: hero / messages / composer ────────────────────────────────────── */
#arti-body { padding: 32px 24px 24px; background: transparent; }
.arti-content { max-width: 820px; gap: 12px; }
.arti-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; padding: 40px 16px 20px; margin: 0; }
.arti-hero-mark { height: 44px; width: auto; opacity: .9; margin-bottom: 22px; user-select: none; -webkit-user-drag: none; }
.arti-hero-title { margin: 0 0 12px; font-size: 36px; font-weight: 400; letter-spacing: -.02em; line-height: 1.1; color: var(--ff-navy); }
.arti-hero-sub { margin: 0; max-width: 460px; font-size: 17px; line-height: 1.55; color: var(--ff-muted); font-weight: 400; text-align: center; }
#arti-chips { justify-content: center; margin: 4px 0 6px; }
.arti-chip-waste { background: var(--ff-navy); border-color: var(--ff-navy); color: var(--ff-cream); }
.arti-chip-waste:hover { background: var(--ff-teal); border-color: var(--ff-teal); color: var(--text-on-action); }

#arti-messages { gap: 14px; }
/* User: navy bubble, right-aligned. */
.arti-bubble.arti-user {
  max-width: 70%; padding: 12px 16px; border-radius: 16px 16px 4px 16px; font-size: 14.5px; line-height: 1.5;
  box-shadow: none; animation: arti-in .22s cubic-bezier(.22, .61, .36, 1);
}
/* Arti: plain prose with the mark as avatar on the left. */
.arti-bubble.arti-assistant { position: relative; padding-left: 40px; font-size: 15px; line-height: 1.6; animation: arti-in .22s cubic-bezier(.22, .61, .36, 1); }
/* Avatar = Toast (Nicole, 17.11.2026): etwas größer als das alte Zeichen; solange Arti
   arbeitet, bewegen sich die Balken (arti-toast-loading.svg), die fertige Antwort steht still. */
.arti-bubble.arti-assistant::before,
.arti-activity::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 30px; height: 22px;
  background: url("/assets/arti-toast-90762bfd.svg") left center / contain no-repeat;
}
.arti-activity::before { top: 2px; background-image: url("/assets/arti-toast-loading-afd7bbaf.svg"); }
.arti-env-staging .arti-bubble.arti-assistant::before { background-image: url("/assets/arti-toast-staging-75f09ffd.svg"); }
.arti-env-staging .arti-activity::before { background-image: url("/assets/arti-toast-loading-staging-62cbe879.svg"); }
.arti-bubble.arti-assistant:empty::before { display: none; }
/* Widgets of a turn line up with the answer text (avatar column stays free). */
#arti-messages > .arti-result, #arti-messages > .arti-steps, #arti-messages > .arti-memsug, #arti-messages > .arti-scope,
#arti-messages > .arti-action, #arti-messages > .arti-action-group, #arti-messages > .arti-adopt { margin-left: 40px; }
/* Thinking line: animated toast avatar + status (the bars replace the three dots). */
@keyframes arti-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.arti-activity { position: relative; padding: 0 0 0 40px; margin: 0; min-height: 26px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.arti-activity > .arti-thinking { min-height: 26px; }
/* Second line: the model's one-sentence note on why (empty → hidden). Each
   line stays one line — the panel never grows beyond two. */
.arti-activity-note:empty { display: none; }
.arti-activity-note, .arti-activity [data-activity-target="label"] {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.arti-activity > .arti-thinking { max-width: 100%; }
.arti-activity .arti-activity-elapsed { flex-shrink: 0; }
.arti-activity-note { max-width: 100%; font-size: 12.5px; color: var(--ff-muted-2); padding-left: 2px; }
.arti-activity .arti-thinking { color: var(--ff-muted); font-size: 13px; gap: 10px; }
/* Tables: sand card with a cream header row (design). */
.arti-assistant th, .arti-result-table th { background: var(--ff-cream-50); }
.arti-result-table tbody tr:hover { background: var(--ff-cream-50); }

/* Composer — white pill over a cream fade; context card above; disclaimer below. */
#arti-composer { padding: 0 24px 22px; border-top: 0; background: linear-gradient(to bottom, rgba(242, 235, 227, 0), var(--ff-cream) 40%); }
.arti-composer-col { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.arti-attach-status { max-width: none; margin: 0; }
.arti-composer-inner {
  max-width: none; margin: 0; display: flex; align-items: flex-end; gap: 8px;
  background: var(--bg-surface); border: 1px solid var(--ff-teal-soft); border-radius: 18px; padding: 8px 8px 8px 10px;
  box-shadow: var(--ff-shadow-md);
}
.arti-composer-inner:focus-within { border-color: var(--ff-navy); box-shadow: 0 0 0 3px rgba(237, 133, 120, .35), var(--ff-shadow-md); }
#arti-attach-plus { width: 36px; height: 36px; color: var(--ff-muted); }
#arti-attach-plus:hover { background: var(--ff-cream); color: var(--ff-navy); }
#arti-input { flex: 1 1 auto; width: auto; min-width: 0; padding: 8px 4px; font-size: 15px; min-height: 36px; }
#arti-input::placeholder { color: var(--ff-muted-2); }
.arti-ctxbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; margin-bottom: 2px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--ff-teal-soft); background: transparent; color: var(--ff-muted);
  font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; flex: 0 0 auto; transition: background .14s, border-color .14s;
}
.arti-ctxbtn:hover, .arti-ctxbtn.is-active { background: var(--ff-cream); border-color: var(--ff-navy); }
#arti-send { position: static; transform: none; width: 38px; height: 38px; box-shadow: none; }
#arti-stop {
  display: none; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0;
  background: var(--ff-navy); color: var(--text-on-action); place-items: center; cursor: pointer; transition: background .15s, opacity .15s;
}
#arti-stop svg { fill: currentColor; }
#arti-stop:hover:not(:disabled) { background: #000; }
#arti-stop:disabled { opacity: .55; cursor: progress; }
.arti-turn-running #arti-stop { display: grid; }
.arti-turn-running #arti-send { display: none; }
.arti-composer-note { text-align: center; font-size: 11.5px; color: var(--ff-muted-2); }
.arti-context {
  background: var(--bg-surface); border: 1px solid var(--ff-teal-soft); border-radius: 14px; padding: 14px 16px;
  box-shadow: var(--ff-shadow-md); animation: arti-in .22s cubic-bezier(.22, .61, .36, 1);
}
.arti-context[hidden] { display: none; }
.arti-context-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.arti-context-title { font-size: 13px; font-weight: 500; }
.arti-textbtn { border: 0; background: transparent; color: var(--ff-teal); font: inherit; font-size: 12px; cursor: pointer; padding: 0; }
.arti-textbtn:hover { color: var(--ff-coral); }
.arti-context-grid { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-size: 12.5px; line-height: 1.55; color: var(--ff-muted); }
.arti-context-grid dt { font-weight: 500; color: var(--ff-navy); }
.arti-context-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* Angeheftete Analyse-Regeln des Chats (pin_rule) — als entfernbare Chips. */
.arti-rule-list { display: flex; flex-wrap: wrap; gap: 6px; }
.arti-rule { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px;
  border: 1px solid var(--ff-line); border-radius: 999px; background: var(--ff-cream-50);
  color: var(--ff-navy); font-size: 12px; line-height: 1.45; }
.arti-rule-x { border: 0; background: none; cursor: pointer; padding: 0 4px; line-height: 1;
  font-size: 14px; color: var(--ff-muted-2); border-radius: 999px; }
.arti-rule-x:hover { color: var(--ff-navy); background: var(--ff-cream-200); }

/* ── Turn actions / watchdog / viz escape hatch (Chat-Analyse 2026-09) ───── */
.arti-turn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -4px 0 4px 40px; }
.arti-turn-actions:empty { display: none; }
.arti-turn-actions .arti-textbtn { display: inline-flex; align-items: center; gap: 5px; color: var(--ff-muted-2); text-decoration: none; }
.arti-turn-actions .arti-textbtn:hover { color: var(--ff-teal); }
.arti-turn-actions .arti-textbtn .arti-icon { color: inherit; }
.arti-chip-retry { padding: 5px 12px; font-size: 12px; }
.arti-chip-retry .arti-icon { color: var(--ff-teal); }
/* The panel is a column flexbox: no flex-wrap here, or the hint wraps into a
   second column beside the panel and the chat scrolls sideways. */
.arti-activity { row-gap: 4px; }
.arti-activity-hint { max-width: 100%; font-size: 12.5px; color: var(--ff-muted); }
.arti-activity-hint[hidden] { display: none; }
.arti-activity-hint .arti-textbtn { font-size: 12.5px; font-weight: 500; margin-left: 4px; }
.arti-viz-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.arti-viz-open { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.arti-viz-open .arti-icon { color: inherit; }
@media (max-width: 640px) { .arti-turn-actions { margin-left: 0; } }

/* ── Gedächtnis modal (<dialog>) ─────────────────────────────────────────── */
.arti-modal { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; color: var(--ff-navy); }
.arti-modal::backdrop { background: rgba(30, 65, 80, .6); }
.arti-modal[open] { display: grid; place-items: center; width: 100vw; height: 100vh; margin: 0; inset: 0; }
.arti-modal-box {
  width: 600px; max-width: calc(100vw - 48px); max-height: calc(100vh - 48px); overflow-y: auto;
  background: var(--bg-surface); border-radius: 20px; box-shadow: 0 14px 40px rgba(30, 65, 80, .2); padding: 28px 28px 24px;
  animation: arti-in .22s cubic-bezier(.22, .61, .36, 1);
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif; font-weight: 400;
}
.arti-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.arti-modal-title { margin: 0; font-size: 24px; font-weight: 400; letter-spacing: -.02em; }
.arti-modal-lead { margin: 0 0 18px; font-size: 13.5px; color: var(--ff-muted); line-height: 1.55; }
.arti-modal-lead strong { font-weight: 500; color: var(--ff-navy); }
.arti-modal-form { display: flex; flex-direction: column; margin: 0; }
.arti-modal-text {
  width: 100%; min-height: 120px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--ff-teal-soft);
  font: inherit; font-size: 14px; font-weight: 400; color: var(--ff-navy); resize: vertical; line-height: 1.5; outline: none;
}
.arti-modal-text:focus { border-color: var(--ff-navy); box-shadow: 0 0 0 3px rgba(237, 133, 120, .35); }
.arti-modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 20px; }
.arti-modal-remove { margin: 0 auto 0 0; }
.arti-memory-seg { margin: 0 0 16px; }
.arti-memory-level[hidden] { display: none; }
.arti-memory-readonly { white-space: pre-wrap; resize: none; background: var(--ff-cream-50); }
.arti-memory-hint { margin: 8px 0 0; font-size: 12px; font-weight: 300; color: var(--ff-muted); line-height: 1.45; }
.arti-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 18px;
  border-radius: 999px; border: 1px solid transparent; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .14s, color .14s;
}
.arti-btn-primary { background: var(--ff-coral); color: var(--text-on-action); }
.arti-btn-primary:hover { background: #D86A5C; }
.arti-btn-outline { background: transparent; border-color: var(--ff-navy); color: var(--ff-navy); }
.arti-btn-outline:hover { background: var(--ff-cream); }
.arti-btn-ghost { background: transparent; color: var(--ff-muted); padding: 0 10px; }
.arti-btn-ghost:hover { color: var(--status-error-fg); }

/* ── Mobile (≤900px): sidebar becomes a drawer, burger in the top bar ────── */
@media (max-width: 900px) {
  #arti-panel { width: 100%; }
}
@media (max-width: 640px) {
  .arti-hero { padding: 20px 8px 12px; }
  .arti-hero-title { font-size: 28px; }
  .arti-hero-sub { font-size: 15px; }
  .arti-bubble.arti-assistant { padding-left: 0; }
  .arti-bubble.arti-assistant::before { display: none; }
  #arti-messages > .arti-result, #arti-messages > .arti-steps, #arti-messages > .arti-memsug, #arti-messages > .arti-scope,
  #arti-messages > .arti-action, #arti-messages > .arti-action-group, #arti-messages > .arti-adopt { margin-left: 0; }
  .arti-bubble.arti-user { max-width: 86%; }
  #arti-composer { padding: 0 12px 14px; }
  #arti-input { font-size: 16px; }   /* prevents iOS zoom-on-focus */
  .arti-ctxbtn span, .arti-ctxbtn { font-size: 0; gap: 0; padding: 0 9px; }
  .arti-ctxbtn .arti-icon { font-size: 14px; }
  .arti-composer-note { display: none; }
}

/* ═══ Last Crumb in Navigation und Topbar (12.11.2026) ═════════════════════
   Navigation (`nav.ff-nav`), Topbar (`header.ff-topbar`), Menüs (`<ff-menu>`),
   Kundenwechsel (`<ff-popover>` + `<ff-searchable-list>`, Muster „Account-Auswahl“)
   kommen aus vendor/last-crumb. Hier steht nur
   1. der App-Rahmen (Muster docs/patterns/app-rahmen.md: Raster bleibt Projektcode),
   2. was Last Crumb (0.8.0) noch nicht hat — laut Arti-Abgleich: Chat-Verlauf (A9),
      Ordner-Baum (A10), Suche auf dunklem Grund (A11), Untereintrag mit ⋯ (A8).
   Nur Tokens, keine Hex-Werte (GUIDE.md, Regel 2). Der Chat selbst ist unverändert. */

/* 1. App-Rahmen: Navigation links über beide Zeilen, Topbar und Chat rechts. */
.arti-app {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
  gap: var(--sp-3); height: 100vh; height: 100dvh; padding: var(--sp-3); box-sizing: border-box;
  background: var(--bg-page);
}
.arti-shell { display: contents; }   /* Navigation und Chat sind im Markup Geschwister */
/* Sprach-Dialog (Konto-Menü): der <ff-modal>-Rahmen ist kein Grid-Element; der <dialog> liegt offen im Top-Layer. */
#arti-language-modal { display: contents; }
/* Last Crumb setzt Text in 400 (Poppins 300 liefert es nicht aus); .arti-app erbt sonst 300. */
.arti-sidebar, .arti-topbar, .arti-app .ff-menu, .arti-app .ff-popover { font-weight: 400; }
.arti-app > .arti-topbar { grid-column: 2; grid-row: 1; }
.arti-app .arti-sidebar { grid-column: 1; grid-row: 1 / span 2; min-height: 0; }
/* 280 px wie die ARTi-Sidebar vor Last Crumb (Standard dort: 248 px). Untereinträge sind
   32 px eingerückt und haben ein eigenes ⋯ — bei 248 px wurde z. B. „Produktionsplan-Hinweis“
   abgeschnitten. Last Crumb sieht die Anpassung über --ff-nav-width vor (nav.md). */
.arti-sidebar { --ff-nav-width: 280px; }
.arti-app #arti-panel { grid-column: 2; grid-row: 2; height: auto; min-height: 0; border-radius: var(--radius-lg); }

/* Topbar: links der Kunde des Chats (die Topbar von Last Crumb hat dafür keinen Teil). */
.arti-topbar-brand { min-width: 0; }
.arti-topbar-client {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-heading); font-size: var(--fs-section, 16px); font-weight: 500;
}

/* Navigation: Marke, Schließen-Knopf nur in der mobilen Schublade. */
.arti-nav-mark { flex: none; width: auto; height: 22px; }
.arti-nav-close { display: none; }
/* Die Liste oben (Neuer Chat, Berichte, Insights, Jobs) scrollt bei Bedarf selbst,
   die Chats darunter behalten Platz, der Fuß bleibt sichtbar (Copilot-Review #208). */
.arti-sidebar > .ff-nav__list { flex: 0 1 auto; }
.arti-nav-form { margin: 0; }
.arti-nav-primary { background: var(--nav-item-selected); color: var(--nav-fg-active); font-weight: 500; }
.arti-sb-report-sep { height: 1px; margin: var(--sp-1) 0 var(--sp-1) 32px; background: var(--nav-border); list-style: none; }
.arti-sb-divider { flex: none; height: 1px; margin: 0 10px; background: var(--nav-border); }

/* 2a. Untereintrag mit ⋯ (A8) und Chat-Zeilen: Zeile + Ghost-Icon-Button auf dunklem Grund. */
.arti-nav-subrow, .arti-nav-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.arti-nav-subrow > .ff-nav__subitem { flex: 1; min-width: 0; width: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arti-nav-row > .ff-nav__item, .arti-nav-row > .ff-nav__group { flex: 1; min-width: 0; }
/* Ordner: das ⋯ bleibt an der Kopfzeile, auch wenn der Ordner aufgeklappt ist. */
.arti-sb-folder-row { align-items: flex-start; }
.arti-sb-folder-row > ff-menu { margin-top: 4px; }
.arti-nav-dots { flex: none; color: var(--nav-fg-subtle); }
.arti-nav-dots:hover, .arti-nav-dots[aria-expanded="true"] { background: var(--nav-item-hover); color: var(--nav-fg-active); }
.arti-nav-dots:focus-visible { outline: 2px solid var(--focus-on-inverse); outline-offset: 2px; }

/* 2b. Chat-Verlauf (A9): Überschrift mit „+ Ordner“, zweizeilige Einträge. */
.arti-nav-chats { flex: 1 1 auto; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; padding: var(--sp-2) 10px; }
.arti-sidebar .arti-chats-panel {            /* früheres Dropdown — hier ein normaler Block */
  position: static; width: auto; max-height: none; overflow: visible;
  background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0;
}
.arti-nav-heading {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-1) 10px var(--sp-2); color: var(--nav-fg-subtle); font-size: var(--fs-caption); font-weight: 500;
}
.arti-nav-headbtn {
  display: inline-flex; align-items: center; gap: var(--sp-1); padding: 2px var(--sp-2);
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--nav-fg-subtle);
  font: inherit; cursor: pointer;
}
.arti-nav-headbtn:hover { background: var(--nav-item-hover); color: var(--nav-fg-active); }
.arti-nav-entry { flex-direction: column; align-items: stretch; justify-content: center; gap: 0; padding-block: 6px; line-height: 1.3; }
.arti-nav-entry-title, .arti-nav-entry-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arti-nav-entry-meta { color: var(--nav-fg-subtle); font-size: var(--fs-micro); }
.arti-nav-chatlist, .arti-nav-children { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.arti-nav-empty { margin: 0; padding: var(--sp-2) 10px; color: var(--nav-fg-subtle); font-size: var(--fs-control); list-style: none; }
.arti-sb-hiddenform { display: none; }
.arti-sb-chat[hidden], .arti-sb-folder-row[hidden] { display: none; }

/* 2c. Ordner-Baum (A10): Ordner, Kunde → Job → Lauf mit Zähler und Einrückung. */
.arti-nav-count { flex: none; color: var(--nav-fg-subtle); font-size: var(--fs-micro); font-variant-numeric: tabular-nums; }
.arti-nav-node .arti-nav-children { padding-inline-start: var(--sp-3); }
.arti-nav-tree .ff-nav__subitem, .arti-nav-node .ff-nav__subitem { margin-inline-start: 0; width: 100%; }
.arti-nav-tree { padding-inline-start: 32px; }
.arti-nav-tree .ff-icon { flex: none; }
.arti-nav-subheading { margin: var(--sp-2) 0 2px; padding: 0 10px; color: var(--nav-fg-subtle); font-size: var(--fs-micro); font-weight: 500; }

/* 2d. Suche auf dunklem Grund (A11): `.ff-search` mit Navigations-Tokens. */
.arti-nav-filter { padding: 0 0 var(--sp-2); }
.arti-nav-search .ff-input { background: var(--nav-item-hover); border-color: var(--nav-border); color: var(--nav-fg-active); }
.arti-nav-search .ff-input::placeholder { color: var(--nav-fg-subtle); }
.arti-nav-search > .ff-icon { color: var(--nav-fg-subtle); }
.arti-nav-search .ff-input:focus { border-color: var(--focus-on-inverse); outline: none; }

/* Fuß: Kundenwechsel + ⚙ nebeneinander. */
.arti-sb-foot { align-items: center; gap: var(--sp-1); }
.arti-sb-foot > .arti-sb-client { flex: 1 1 auto; min-width: 0; }
.arti-sb-foot > .arti-sb-settings { flex: none; }
.arti-sb-client-static { cursor: default; }
/* Langer Kundenname: Last Crumb kürzt im Muster nur die zweite Zeile (<small>). */
.arti-sb-client-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arti-sb-client-static:hover { background: transparent; }
.arti-client-switch .ff-searchable-list__item { width: 100%; border: 0; background: transparent; font: inherit; text-align: start; cursor: pointer; }
.arti-client-switch-failed { align-self: center; max-width: 840px; margin: 4px auto 12px; }

/* 3. Hintergrund, Begrüßung und Login (12.11.2026, Arti-Abgleich B1, B2, G2, G3, I5).
   Die Chat-Fläche ist eine weiße Fläche mit Rahmen wie die Topbar (App-Rahmen), der
   Verlauf über dem Eingabefeld läuft ins Weiß statt ins Teiggrau aus. */
body.arti-standalone { background: var(--bg-page); color: var(--text-primary); }
#arti-panel { --ff-bg: var(--bg-surface); --ff-bg-bottom: var(--bg-surface); --ff-bg-gradient: var(--bg-surface);
              background: var(--bg-surface); }
.arti-app #arti-panel { border: 1px solid var(--border-default); }
#arti-composer { background: linear-gradient(to bottom, transparent, var(--bg-surface) 40%); }
.arti-hero-mark { height: 40px; opacity: 1; margin-bottom: var(--sp-4); }
.arti-hero-title { margin: 0 0 var(--sp-2); font-size: var(--fs-page-title); font-weight: 500; letter-spacing: normal; line-height: 1.25; color: var(--text-heading); }
.arti-hero-sub { max-width: 460px; font-size: var(--fs-body); font-weight: 400; line-height: 1.5; color: var(--text-secondary); }
/* safe center: wenn die Vorschläge mobil seitlich scrollen, bleibt der erste erreichbar
   (mit „center“ lag er links außerhalb und ließ sich nicht hinscrollen). */
#arti-chips { gap: var(--sp-2); justify-content: safe center; }
/* Login: weiße Karte mittig auf dem Seitengrund (Last Crumb hat kein Login-Muster). */
#arti-panel.arti-login-page { height: 100vh; height: 100dvh; background: var(--bg-page); overflow-y: auto; }
.arti-login-page #arti-body { display: grid; place-items: center; min-height: 100%; padding: var(--sp-6) var(--sp-4); }
.arti-login-page .arti-content { width: 100%; max-width: 440px; }
.arti-gate {
  gap: var(--sp-3); max-width: none; margin: var(--sp-4) 0 0; padding: var(--sp-8) var(--sp-6);
  background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: var(--radius-lg);
}
.arti-gate .ff-page-title { margin: 0; }
.arti-gate-form .ff-btn { justify-content: center; }

/* 4. Hinweise und Meldungen: Last Crumb `.ff-notice` (Arti-Abgleich G2, G3). Die
   Komponenten von Last Crumb liegen in @layer und würden das hidden-Attribut sonst
   überstimmen (z. B. der Montags-Hinweis im Job-Dialog, den JavaScript ein- und ausblendet). */
.ff-notice[hidden], .ff-btn[hidden], .ff-pill[hidden], .ff-card[hidden] { display: none; }
.arti-sched-readonly, .arti-job-warn { margin: var(--sp-2) 0; }

/* Mobil (unter 1.024 px wie Last Crumb): Navigation als Schublade über dem Chat,
   geöffnet über den Menü-Button der Topbar, geschlossen über ✕ oder den Rand. */
.arti-sb-scrim { display: none; }
@media (max-width: 1023.98px) {
  .arti-app { grid-template-columns: minmax(0, 1fr); padding: var(--sp-2); gap: var(--sp-2); }
  .arti-app > .arti-topbar, .arti-app #arti-panel { grid-column: 1; }
  .arti-app .arti-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60; width: min(var(--ff-nav-width), calc(100vw - 56px));
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    transform: translateX(-100%); transition: transform var(--dur-base) var(--ease-out);
  }
  .arti-app.is-drawer-open .arti-sidebar { transform: none; box-shadow: var(--shadow-modal); }
  .arti-nav-close { display: inline-flex; }
  .arti-sb-scrim {
    display: block; position: fixed; inset: 0; z-index: 55; background: var(--scrim-modal);
    opacity: 0; pointer-events: none; transition: opacity var(--dur-base) var(--ease-out);
  }
  .arti-app.is-drawer-open .arti-sb-scrim { opacity: 1; pointer-events: auto; }
}
@media (max-width: 639.98px) {
  .arti-app { padding: 0; gap: 0; }
  .arti-app > .arti-topbar, .arti-app #arti-panel { border-radius: 0; }
}

/* "Neue Analyse" pending notice — shown above the client picker so it's clear an
   analysis runs right after the pick. Optik: Last Crumb `.ff-notice--info`. */
.arti-analysis-pending { align-self: center; max-width: 840px; margin: 4px auto 12px; }
.arti-analysis-pending strong { font-weight: 500; }

/* ── Automatisierungen (/schedules): Verwaltung der bakery-web ScheduledJobs ── */

.arti-sched-clientpick { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; font-size: 13px; }
.arti-sched-clientpick label { color: var(--ff-muted); font-weight: 600; }
.arti-sched-clientpick select {
  padding: 6px 10px; border: 1px solid var(--ff-teal-soft); border-radius: 8px;
  background: var(--bg-surface); font: inherit; color: var(--ff-navy);
}

/* Die Zeilen (nowrap-Zeitplan, Toggle, Löschen) brauchen mehr Platz als der
   1040px-Editor-Rahmen — auf breiten Screens darf die Seite wachsen; erst
   darunter greift das overflow-x-Scrollen der .arti-result-table. */
.arti-schedules { max-width: 1400px; }
.arti-schedules .arti-result-table { margin-top: 6px; }
/* Job-Tabelle: linksbündig wie die Kopfzeile (die Ergebnistabelle richtet Zahlen rechts aus),
   Name/Auftrag dürfen umbrechen, die übrigen Spalten bleiben einzeilig. */
.arti-schedules .arti-result-table th, .arti-schedules .arti-result-table td { text-align: left; vertical-align: middle; }
.arti-schedules .arti-result-table td:first-child { white-space: normal; min-width: 260px; max-width: 520px; }
.arti-schedules .arti-result-table td:not(:first-child) { font-variant-numeric: normal; }
.arti-sched-prompt { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.arti-sched-editrow > td { white-space: normal; }
.arti-sched-empty { color: var(--ff-muted); text-align: center; padding: 22px 8px !important; }
.arti-schedules tr.is-disabled td { opacity: .55; }
.arti-sched-name strong { color: var(--ff-navy); }
.arti-sched-prompt { color: var(--ff-muted); font-size: 12px; margin-top: 2px; max-width: 520px; }
.arti-sched-schedule { white-space: nowrap; }
.arti-sched-next { color: var(--ff-muted); font-size: 11.5px; }
.arti-sched-status.is-successful { color: #1d6f42; }
.arti-sched-status.is-failed { color: var(--status-error-fg); }

/* Toggle (button_to renders a form + button) */
.arti-sched-toggle {
  width: 36px; height: 20px; border-radius: 999px; border: 1px solid var(--ff-teal-soft);
  background: #d8dee2; padding: 1px; cursor: pointer; display: inline-flex; align-items: center;
}
.arti-sched-toggle .arti-sched-knob {
  width: 16px; height: 16px; border-radius: 50%; background: var(--bg-surface); transition: transform .15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.arti-sched-toggle.is-on { background: var(--ff-teal); }
.arti-sched-toggle.is-on .arti-sched-knob { transform: translateX(15px); }
.arti-sched-delete { padding: 5px 8px; color: var(--status-error-fg); }
.arti-sched-rowactions { display: flex; align-items: center; gap: 6px; }
.arti-sched-mailpreview { padding: 5px 8px; }

/* Anlegen-Formular */
.arti-sched-new { margin-top: 18px; }
.arti-sched-new > summary { display: inline-flex; }
/* Vorlagen-Pills neben „Neue Automatisierung“ (füllen das Formular vor) */
.arti-sched-templates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.arti-sched-templates-label { font-size: 12px; color: var(--ff-muted); margin-right: 2px; }
.arti-sched-template { text-decoration: none; padding: 5px 11px; font-size: 12px; }
.arti-sched-template.is-active { border-color: var(--ff-navy); background: var(--ff-cream); }
.arti-sched-form {
  margin-top: 12px; padding: 16px; border: 1px solid var(--ff-teal-soft); border-radius: 12px;
  background: var(--bg-surface); display: flex; flex-direction: column; gap: 12px; max-width: none; width: 100%;
}
.arti-sched-form textarea { width: 100%; }
.arti-sched-form input[type="text"] { width: 100%; }
.arti-sched-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--ff-navy); }
.arti-sched-form input[type="text"], .arti-sched-form input[type="time"], .arti-sched-form textarea {
  padding: 8px 10px; border: 1px solid var(--ff-teal-soft); border-radius: 8px; font: inherit; font-weight: 400;
}
.arti-sched-form-row { display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap; }
.arti-sched-days { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; align-items: center; }
.arti-sched-days legend { font-size: 13px; font-weight: 600; color: var(--ff-navy); margin-bottom: 4px; }
.arti-sched-day { position: relative; }
.arti-sched-day input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.arti-sched-day span {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 28px;
  border: 1px solid var(--ff-teal-soft); border-radius: 8px; font-size: 12.5px; color: var(--ff-muted);
}
.arti-sched-day input:checked + span { background: var(--ff-teal); border-color: var(--ff-teal); color: var(--text-on-action); }
.arti-sched-form-actions { display: flex; align-items: center; gap: 14px; }
.arti-sched-hint { color: var(--ff-muted); font-size: 12px; max-width: 420px; }

/* Automatisierungen: Zeile anklicken → Bearbeiten-Formular klappt darunter auf */
.arti-sched-row { cursor: pointer; }
.arti-sched-row:hover td { background: var(--ff-cream-50); }
.arti-sched-row.is-editing td { background: var(--ff-cream-50); }
.arti-sched-editrow > td { padding: 0 10px 0; border-bottom: 1px solid var(--ff-table-line); }
.arti-sched-edit > summary { display: none; }
.arti-sched-edit[open] { padding: 4px 0 12px; }
.arti-sched-editrow:has(.arti-sched-edit:not([open])) > td { padding: 0; border-bottom: 0; }
.arti-sched-hint-click { color: var(--ff-muted); font-size: 12px; margin: 6px 0 0; }

/* Mail-Bausteine über dem Auftrag (Prompt) – Klick fügt "### Baustein" unter "## Mail" ein */
.arti-sched-blocks { display: flex; flex-direction: column; gap: 6px; }
.arti-sched-blocks-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12px; color: var(--ff-muted); font-weight: 400; }
.arti-sched-blocks-head strong { color: var(--ff-navy); font-weight: 600; font-size: 13px; }
.arti-sched-blocks-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.arti-sched-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--ff-teal-soft); background: var(--bg-surface); color: var(--ff-navy);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; line-height: 1.3;
}
.arti-sched-chip:hover { background: var(--ff-teal-soft); }
.arti-sched-chip small { font-weight: 400; color: var(--ff-muted); }
.arti-sched-blocks textarea { min-height: 96px; resize: vertical; }
.arti-sched-blocks details { font-size: 12px; color: var(--ff-muted); font-weight: 400; }
.arti-sched-blocks details summary { cursor: pointer; }
/* „So funktioniert ## Mail“ – Erklärtabelle statt Codeblock */
.arti-sched-help-intro, .arti-sched-help-foot { margin: 8px 0 0; font-size: 12px; line-height: 1.5; color: var(--ff-muted); font-weight: 400; }
.arti-sched-help-intro code, .arti-sched-help-table code {
  font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ff-navy);
  background: var(--ff-cream-50); border: 1px solid var(--ff-teal-soft); border-radius: 4px; padding: 0 4px; white-space: nowrap;
}
.arti-sched-help-table {
  margin: 8px 0 0; width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; font-weight: 400;
  background: var(--bg-surface); border: 1px solid var(--ff-table-border); border-radius: 10px; overflow: hidden; color: var(--ff-navy);
}
.arti-sched-help-table th {
  text-align: left; padding: 7px 10px; font-size: 10.5px; font-weight: 500;
  color: var(--ff-muted); background: var(--ff-cream-50); border-bottom: 1px solid var(--ff-table-border);
}
.arti-sched-help { width: 100%; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.arti-sched-help-intro code { white-space: normal; }
.arti-result-table .arti-sched-help-table { table-layout: fixed; box-shadow: none; }
.arti-result-table .arti-sched-help-table th:first-child, .arti-result-table .arti-sched-help-table td:first-child { width: 16%; }
.arti-result-table .arti-sched-help-table th:nth-child(2), .arti-result-table .arti-sched-help-table td:nth-child(2) { width: 44%; }
.arti-result-table .arti-sched-help-table td, .arti-result-table .arti-sched-help-table th { text-align: left; white-space: normal; font-variant-numeric: normal; }
.arti-sched-help-table td { padding: 8px 10px; vertical-align: top; border-bottom: 1px solid var(--ff-table-line); line-height: 1.55; }
.arti-sched-help-table tbody tr:last-child td { border-bottom: 0; }
.arti-result-table .arti-sched-help-table tbody tr:hover { background: transparent; }
.arti-sched-help-table td:first-child { font-weight: 500; white-space: nowrap; }
.arti-sched-help-table td code { display: inline-block; margin: 1px 0; white-space: normal; overflow-wrap: anywhere; }
.arti-sched-blocks details pre {
  margin: 6px 0 0; padding: 8px 10px; background: var(--bg-subtle); border: 1px solid var(--ff-teal-soft);
  border-radius: 8px; white-space: pre-wrap; font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ff-navy);
}

/* ── Geplante Jobs (Redesign 12.09.2026, Mockup „Arti Chat 1“) ───────────── */
.arti-sched-back { margin-bottom: 10px; font-size: 13px; }
.arti-sched-back .arti-textbtn { display: inline-flex; align-items: center; gap: 4px; color: var(--ff-muted); text-decoration: none; }
.arti-flip { transform: rotate(180deg); }
.arti-sched-head { align-items: flex-end; margin-bottom: 14px; }
.arti-editor-head h1.arti-sched-title { margin: 0; font-family: "Poppins", ui-sans-serif, system-ui, sans-serif; font-weight: 400; font-size: 30px; letter-spacing: -.02em; color: var(--ff-navy); }
.arti-sched-lead { margin: 4px 0 0; font-size: 13.5px; color: var(--ff-muted); }
.arti-sched-table td { vertical-align: middle; }
.arti-sched-table td:not(:first-child) { text-align: left; }
.arti-sched-sub { font-size: 12px; color: var(--ff-muted); margin-top: 2px; }
.arti-sched-recipients { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arti-sched-more { color: var(--ff-muted); }
.arti-sched-status.is-failed { font-size: 11.5px; color: var(--status-error-fg); margin-top: 2px; }
.arti-sched-toggle {
  display: inline-flex; align-items: center; width: 40px; height: 22px; padding: 2px; border-radius: 999px; border: 0;
  background: var(--ff-teal-soft); cursor: pointer; transition: background .16s;
}
.arti-sched-toggle .arti-sched-knob { width: 18px; height: 18px; border-radius: 50%; background: var(--bg-surface); transition: transform .16s; box-shadow: var(--ff-shadow-sm); }
.arti-sched-toggle.is-on { background: var(--ff-navy); }
.arti-sched-toggle.is-on .arti-sched-knob { transform: translateX(18px); }
.arti-sched-actions-cell { width: 1%; white-space: nowrap; text-align: right; }
.arti-sched-actions { display: inline-flex; gap: 2px; align-items: center; }
.arti-sched-actions .arti-menu-form { display: inline; margin: 0; }
.arti-sched-action { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0;
  border-radius: 6px; padding: 4px; line-height: 1; color: var(--text-secondary); cursor: pointer; }
.arti-sched-action:hover, .arti-sched-action:focus-visible { color: var(--text-primary); }
.arti-sched-action:hover, .arti-sched-action:focus-visible { background: var(--bg-hover); }
.arti-sched-menu .arti-menu-panel { right: 0; left: auto; }
.arti-menu-item-danger { color: var(--status-error-fg); }
.arti-menu-item-danger .arti-icon { color: inherit; }

/* Job-/Berichts-Maske */
.arti-job-box { width: 640px; padding: 26px 28px 22px; }
.arti-job-form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.arti-job-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
/* hidden muss in der Maske IMMER gewinnen: .arti-job-field & Co. setzen display,
   und das schlägt sonst das hidden-Attribut (Wochentag blieb bei „Täglich" stehen). */
.arti-job-form [hidden] { display: none !important; }
.arti-job-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ff-navy); min-width: 0; }
.arti-job-field > span, .arti-job-field > legend { font-size: 12.5px; font-weight: 500; color: var(--ff-navy); }
.arti-job-field-wide { grid-column: 1 / -1; }
.arti-job-field select, .arti-job-field input[type=text], .arti-job-field input[type=time], .arti-job-field textarea, .arti-job-search {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--ff-teal-soft); background: var(--bg-surface);
  font: inherit; font-size: 14px; font-weight: 400; color: var(--ff-navy); outline: none;
}
.arti-job-field select:focus, .arti-job-field input:focus, .arti-job-field textarea:focus { border-color: var(--ff-navy); box-shadow: 0 0 0 3px rgba(237, 133, 120, .3); }
.arti-job-desc { margin: -4px 0 0; font-size: 13px; font-weight: 400; color: var(--ff-muted); line-height: 1.5; }
.arti-job-seg { display: flex; padding: 3px; border-radius: 10px; border: 1px solid var(--ff-teal-soft); background: var(--ff-cream-50); }
.arti-job-segopt { flex: 1; }
.arti-job-segopt input { position: absolute; opacity: 0; pointer-events: none; }
.arti-job-segopt span { display: block; text-align: center; padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 400; cursor: pointer; }
.arti-job-segopt input:checked + span { background: var(--ff-navy); color: var(--text-on-action); font-weight: 500; }
.arti-job-pick { border: 0; padding: 0; margin: 0; }
.arti-job-pickmode { display: flex; gap: 16px; font-size: 13px; font-weight: 400; }
.arti-job-pickmode label { display: inline-flex; align-items: center; gap: 6px; }
.arti-job-picklist { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.arti-job-picklist[hidden] { display: none; }
.arti-job-pickrows { max-height: 180px; overflow: auto; background: var(--bg-surface); border: 1px solid var(--ff-teal-soft); border-radius: 10px; padding: 4px 10px; }
.arti-job-pickrow { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; padding: 4px 0; white-space: pre; }
.arti-job-pickrow[hidden] { display: none; }
.arti-job-hint { margin: 0; font-size: 12px; font-weight: 400; color: var(--ff-muted); line-height: 1.45; }
.arti-job-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; }
.arti-job-power { padding-top: 6px; border-top: 1px dashed var(--ff-teal-soft); }
.arti-job-schedule { border: 1px solid var(--ff-teal-soft); border-radius: 14px; background: var(--ff-cream-50); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.arti-job-toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; position: relative; }
.arti-job-toggle strong { display: block; font-size: 14px; font-weight: 500; color: var(--ff-navy); }
.arti-job-toggle small { display: block; font-size: 12px; font-weight: 400; color: var(--ff-muted); margin-top: 2px; }
.arti-job-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.arti-job-switch { flex: 0 0 auto; width: 40px; height: 22px; border-radius: 999px; background: var(--ff-teal-soft); position: relative; transition: background .16s; }
.arti-job-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--bg-surface); box-shadow: var(--ff-shadow-sm); transition: transform .16s; }
.arti-job-toggle input:checked ~ .arti-job-switch { background: var(--ff-navy); }
.arti-job-toggle input:checked ~ .arti-job-switch::after { transform: translateX(18px); }
.arti-job-schedule .arti-job-grid[hidden] { display: none; }
.arti-job-form .arti-sched-blocks { margin-top: 8px; }
.arti-job-form .arti-modal-actions {
  position: sticky; bottom: -22px; margin-top: 4px; padding: 14px 0 4px;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0, #fff 14px);
}
@media (max-width: 640px) { .arti-job-grid { grid-template-columns: 1fr; } .arti-job-box { padding: 20px 16px; } }

/* Sidebar: Zähler, Ordner, Chat-Menüs */

/* Filialauswahl: alles Sichtbare an-/abwählen (große Kunden haben 50+ Filialen) */
.arti-job-picktools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arti-job-pickbtn {
  border: 1px solid var(--ff-teal-soft); background: var(--bg-surface); border-radius: 8px; padding: 4px 10px;
  font: inherit; font-size: 12px; font-weight: 500; color: var(--ff-navy); cursor: pointer;
}
.arti-job-pickbtn:hover { background: var(--ff-cream); border-color: var(--ff-navy); }
.arti-job-pickbtn[aria-pressed="true"] { background: var(--bg-selected); border-color: var(--border-selected); color: var(--text-heading); }
.arti-job-pickcount { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--ff-muted); }
.arti-job-pickcount.is-error { color: var(--ff-danger, var(--status-error-fg)); font-weight: 500; }

/* Kundenauswahl auf der Jobs-Seite: suchbares Dropdown statt <select> */
.arti-sched-clientlabel { color: var(--ff-muted); font-weight: 600; }
.arti-sched-clientmenu { position: relative; }
.arti-sched-clientbtn {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--ff-teal-soft); background: var(--bg-surface); color: var(--ff-navy);
  font-size: 14px; font-weight: 400; cursor: pointer; list-style: none; max-width: 380px;
}
.arti-sched-clientbtn::-webkit-details-marker { display: none; }
.arti-sched-clientbtn:hover { border-color: var(--ff-navy); }
.arti-sched-clientbtn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arti-sched-clientmenu[open] .arti-sched-clientbtn .arti-icon { transform: rotate(180deg); }
.arti-sched-clientpanel { left: 0; right: auto; width: 340px; max-width: 90vw; padding: 10px; }
.arti-sched-clientpanel .arti-client-search { width: 100%; margin: 0 0 8px; }
.arti-sched-clientpanel .arti-client-options { max-height: 280px; overflow-y: auto; margin: 0; }
.arti-client-option.is-current button { background: var(--ff-mint); font-weight: 500; }

/* Absenden-Knopf mit Spinner (Anlegen dauert: MCP, S3, neuer Seitenaufbau). Last Crumb
   zeigt den Ladezustand nur als Beispiel (.ff-spinner im Button, button.md) — hier als
   Zustand .is-busy am .ff-btn, gesetzt vom job-dialog-Controller. */
.ff-btn.is-busy { cursor: progress; }
.ff-btn.is-busy::before {
  content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; opacity: .8;
  animation: arti-spin .7s linear infinite;
}
@keyframes arti-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ff-btn.is-busy::before { animation-duration: 2.4s; } }

/* ── Sidebar-Feedback 21.09.2026: Insights · Verlauf im Berichtsmenü · Ordner ─ */

.arti-menu-empty { padding: 4px 12px 8px; font-size: 12px; color: var(--ff-muted); }
/* Geplante Jobs: Kunde → Job → Lauf (Feedback 27.10.2026) */

/* Chat-Suche (Titel; SuperAdmins zusätzlich Kunde) */

/* /reports — Verlauf je Berichtsart */
.arti-reports-page { max-width: 1100px; }
.arti-reports-group { margin-top: 26px; }
.arti-reports-group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; font-weight: 500; color: var(--ff-navy); }
.arti-reports-group-title .arti-icon { color: var(--ff-teal); }
.arti-reports-group-count { font-size: 12px; font-weight: 400; color: var(--ff-muted-2); }
.arti-reports-only { margin-left: auto; }
.arti-reports-empty { margin: 8px 0 0; font-size: 13px; color: var(--ff-muted); }
.arti-reports-table td:first-child { white-space: normal; min-width: 260px; max-width: 560px; }
.arti-reports-table td a { color: var(--ff-navy); text-decoration: none; border-bottom: 1px solid var(--ff-teal-soft); }
.arti-reports-table td a:hover { color: var(--ff-teal); border-bottom-color: var(--ff-teal); }

/* ── Tabelle kopieren (table_copy_controller) ─────────────────────────────
   Knopf rechts über jeder Chat-Tabelle; dezent, bei Hover/Fokus voll sichtbar.
   Auf Touch-Geräten ohne Hover immer sichtbar. */
.arti-table-copy { margin: 12px 0; }
.arti-table-copy > table { margin-top: 0 !important; margin-bottom: 0 !important; }
.arti-table-copy-bar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.arti-table-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid transparent; background: transparent; color: var(--ff-muted-2);
  border-radius: 9999px; padding: 3px 9px; font: inherit; font-size: 11.5px; font-weight: 400;
  cursor: pointer; opacity: .55; transition: opacity .15s, background .15s, color .15s, border-color .15s;
}
.arti-table-copy:hover .arti-table-copy-btn, .arti-table-copy-btn:focus-visible { opacity: 1; }
.arti-table-copy-btn:hover { background: var(--bg-surface); border-color: var(--ff-teal-soft); color: var(--ff-teal); }
.arti-table-copy-btn.is-done { opacity: 1; color: var(--status-success-fg); }
@media (hover: none) { .arti-table-copy-btn { opacity: 1; } }

/* Diktiermodus (04.10.2026): Mikrofon links vom Senden-Knopf. Während der
   Aufnahme wird er zum Stopp-Knopf mit pulsierendem Ring. */
#arti-mic {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 0; background: transparent; color: var(--ff-muted);
  transition: background .12s, color .12s;
}
#arti-mic:hover { background: var(--ff-cream); color: var(--ff-navy); }
#arti-mic:focus-visible { outline: 2px solid var(--ff-coral); outline-offset: 2px; }
#arti-mic .arti-mic-stop { display: none; }
#arti-mic.is-recording, #arti-mic.is-busy { background: var(--status-error-bg); color: var(--status-error-fg); }   /* Aufnahme läuft: Status, keine Aktion */
#arti-mic.is-recording .arti-mic-idle { display: none; }
#arti-mic.is-recording .arti-mic-stop { display: block; fill: currentColor; }
#arti-mic.is-recording { animation: arti-mic-pulse 1.4s ease-out infinite; }
#arti-mic.is-busy { opacity: .7; cursor: progress; }
@keyframes arti-mic-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(237, 133, 120, .55); }
  100% { box-shadow: 0 0 0 10px rgba(237, 133, 120, 0); }
}
@media (prefers-reduced-motion: reduce) { #arti-mic.is-recording { animation: none; } }

/* Filial-Info: 👍 / 👎 / 🔕 je Insight unter dem Ergebnis (messages/_store_insight_feedback). */
.arti-insight-feedback-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--arti-line, var(--border-default));
}
.arti-insight-feedback-row:last-of-type { border-bottom: 0; }
.arti-insight-feedback-label { font-size: 13px; }
.arti-insight-feedback-actions { display: inline-flex; gap: 6px; }
.arti-insight-feedback-actions form { margin: 0; }
.arti-insight-feedback-actions .arti-pillbtn { font-size: 12px; padding: 3px 10px; }

/* ═══ Gedächtnis als Pop-up mit Akkordeon (Variante 7, 13.11.2026) ═══
   Aus Last Crumb (vendor/last-crumb): .ff-count, .ff-notice, .ff-card, .ff-pill,
   .ff-field, .ff-btn. Der Chat bleibt abgedunkelt dahinter sichtbar. Weiße Fläche,
   je Gedächtnis ein Abschnitt (aufklappbar, beim Öffnen alle offen), Abschnitte
   durch eine Linie getrennt. Hier nur Layout, nur Tokens. Inhalt: memory-editor. */
/* Vollbild mit 24px Rand (Nicole, 13.11.2026: die schmale Box war doch zu klein). */
.arti-modal.arti-memfull[open] {
  display: flex; flex-direction: column; place-items: initial; position: fixed; inset: var(--sp-6);
  width: auto; height: auto; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface);
  box-shadow: var(--shadow-popover);
}
.arti-modal.arti-memfull::backdrop { background: rgba(15, 42, 53, .65); }
.arti-memfull-app {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; box-sizing: border-box;
  background: var(--bg-surface); color: var(--text-primary); font-weight: 400;
  animation: arti-in .22s cubic-bezier(.22, .61, .36, 1);
}
.arti-memfull-top { flex: none; display: flex; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-5) var(--sp-6) var(--sp-4) var(--sp-8); box-shadow: inset 0 -1px 0 var(--border-default); }
.arti-memfull-titles { flex: 1 1 auto; min-width: 0; }
.arti-memfull-title { margin: 0; color: var(--text-heading); font-size: 22px; font-weight: 500; letter-spacing: -.01em; }
.arti-memfull-subtitle { margin: 2px 0 0; font-size: var(--fs-body); color: var(--text-muted); }
.arti-memfull-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--sp-3) 0 var(--sp-6); background: var(--bg-surface); }
.arti-memfull-lead { margin: 0; padding: 0 var(--sp-8) var(--sp-3); max-width: none; }
.arti-memfull-alert { margin: 0 var(--sp-8) var(--sp-3); }
.arti-memfull-lead strong { font-weight: 500; color: var(--text-heading); }
.arti-memfull-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-3); align-items: stretch; }
.arti-memfull-form { display: none; }
.arti-memfull-foot { flex: none; display: flex; justify-content: flex-end; padding: var(--sp-4) var(--sp-6); background: var(--bg-page); border-top: 1px solid var(--border-default); }

/* Abschnitt je Gedächtnis: Kopf (Pfeil, Icon, Publikum, Anzahl, Füllstand,
   „Thema hinzufügen“ oder „Nur lesen“), darunter Warnung und Kacheln. */
.arti-memgroup { padding: 0 var(--sp-8); border-top: 1px solid var(--border-default); scroll-margin-top: var(--sp-2); }
/* Eine Zeile (Nicole, 13.11.2026): links Titel-Button (Pfeil, Icon, Publikum + Anzahl
   in fester Breite), rechts Füllstand, dann „Thema hinzufügen“ / „Nur lesen“. Reicht der
   Platz nicht, rutschen Füllstand und Button in die nächste Zeile (Copilot-Review #224). */
.arti-memgroup-head {
  position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3);
  margin: 0 calc(var(--sp-1) * -1); padding: var(--sp-2) var(--sp-1); border-radius: var(--radius-sm, 8px);
}
/* Die ganze Kopfzeile klappt auf und zu (Nicole, 13.11.2026): die Fläche des Buttons
   liegt über der Zeile (::after), nur „Thema hinzufügen“ liegt darüber. */
.arti-memgroup-head:hover { background: var(--bg-hover, var(--bg-page)); }
.arti-memgroup-head:has(.arti-memgroup-toggle:focus-visible) { outline: 2px solid var(--border-selected); outline-offset: 2px; }
.arti-memgroup-toggle::after { content: ""; position: absolute; inset: 0; border-radius: inherit; cursor: pointer; }
.arti-memgroup-add { position: relative; z-index: 1; }
.arti-memgroup-heading { order: 1; flex: 1 1 260px; min-width: 0; margin: 0; font: inherit; }
.arti-memgroup-add, .arti-memgroup-ro { order: 3; flex: none; white-space: nowrap; }
.arti-memgroup-toggle {
  display: flex; align-items: center; flex-wrap: nowrap; gap: var(--sp-2) var(--sp-3); width: 100%; min-width: 0;
  padding: 0; border: 0; border-radius: var(--radius-sm, 8px); background: transparent;
  font: inherit; text-align: left; color: var(--text-heading); cursor: pointer;
}
.arti-memgroup-toggle:focus-visible { outline: none; }
.arti-memgroup-chev { display: inline-flex; color: var(--text-muted); transition: transform .15s; }
.arti-memgroup-toggle[aria-expanded="false"] .arti-memgroup-chev { transform: rotate(-90deg); }
.arti-memgroup-icon { display: inline-flex; color: var(--brand-seegruen); }
.arti-memgroup-title { flex: 0 1 440px; min-width: 0; display: inline-flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-section, 16px); font-weight: 600; white-space: nowrap; }
.arti-memgroup-title .ff-count, .arti-memgroup-title .ff-pill { flex: none; }
/* langer Kundenname: kürzt mit …, die Anzahl bleibt sichtbar (Copilot-Review #224) */
.arti-memgroup-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.arti-memgroup-ro { display: inline-flex; align-items: center; gap: var(--sp-1); }
.arti-memgroup-meter { order: 2; flex: 0 0 260px; display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); font-size: var(--fs-caption); color: var(--text-muted); white-space: nowrap; }
.arti-memgroup-meter .ff-bar { flex: 0 0 120px; }
.arti-memgroup-meter .ff-bar__fill { transition: width .2s; }
.arti-memgroup-body { display: flex; flex-direction: column; gap: var(--sp-3); padding-bottom: var(--sp-4); }
.arti-memgroup-body[hidden], .arti-memgroup-body > [hidden] { display: none; }
.arti-memory-warn { margin: 0; }
.arti-memory-warn strong { font-weight: 600; }
.arti-memgroup-empty { margin: 0; padding: var(--sp-3) var(--sp-4); border: 1px dashed var(--border-default); border-radius: var(--radius-md, 10px); color: var(--text-muted); font-size: var(--fs-body); }

/* Kacheln */
.arti-memcard { scroll-margin-top: var(--sp-4); min-width: 0; background: var(--bg-page); }
.arti-memcard .ff-card-title { overflow-wrap: anywhere; }
/* Der Editor bleibt in der Kachel-Form (eine Spalte), wie im Entwurf (Nicole, 13.11.2026). */
.arti-memcard.is-editing { background: var(--bg-surface); border-color: var(--border-selected); box-shadow: var(--shadow-popover); }
.arti-memcard-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: var(--sp-1); }
.arti-memcard-list li { line-height: 1.55; color: var(--text-secondary); overflow-wrap: anywhere; }
.arti-memcard-list li::marker { color: var(--brand-seegruen); }
.arti-memcard-list strong { font-weight: 500; color: var(--text-heading); }
.arti-memcard-form { display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-4); }
.arti-memcard-titleinput { font-weight: 500; }
.arti-memcard-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.arti-memcard-bold strong { font-weight: 600; }
.arti-memcard-rows { display: flex; flex-direction: column; gap: var(--sp-2); }
.arti-memcard-row { display: flex; align-items: center; gap: var(--sp-2); }
.arti-memcard-row > .ff-input { flex: 1; min-width: 0; }
.arti-memcard-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-seegruen); }
.arti-memcard-add { align-self: flex-start; }
.arti-memcard-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--border-row); }
.arti-memcard-spacer { flex: 1; }
/* Gedächtnis-Prüfung (MemoryCheck, 18.11.2026): Etikett rechts neben dem Punkt (Last-Crumb-Pill),
   ein Klick klappt Satz, Probelauf und ggf. Antworten darunter auf. Nur Tokens, keine neuen Farben. */
.arti-memcheck-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--sp-3); }
.arti-memcheck-row > span { min-width: 0; }
.arti-memcheck { margin-top: 1px; font-family: inherit; }
.arti-memcheck:focus-visible { outline: 2px solid var(--border-selected); outline-offset: 2px; }
.arti-memcheck .arti-spinner { width: 10px; height: 10px; border-width: 2px; }
.arti-memcheck-detail { margin: var(--sp-2) 0 var(--sp-1); padding: var(--sp-3); border: 1px solid var(--border-default); border-radius: var(--radius-md, 10px);
  background: var(--bg-surface); color: var(--text-primary); display: flex; flex-direction: column; gap: var(--sp-3); font-size: var(--fs-body); }
.arti-memcheck-detail p { margin: 0; line-height: 1.5; }
.arti-memcheck-meta { color: var(--text-muted); font-size: var(--fs-caption); }
.arti-memcheck-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.arti-memprobe-wrap { overflow-x: auto; }
.arti-memprobe { width: 100%; border-collapse: collapse; font-size: var(--fs-caption); font-variant-numeric: tabular-nums; }
.arti-memprobe caption { text-align: left; color: var(--text-muted); padding-bottom: var(--sp-1); }
.arti-memprobe th, .arti-memprobe td { padding: 4px 0 4px var(--sp-3); border-top: 1px solid var(--border-row); text-align: right; white-space: nowrap; }
.arti-memprobe th:first-child, .arti-memprobe td:first-child { text-align: left; white-space: normal; padding-left: 0; }
.arti-memprobe thead th { border-top: 0; color: var(--text-muted); font-weight: 500; }
.arti-memprobe td:last-child { color: var(--text-heading); font-weight: 500; }

@media (max-width: 900px) {
  .arti-modal.arti-memfull[open] { inset: 0; border-radius: 0; }
  .arti-memfull-top { padding: var(--sp-4) var(--sp-3) var(--sp-3) var(--sp-4); }
  .arti-memfull-lead { padding-inline: var(--sp-4); }
  .arti-memfull-alert { margin-inline: var(--sp-4); }
  .arti-memgroup { padding-inline: var(--sp-4); }
  /* schmal: Titel in eigener Zeile und darf umbrechen, darunter Füllstand und Button */
  .arti-memgroup-heading { flex-basis: 100%; }
  .arti-memgroup-title { flex: 1 1 auto; white-space: normal; }
  .arti-memgroup-name { overflow: visible; overflow-wrap: anywhere; }
  .arti-memgroup-meter { flex: 1 1 auto; justify-content: flex-start; }
  .arti-memgroup-meter .ff-bar { flex-basis: 80px; }
  .arti-memfull-cards { grid-template-columns: minmax(0, 1fr); }
  .arti-memfull-foot { padding: var(--sp-3) var(--sp-4); }
}
/* „ARTI in Claude nutzen“ (/claude) */
.arti-claude-page { max-width: 820px; }
.arti-claude-card { background: #fff; border: 1px solid var(--ff-line, #e5e9ee); border-radius: 14px; padding: 18px 20px; margin: 0 0 14px; }
.arti-claude-card h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; color: var(--ff-navy); }
.arti-claude-sub { margin: 10px 0 4px; font-size: 13.5px; color: var(--ff-navy); font-weight: 500; }
.arti-claude-steps { margin: 0 0 6px; padding-left: 20px; font-size: 13.5px; line-height: 1.6; }
.arti-claude-data { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 13.5px; align-items: start; }
.arti-claude-data dt { color: var(--ff-muted); padding-top: 3px; }
.arti-claude-data dd { margin: 0; min-width: 0; }
.arti-claude-code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; user-select: all; padding: 3px 8px; border-radius: 6px; background: var(--ff-mint, #eef6f4); color: var(--ff-navy); font-size: 12.5px; }
.arti-claude-pre { margin: 6px 0; padding: 10px 12px; border-radius: 8px; background: var(--ff-mint, #eef6f4); color: var(--ff-navy); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.arti-claude-hint { display: flex; gap: 6px; align-items: flex-start; margin: 8px 0 0; font-size: 12.5px; color: var(--ff-muted); }
.arti-claude-hint .arti-icon { flex: none; margin-top: 2px; }
.arti-claude-secret summary { cursor: pointer; color: var(--ff-navy); font-size: 13px; }
.arti-claude-secret .arti-claude-code { margin-top: 6px; }
@media (max-width: 600px) { .arti-claude-data { grid-template-columns: 1fr; gap: 2px; } .arti-claude-data dd { margin-bottom: 8px; } }
.arti-claude-cta { margin: 4px 0 12px; }
.arti-claude-cta .arti-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.arti-claude-hero .arti-claude-data { margin-top: 10px; }
.arti-claude-tech summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ff-navy); }
.arti-claude-tech[open] summary { margin-bottom: 8px; }
/* Produktionsplan-Änderung (FE-582): Tabelle je Filiale mit Ergebnis-Badge. */
.arti-action.arti-pp {
  border: 1px solid var(--ff-table-border);
  border-radius: 16px;
  box-shadow: var(--ff-shadow-md);
  padding: 6px 0 0;
  gap: 0;
  max-width: 100%;
  width: 100%;
}
.arti-pp-scroll { max-height: 440px; overflow: auto; padding: 0 20px; }
.arti-pp-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.arti-pp-table th {
  position: sticky; top: 0; background: #fff;
  text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ff-muted);
  padding: 12px 10px; border-bottom: 1px solid var(--ff-table-border);
}
.arti-pp-table td {
  padding: 12px 10px; color: var(--ff-ink);
  border-bottom: 1px solid var(--ff-table-line); white-space: nowrap;
}
.arti-pp-table td.arti-pp-store { font-weight: 600; color: var(--ff-navy); }
.arti-pp-table tr.arti-pp-muted td, .arti-pp-table tr.arti-pp-muted td.arti-pp-store { color: var(--ff-muted-2); font-weight: 400; }
.arti-pp-badge {
  display: inline-block; padding: 3px 11px; border-radius: 9999px;
  font-size: 12.5px; font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.arti-pp-badge-add    { background: var(--ff-mint); color: var(--ff-navy); }
.arti-pp-badge-remove { background: var(--ff-coral-soft); color: var(--ff-navy); }
.arti-pp-badge-move   { background: #DCE8EC; color: var(--ff-navy); }
.arti-pp-badge-skip   { background: var(--ff-cream); color: var(--ff-navy); }
.arti-pp-badge-error  { background: #F6D5CF; color: #a2402f; }
.arti-pp-foot {
  display: flex; justify-content: flex-end; align-items: center; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--ff-table-border);
}
.arti-pp-btn {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  padding: 11px 20px; border-radius: 8px;
  border: 1px solid var(--ff-table-border); background: #fff; color: var(--ff-navy);
}
.arti-pp-btn:hover { border-color: var(--ff-navy); }
.arti-pp-btn-primary { background: var(--ff-navy); border-color: var(--ff-navy); color: #fff; }
.arti-pp-btn-primary:hover { background: #163340; }
.arti-pp-btn:disabled { opacity: .6; cursor: progress; }
.arti-pp-result { font-size: 13.5px; color: #2e6b4f; font-weight: 500; white-space: normal; }
@media (max-width: 640px) {
  .arti-pp-scroll { padding: 0 10px; }
  .arti-pp-table td, .arti-pp-table th { padding: 10px 6px; }
}
