:root {
  /* Flächen aus der FleetTrack-Vorlage, Akzente aus dem KING-Logo (Orange #D9772B „KI“, Navy #16213E „NG“) */
  --bg: #efefef; --surface: #ffffff; --surface-2: #f5f5f5; --surface-3: #f8f8f8; --dark: #1f1f1f;
  --line: #e8e8e8; --border: #e3e3e3;
  --text: #16213e; --muted: #686c78; --soft-text: #4f5566;
  --accent: #d9772b; --accent-soft: #fbeadb; --accent-ink: #a8571b; --navy: #16213e;
  --ok: #2f8f5b; --ok-soft: #e3f3e9; --bad: #c8432f; --bad-soft: #fbe6e1; --warn: #a96b12; --warn-soft: #fbf0db;
  --radius: 18px; --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 6px 22px rgba(0, 0, 0, .045);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14.5px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Inter, Roboto, sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--bad); min-height: 1.2em; margin: 0; }
.i { flex: none; display: block; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { background: var(--surface); padding: 34px 32px 30px; border-radius: 26px; width: 100%; max-width: 400px;
  display: grid; gap: 14px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, .08); }
.login-logo { display: block; width: 100%; max-width: 270px; margin: 2px auto 4px; }
.login-card .muted { text-align: center; margin: 0 0 6px; }
.login-card h1 { font-size: 12px; letter-spacing: .26em; text-transform: uppercase; text-align: center; margin: 0; color: var(--muted); font-weight: 600; }

