/* t56u Phase A – Bedingungen (Konto, public page, admin). Scoped to .tm / .tm-*; light + dark. */
.tm, .tm-moved, .tm-userlink {
  --tm-ink: #1c1915; --tm-muted: #5a5247; --tm-card: #fffdf9; --tm-card-2: #f7f1e6; --tm-line: rgba(28,25,21,.12);
  --tm-brand: #12352c; --tm-brand-ink: #f7f3ea; --tm-gold: #8a6230; --tm-gold-bg: #f3ecdf;
  --tm-ok: #1d6b45; --tm-ok-bg: #e5f3ea; --tm-due: #8c2f12; --tm-due-bg: #fbeae2; --tm-info-bg: #eaf1f7; --tm-info: #1f4f78;
  --tm-shadow: 0 1px 2px rgba(28,25,21,.05), 0 14px 34px -18px rgba(28,25,21,.28);
}
html[data-theme="dark"] .tm, html[data-theme="dark"] .tm-moved, html[data-theme="dark"] .tm-userlink {
  --tm-ink: #f6f1e8; --tm-muted: #c4bcaf; --tm-card: #1b211d; --tm-card-2: #222a25; --tm-line: rgba(246,241,232,.14);
  --tm-brand: #e8c98a; --tm-brand-ink: #14211c; --tm-gold: #e8c98a; --tm-gold-bg: rgba(232,201,138,.12);
  --tm-ok: #8fdcb0; --tm-ok-bg: rgba(143,220,176,.12); --tm-due: #ffb59a; --tm-due-bg: rgba(255,181,154,.12); --tm-info-bg: rgba(140,190,235,.12); --tm-info: #a9d0f2;
  --tm-shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 40px -20px rgba(0,0,0,.7);
}
.tm { color: var(--tm-ink); }
.tm-muted { color: var(--tm-muted); }
.tm a:not(.btn) { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.tm a:not(.btn):hover { text-decoration-thickness: 2px; color: var(--tm-gold); }

/* document */
.tm-doc { background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 22px; box-shadow: var(--tm-shadow); overflow: hidden; }
.tm-doc-head { display: flex; gap: 18px; align-items: center; padding: 26px 28px 22px; background: linear-gradient(135deg, var(--tm-card-2), var(--tm-card) 70%); border-bottom: 1px solid var(--tm-line); position: relative; }
.tm-doc-head::after { content: ""; position: absolute; left: 28px; right: 28px; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--tm-gold), transparent 70%); opacity: .55; }
.tm-seal { flex: 0 0 auto; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--tm-brand); color: var(--tm-brand-ink); font-size: 1.35rem; box-shadow: 0 10px 22px -12px rgba(18,53,44,.8); }
.tm-kicker { margin: 0 0 2px; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--tm-gold); }
.tm-doc-head h2 { margin: 0; font-family: Fraunces, Georgia, serif; font-weight: 560; font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.2; color: var(--tm-ink); }
.tm-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 8px 0 0; font-size: .88rem; color: var(--tm-muted); }
.tm-chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--tm-gold-bg); color: var(--tm-gold); font-weight: 600; font-size: .8rem; }
.tm-summary { margin: 22px 28px 0; padding: 16px 20px; border-radius: 16px; background: var(--tm-gold-bg); border: 1px solid var(--tm-line); }
.tm-summary h3 { margin: 0 0 8px; font-size: .95rem; display: flex; gap: 8px; align-items: center; color: var(--tm-ink); }
.tm-summary h3 i { color: var(--tm-gold); }
.tm-prose { line-height: 1.7; font-size: 1rem; color: var(--tm-ink); overflow-wrap: anywhere; }
.tm-prose > :first-child { margin-top: 0; }
.tm-prose > :last-child { margin-bottom: 0; }
.tm-prose h2, .tm-prose h3, .tm-prose h4 { font-family: Fraunces, Georgia, serif; font-weight: 560; margin: 1.4em 0 .4em; }
.tm-prose ul, .tm-prose ol { padding-left: 1.3em; }
.tm-body { padding: 22px 28px 8px; max-width: 76ch; }
.tm-body:focus-visible { outline: 2px solid var(--tm-gold); outline-offset: -4px; border-radius: 12px; }
.tm-empty { text-align: center; padding: 36px 24px; color: var(--tm-muted); }
.tm-empty > i { font-size: 2rem; color: var(--tm-gold); margin-bottom: 10px; }
.tm-empty p { margin: 4px auto; max-width: 52ch; }
.tm-empty strong { color: var(--tm-ink); }
.tm-doc-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 16px 28px 20px; margin-top: 16px; border-top: 1px dashed var(--tm-line); font-size: .9rem; color: var(--tm-muted); }

