/* KI-Workspace design system. Ink lines, chalk ground, one accent per view. Tokens only, no raw colours.
   Sections: base, type, frame, buttons, tags, lists, panes, forms, tables, overlays, answers, states, diagram, mobile.
   Page-specific rules go to css/<page>.css, loaded by the layout, never here. */

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}
[x-cloak] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[aria-modal="true"]:focus, #scroll:focus { outline: 0; } /* focus stands on the whole of it for a moment: the next Tab lands on its first control */
.skip { position: absolute; left: -9999px; top: 8px; z-index: 70; padding: 8px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-raised); font-size: 14px; font-weight: 700; }
.skip:focus { left: 8px; }
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: block; }
.i.s { width: 15px; height: 15px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- type ---------- */
.h1 { font-size: 38px; line-height: 1.06; font-weight: 800; letter-spacing: -.035em; }
.h1 em, .h2 em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.015em; font-size: 1.08em; }
.h2 { font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; }
.h3 { font-size: 15.5px; line-height: 1.3; font-weight: 700; letter-spacing: -.005em; }
.lead { font-size: 16px; color: var(--ink-muted); }
.meta { font-size: 13.5px; line-height: 1.4; color: var(--ink-muted); }
.small { font-size: 13px; line-height: 1.45; color: var(--ink-muted); }
.label { font-family: var(--font-mono); font-size: 11px; line-height: 1.4; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.label.ink { color: var(--ink); }
.caption { font-family: var(--font-serif); font-style: italic; font-size: 19px; line-height: 1.3; }
.muted { color: var(--ink-muted); }
.link { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; cursor: pointer; }
.link:hover { text-decoration-thickness: 2px; }

/* ---------- frame ---------- */
.ws { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side {
  display: flex; flex-direction: column; gap: 2px; padding: 22px 14px 16px;
  background: var(--surface); border-right: 1.5px solid var(--line-soft); overflow-y: auto; min-height: 0;
}
.side .logo { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 18px; text-decoration: none; }
.side .logo img { width: 104px; height: auto; display: block; }
[data-theme="dark"] .side .logo img, [data-theme="dark"] .signin .logo img { filter: invert(1); }
.side .grp { padding: 18px 10px 6px; }
.nav {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm);
  border: 1.5px solid transparent; font-size: 14.5px; font-weight: 500; text-decoration: none;
}
.nav:hover { background: var(--surface-sunken); }
.nav .count {
  margin-left: auto; min-width: 22px; padding: 1px 6px; border-radius: var(--radius-pill); text-align: center;
  background: var(--surface-inverse); color: var(--on-inverse); font: 500 11px/1.5 var(--font-mono);
}
body[data-page="inbox"] .nav[data-nav="inbox"],
body[data-page="chat"] .nav[data-nav="chat"],
body[data-page="kunden"] .nav[data-nav="kunden"], body[data-page="kunde"] .nav[data-nav="kunden"],
body[data-page="meeting"] .nav[data-nav="inbox"],
body[data-page="kontext"] .nav[data-nav="kontext"],
body[data-page="verbindungen"] .nav[data-nav="verbindungen"],
body[data-page="skills"] .nav[data-nav="skills"], body[data-page="skill"] .nav[data-nav="skills"],
body[data-page="routinen"] .nav[data-nav="routinen"],
body[data-page="transparenz"] .nav[data-nav="transparenz"],
body[data-page="feedback"] .nav[data-nav="feedback"] {
  background: var(--surface-raised); border-color: var(--line); font-weight: 700;
}
.side .foot { margin-top: auto; padding-top: 18px; display: flex; flex-direction: column; gap: 2px; }
.sig {
  display: inline-flex; align-items: center; gap: 5px; padding: 12px 10px 0;
  font: 500 9px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted);
}
.sig svg { width: 9px; height: 9px; fill: var(--rose); stroke: var(--line); stroke-width: 8; overflow: visible; }