/* Layout: schwebende Fenster auf grauem Grund */
.shell { display: grid; grid-template-columns: 252px 1fr; gap: 14px; min-height: 100vh; padding: 14px; }
.sidebar { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; padding: 18px 12px 12px; position: sticky; top: 14px; height: calc(100vh - 28px); overflow-y: auto; }
.brand { display: block; padding: 2px 8px 14px; text-decoration: none; }
.brand img { width: 100%; max-width: 212px; height: auto; display: block; }
/* Kleines Logo (orange Kachel mit „KI“): Anmeldung und kleine Darstellungen */
.brand-small { display: flex; align-items: center; gap: 11px; }
.brand-small img { width: 40px; height: 40px; display: block; flex: none; }
.brand-small b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--text); line-height: 1.2; }
.brand-small small { display: block; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.login-brand { flex-direction: column; text-align: center; gap: 12px; margin: 4px 0 2px; }
.login-brand img { width: 64px; height: 64px; }
.login-brand b { font-size: 20px; }
nav { display: grid; gap: 2px; }
nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--soft-text); font-weight: 500; transition: background .15s, color .15s; }
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a.active { background: var(--navy); color: #fff; }
nav a:focus-visible, .btn:focus-visible, .seg a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
nav .ico { width: 18px; display: grid; place-items: center; }
.nav-group { font-size: 10px; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); padding: 16px 12px 5px; font-weight: 600; }
.nav-sep { height: 1px; background: var(--line); margin: 12px 8px; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 4px; border-top: 1px solid var(--line); }
.me { font-size: 12px; color: var(--muted); min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me b { display: block; color: var(--text); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 6px 4px; }
.titles { flex: 1; min-width: 0; }
.topbar h1 { font-size: 26px; margin: 0; white-space: nowrap; letter-spacing: -.02em; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.topbar .sub:empty { display: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-actions { padding: 10px 6px 0; }
.page-actions:empty { display: none; }
.page-actions select, .page-actions input:not([type=checkbox]) { width: auto; min-width: 160px; }
.view { padding: 16px 6px 36px; display: grid; gap: 16px; align-content: start; }
.global-search { width: min(320px, 34vw); position: relative; }
.global-search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.global-search input { background: var(--surface); border-radius: 999px; padding-left: 40px; height: 42px; box-shadow: var(--shadow); }
.icon-btn, .bell { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; cursor: pointer; box-shadow: var(--shadow); }
.icon-btn:hover, .bell:hover { background: var(--surface-3); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--accent-ink); color: #fff; font-size: 11px; font-weight: 700; }
.bell .count { position: absolute; top: -3px; right: -4px; border: 2px solid var(--bg); }
nav .count { margin-left: auto; }
nav a.active .count { background: #fff; color: var(--navy); }
.topbar .menu-btn { display: none; }

/* Buttons & Pills */
.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: 999px;
  font: inherit; font-weight: 550; font-size: 13.5px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 7px;
  align-items: center; justify-content: center; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-3); border-color: #d6d6d6; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #22305a; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { background: transparent; border-color: transparent; color: inherit; }
.btn.small { padding: 5px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .55; cursor: progress; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow); width: fit-content; max-width: 100%; }
.seg a { padding: 7px 15px; border-radius: 999px; text-decoration: none; color: var(--soft-text); font-size: 13px; font-weight: 550;
  border: 1px solid transparent; }
.seg a:hover { background: var(--surface-2); }
.seg a.on { color: var(--accent-ink); background: #fff8f2; border-color: #f3d6bf; }

/* Kacheln */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); min-width: 0; }
.card h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card.dark { background: var(--dark); border-color: var(--dark); color: #f2f2f2; }
.card.dark h2 { color: #fff; }
.card.dark .btn { background: #fff; color: #1f1f1f; border-color: #fff; }
.card.dark .muted { color: #9b9b9b; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(390px, 1fr); }
.grid-3 { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi { display: flex; gap: 14px; align-items: center; padding: 16px 18px; text-decoration: none; }
.kpi .ibox { width: 46px; height: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-3);
  display: grid; place-items: center; color: var(--text); flex: none; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; }
.kpi .num { font-size: 26px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; display: flex; align-items: center; gap: 8px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--soft-text); letter-spacing: 0; }
.delta.ok { background: var(--ok-soft); color: var(--ok); }
.delta.bad { background: var(--bad-soft); color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.stats small { display: block; font-size: 11.5px; color: #9b9b9b; }
.stats b { font-size: 17px; font-weight: 600; }
.hero { font-size: 34px; font-weight: 650; letter-spacing: -.02em; margin: 2px 0 8px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 550; background: var(--surface-2);
  color: var(--soft-text); white-space: nowrap; }
.badge.gold { background: var(--accent-soft); color: var(--accent-ink); }
.badge.hoch { background: var(--bad-soft); color: var(--bad); }
.badge.mittel { background: var(--warn-soft); color: var(--warn); }
.badge.niedrig { background: var(--ok-soft); color: var(--ok); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #c9c9c9; }
.dot.online { background: var(--ok); } .dot.offline, .dot.fehler { background: var(--bad); }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: center; }
.list li:last-child { border: 0; }
.empty { color: var(--muted); text-align: center; padding: 28px; }
.progress { height: 6px; border-radius: 99px; background: #ececec; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.ticks { display: inline-flex; gap: 2px; align-items: center; }
.ticks i { width: 3px; height: 14px; border-radius: 2px; background: #e4e4e4; }
.ticks i.on { background: var(--accent); }
.dist { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px 14px; align-items: center; font-size: 13.5px; }
.dist .name { display: flex; align-items: center; gap: 10px; }
.dist .name .i { color: var(--muted); }
.dist .pct { color: var(--muted); font-size: 12.5px; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

/* Diagramme (ui.js) */
.chart { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; outline: none; }
.chart-svg .grid { stroke: #ececec; stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 11px; }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area { fill: var(--accent); opacity: .1; }
.chart-svg .dot { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.chart-svg .dot.hover, .chart-svg .cross { opacity: 0; }
.chart-svg.hovering .dot.hover, .chart-svg.hovering .cross { opacity: 1; }
.chart-svg .cross { stroke: #cfcfcf; stroke-width: 1; }
.chart-svg .cbar .bar { fill: #f2f2f2; transition: fill .12s; }
.chart-svg .cbar.on .bar, .chart-svg .cbar:focus .bar { fill: var(--accent); }
.chart-svg .cbar { outline: none; }
.chart-svg .cbar .hit { fill: transparent; }
.chart-svg .base { stroke: #3c3c3c; stroke-width: 1; }
.card.dark .chart-svg .tick { fill: #8d8d8d; }
.chart-tip { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 12px)); background: #fff; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); font-size: 12px;
  pointer-events: none; opacity: 0; transition: opacity .1s; white-space: nowrap; display: grid; text-align: center; z-index: 2; }
.chart-tip b { font-size: 14px; }
.chart-tip span { color: var(--muted); }
.chart-tip.on { opacity: 1; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 8px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 550; background: var(--surface-3); border-bottom: 0; }
th:first-child { border-radius: 12px 0 0 12px; } th:last-child { border-radius: 0 12px 12px 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafafa; }
td.act { text-align: right; white-space: nowrap; }
td .sub { display: block; color: var(--muted); font-size: 12px; }

/* Formulare */
input, select, textarea { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 119, 43, .16); }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b7f8c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 13px center; }
.page-actions select, .page-actions input:not([type=checkbox]) { border-radius: 999px; height: 38px; padding-top: 0; padding-bottom: 0; }
label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--soft-text); }
textarea { min-height: 90px; resize: vertical; }
.search { max-width: 280px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.check input { width: auto; accent-color: var(--accent); }

dialog { border: 1px solid var(--line); border-radius: 24px; padding: 0; width: min(580px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, .18); }
dialog::backdrop { background: rgba(30, 30, 30, .32); backdrop-filter: blur(2px); }
#modal-form { padding: 24px; display: grid; gap: 16px; }
#modal-form h3 { margin: 0; font-size: 18px; }
dialog.confirm { width: min(420px, calc(100vw - 32px)); }
dialog.confirm form { padding: 24px; display: grid; gap: 16px; }
dialog.confirm p { margin: 0; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-height: 320px; }
.col h3 { margin: 4px 6px 12px; font-size: 13.5px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
  margin-bottom: 10px; cursor: grab; display: grid; gap: 7px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); transition: box-shadow .15s, transform .15s; }
.task:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, .07); transform: translateY(-1px); }
.task:active { cursor: grabbing; }
.task .t { font-weight: 600; display: flex; gap: 7px; align-items: start; line-height: 1.35; }
.task .t .i { margin-top: 1px; color: var(--muted); }
.task small { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.typeicon { display: inline-grid; color: var(--muted); vertical-align: -3px; }

.toast { position: fixed; bottom: 22px; right: 22px; background: var(--dark); color: #fff; padding: 12px 18px;
  border-radius: 14px; opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; z-index: 50;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .2); }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--bad); }

.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }

/* Zusammenarbeit */
.click { cursor: pointer; }
.card.click, a.card, .thread { transition: box-shadow .15s, transform .15s, border-color .15s; }
.card.click:hover, a.card:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, .08); transform: translateY(-1px); }
a.card { text-decoration: none; color: inherit; }
.stack { display: grid; gap: 16px; align-content: start; }
.info { background: #fff8f2; border-color: #f6dcc6; box-shadow: none; padding: 12px 16px; font-size: 13.5px; color: var(--soft-text); }
.bad-text { color: var(--bad); font-weight: 600; }
.list li.click:hover { background: var(--surface-3); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 10px; }
.list li.unread { font-weight: 600; }
.list.compact li { padding: 7px 0; font-size: 13.5px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; margin: 0; }
.hint { margin: 0; font-size: 12px; }
textarea.tall { min-height: 180px; }
textarea.huge { min-height: 380px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.md { overflow-wrap: anywhere; }
.md p { margin: 0 0 10px; }
.md h3, .md h4, .md h5 { margin: 18px 0 8px; letter-spacing: -.01em; }
.md h3 { font-size: 21px; } .md h4 { font-size: 16px; } .md h5 { font-size: 14px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 22px; }
.md li.check-item { list-style: none; margin-left: -20px; }
.md li.check-item input { width: auto; vertical-align: middle; accent-color: var(--accent); }
.md a { color: var(--accent-ink); }
.md table { margin: 8px 0 14px; }
.mention { background: var(--accent-soft); color: var(--accent-ink); border-radius: 6px; padding: 0 4px; font-weight: 600; }
.sec-title { font-size: 13px; margin: 4px 0 10px; color: var(--muted); font-weight: 600; }
.list-card { padding: 4px 20px; }
.thread { display: flex; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.thread:last-child { border: 0; }
.thread .row { margin-top: 5px; }
.thread-stats { display: grid; text-align: right; min-width: 90px; align-content: start; }
.thread-stats b { font-size: 18px; }
.idea .vote, .vote { display: grid; place-items: center; min-width: 46px; padding: 6px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-3); color: var(--soft-text); cursor: pointer; font: inherit; line-height: 1.1; }
.vote.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.idea { display: grid; gap: 10px; align-content: start; }
.ms { margin-bottom: 14px; }
.ms:last-child { margin-bottom: 0; }
.timeline { display: grid; gap: 16px; position: relative; padding-left: 28px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 10px; bottom: 10px; width: 2px; background: #e0e0e0; }
.tl-item { position: relative; }
.tl-dot { position: absolute; left: -28px; top: 24px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.tl-item.reached .tl-dot { background: var(--accent); }
.wiki { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.wiki-nav { display: grid; gap: 2px; position: sticky; top: 14px; padding: 14px; }
.wiki-nav small { margin-top: 12px; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 600; padding: 0 8px; }
.wiki-nav small:first-child { margin-top: 0; }
.wiki-nav a { text-decoration: none; padding: 7px 10px; border-radius: 10px; font-size: 13.5px; color: var(--soft-text); }
.wiki-nav a:hover { background: var(--surface-2); }
.wiki-nav a.active { background: var(--navy); color: #fff; font-weight: 550; }
dialog.wide { width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
#detail-body { padding: 24px 28px; display: grid; gap: 16px; }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.detail-head h2 { margin: 2px 0 0; font-size: 22px; letter-spacing: -.01em; display: flex; gap: 8px; align-items: center; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.meta-grid small { display: block; color: var(--muted); font-size: 11px; font-weight: 550; }
.meta-grid b { font-size: 13.5px; font-weight: 600; }
.detail-sec h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.detail-sec { border-top: 1px solid var(--line); padding-top: 14px; }
.inline-select { width: auto; border-radius: 999px; }
.comments { display: grid; gap: 10px; margin-bottom: 12px; }
.comment { background: var(--surface-2); border-radius: 14px; padding: 11px 15px; }
.comment .md { margin-top: 4px; }
.comment-form { display: grid; gap: 8px; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; text-decoration: underline; }
.module { display: grid; gap: 10px; align-content: start; }
.module h2 { margin: 0; }
.module .foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.module .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.module .meta b { color: var(--text); }

@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; padding: 10px; }
  .sidebar { position: fixed; inset: 10px auto 10px 10px; width: 260px; height: auto; z-index: 20; transform: translateX(-120%); transition: .2s; }
  .shell.nav-open .sidebar { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .25); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 15; background: rgba(30, 30, 30, .32); }
  .topbar .menu-btn { display: grid; }
  .topbar { flex-wrap: wrap; padding: 4px 2px; }
  .topbar h1 { font-size: 22px; }
  .global-search { order: 5; width: 100%; }
  .page-actions { padding: 8px 2px 0; }
  .view { padding: 12px 2px 24px; }
  .kanban { grid-template-columns: repeat(4, 260px); }
  .wiki, .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .wiki-nav { position: static; }
  .search { max-width: none; }
  /* iOS zoomt bei Eingabefeldern unter 16px automatisch hinein */
  input, select, textarea, textarea.huge { font-size: 16px; }
}
/* In Teams eingebettet: kompakter */
body.in-teams .shell { padding: 8px; gap: 8px; }
body.in-teams .topbar h1 { font-size: 22px; }
.ibox-sm { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-3); display: grid; place-items: center; color: var(--text); }
.ttl { display: flex; gap: 7px; align-items: flex-start; }
.ttl .typeicon { margin-top: 2px; }
/* Einstellungen: Claude-Connector */
.connector { display: grid; gap: 14px; }
.connector h2 { margin: 0; }
.connector h3 { font-size: 13.5px; margin: 4px 0 -6px; }
.connector p { margin: 0; }
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.copy-row input { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-3); }
.connect-steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.connect-steps > div { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.connect-steps > div > b { border-left: 3px solid var(--accent); padding-left: 8px; }
.connect-steps ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* Testprojekt: Module ohne Weboberfläche ausgegraut */
.test-tile.off { background: var(--surface-3); box-shadow: none; }
.test-tile.off h2 { color: var(--muted); }
.test-tile .foot .hint { flex-basis: 100%; }
.test-tile code { overflow-wrap: anywhere; }