/* status banner (Konto) */
.tm-status { display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border-radius: 18px; margin: 0 0 18px; border: 1px solid var(--tm-line); background: var(--tm-card); box-shadow: var(--tm-shadow); }
.tm-status h2 { margin: 0 0 4px; font-size: 1.08rem; color: var(--tm-ink); }
.tm-status p { margin: 0; color: var(--tm-muted); line-height: 1.55; }
.tm-status-icon { flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; font-size: 1.1rem; }
.tm-status.is-required { background: var(--tm-due-bg); border-color: color-mix(in srgb, var(--tm-due) 35%, transparent); }
.tm-status.is-required .tm-status-icon { background: var(--tm-due); color: #fff; }
html[data-theme="dark"] .tm-status.is-required .tm-status-icon { color: #2a120a; }
.tm-status.is-ok .tm-status-icon { background: var(--tm-ok-bg); color: var(--tm-ok); }
.tm-status.is-exempt .tm-status-icon, .tm-status.is-off .tm-status-icon { background: var(--tm-info-bg); color: var(--tm-info); }

.tm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.tm-side { display: grid; gap: 16px; position: sticky; top: 16px; }
.tm-accept, .tm-card { background: var(--tm-card); border: 1px solid var(--tm-line); border-radius: 18px; padding: 18px 18px 16px; box-shadow: var(--tm-shadow); }
.tm-accept { border: 1.5px solid var(--tm-gold); background: linear-gradient(180deg, var(--tm-gold-bg), var(--tm-card) 60%); }
.tm-accept h2, .tm-card h2 { margin: 0 0 12px; font-size: 1.02rem; display: flex; gap: 8px; align-items: center; color: var(--tm-ink); }
.tm-check { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--tm-card); border: 1px solid var(--tm-line); cursor: pointer; line-height: 1.45; font-size: .95rem; }
.tm-check:hover { border-color: var(--tm-gold); }
.tm-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--tm-brand); }
.tm-go { width: 100%; justify-content: center; margin-top: 12px; min-height: 46px; }
.tm-fine { margin: 10px 0 0; font-size: .8rem; color: var(--tm-muted); line-height: 1.45; }
.tm-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tm .tm-links a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; }
.tm .tm-links a:hover { background: var(--tm-card-2); color: var(--tm-ink); text-decoration: underline; }
.tm-links i { width: 18px; text-align: center; color: var(--tm-gold); }
.tm-history { margin-top: 20px; }
.tm-timeline { list-style: none; margin: 0; padding: 0 0 0 6px; display: grid; gap: 12px; }
.tm-timeline li { display: flex; gap: 12px; align-items: flex-start; }
.tm-timeline li div { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.tm-dot { width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--tm-ok); box-shadow: 0 0 0 4px var(--tm-ok-bg); flex: 0 0 auto; }
.tm-when, .tm-dev { color: var(--tm-muted); font-size: .92rem; }
.tm .flag-img { vertical-align: -2px; border-radius: 2px; }
@media (max-width: 980px) { .tm-grid { grid-template-columns: 1fr; } .tm-side { position: static; } }
@media (max-width: 560px) {
  .tm-doc-head { padding: 20px 18px 18px; gap: 14px; }
  .tm-seal { width: 46px; height: 46px; border-radius: 13px; font-size: 1.1rem; }
  .tm-summary { margin: 18px 16px 0; padding: 14px 16px; }
  .tm-body { padding: 18px 18px 6px; }
  .tm-doc-foot { padding: 14px 18px 18px; }
  .tm-status { padding: 14px; gap: 12px; }
}