body[data-page="start"] .ws { grid-template-columns: minmax(0, 1fr); } /* the first run is a screen of its own: the top bar stays */
body[data-page="start"] .side, body[data-page="start"] .side-shade, body[data-page="start"] .top .menu-btn { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-raised); }
.top {
  display: flex; align-items: center; gap: 12px; flex: none; height: 56px; padding: 0 24px 0 40px;
  border-bottom: 1.5px solid var(--line-soft);
}
.top .menu-btn { display: none; }
.top .crumb { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top .crumb b { font-weight: 700; font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.top .sp { flex: 1; }
.scroll { position: relative; flex: 1; min-height: 0; overflow-y: auto; } /* a positioned child scrolls with it and never stretches the document */
.page { padding: 36px 40px 64px; max-width: 1240px; }
.page.narrow { max-width: 860px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-head .lead { margin-top: 8px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: start; }
.cols.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.cols.wide-side { grid-template-columns: minmax(0, 1fr) 380px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.lg { gap: 28px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 6px 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-pill); background: var(--surface-raised); color: var(--ink);
  font-size: 13.5px; font-weight: 700; line-height: 1.2; letter-spacing: -.005em; text-decoration: none; white-space: nowrap;
  transition: transform var(--duration-quick) var(--ease-out), background var(--duration-quick);
}
.btn:hover:not(:disabled) { background: var(--surface-sunken); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--surface-inverse); color: var(--on-inverse); border-color: var(--surface-inverse); }
.btn.primary:hover:not(:disabled) { background: var(--surface-inverse); opacity: .86; }
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.accent:hover:not(:disabled) { background: var(--accent); opacity: .86; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover:not(:disabled) { background: var(--surface-sunken); }
.btn.sm { min-height: 30px; padding: 3px 12px; font-size: 12.5px; }
.btn.lg { min-height: 44px; padding: 8px 22px; font-size: 15px; }
.btn:disabled, .btn.primary:disabled, .btn.accent:disabled, .btn.ghost:disabled { background: var(--surface-sunken); border-color: var(--line-soft); color: var(--ink-muted); cursor: not-allowed; } /* sunken, and the words stay readable */
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: none;
  border-radius: var(--radius-sm); border: 1.5px solid transparent;
}
.iconbtn:hover { background: var(--surface-sunken); }
.iconbtn.on { border-color: var(--line); background: var(--surface-raised); }
.iconbox {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface-raised); color: var(--ink);
}
.iconbox.sm { width: 32px; height: 32px; border-radius: 9px; }

/* ---------- tags, chips, avatars ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1.5px solid var(--line); border-radius: var(--radius-pill);
  font: 500 10.5px/1.35 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: var(--surface-raised);
}
.tag.soft { border-color: var(--line-soft); color: var(--ink-muted); background: transparent; }
.tag.dash { border-style: dashed; background: transparent; }
.tag.fill { background: var(--accent); color: var(--on-accent); }
.tag.ink { background: var(--surface-inverse); border-color: var(--surface-inverse); color: var(--on-inverse); }
.openmark {
  display: inline-flex; align-items: center; padding: 1px 7px; border: 1.5px dashed var(--line); border-radius: 7px;
  font: 500 11.5px/1.5 var(--font-mono); white-space: nowrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border: 1.5px solid var(--line-soft); border-radius: var(--radius-pill);
  background: var(--surface); font: 500 11px/1.6 var(--font-mono); text-decoration: none; white-space: nowrap; vertical-align: 1px;
}
button.chip:hover, a.chip:hover { border-color: var(--line); }
.chip.conn-off { border: 1.5px dashed var(--line); background: transparent; } /* a connection that is off or waits, where that is the point */
.chip.conn-quiet { color: var(--ink-muted); background: transparent; } /* the same on a list: it runs without it, so no warning */
.chip.client { font: 700 12.5px/1.4 var(--font-display); padding: 4px 11px; border-color: var(--line); background: var(--surface-raised); white-space: normal; vertical-align: 0; } /* a client's name */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border: 1.5px solid var(--line);
  border-radius: 50%; background: var(--surface-raised); font: 500 10.5px/1 var(--font-mono);
}
.avatar.sm { width: 26px; height: 26px; font-size: 9.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line-ghost); }
.dot.on { background: var(--ink); } /* a state, not the next thing to do: the one accent of a view stays free for that */
.dot.work { background: var(--ink); animation: ws-pulse 1.4s var(--ease-in-out) infinite; }
@keyframes ws-pulse { 50% { transform: scale(.65); } }

