/* Raydar Remote — mobil zuerst, dunkel.
 * Farben aus Raydar-Desktop (ui/style.css, README „Farben“):
 *   Amber = läuft (reserviert, kein Button trägt es), Grünblau = fertig,
 *   Ton/Rot = wartet bzw. Achtung, Grau = ruhig. Indigo = Marke, Haupt-Knöpfe. */

:root {
  --bg: #0a0d13;
  --card: #10141b;
  --card-2: #151a23;
  --card-3: #1b212c;
  --line: #1a2029;
  --line-2: #252d39;

  --ink: #eef1f6;
  --ink-2: #b0b8c5;
  --ink-3: #8a93a1;
  --ink-4: #5d6573;

  --amber: #ffb81c;
  --jade: #4fb39f;
  --rust: #ef6a4c;
  --rust-soft: rgba(239, 106, 76, .14);
  --grey: #68738a;

  --indigo: #6e5cf5;
  --indigo-hi: #8474ff;
  --indigo-deep: #34238f;
  --indigo-soft: rgba(132, 116, 255, .14);

  --text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --radius: 16px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--text);
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

button, input, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--indigo-hi); outline-offset: 2px; border-radius: 8px; }

h1, h2, h3, p { margin: 0; }

/* ------------------------------------------------------------ Knöpfe */

.btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--card-3);
  color: var(--ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn--primary { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.btn--primary:not(:disabled):hover { background: #7b6aff; }
.btn--deny { background: transparent; color: var(--ink); }
.btn--deny:not(:disabled):hover { border-color: var(--rust); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--danger { background: var(--rust-soft); border-color: rgba(239, 106, 76, .4); color: #ffc2b4; }
.btn--wide { width: 100%; }

.iconbtn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
.iconbtn:hover, .iconbtn[aria-pressed="true"] { background: var(--card-3); color: var(--ink); }

/* --------------------------------------------------------------- Logo */

.logo { flex: none; display: block; }
.logo__bg { fill: #4a39c4; }
.logo__ring { fill: none; stroke: rgba(255, 255, 255, .35); stroke-width: 1.6; }
.logo__sweep { fill: rgba(210, 205, 255, .3); }
.logo__lead { stroke: rgba(255, 255, 255, .85); stroke-width: 1.5; stroke-linecap: round; }
.logo__dot { fill: #fff; }
.logo__blip { fill: #8ff0d6; }

/* ------------------------------------------- Kopplung / Willkommen */

.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px var(--gutter) 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin-bottom: 8px; }
.hero .logo { border-radius: 18px; box-shadow: 0 10px 40px rgba(110, 92, 245, .35); }
.hero__title { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.hero__lead { color: var(--ink-2); }

.pairform { display: flex; flex-direction: column; gap: 10px; }
.label { font-size: 14px; color: var(--ink-2); }

.field {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
}
.field::placeholder { color: var(--ink-4); }
.field:focus-visible { border-color: var(--indigo-hi); outline-offset: 0; }

.note {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 15px;
}
.note:empty { display: none; }
.note--bad { border-color: rgba(239, 106, 76, .45); color: #ffc2b4; }
.note--warn { border-color: var(--line-2); color: var(--ink-2); }
.note--hint { display: flex; gap: 10px; align-items: flex-start; border-color: rgba(132, 116, 255, .35); background: var(--indigo-soft); color: var(--ink); }
.note--hint svg { flex: none; margin-top: 2px; color: var(--indigo-hi); }

/* Warte-Radar beim Koppeln */
.radar-wait { position: relative; width: 120px; height: 120px; margin: 8px auto; }
.radar-wait i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--indigo-hi);
  opacity: 0;
  animation: ping 2.4s var(--ease) infinite;
}
.radar-wait i:nth-child(2) { animation-delay: .8s; }
.radar-wait i:nth-child(3) { animation-delay: 1.6s; }
@keyframes ping { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }

/* ------------------------------------------------------ Hauptansicht */

.main { max-width: 640px; margin: 0 auto; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px var(--gutter) 10px;
  background: rgba(10, 13, 19, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top__row { display: flex; align-items: center; gap: 12px; }
.top__row .logo { border-radius: 9px; }
.top__who { flex: 1; min-width: 0; }
.top__pc { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.conn { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); }
.conn__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey); flex: none; }
.conn[data-state="on"] .conn__dot { background: var(--jade); }
.conn[data-state="on"] { color: var(--ink-2); }
.conn[data-state="pc-off"] .conn__dot { background: var(--grey); }
.conn[data-state="off"] .conn__dot { background: var(--rust); }

.usage { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
}
.chip b { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip__track { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.chip__bar { display: block; height: 100%; background: var(--ink-3); }
.chip--hot .chip__bar { background: var(--rust); }
.chip--hot b { color: #ffc2b4; }

.content { padding: 12px var(--gutter) 0; }
.view { display: flex; flex-direction: column; gap: 22px; }
.banners { display: flex; flex-direction: column; gap: 10px; }
.banners:empty { display: none; }

.sec { display: flex; flex-direction: column; gap: 10px; }
.sec__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
}
.count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--rust);
  color: #1a0904;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}
.count:empty { display: none; }
.needs { display: flex; flex-direction: column; gap: 12px; }
.empty { color: var(--ink-3); font-size: 15px; padding: 4px 2px; list-style: none; }

.is-offline .card--need { opacity: .8; }

/* -------------------------------------------------------------- Karten */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.card--need { border-color: rgba(239, 106, 76, .35); box-shadow: inset 3px 0 0 var(--rust); }
.card.is-busy { border-color: rgba(132, 116, 255, .5); box-shadow: inset 3px 0 0 var(--indigo-hi); }
.card__kicker { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); flex-wrap: wrap; }
.card__kicker > span:first-of-type { color: var(--ink-2); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.card__time { margin-left: auto; font-variant-numeric: tabular-nums; }
.card__title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.card__desc { color: var(--ink-2); overflow-wrap: anywhere; }

.risks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: #ffc2b4; }
.risks svg { color: var(--rust); }
.risks__tag {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--rust-soft);
  border: 1px solid rgba(239, 106, 76, .35);
}

.cmd {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #06080c;
  border: 1px solid var(--line-2);
  font: 13.5px/1.55 var(--mono);
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 42vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.cmd code { font: inherit; }
.risk {
  background: rgba(239, 106, 76, .22);
  color: #ffd3c8;
  border-radius: 4px;
  padding: 0 2px;
  box-shadow: inset 0 -2px 0 var(--rust);
}
.file { font: 13px var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions .btn--wide { grid-column: 1 / -1; }

.step { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.step .btn { min-height: 44px; }
.step__msg { color: var(--ink-2); }
.step__msg--bad { color: #ffc2b4; }
.spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--indigo-hi);
  animation: spin .8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Rückfragen */
.q { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.q + .q { padding-top: 12px; border-top: 1px solid var(--line); }
.q__head { display: flex; align-items: center; gap: 8px; padding: 0; font-size: 12.5px; color: var(--ink-3); }
.q__tag { padding: 2px 8px; border-radius: 6px; background: var(--card-3); color: var(--ink-2); font-weight: 600; }
.q.is-done .q__mode::after { content: " ✓"; color: var(--jade); }
.q__text { font-weight: 600; font-size: 16.5px; overflow-wrap: anywhere; }
.q__opts { display: flex; flex-direction: column; gap: 8px; }

.opt {
  min-height: 48px;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  cursor: pointer;
  touch-action: manipulation;
}
.opt[aria-checked="true"] { border-color: var(--indigo-hi); background: var(--indigo-soft); }
.opt:disabled { opacity: .55; }
.opt__box {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid var(--ink-4);
  border-radius: 50%;
}
.opt[role="checkbox"] .opt__box { border-radius: 5px; }
.opt[aria-checked="true"] .opt__box { border-color: var(--indigo-hi); background: var(--indigo-hi); box-shadow: inset 0 0 0 3px var(--card-2); }
.opt[role="checkbox"][aria-checked="true"] .opt__box { box-shadow: none; background: var(--indigo-hi) center / 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.opt__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt__l { font-weight: 600; overflow-wrap: anywhere; }
.opt__d { font-size: 14px; color: var(--ink-3); overflow-wrap: anywhere; }
.field--other.is-on { border-color: var(--indigo-hi); }

/* Lagebild */
.brief__text { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink-2); overflow-wrap: anywhere; }

/* ------------------------------------------------------------ Sessions */

.sessions { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sess { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; min-height: 56px; }
.sess + .sess { border-top: 1px solid var(--line); }
.sess__main { flex: 1; min-width: 0; }
.sess__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess__meta { font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess__tool { font: 12.5px var(--mono); color: var(--amber); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sess__side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sess__status--wait { color: var(--rust); font-weight: 600; }
.sess__status--run { color: var(--amber); }
.sess__status--done { color: var(--jade); }

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--grey); display: inline-block; }
.sess .dot { margin-top: 7px; }
.dot--run { background: var(--amber); box-shadow: 0 0 0 3px rgba(255, 184, 28, .18); }
.dot--wait { background: var(--rust); box-shadow: 0 0 0 3px rgba(239, 106, 76, .2); }
.dot--done { background: var(--jade); }
.dot--idle { background: var(--grey); }

@media (prefers-reduced-motion: no-preference) {
  .dot--run { animation: pulse 1.6s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 184, 28, 0); } }
}

.is-flash { animation: flash 1.8s var(--ease); }
@keyframes flash { 0%, 40% { background: var(--indigo-soft); outline: 2px solid var(--indigo-hi); outline-offset: -2px; } 100% { outline-color: transparent; } }

/* --------------------------------------------------------- Einstellungen */

.settings { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.row__title { font-weight: 600; }
.row__hint { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.version { text-align: center; font-size: 13px; color: var(--ink-4); }

.switch {
  flex: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  border: 0;
  background: none;
  cursor: pointer;
}
.switch__knob {
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: 15px;
  background: var(--line-2);
  transition: background .2s;
}
.switch__knob::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink-2);
  transition: transform .2s var(--ease), background .2s;
}
.switch[aria-checked="true"] .switch__knob { background: var(--indigo); }
.switch[aria-checked="true"] .switch__knob::after { transform: translateX(20px); background: #fff; }
.switch__text { font-size: 14px; color: var(--ink-2); min-width: 2.2em; }
.switch:disabled { opacity: .45; cursor: default; }

/* --------------------------------------------------------------- Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  width: max-content;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--card-3);
  border: 1px solid var(--line-2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  font-size: 15px;
  z-index: 20;
}

@media (min-width: 640px) {
  .content { padding-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .radar-wait i { animation: none; opacity: .5; }
  .radar-wait i:nth-child(1) { transform: scale(.35); }
  .radar-wait i:nth-child(2) { transform: scale(.65); }
  .radar-wait i:nth-child(3) { transform: scale(1); }
}

/* =====================================================================
   v1.1 — Reiter, Radar, Detail, Heute, GitHub, Fokus
   ===================================================================== */

.banners { padding: 12px var(--gutter) 0; }

/* ------------------------------------------------------- Reiterleiste */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(10, 13, 19, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
body:not([data-screen="main"]) .tabbar { display: none; }
.tab {
  flex: 1;
  max-width: 150px;
  min-height: 56px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  touch-action: manipulation;
}
.tab[aria-current="page"] { color: var(--ink); background: var(--card-2); }
.tab[aria-current="page"] .tab__icon { color: var(--indigo-hi); }
.tab__icon { position: relative; display: flex; }
.tab__l { font-size: 12px; font-weight: 600; }
.tab__badge {
  position: absolute;
  top: -6px;
  right: -12px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--rust);
  color: #1a0904;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* ---------------------------------------------------------- Radar */

.radar {
  --glow: 120, 140, 170;
  --dish: min(calc(100vw - 32px), 420px);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 50%, rgba(var(--glow), .16), transparent 62%), var(--card);
}
.radar[data-state="need"] { --glow: 239, 106, 76; border-color: rgba(239, 106, 76, .35); }
.radar[data-state="work"] { --glow: 255, 184, 28; }
.radar[data-state="idle"] { --glow: 52, 199, 154; }
.radar[data-state="sleep"] { --glow: 80, 90, 105; }
.radar__rings { position: absolute; left: 50%; top: 46%; width: 0; height: 0; pointer-events: none; }
.radar__rings i { position: absolute; left: 0; top: 0; border-radius: 50%; border: 1px solid rgba(var(--glow), .22); transform: translate(-50%, -50%); }
.radar__rings i:nth-child(1) { width: calc(var(--dish) * .4); height: calc(var(--dish) * .4); }
.radar__rings i:nth-child(2) { width: calc(var(--dish) * .66); height: calc(var(--dish) * .66); border-color: rgba(var(--glow), .15); }
.radar__rings i:nth-child(3) { width: calc(var(--dish) * .94); height: calc(var(--dish) * .94); border-color: rgba(var(--glow), .09); }
/* Strahl: harte, helle Kante vorn (im Uhrzeigersinn), Schweif dahinter — wie in Raydar */
.radar__rings b {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--dish) * .94);
  height: calc(var(--dish) * .94);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, transparent 0deg, transparent 290deg, rgba(var(--glow), 0) 290deg, rgba(var(--glow), .32) 360deg);
  opacity: 0;
}
.radar[data-state="work"] .radar__rings b, .radar[data-state="need"] .radar__rings b, .radar[data-state="idle"] .radar__rings b { opacity: 1; animation: radarSweep 3.2s linear infinite; }
.radar[data-state="idle"] .radar__rings b { animation-duration: 6s; opacity: .6; }
.radar[data-state="need"] .radar__rings b { animation-duration: 1.6s; }
@keyframes radarSweep { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
.radar__fig { position: absolute; left: 50%; top: 46%; width: 126px; height: 126px; transform: translate(-50%, -50%); }
.radar__slot { position: relative; width: 126px; height: 126px; transform: translateY(var(--vy, 0px)); }
/* Effekt-Leinwand 34×26 um das 18×18-Feld (wie Raydars canvas.fx) */
.radar canvas.fx {
  position: absolute;
  left: calc(100% * -8 / 18);
  top: calc(100% * -4 / 18);
  width: calc(100% * 34 / 18);
  height: calc(100% * 26 / 18);
  image-rendering: pixelated;
  pointer-events: none;
}
.radar__head { position: absolute; left: 0; right: 0; bottom: 16px; padding: 0 16px; text-align: center; }
.radar__big { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.radar__big.is-need { color: #ffc2b4; }
.radar__sub { margin-top: 2px; font-size: 13.5px; color: var(--ink-3); }

/* ---------------------------------------------------- Segmente, Chips */

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.seg__b {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.seg__b[aria-pressed="true"] { background: var(--card-3); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.btn--chip { min-height: 44px; padding: 0 16px; }
.btn--ghost-line { background: transparent; }
.sec__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec__sub { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-4); }
.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 15px; }
.note--ok { border-color: rgba(79, 179, 159, .45); color: #bdf0e2; }
.chip--focus { color: var(--ink-2); border-color: rgba(132, 116, 255, .4); }

/* Fokus */
.focus__state { font-weight: 600; color: var(--ink-2); }
.focus__state.is-on { color: var(--ink); }

/* Lagebild */
.brief__ctl { display: flex; flex-wrap: wrap; gap: 8px; }
.brief__overall { color: var(--ink); overflow-wrap: anywhere; }
.brief__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.brief__items li { display: flex; flex-direction: column; gap: 2px; color: var(--ink-2); overflow-wrap: anywhere; }
.brief__who {
  align-self: flex-start;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--indigo-hi);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

/* GitHub */
.gh__card { gap: 6px; }
.gh__h { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-top: 6px; }
.gh__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.gh__row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--card-2);
  color: var(--ink);
  text-decoration: none;
}
a.gh__row:hover { background: var(--card-3); }
.gh__t { font-weight: 600; overflow-wrap: anywhere; }
.gh__m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }
.gh__m code { font: 12px var(--mono); color: var(--ink-2); }
.ghc { padding: 1px 7px; border-radius: 6px; background: var(--card-3); color: var(--ink-2); font-size: 12px; }
.ghc--success { color: #bdf0e2; background: rgba(79, 179, 159, .16); }
.ghc--failure { color: #ffc2b4; background: var(--rust-soft); }

/* -------------------------------------------------- Sessions-Liste */

.sess-li { list-style: none; }
.sess-li + .sess-li { border-top: 1px solid var(--line); }
.sess--btn {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.sess--btn:active { background: var(--card-2); }
.sess__chev { align-self: center; color: var(--ink-4); flex: none; display: flex; }

/* ------------------------------------------------------------ Detail */

.dhead { display: flex; align-items: flex-start; gap: 8px; margin-left: -8px; }
.dhead__main { flex: 1; min-width: 0; padding-top: 6px; }
.dhead__title { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.dhead__meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; color: var(--ink-3); }
.ctx { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-3); }
.ctx__track { flex: 1; height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.ctx__bar { display: block; height: 100%; background: var(--ink-3); }
.ctx.is-hot .ctx__bar { background: var(--rust); }
.dsec { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.dsec__body { min-width: 0; }

.cur { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cur__tool { display: inline-flex; align-items: center; gap: 8px; font: 600 14px var(--mono); color: var(--ink); }
.cur__since { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.pv { display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; min-width: 0; }
.pv__file, .pv__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 13px var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.pv__tag { font: 12px var(--text); padding: 1px 7px; border-radius: 6px; background: var(--card-3); color: var(--ink-2); }
.pv__text { color: var(--ink-2); font-size: 14.5px; overflow-wrap: anywhere; white-space: pre-wrap; }
.pv__cmd, .pv__out, .diff {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: #06080c;
  border: 1px solid var(--line-2);
  font: 12.5px/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 46vh;
  overflow: auto;
}
.pv__prompt { color: var(--ink-4); }
.pv__out { color: var(--ink-2); }
.pv__out.is-err { border-color: rgba(239, 106, 76, .45); color: #ffc2b4; }
.pv__opts { margin: 4px 0 0; padding-left: 18px; color: var(--ink-2); }
.diff { padding: 6px 0; }
.diff__l { display: block; padding: 0 10px; }
.diff__s { display: inline-block; width: 1.2em; color: var(--ink-4); }
.diff__l--add { background: rgba(79, 179, 159, .13); color: #c9f3e8; }
.diff__l--add .diff__s { color: var(--jade); }
.diff__l--del { background: rgba(239, 106, 76, .13); color: #ffd3c8; }
.diff__l--del .diff__s { color: var(--rust); }
.diff__l--hunk { color: var(--indigo-hi); }
.diff__l--ctx { color: var(--ink-3); }

.todos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.todo { display: flex; gap: 10px; align-items: flex-start; overflow-wrap: anywhere; }
.todo__box { flex: none; width: 16px; height: 16px; margin-top: 3px; border-radius: 5px; border: 2px solid var(--ink-4); }
.todo--in_progress .todo__box { border-color: var(--amber); box-shadow: inset 0 0 0 3px var(--bg); background: var(--amber); }
.todo--completed { color: var(--ink-3); text-decoration: line-through; }
.todo--completed .todo__box { border-color: var(--jade); background: var(--jade); }

.agents, .steps { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.agent, .stepi { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-height: 44px; font-size: 14px; min-width: 0; }
.agent + .agent, .stepi + .stepi { border-top: 1px solid var(--line); }
.agent__n { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent__t { font: 12.5px var(--mono); color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent__s { margin-left: auto; }
.agent__s, .agent__since, .stepi__at { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; }
.stepi__at { margin-left: auto; }
.stepi__mark { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--jade); }
.stepi--err .stepi__mark { background: var(--rust); }
.stepi--run .stepi__mark { background: var(--amber); }
.stepi__tool { font: 600 13px var(--mono); flex: none; }
.stepi__d { color: var(--ink-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }

.d-user__t { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Mini-Markdown */
.md { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overflow-wrap: anywhere; color: var(--ink); }
.md p, .md li { color: var(--ink-2); }
.md__h { font-size: 15.5px; margin: 4px 0 0; color: var(--ink); }
.md__list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.md__code { margin: 0; padding: 10px; border-radius: 10px; background: #06080c; border: 1px solid var(--line-2); font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow: auto; max-height: 40vh; }
.md__c { font: 13px var(--mono); padding: 0 4px; border-radius: 4px; background: var(--card-3); color: var(--ink); }
.md__quote { margin: 0; padding-left: 12px; border-left: 3px solid var(--line-2); color: var(--ink-3); }
.md a { color: var(--indigo-hi); }

.recall { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.recall dt { font-weight: 600; color: var(--ink-3); font-size: 13.5px; }
.recall dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

/* Anweisung */
.d-compose { padding: 14px; background: var(--card); border: 1px solid rgba(132, 116, 255, .35); border-radius: var(--radius); }
.field--area { min-height: 112px; resize: vertical; line-height: 1.45; font-size: 16px; }
.ins__row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.ins__count { font-size: 12.5px; color: var(--ink-4); font-variant-numeric: tabular-nums; flex: none; }

/* ------------------------------------------------------------- Heute */

.today { display: flex; flex-direction: column; gap: 14px; }
.totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.total { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.total b { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.total span { color: var(--ink-3); font-size: 13.5px; }
.effort { list-style: none; margin: 0; }
.effort__row { display: flex; flex-direction: column; gap: 6px; }
.effort__top { display: flex; justify-content: space-between; gap: 8px; }
.effort__l { overflow-wrap: anywhere; }
.effort__top b { font-variant-numeric: tabular-nums; flex: none; }
.effort__track { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.effort__bar { display: block; height: 100%; background: var(--indigo); }

@media (prefers-reduced-motion: reduce) {
  .radar__rings b { animation: none !important; transform: translate(-50%, -50%) rotate(40deg); }
}

/* Hinweis über der Reiterleiste */
body[data-screen="main"] .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

/* =====================================================================
   v1.1.1 — Live-Liste, Banner-Knopf, gekürzte Antwort
   ===================================================================== */

.sess__tool.is-wait { color: #ffc2b4; }

.toast.is-action { padding: 0; }
.toast__btn {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.toast__btn::after { content: " ›"; color: var(--indigo-hi); font-weight: 700; }
.toast__btn:focus-visible { outline-offset: -2px; }

/* Letzte Antwort: erst ~12 Zeilen, dann „Mehr anzeigen“ */
.d-answer .clamp { position: relative; max-height: calc(12 * 1.45em + 26px); overflow: hidden; }
.d-answer .clamp.is-open { max-height: none; }
.d-answer .clamp:not(.is-open)::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 48px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(transparent, var(--card));
  pointer-events: none;
}
.d-answer .more { align-self: flex-start; min-height: 44px; padding: 0 4px; color: var(--indigo-hi); }
.d-pending .needs { display: flex; flex-direction: column; gap: 12px; }

/* Neue Version: oben, über allem, antippbar */
.update {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: max-content;
  max-width: calc(100vw - 32px);
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(132, 116, 255, .6);
  border-radius: 12px;
  background: var(--indigo);
  color: #fff;
  font: 600 15px var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  cursor: pointer;
}