/* public page */
.tm-public { max-width: 920px; margin: 8px auto 40px; }
.tm-public-note { margin: 16px 4px 0; color: var(--tm-muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* admin */
.tm-admin .tm-gate { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--tm-line); background: var(--tm-card); margin: 0 0 16px; }
.tm-admin .tm-gate.is-on { background: linear-gradient(135deg, var(--tm-ok-bg), var(--tm-card) 70%); }
.tm-gate-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--tm-brand); color: var(--tm-brand-ink); font-size: 1.15rem; }
.tm-gate.is-off .tm-gate-icon { background: var(--tm-card-2); color: var(--tm-muted); border: 1px solid var(--tm-line); }
.tm-gate h2 { margin: 0 0 4px; font-size: 1.05rem; color: var(--tm-ink); }
.tm-gate p { margin: 0; color: var(--tm-muted); line-height: 1.5; }
.tm-gate .tm-gate-note { margin-top: 6px; font-size: .86rem; }
.tm-warn, .tm-info { display: flex; gap: 10px; align-items: baseline; padding: 12px 16px; border-radius: 12px; margin: 0 0 16px; }
.tm-warn { background: var(--tm-due-bg); color: var(--tm-due); font-weight: 550; }
.tm-info { background: var(--tm-info-bg); color: var(--tm-info); }
.tm-bar { height: 8px; border-radius: 99px; background: var(--tm-card-2); border: 1px solid var(--tm-line); overflow: hidden; margin: -4px 0 18px; }
.tm-bar span { display: block; height: 100%; width: var(--tm-p, 0%); background: linear-gradient(90deg, var(--tm-ok), var(--tm-gold)); border-radius: inherit; }
.tm-admin-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; align-items: start; }
.tm-editor h2, .tm-preview-h { margin: 0 0 12px; font-size: 1.05rem; color: var(--tm-ink); }
.tm-editor .row { margin-bottom: 14px; }
.tm-editor-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.tm-preview .tm-doc { box-shadow: none; }
.tm-preview .tm-body { max-height: 520px; overflow: auto; }
.tm-recent { margin-top: 16px; }
.tm-recent h3 { margin: 0 0 8px; font-size: .98rem; }
.tm-recent ul { margin: 0 0 10px; padding-left: 1.1em; display: grid; gap: 4px; color: var(--tm-muted); }
.tm-live { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--tm-ok-bg); color: var(--tm-ok); font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; vertical-align: 1px; }
.tm-ok { color: var(--tm-ok); font-weight: 600; }
.tm-due { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--tm-due-bg); color: var(--tm-due); font-weight: 600; font-size: .86rem; }
.tm-versions { display: grid; gap: 16px; }
.tm-version.is-live { border-color: var(--tm-gold); box-shadow: 0 0 0 1px var(--tm-gold) inset; }
.tm-version header h2 { margin: 0; font-size: 1.12rem; color: var(--tm-ink); }
.tm-version header p { margin: 4px 0 0; }
.tm-vstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.tm-vstats div { padding: 10px 12px; border-radius: 12px; background: var(--tm-card-2); border: 1px solid var(--tm-line); }
.tm-vstats dt { font-size: .78rem; color: var(--tm-muted); }
.tm-vstats dd { margin: 2px 0 0; font-weight: 650; color: var(--tm-ink); }
.tm-revs { margin: 0 0 14px; padding-left: 1.2em; display: grid; gap: 4px; }
.tm-revs li span { color: var(--tm-muted); margin-left: 6px; font-size: .9rem; }
.tm-revs em { display: block; color: var(--tm-muted); font-size: .9rem; }
.desk .sp form.sp-filters.tm-filters { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); align-items: end; }
.desk .sp form.sp-filters.tm-filters > * { min-width: 0; }
.desk .sp form.sp-filters.tm-filters input, .desk .sp form.sp-filters.tm-filters select { width: 100%; min-width: 0; box-sizing: border-box; }
.desk .sp form.sp-filters.tm-filters.is-short { grid-template-columns: minmax(220px, 1fr) auto; }
.tm-logbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 14px 0 10px; }
.tm-logbar p { margin: 0; }
.tm-table-wrap { padding: 0; overflow-x: auto; }
.tm-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tm-table th, .tm-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--tm-line); vertical-align: middle; color: var(--tm-ink); }
.tm-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tm-muted); background: var(--tm-card-2); }
.tm-table tbody tr:hover td { background: var(--tm-card-2); }
.tm-table code { font-size: .86rem; background: none; color: inherit; }
.tm-ip { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.tm-pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; color: var(--tm-muted); }
.tm-userhead { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.tm-userhead h2 { margin: 0; font-size: 1.08rem; }
.tm-userhead p { margin: 2px 0 0; }
.tm-userhead .btn { margin-left: auto; }
.tm-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--tm-brand); color: var(--tm-brand-ink); font-weight: 700; }
.tm-moved { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px; border-radius: 16px; border: 1px solid var(--tm-line); background: var(--tm-card-2); margin-bottom: 14px; color: var(--tm-ink); }
.tm-moved p { margin: 0 0 4px; color: var(--tm-muted); }
.tm-moved .set-sub { margin: 0 0 4px; }
.tm-moved-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--tm-brand); color: var(--tm-brand-ink); }
.tm-userlink { margin: 0 0 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tm-userlink .tm-due { display: inline-block; padding: 1px 8px; border-radius: 99px; background: var(--tm-due-bg); color: var(--tm-due); font-weight: 600; font-size: .86rem; }
@media (max-width: 1100px) { .tm-admin-grid { grid-template-columns: 1fr; } .desk .sp form.sp-filters.tm-filters:not(.is-short) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) {
  .tm-admin .tm-gate, .tm-moved { grid-template-columns: 1fr; }
  .tm-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tm-table, .tm-table tbody, .tm-table tr, .tm-table td { display: block; width: 100%; }
  .tm-table tr { padding: 10px 14px; border-bottom: 1px solid var(--tm-line); }
  .tm-table td { border: 0; padding: 3px 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 8px; }
  .tm-table td::before { content: attr(data-label); font-size: .78rem; color: var(--tm-muted); font-weight: 600; }
  .tm-userhead { flex-wrap: wrap; } .tm-userhead .btn { margin-left: 0; }
  .tm-logbar { flex-wrap: wrap; }
}
/* active tab keeps its ink on hover (mobile dark nav hover colour must not apply) */
.desk nav.sp-views.py-tabs a.is-on:hover, .desk nav.sp-views.py-tabs a.is-on:focus-visible { background: var(--a-brand, var(--brand)); color: var(--a-brand-ink, var(--card)); }

/* t56u Phase C: header chat badges are always rendered (JS updates them) */
[data-chat-badge][hidden] { display: none !important; }