/* ---------- lists: the Inbox row of the deck ---------- */
.items { display: flex; flex-direction: column; }
.item {
  display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px;
  border: 1.5px solid transparent; border-bottom-color: var(--line-soft);
}
.item:last-child { border-bottom-color: transparent; }
.item .t { font-weight: 700; font-size: 15.5px; line-height: 1.3; letter-spacing: -.01em; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.item .m { font-size: 13.5px; color: var(--ink-muted); line-height: 1.4; margin-top: 2px; }
.item .acts { display: flex; align-items: center; gap: 4px; }
.item .quiet { opacity: 0; transition: opacity var(--duration-quick); }
.item:hover .quiet, .item:focus-within .quiet { opacity: 1; }
.item.focus {
  background: var(--accent); color: var(--on-accent); border: 1.5px solid var(--line); border-radius: var(--radius-md); margin: 0 -2px 2px; padding-inline: 16px; /* hangs out by what its padding gives back: its content stays on the rows' columns */
}
.item.focus .m { color: var(--on-accent); }
.item.focus .iconbox { color: var(--ink); background: var(--surface-raised); }
.item.focus .btn { background: var(--surface-inverse); color: var(--on-inverse); border-color: var(--surface-inverse); }
.item.focus .iconbtn { color: var(--on-accent); }
.item.focus .iconbtn:hover { background: transparent; }
.item.focus :focus-visible { outline-color: var(--on-accent); }
[data-theme="dark"] .item.focus .iconbox { color: var(--on-accent); background: var(--accent); border-color: var(--on-accent); }
[data-theme="dark"] .item.focus .btn { background: var(--on-accent); color: var(--accent); border-color: var(--on-accent); }
.item.focus .btn:disabled, [data-theme="dark"] .item.focus .btn:disabled { background: transparent; border-color: var(--on-accent); color: var(--on-accent); }
.mini { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); text-decoration: none; align-items: flex-start; }
.mini:last-child { border-bottom: 0; }
a.mini:hover .t { text-decoration: underline; text-underline-offset: 2px; }
.mini .t { font-weight: 600; font-size: 14px; line-height: 1.3; }
.item .t, .mini { text-wrap: pretty; } /* no lone word on a title's last line ("Launch Ridge" / "3"); on .mini, since its .t is inline */
.mini .m { font-size: 12.5px; color: var(--ink-muted); line-height: 1.35; margin-top: 1px; }
.mini .tm { font: 500 11px/1.7 var(--font-mono); width: 40px; flex: none; }

/* ---------- panes and cards ---------- */
.pane { padding: 18px 20px; border: 1.5px solid var(--line-soft); border-radius: var(--radius-md); background: var(--surface); }
.pane.white { background: var(--surface-raised); }
.pane > .label:first-child, .pane > .row:first-child { margin-bottom: 8px; }
.card { padding: 18px 20px; border: 1.5px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
a.card { display: block; text-decoration: none; transition: transform var(--duration-quick) var(--ease-out); }
a.card:hover { transform: translateY(-2px); }
.card.focus { background: var(--accent); color: var(--on-accent); }
.card.dash { border-style: dashed; background: transparent; }
.locked {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface-sunken);
  border: 1.5px solid var(--line-soft); font-size: 13.5px;
}
.note { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1.5px solid var(--line-soft); font-size: 13.5px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.input, .textarea, .select {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--line-soft); border-radius: 12px; background: var(--surface);
  font-size: 14.5px; line-height: 1.45;
}
.textarea { resize: vertical; min-height: 92px; }
.input:focus, .textarea:focus, .select:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--line); }
.input::placeholder, .textarea::placeholder { color: var(--ink-muted); }
.select { appearance: none; padding-right: 30px; background-image: none; }
.selectwrap { position: relative; display: block; }
.selectwrap .i { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; background: var(--surface-raised); max-width: 100%; }
.seg button { padding: 6px 16px; font-size: 13.5px; font-weight: 700; border-right: 1.5px solid var(--line); white-space: nowrap; }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--surface-inverse); color: var(--on-inverse); }
.seg button:focus-visible { outline-offset: -3px; } /* inside the clip of the rounded group */
.seg button[aria-pressed="true"]:focus-visible { outline-color: var(--on-inverse); }
.switch {
  position: relative; display: inline-flex; width: 46px; height: 26px; flex: none; border: 1.5px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface-raised); transition: background var(--duration-quick);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: var(--ink);
  transition: transform var(--duration-quick) var(--ease-out);
}
.switch[aria-checked="true"] { background: var(--surface-inverse); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--on-inverse); }
.switch:disabled { opacity: .35; cursor: not-allowed; }
.check { display: inline-flex; align-items: flex-start; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: var(--ink); }

