/* app.css part 5/8: admin mode, sources page, dashboard, day loading state, swipe. Split from app.css 10.11.2026; the parts load in this order [see css_parts.py], one cascade. */
/* ── Admin Mode ── */
/* The admin-mode indicator is a red dot on the Admin button [admin.css]; the old corner badge is gone [18.11.]. */
.admin-bar {
  display: none; position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(225,29,72,.92); backdrop-filter: blur(4px);
  padding: .35rem .6rem; gap: .4rem; flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.2);
}
body.admin-mode .article-card { position: relative; padding-bottom: 2.4rem; }
body.admin-mode .admin-bar { display: flex; }
.admin-bar button {
  appearance: none; border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.12); color: #fff;
  font-family: var(--sans); font-size: .75rem; font-weight: 600;
  padding: .18rem .55rem; border-radius: 5px; cursor: pointer;
  transition: background .15s ease;
}
.admin-bar button:hover { background: rgba(255,255,255,.28); }
.admin-panel {
  display: none; position: fixed; top: 0; right: 0; bottom: 0;
  width: min(480px, 100vw); background: var(--bg-soft);
  border-left: var(--rule-w) solid var(--rule);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 8500; overflow-y: auto; padding: 1.5rem 1.25rem;
  font-family: var(--sans); font-size: .8rem;
}
.admin-panel.open { display: block; }
.admin-panel-close {
  position: absolute; top: .8rem; right: .8rem;
  appearance: none; background: none; border: none;
  font-size: 1.2rem; cursor: pointer; color: var(--fg-mid); line-height: 1; padding: .2rem;
}
.admin-panel h3 { font-size: .9rem; margin: 0 0 .75rem; color: var(--fg); }
.admin-panel h4 { font-size: .75rem; margin: 1rem 0 .4rem; color: var(--fg-dim); text-transform: uppercase; letter-spacing: .07em; }
.admin-kv { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; margin-bottom: .5rem; }
.admin-kv dt { color: var(--fg-dim); white-space: nowrap; }
.admin-kv dd { color: var(--fg); word-break: break-all; margin: 0; }
.admin-ev-true  { color: #16a34a; font-weight: 700; }
.admin-ev-false { color: #e11d48; font-weight: 700; }
.admin-ev-none  { color: var(--fg-dim); }
.admin-member { padding: .5rem .6rem; border-radius: 8px; border: var(--rule-w) solid var(--rule); margin-bottom: .4rem; background: var(--bg); }
.admin-member-title { font-size: .78rem; color: var(--fg); margin-bottom: .25rem; }
.admin-member-meta  { font-size: .75rem; color: var(--fg-dim); }
.admin-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.admin-actions button {
  appearance: none; background: var(--accent-soft); color: var(--accent-strong);
  border: var(--rule-w) solid var(--accent); font-family: var(--sans);
  font-size: .75rem; font-weight: 600; padding: .35rem .8rem;
  border-radius: 8px; cursor: pointer; transition: background .15s ease;
}
.admin-actions button:hover { background: var(--accent-solid); color: var(--accent-fg); }
.admin-actions button.danger { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.admin-actions button.danger:hover { background: #e11d48; color: #fff; border-color: #e11d48; }
@keyframes spin { to { transform: rotate(360deg); } }
.admin-spinner { display: inline-block; width: .9rem; height: .9rem; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; vertical-align: middle; margin-left: .4rem; }

/* ─── Sources page (/quellen) ─── */
.sources-hero { padding: 2.5rem 0 1.5rem; border-bottom: var(--rule-w) solid var(--rule); margin-bottom: 2rem; }
.sources-hero h1 { font-family: var(--display); font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; margin: 0 0 .6rem; }
.sources-hero p { font-family: var(--sans); font-size: .95rem; color: var(--fg-mid); margin: 0; max-width: 56ch; }
.sources-grid { display: flex; flex-direction: column; gap: 0; }
.source-group { margin-bottom: 2.5rem; }
.source-group-label { font-family: var(--sans); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-dim); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: var(--rule-w) solid var(--rule-soft); }
.source-card { display: flex; gap: 1rem; padding: 1.25rem 0; border-bottom: var(--rule-w) solid var(--rule-soft); }
.source-card:last-child { border-bottom: none; }
.source-body { flex: 1; min-width: 0; }
.source-flag { flex-shrink: 0; width: 30px; height: 20px; border-radius: 0; overflow: hidden; box-shadow: 0 0 0 .5px rgba(0,0,0,.08); margin-top: .15rem; }
.source-flag svg { display: block; width: 100%; height: 100%; }
.source-name { font-family: var(--display); font-size: 1.05rem; font-weight: 700; color: var(--fg); text-decoration: none; display: inline-block; margin-bottom: .4rem; }
.source-name:hover { color: var(--accent); }
.source-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .5rem; }
.source-tag { font-family: var(--sans); font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 4px; background: var(--bg-card); color: var(--fg-mid); }
.source-tag.type { background: color-mix(in oklab, var(--accent-soft) 40%, var(--bg-card)); color: var(--accent-strong); }
.source-desc { font-family: var(--sans); font-size: .88rem; line-height: 1.7; color: var(--fg-mid); max-width: 72ch; margin: 0; }
.back-link { font-family: var(--sans); font-size: .82rem; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; margin-bottom: 1.5rem; }
.back-link:hover { text-decoration: underline; }
.sources-count { font-family: var(--sans); font-size: .8rem; color: var(--fg-dim); margin-top: .4rem; }

/* ─── Dashboard (/dashboard) ─── */
.dash-wrap { max-width: 1100px; margin: 0 auto; padding: 1rem 1.5rem 6rem; }
.stat-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 2rem; }
.stat { background: var(--bg-soft); border: var(--rule-w) solid var(--rule); border-radius: var(--radius-sm);
  padding: 1rem 1.4rem; min-width: 140px; }
.stat .val { font-family: var(--display); font-size: 1.7rem; font-weight: 700; color: var(--accent-strong); }
.stat .lbl { font-size: .75rem; color: var(--fg-dim); margin-top: .2rem; }
.audit-card { background: var(--bg-soft); border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 1rem;
  box-shadow: var(--shadow-sm); overflow: hidden; }
.audit-head { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.audit-title { font-family: var(--display); font-weight: 600; font-size: 1.05rem;
  overflow-wrap: anywhere; word-break: break-word; }
.audit-meta { font-size: .75rem; color: var(--fg-dim); overflow-wrap: anywhere; word-break: break-word; }
.audit-meta a { color: var(--accent-strong); text-decoration: none; overflow-wrap: anywhere; }
.audit-badges { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; min-width: 0; }
.badge { display: inline-block; padding: .2rem .65rem; border-radius: 999px;
  font-size: .73rem; font-weight: 600; font-family: var(--sans); }
.badge-ok { background: #dcfce7; color: #15803d; }
.badge-warn { background: #fef9c3; color: #a16207; }
.badge-err { background: #fee2e2; color: #b91c1c; }
.badge-pending { background: var(--bg-tint); color: var(--fg-dim); }
[data-theme="dark"] .badge-ok { background: #14241a; color: #4ade80; }
[data-theme="dark"] .badge-warn { background: #2d2000; color: #fbbf24; }
[data-theme="dark"] .badge-err { background: #2d0a0a; color: #f87171; }
.chars { font-size: .73rem; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.verify-btn {
  appearance: none; background: var(--accent-solid); color: var(--accent-fg);
  border: 0; border-radius: 999px; padding: .25rem .85rem;
  font-family: var(--sans); font-size: .73rem; font-weight: 600; cursor: pointer;
  transition: background .15s ease; }
.verify-btn:hover { background: var(--accent-strong); }
.verify-btn:disabled { opacity: .5; cursor: default; }
.issues { margin: .5rem 0 0 1rem; padding: 0; font-size: .82rem; color: var(--fg-mid); line-height: 1.6; }
.issues li { margin-bottom: .25rem; }
.col-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.col { background: var(--bg-tint); border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius-sm); padding: 1rem; }
.col-head { font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--fg-dim); margin-bottom: .6rem; }
.col-body { font-size: .83rem; line-height: 1.65; color: var(--fg-mid);
  white-space: pre-wrap; word-break: break-word; max-height: 1200px; overflow-y: auto; }
.toggle-btn {
  appearance: none; background: transparent; border: 0; padding: .4rem 0 0;
  font-family: var(--sans); font-size: .78rem; color: var(--accent-strong);
  cursor: pointer; text-align: left; }
.toggle-btn:hover { text-decoration: underline; }
.empty-state { color: var(--fg-dim); font-style: italic; padding: 3rem 0;
  text-align: center; font-family: var(--serif); font-size: 1.1rem; }
#toast { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  background: var(--fg); color: var(--bg); padding: .7rem 1.2rem;
  border-radius: 999px; font-size: .82rem; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .25s ease;
  pointer-events: none; }
#toast.show { opacity: 1; }
.errors-bar { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.err-row { display: flex; gap: .8rem; padding: .7rem .9rem; border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius-sm); margin-bottom: .5rem; background: var(--bg-soft); align-items: flex-start; }
.err-badge { flex: 0 0 auto; font-size: .75rem; font-weight: 700; padding: .15rem .5rem;
  border-radius: 999px; font-family: var(--sans); letter-spacing: .04em; }
.err-lvl-warn { background: #fef9c3; color: #a16207; }
.err-lvl-err { background: #fee2e2; color: #b91c1c; }
.err-lvl-info { background: var(--bg-tint); color: var(--fg-dim); }
[data-theme="dark"] .err-lvl-warn { background: #2d2000; color: #fbbf24; }
[data-theme="dark"] .err-lvl-err { background: #2d0a0a; color: #f87171; }
.err-body { flex: 1; min-width: 0; }
.err-msg { font-size: .85rem; line-height: 1.5; color: var(--fg-mid); word-break: break-word; }
.err-meta { font-size: .7rem; color: var(--fg-dim); margin-top: .25rem; font-variant-numeric: tabular-nums; }
.run-card { border: var(--rule-w) solid var(--rule); border-radius: var(--radius-sm);
  margin-bottom: .7rem; background: var(--bg-soft); overflow: hidden; }
.run-card.warn { border-left: 3px solid #d97706; }
.run-card.ok { border-left: 3px solid var(--rule); }
.run-head { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem;
  cursor: pointer; user-select: none; }
.run-head:hover { background: var(--bg-tint); }
.run-dot { flex: 0 0 auto; width: .7rem; height: .7rem; border-radius: 999px; background: #16a34a; }
.run-card.warn .run-dot { background: #d97706; }
.run-time { font-family: var(--sans); font-weight: 700; font-size: .9rem;
  font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.run-summary { flex: 1; min-width: 0; font-size: .82rem; color: var(--fg-mid);
  font-family: var(--sans); }
.run-flags { flex: 0 0 auto; display: flex; gap: .35rem; flex-wrap: wrap; }
.run-flag { font-size: .75rem; font-weight: 700; padding: .12rem .45rem; border-radius: 999px;
  background: #fef9c3; color: #a16207; font-family: var(--sans); white-space: nowrap; }
[data-theme="dark"] .run-flag { background: #2d2000; color: #fbbf24; }
.run-chevron { flex: 0 0 auto; color: var(--fg-dim); transition: transform .15s ease; font-size: .8rem; }
.run-card.open .run-chevron { transform: rotate(90deg); }
.run-body { display: none; padding: 0 1rem 1rem; }
.run-card.open .run-body { display: block; }
.run-sec { margin-top: 1rem; }
.run-sec-head { font-family: var(--sans); font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--fg-dim);
  margin-bottom: .5rem; cursor: pointer; display: flex; align-items: center; gap: .4rem; }
.run-sec-head .cnt { color: var(--accent-strong); }
.run-sec-body { display: none; }
.run-sec.open .run-sec-body { display: block; }
.run-sec-head::before { content: "▸"; font-size: .7rem; transition: transform .15s; }
.run-sec.open .run-sec-head::before { transform: rotate(90deg); }
.doc-render { font-family: var(--sans); font-size: .9rem; line-height: 1.6; color: var(--fg); max-width: 820px; }
.doc-render h1 { font-size: 1.5rem; margin: 1.2rem 0 .6rem; }
.doc-render h2 { font-size: 1.2rem; margin: 1.4rem 0 .5rem; padding-top: .6rem; border-top: var(--rule-w) solid var(--rule); }
.doc-render h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.doc-render h4 { font-size: .9rem; margin: .8rem 0 .3rem; color: var(--fg-mid); }
.doc-render p { margin: .5rem 0; }
.doc-render ul { margin: .5rem 0; padding-left: 1.3rem; }
.doc-render li { margin: .25rem 0; }
.doc-render code { font-family: var(--mono, monospace); font-size: .82rem; background: var(--bg-tint); padding: .1rem .3rem; border-radius: 4px; }
.doc-render pre { background: var(--bg-tint); padding: .8rem 1rem; border-radius: var(--radius-sm); overflow-x: auto; margin: .6rem 0; }
.doc-render pre code { background: none; padding: 0; }
.doc-render table { border-collapse: collapse; margin: .6rem 0; font-size: .82rem; }
.doc-render th, .doc-render td { border: var(--rule-w) solid var(--rule); padding: .3rem .6rem; text-align: left; }
.doc-render blockquote { border-left: 3px solid var(--accent); margin: .6rem 0; padding: .2rem 0 .2rem .9rem; color: var(--fg-mid); }
.doc-render hr { border: 0; border-top: var(--rule-w) solid var(--rule); margin: 1.2rem 0; }
.doc-render a { color: var(--accent-strong); }
.tabnav { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.8rem;
  border-bottom: var(--rule-w) solid var(--rule); padding-bottom: 0; }
.tabnav button { appearance: none; background: transparent; border: 0;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: .6rem 1rem; cursor: pointer; font-family: var(--sans);
  font-size: .88rem; font-weight: 600; color: var(--fg-dim);
  transition: color .15s ease, border-color .15s ease; }
.tabnav button:hover { color: var(--fg); }
.tabnav button.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
/* ── Dashboard overhaul (2026-07-06) ────────────────────────────────────
   Grouped tab bar, button hierarchy (accent = state-changing action,
   ghost = neutral), compact/sub-line classes instead of inline styles,
   colour-coded event badges. All on existing tokens. */
/* Two-level navigation: areas (groupnav) as the main level, tabs of the
   active area as subnav below. Max. 4 subnav entries -> no
   horizontal scrolling needed, even on mobile. */
.groupnav { display: inline-flex; gap: 2px; margin-bottom: .9rem; padding: 3px;
  background: var(--bg-tint); border: var(--rule-w) solid var(--rule); border-radius: 999px; }
.groupnav button { appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: .78rem; font-weight: 600; color: var(--fg-dim);
  padding: .3rem .95rem; border-radius: 999px; transition: background .15s ease, color .15s ease; }
.groupnav button:hover { color: var(--fg); }
.groupnav button.active { background: var(--bg-soft); color: var(--fg); box-shadow: var(--shadow-sm); }
.tabnav button { white-space: nowrap; }
.verify-btn.btn-ghost { background: var(--bg-tint); color: var(--fg-mid); }
.verify-btn.btn-ghost:hover { background: var(--rule); color: var(--fg); }
select.verify-btn.btn-ghost { appearance: auto; padding-right: .6rem; }
.pane-note { color: var(--fg-dim); font-size: .8rem; margin: .8rem 0 0; }
.err-msg-sm { font-size: .82rem; }
.err-meta-multi { line-height: 1.5; }
.err-sub { margin-top: .25rem; }
.dim { color: var(--fg-dim); }
.link-plain { color: inherit; }
/* Event kinds (dashboard tab "Ereignisse" [UI text]): quick to scan, token-based */
.ev-k-version { background: color-mix(in oklab, var(--accent) 16%, transparent); color: var(--accent-strong); }
.ev-k-lead-wechsel { background: color-mix(in oklab, var(--upd) 18%, transparent); color: var(--fg); }
.ev-k-null-merge, .ev-k-konsens-merge { background: color-mix(in oklab, var(--accent) 9%, transparent); color: var(--fg-mid); }
.ev-k-konsens-fallback { background: #fef9c3; color: #a16207; }
[data-theme="dark"] .ev-k-konsens-fallback { background: #2d2000; color: #fbbf24; }

.tabpane { display: none; }
.tabpane.active { display: block; animation: fadein .2s ease; }
.status-card { background: var(--bg-soft); border: var(--rule-w) solid var(--rule);
  border-radius: var(--radius); padding: 1.6rem 1.8rem; margin-bottom: 1.2rem; }
.status-phase { display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--display); font-size: 1.4rem; font-weight: 600; }
.status-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--fg-dim); }
.status-dot.live { background: var(--accent); animation: pblip2 1.6s ease-out infinite; }
@keyframes pblip2 { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.status-detail { color: var(--fg-mid); font-size: .92rem; margin-top: .6rem; }
.status-meta { color: var(--fg-dim); font-size: .8rem; margin-top: .8rem; font-variant-numeric: tabular-nums; }
.usage-bars { display: flex; flex-direction: column; gap: .5rem; margin-top: 1rem; }
.usage-bar-row { display: grid; grid-template-columns: 6rem 1fr auto; align-items: center; gap: .8rem; font-size: .82rem; }
.usage-bar-track { background: var(--bg-tint); border-radius: 999px; height: 12px; overflow: hidden; }
.usage-bar-fill { background: var(--accent); height: 100%; border-radius: 999px; }
.usage-num { font-variant-numeric: tabular-nums; color: var(--fg-mid); }
.model-row { display: grid; grid-template-columns: 8rem 1fr; align-items: center; gap: 1rem;
  padding: .9rem 0; border-bottom: var(--rule-w) solid var(--rule-soft); min-width: 0; }
.model-row span { min-width: 0; overflow-wrap: anywhere; }
.model-row select { font-family: var(--sans); font-size: .85rem; padding: .4rem .7rem;
  border-radius: 8px; border: var(--rule-w) solid var(--rule); background: var(--bg-soft);
  color: var(--fg); max-width: 100%; min-width: 0; width: 100%; box-sizing: border-box; }
.cfg-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.cfg-table th { text-align: left; font-weight: 600; color: var(--fg-dim); padding: .5rem .6rem;
  border-bottom: var(--rule-w) solid var(--rule); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.cfg-table td { padding: .5rem .6rem; border-bottom: var(--rule-w) solid var(--rule-soft); color: var(--fg-mid); }
.cfg-yes { color: var(--accent-strong); font-weight: 600; }
.loading { color: var(--fg-dim); font-style: italic; padding: 2rem 0; }
@media (max-width: 640px) {
  .col-wrap { grid-template-columns: 1fr; }
  .dash-wrap { padding: .75rem 1rem 5rem; }
  .usage-bar-row { grid-template-columns: 4.5rem 1fr auto; gap: .5rem; font-size: .75rem; }
  .usage-num { font-size: .7rem; }
  .cfg-table { display: block; overflow-x: auto; white-space: nowrap; }
  .stat { flex: 1 1 calc(50% - .5rem); min-width: 0; }
  .stat .val { font-size: 1.4rem; }
  .audit-card { padding: 1rem; }
  .model-row { grid-template-columns: 1fr; gap: .4rem; }
  .tabnav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    margin-bottom: 1.2rem; padding-bottom: .3rem; }
  .tabnav button { flex: 0 0 auto; white-space: nowrap; }
  .errors-bar { flex-wrap: wrap; gap: .5rem; }
  .errors-bar select, .errors-bar button { flex: 1 1 auto; min-width: 0; }
  .err-row { flex-direction: column; gap: .4rem; padding: .6rem .7rem; }
  .err-badge { align-self: flex-start; }
  .err-msg { word-break: break-word; overflow-wrap: anywhere; }
}

/* ─── Lazy-load day loading state ─── */
.day-loading { padding: 2rem 0; text-align: center; color: var(--fg-dim); font-family: var(--sans); font-size: .9rem; min-height: 90vh; }

/* ─── Day change by swipe (touch only) ─── */
/* .date-group follows the finger while dragging; on release snap back or switch. */
#day-pager { scroll-margin-top: calc(var(--topstack-h, 0px) + var(--feedtools-h, 0px)); }
#day-pager .date-group { will-change: transform; }
#day-pager.swiping .date-group { transition: none; }
#day-pager.swipe-settle .date-group { transition: transform .22s cubic-bezier(.22,.61,.36,1); }
/* Subtle one-time hint below the day navigation. */
.swipe-hint {
  display: none; align-items: center; justify-content: center; gap: .4rem;
  font-family: var(--sans); font-size: .78rem; color: var(--fg-dim);
  padding: .35rem 0 .15rem; opacity: .85;
  animation: swipeHintPulse 2.4s ease-in-out 2;
}
.swipe-hint .swipe-hint-arrows { letter-spacing: .15em; }
@keyframes swipeHintPulse { 0%,100% { opacity: .35; } 50% { opacity: .9; } }
@media (hover: none) and (pointer: coarse) {
  .swipe-hint { display: flex; }
}