/* ---------- the ask box ---------- */
.ask {
  display: flex; align-items: flex-end; gap: 10px; padding: 10px 10px 10px 18px; border: 1.5px solid var(--line); border-radius: 22px; background: var(--surface-raised);
}
.ask:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.ask textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; padding: 7px 0; background: transparent; font-size: 16px; line-height: 1.4; max-height: 180px; }
.ask textarea::placeholder { color: var(--ink-muted); }
.ask .send { width: 38px; height: 38px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-inverse); color: var(--on-inverse); }
.ask .send:disabled { opacity: .25; cursor: not-allowed; }
.proof { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 4px 0; text-decoration: none; }
.proof span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { padding: 0 12px 8px 0; text-align: left; font: 500 10.5px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }

/* ---------- overlays ---------- */
.shade { position: fixed; inset: 0; background: color-mix(in srgb, var(--surface-inverse) 42%, transparent); z-index: 40; }
[data-theme="dark"] .shade { background: color-mix(in srgb, var(--surface-sunken) 72%, transparent); } /* the inverse is chalk there: it would brighten the page */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); z-index: 41; display: flex; flex-direction: column;
  background: var(--surface-raised); border-left: 1.5px solid var(--line);
}
.drawer .dh { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1.5px solid var(--line-soft); }
.drawer .db { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px; }
.drawer .df { padding: 14px 22px; border-top: 1.5px solid var(--line-soft); display: flex; flex-direction: column; gap: 8px; }
.dialog {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto;
  z-index: 41; padding: 24px; background: var(--surface-raised); border: 1.5px solid var(--line); border-radius: var(--radius-lg);
}
.popmenu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 30; padding: 8px; background: var(--surface-raised);
  border: 1.5px solid var(--line); border-radius: var(--radius-md);
}
.popmenu a, .popmenu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 14px; text-decoration: none; text-align: left; }
.popmenu a:hover, .popmenu button:hover { background: var(--surface-sunken); }
.popmenu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.rel { position: relative; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  padding: 10px 18px; border-radius: var(--radius-pill); background: var(--surface-inverse); color: var(--on-inverse); font-size: 14px; font-weight: 600;
}

/* ---------- answers ---------- */
.md { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.md p { margin: 0 0 .7em; }
.md p:last-child { margin-bottom: 0; }
.md h3 { margin: 1.1em 0 .35em; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.md h3:first-child { margin-top: 0; }
.md ul, .md ol { margin: 0 0 .7em; padding-left: 1.25em; }
.md ul { list-style: disc; }
.md ol { list-style: decimal; }
.md li { margin-bottom: .25em; }
.md code { font: 500 13px/1.4 var(--font-mono); padding: 1px 2px; background: var(--surface); border-radius: 5px; }
.md pre { overflow-x: auto; padding: 12px 14px; background: var(--surface); border-radius: 10px; }
.md pre code { padding: 0; background: none; }
.md a { text-decoration: underline; text-underline-offset: 2px; }
.md a.src {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; margin: 0 1px; border: 1.5px solid var(--line); border-radius: 50%;
  font: 500 9.5px/1 var(--font-mono); text-decoration: none; vertical-align: 2px;
}
.md a.src:hover { background: var(--accent); color: var(--on-accent); }
.md .open { display: inline-block; max-width: calc(100% - 1ch); padding: 1px 6px; border: 1.5px dashed var(--line); border-radius: 7px; font: 500 12.5px/1.6 var(--font-mono); } /* whole, and room for a full stop behind it */
.trace { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.why { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.why summary { cursor: pointer; font-size: 13px; color: var(--ink-muted); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.why summary::-webkit-details-marker { display: none; }
.why[open] summary { color: var(--ink); margin-bottom: 8px; }
.srcrow { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); }
.srcrow:last-child { border-bottom: 0; }
.srcrow .n { font: 500 10.5px/1.4 var(--font-mono); width: 26px; flex: none; }
.activity { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13.5px; color: var(--ink-muted); }
.skeleton { display: block; height: 14px; border-radius: 6px; background: var(--surface-sunken); animation: ws-sk 1.4s var(--ease-in-out) infinite; }
@keyframes ws-sk { 50% { opacity: .45; } }
.alert { padding: 11px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.alert.stop { background: var(--rose); color: var(--on-accent); }
.reauth { flex: none; justify-content: space-between; margin: 16px 16px 0; }

/* ---------- empty states and diagrams ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; text-align: center; }
.empty svg { width: 150px; height: auto; }
.dg { display: block; width: 100%; height: auto; }
.dg .ln { fill: none; stroke: var(--line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dg .sf { fill: var(--surface-raised); stroke: var(--line); stroke-width: 2; }
.dg .af { fill: var(--accent); stroke: var(--line); stroke-width: 2; }
.dg .dsh { fill: none; stroke: var(--line); stroke-width: 2; stroke-dasharray: 5 5; }
.dg text { fill: var(--ink); font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.dg text.mono { font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: .08em; fill: var(--ink-muted); }
.dg .ontext { fill: var(--on-accent); }

/* ---------- sign-in ---------- */
.signin { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--surface); }
.signin .box { width: min(460px, 100%); display: flex; flex-direction: column; gap: 20px; }
.signin .logo img { width: 150px; height: auto; display: block; }
.signin .ms { display: inline-grid; grid-template-columns: 7px 7px; gap: 1.5px; }
.signin .ms i { width: 7px; height: 7px; background: currentColor; display: block; }
.signin .trust { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.signin .trust li { display: flex; gap: 9px; align-items: center; }
.oid { font: 500 12px/1.5 var(--font-mono); overflow-wrap: anywhere; padding: 8px 12px; background: var(--surface-sunken); border-radius: 8px; }

/* ---------- mobile ---------- */
@media (max-width: 1080px) {
  .cols, .cols.wide-side { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .cols.even { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 28px 28px 56px; }
  .top { padding-left: 28px; }
}
@media (max-width: 820px) {
  .ws { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 50; transform: translateX(-100%); visibility: hidden;
    transition: transform var(--duration-base) var(--ease-out), visibility 0s linear var(--duration-base); background: var(--surface);
  }
  .ws.nav-open .side { transform: none; visibility: visible; border-right-color: var(--line); transition: transform var(--duration-base) var(--ease-out), visibility 0s; }
  .top { padding: 0 12px 0 8px; height: 52px; }
  .top .menu-btn { display: inline-flex; }
  body[data-page="start"] .top { padding-left: 16px; } /* no menu button there: the page's name keeps the gutter */
  .page { padding: 22px 16px 48px; }
  .h1 { font-size: 30px; }
  .item { grid-template-columns: 38px minmax(0, 1fr); padding: 14px 8px; gap: 12px; }
  .item .iconbox { width: 38px; height: 38px; }
  .item .acts { grid-column: 2; flex-wrap: wrap; }
  .item.focus { padding: 14px 12px; margin: 0 -4px 2px; }
  .item .quiet { opacity: 1; }
  .ask textarea { font-size: 16px; }
  .drawer { width: 100vw; }
  .toast { left: 16px; right: 16px; width: fit-content; max-width: none; margin-inline: auto; transform: none; border-radius: var(--radius-md); }
}
@media (max-width: 480px) {
  /* The page's own name stands alone: "KI-Workspace" would wrap to two lines beside it. */
  .top .crumb b, .top .crumb b + .label { display: none; }
  .top .crumb .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0s !important; transition-duration: 0s !important; }
}
