/* Portal additions that only the real system needs (the files next to it are the approved prototype styles from
   design/moderator-maske, kept 1:1). */

/* sidebar: a small count/flag next to an entry */
.side-n { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; }

/* bell: a red entry icon for things that are blocked */
.nt-ic.bad { background: var(--bad-soft); box-shadow: none; color: var(--bad); }

/* person menu: logout is a form button that looks like the links above it */
.me-menu .me-out { margin: 0; }
.me-menu .me-out button {
  display: flex; align-items: center; gap: 11px; width: 100%; height: 40px; padding: 0 12px; border: 0; border-radius: 10px;
  background: none; color: var(--ink); font-size: 14px; text-align: left; cursor: pointer;
}
.me-menu .me-out button:hover { background: var(--sunken); }
.me-menu .me-out .ic { width: 18px; height: 18px; color: var(--ink2); }

/* moderator bar: the person is a button that opens the same menu */
.bar .me-btn { border: 0; background: none; padding: 0; border-radius: 999px; cursor: pointer; color: var(--ink); }
.bar .me-btn:hover .me-av { background: var(--line); }
/* person menu: Gästebuch with its count */
.me-menu a .badge { margin-left: auto; }
.bar .me-btn .ic { width: 14px; height: 14px; color: var(--ink3); }

/* flashes from the server arrive as toasts */
.toast[data-flash] { animation: toast-in .25s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .toast[data-flash] { animation: none; } }

/* Kontoeinstellungen */
.ks-inline { display: inline; margin: 0; }
.ks-terms { margin-bottom: 16px; border-color: var(--warn); }
.m-fields > .m-switch { padding: 4px 0; font-size: 13.5px; }
a.btn, a.btn2 { text-decoration: none; }

/* Abrechnung and Rechnungen */
.ab-block { margin: 0 0 16px; }
.ab-pay .ab-brand { background: var(--sunken); color: var(--ink2); }
.ab-pay .ab-brand .ic { width: 20px; height: 20px; }
.ab-unpaid { display: grid; gap: 10px; }
.ab-inv { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.ab-inv-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ab-inv-a { margin-left: auto; font-size: 16px; font-variant-numeric: tabular-nums; }
.ab-inv .m-hint, .ab-inv .m-err { margin-top: 6px; }
.ab-inv-f { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rg-why { color: var(--bad) !important; }
.rg-frame { display: block; width: 100%; height: min(70vh, 900px); margin-bottom: 18px; border: 0; border-radius: 6px; background: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.pay-dlg > .dlg-b, .pay-dlg > .dlg-f { flex: none; }
.pay-body { flex: 1 1 auto; min-height: 0; padding: 14px 22px 16px; overflow-y: auto; overscroll-behavior: contain; }
.pay-dlg > .dlg-f { border-top: 1px solid var(--line); }
.pay-mount { min-height: 120px; }
.pay-dlg { width: min(520px, calc(100vw - 32px)); }

.ref-own { margin-top: 14px; }
.refer .rf-foot a { color: var(--accent-text); font-weight: 600; }

/* Gespräche: real pictures instead of the prototype's placeholders */
.gl-av.has-img img, .gc-av.has-img img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.gl-av.has-img, .gc-av.has-img { background: var(--sunken); }
.gf-av.has-img { background: var(--sunken); }
.gl-pic.real { aspect-ratio: auto; background: var(--sunken); overflow: hidden; }
.gl-pic.real img { display: block; width: 100%; max-height: 72vh; object-fit: contain; }
.gl-pic.real.portrait { width: min(100%, 460px); margin: 0 auto; aspect-ratio: 1; }
.gl-pic.real.portrait img { height: 100%; object-fit: cover; }
.bub .img { background: var(--sunken); overflow: hidden; }
.gl-empty .btn { margin-top: 10px; }
.gc-foot span { flex: 1; }

/* LiveStream: the real player (livestream.js, lp-* from /assets/livestream.css) in the prototype frame, no feed column */
/* the live picture keeps its full width; "Gerade passiert" sits below it */
.ls-grid.ls-real { grid-template-columns: 270px minmax(0, 1fr); grid-template-areas: "accs player" "accs feed"; }
@media (max-width: 1099px) { .ls-grid.ls-real { grid-template-columns: minmax(0, 1fr); grid-template-areas: "player" "feed" "accs"; } }
.ls-player-real { padding: 14px; }
.ls-player-real > .m-empty { min-height: 360px; }
.ls-acc.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: 0 0 0 1px var(--accent); }
.ls-rhead { display: flex; align-items: center; gap: 10px; margin: 0 2px 10px; }
.ls-rtarget { color: var(--ink2); font-size: 13px; }
.db-live-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--sunken); color: var(--ink2); font-size: 12px; font-weight: 700; }
.db-live-badge.is-live { background: var(--bad); color: #fff; }
.db-live-badge.is-off { background: var(--warn-soft); color: var(--warn); }
.db-live-badge.is-error { background: var(--bad-soft); color: var(--bad); }
.lp-btn .ic { width: 15px; height: 15px; }

/* Bilder: real thumbnails */
.im-th { background: var(--sunken); }
.im-th > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.im-th.blur > img { filter: blur(14px); transform: scale(1.08); }
.im-ed-pic { background: var(--sunken); }
.im-ed-pic img { object-fit: contain; }

/* ---------- Bridge dialog (cm-bridge.js): markup of the older page scripts in the portal look ---------- */
dialog.pdrawer { width: min(640px, calc(100vw - 32px)); }
dialog.pdrawer.wide { width: min(860px, calc(100vw - 32px)); }
.pdrawer-body { padding: 16px 22px 4px; }
.pdrawer .gw-body { display: grid; gap: 14px; }
.pdrawer .db-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.pdrawer .db-field > span:first-child { font-size: 13.5px; font-weight: 600; }
.pdrawer .db-field-hint { color: var(--ink3); font-size: 12px; font-style: normal; font-weight: 400; }
.pdrawer .db-field input, .pdrawer .db-field select, .pdrawer .db-field textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--page); color: var(--ink); font-size: 14px;
}
.pdrawer .db-field textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.pdrawer .db-field input:focus, .pdrawer .db-field select:focus, .pdrawer .db-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.pdrawer .db-field.is-bad input, .pdrawer .db-field.is-bad select, .pdrawer .db-field.is-bad textarea { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.pdrawer .db-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.pdrawer .db-switch { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.pdrawer .db-switch input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.pdrawer .db-note { display: flex; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--sunken); color: var(--ink2); font-size: 13px; line-height: 1.5; }
.pdrawer .db-note .ic { flex: none; margin-top: 2px; }
.pdrawer .db-note.is-warn { background: var(--warn-soft); color: var(--warn); }
.pdrawer .db-note.is-bad { background: var(--bad-soft); color: var(--bad); }
.pdrawer .db-metric-note { margin: 0; color: var(--ink3); font-size: 12.5px; line-height: 1.5; }
.pdrawer .db-linkish { padding: 0; border: 0; background: none; color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pdrawer .db-table-sub { color: var(--ink3); font-size: 12.5px; }
.pdrawer .db-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--sunken); color: var(--ink2); font-size: 11.5px; font-weight: 700; }
.pdrawer .db-chip.is-ok { background: var(--ok-soft); color: var(--ok); }
.pdrawer .db-chip.is-warn { background: var(--warn-soft); color: var(--warn); }
.pdrawer .db-chip.is-bad { background: var(--bad-soft); color: var(--bad); }
.pdrawer .db-acct-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pdrawer .db-acct-head h3 { font-size: 16px; }
.pdrawer .db-steps { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 4px; padding: 0; list-style: none; color: var(--ink3); font-size: 12.5px; }
.pdrawer .db-steps li { display: flex; align-items: center; gap: 6px; }
.pdrawer .db-steps li span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--sunken); font-size: 11px; font-weight: 700; }
.pdrawer .db-steps li.is-active { color: var(--ink); font-weight: 600; }
.pdrawer .db-steps li.is-active span { background: var(--accent); color: var(--on-accent); }
.pdrawer .db-steps li.is-done span { background: var(--ok); color: #fff; }
.pdrawer .gw-drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 22px 16px; border: 1.5px dashed var(--line2); border-radius: 14px; background: var(--page); color: var(--ink2); text-align: center; cursor: pointer; }
.pdrawer .gw-drop:hover, .pdrawer .gw-drop.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.pdrawer .gw-drop.is-bad { border-color: var(--bad); }
.pdrawer .gw-drop input { display: none; }
.pdrawer .gw-drop .ic { width: 24px; height: 24px; color: var(--ink3); }
.pdrawer .gw-drop b { color: var(--ink); }
.pdrawer .pw-photo-preview { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; }
.pdrawer .pw-checkgroup { display: grid; gap: 8px; }
.pdrawer .pw-checkgroup.is-bad b { color: var(--bad); }
.pdrawer .pw-checkgroup > b { font-size: 13.5px; }
.pdrawer .pw-checkgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.pdrawer .pw-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 999px; font-size: 13px; cursor: pointer; }
.pdrawer .pw-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pdrawer .pw-check input { accent-color: var(--accent); }
.pdrawer .pa-pw { position: relative; display: block; }
.pdrawer .pa-pw input { padding-right: 44px; }
.pdrawer .pa-pw-eye { position: absolute; right: 4px; top: 4px; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--ink3); cursor: pointer; }
.pdrawer .pa-actions { display: grid; gap: 10px; }
.pdrawer .pa-action { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.pdrawer .pa-action-text { display: grid; flex: 1; gap: 2px; }
.pdrawer .pa-action-text b { font-size: 14px; }
.pdrawer .pa-action-text span { color: var(--ink2); font-size: 12.5px; line-height: 1.45; }
.pdrawer .db-inline { margin: 0; }
.pdrawer .db-form { display: grid; gap: 14px; }

/* Konto: tabs as links, rows of the older dialogs, small bits */
.ko-links a { padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--ink2); font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.ko-links a:hover { color: var(--ink); }
.ko-links a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.ko-periods { margin-bottom: 12px; }
.ko-periods a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; color: var(--ink2); font-size: 13px; font-weight: 500; text-decoration: none; }
.ko-periods a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px var(--shadow-c), 0 0 0 1px var(--line); }
.ko-warnrow { margin: 0 0 16px; }
.ko-panel { margin-top: 16px; }
.ko-post { display: flex; align-items: center; gap: 12px; }
.ko-post img { flex: none; width: 52px; height: 52px; border-radius: 10px; object-fit: cover; }
.ko-targets { display: grid; gap: 6px; }
.ko-rank { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-right: 10px; border-radius: 7px; background: var(--sunken); font-size: 12px; font-weight: 700; }
.pdrawer .db-modal-text { margin: 0; color: var(--ink2); font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.pdrawer .db-quote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--sunken); font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.pdrawer .db-action-list { display: grid; gap: 8px; }
.pdrawer .db-action { margin: 0; }
.pdrawer .db-action button { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.pdrawer .db-action button:hover { background: var(--sunken); }
.pdrawer .db-action.is-danger button { color: var(--bad); }
.pdrawer .db-action button span { display: grid; gap: 2px; }
.pdrawer .db-action button small { color: var(--ink2); font-size: 12.5px; }
.pdrawer .db-check-grid { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; }
.pdrawer .db-check-grid > span { width: 100%; }
.pdrawer .db-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 999px; font-size: 13px; cursor: pointer; }
.pdrawer .db-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pdrawer .db-check input { accent-color: var(--accent); }
.pdrawer .gw-accounts { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; }

/* Image lightbox of the CM bridge (<a data-lightbox>), from the older stylesheets */
.db-lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(8, 7, 6, 0.86); backdrop-filter: blur(3px); animation: db-fade 140ms var(--db-ease); }
@media (prefers-reduced-motion: reduce) {
  .db-lightbox { animation: none; }
}
.db-lightbox img { max-width: min(1400px, 94vw); max-height: 88vh; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); cursor: zoom-out; }
.db-lightbox-close { position: absolute; top: 18px; right: 20px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.08); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; }
.db-lightbox-hint { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 12.5px; color: rgba(255, 255, 255, 0.55); }
.db-lightbox { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(10, 10, 10, 0.82); }
.db-lightbox img { max-width: min(96vw, 1400px); max-height: 92vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); object-fit: contain; }
.db-lightbox-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 22px; cursor: pointer; }
.db-lightbox-close:hover { background: rgba(255, 255, 255, 0.26); }
.db-lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; padding: 0; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.14); color: #fff; cursor: pointer; display: grid; place-items: center; }
.db-lightbox-nav svg { width: 26px; height: 26px; display: block; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.db-lightbox-nav.is-prev { left: 18px; }
.db-lightbox-nav.is-next { right: 18px; }
.db-lightbox-nav:hover { background: rgba(255, 255, 255, 0.26); }
.db-lightbox-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); color: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
.db-lightbox-count:empty { display: none; }
.db-lightbox-pdf { width: min(900px, 90vw); height: 88vh; border: 0; border-radius: 12px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); }
.db-lightbox-video { max-width: min(1400px, 94vw); max-height: 88vh; border-radius: 12px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6); }
.db-lightbox-close .ic { width: 20px; height: 20px; }
.db-lightbox-nav.is-next svg { transform: scaleX(-1); }

/* Moderator pages: period links in the range control, statement table with day headings */
.range > a {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 9px; color: var(--ink2);
  font-size: 13.5px; font-weight: 500; text-decoration: none; white-space: nowrap; transition: background-color .15s, color .15s, box-shadow .15s;
}
.range > a:hover { color: var(--ink); }
.range > a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px var(--shadow-c), 0 0 0 1px var(--line); }
.st-kpis4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 1000px) { .st-kpis4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.st-statement .st-day td { padding-top: 18px; background: none; color: var(--ink2); font-size: 13px; }
.st-statement .st-day b { margin-right: 8px; color: var(--ink); }
.st-statement tr:first-child.st-day td { padding-top: 6px; }
.st-statement .is-muted td { color: var(--ink3); }
.st-statement-text { min-width: 260px; color: var(--ink2); }
.m-table .nw { white-space: nowrap; }

/* small print under a table value (shared: account page, guestbook) */
.pp-sub { display: block; margin-top: 2px; color: var(--ink3); font-size: 12px; font-weight: 400; }
.pp-hint { color: var(--ink2); font-size: 13px; }

/* Moderators: the bar stays on top of long pages (rules, statistics); the chat has its own height */
body[data-role="moderator"] > .bar { position: sticky; top: 0; z-index: 30; }
.st-kpis4 .kpi { align-content: start; }

/* ---- Selects: one look for every dropdown in the portal ---------------------------------------------------------
   Browsers with the customizable select (Chrome/Edge 135+, Safari 27) draw the open list in the portal style too:
   rounded panel, hover, the chosen entry marked, a turning arrow. Everywhere else the closed field looks the same and
   the list stays the system's. Keyboard, screen readers and form posting stay native. Lists with size/multiple keep
   the browser's listbox. */
select:not([multiple]):not([size]) {
  appearance: none; -webkit-appearance: none;
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858079' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 16px;
}
@supports (appearance: base-select) {
  select:not([multiple]):not([size]), select:not([multiple]):not([size])::picker(select) { appearance: base-select; }
  select:not([multiple]):not([size]) { display: flex; align-items: center; gap: 8px; padding-right: 12px; background-image: none; text-align: left; }
  select:not([multiple]):not([size]):hover { border-color: color-mix(in srgb, var(--ink3) 45%, var(--line2)); }
  select::picker-icon {
    content: ""; width: 16px; height: 16px; margin-left: auto; background-color: var(--ink3);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: rotate .2s var(--ease);
  }
  select:open::picker-icon { rotate: 180deg; background-color: var(--accent-text); }
  select:open { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background-color: var(--surface); }
  ::picker(select) {
    margin-block: 6px; padding: 6px; max-height: min(340px, 60vh); overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); box-shadow: var(--pop);
    opacity: 1; translate: 0 0; transition: opacity .16s var(--ease), translate .16s var(--ease), overlay .16s allow-discrete, display .16s allow-discrete;
  }
  @starting-style { ::picker(select):popover-open { opacity: 0; translate: 0 -4px; } }
  select option {
    display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 10px; border-radius: 8px;
    font-size: 14px; line-height: 1.35; cursor: pointer;
  }
  select option:hover, select option:focus-visible { background: var(--sunken); outline: none; }
  select option:checked { background: var(--accent-soft); font-weight: 600; }
  select option::checkmark { order: 1; margin-left: auto; color: var(--accent-text); font-weight: 700; }
  select option:disabled { color: var(--ink3); cursor: default; }
  @media (prefers-reduced-motion: reduce) { ::picker(select), select::picker-icon { transition: none; } }
}
/* checkboxes, radios, date pickers and ranges take the accent */
:root { accent-color: var(--accent); --scroll-thumb: color-mix(in srgb, var(--ink3) 42%, transparent); }
/* Scrollbars stay hidden in the portal (the page and its panels scroll without one); where one is shown - the open
   select list, or any element with .scroll-bar - it is slim, warm grey and without a track */
.scroll-bar { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
.scroll-bar:hover { --scroll-thumb: color-mix(in srgb, var(--ink3) 70%, transparent); }

/* ---- Sliders: accent track up to the thumb (--fill is set by portal.js), a white thumb with an accent ring ---- */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; --fill: 50%; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(var(--accent), var(--accent)) 0 0 / var(--fill) 100% no-repeat, var(--sunken);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line2) 60%, transparent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin-top: -7px; border: 2px solid var(--accent); border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px var(--shadow-c); transition: box-shadow .15s, scale .15s;
}
input[type="range"]:hover::-webkit-slider-thumb { scale: 1.08; }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--sunken); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px var(--shadow-c); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---- Date fields: a quiet calendar button; search fields: the portal's own clear cross ---- */
input[type="date"]::-webkit-calendar-picker-indicator, input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  padding: 3px; border-radius: 6px; opacity: .55; cursor: pointer; transition: opacity .15s, background-color .15s;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover, input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover { opacity: 1; background-color: var(--sunken); }
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-left: 6px; cursor: pointer; background-color: var(--ink3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type="search"]::-webkit-search-cancel-button:hover { background-color: var(--ink); }
/* a file field that is not a drop zone still gets a portal button */
input[type="file"]::file-selector-button {
  height: 32px; margin-right: 10px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 9px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--sunken); }
/* drop zones in dialogs (data-file-drop): the chosen file's name replaces the prompt */
.pdrawer .m-drop { margin: 0; }
.m-drop.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

/* Phones: the prototype hides the person area; here it holds the menu with "Abmelden", so the avatar stays */
@media (max-width: 700px) {
  .bar .me.me-btn { display: inline-flex; padding: 2px; }
  .bar .me-btn > .ic { display: none; }
  /* the name stays the button's accessible name, only hidden from view */
  .bar .me-btn > span:not(.me-av) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Person menu for both roles (model.css only loads for models): avatar, popover, entries */
.side-av {
  position: relative; display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(150deg, #fdba74, #f37338 60%, #9a3412); color: #fff; font-family: var(--font-d); font-size: 13px; font-weight: 700;
}
:root[data-look="kiki"] .side-av { background: linear-gradient(150deg, #ffc2dc, #f28fba 60%, #a3245d); color: #3a0f22; }
.me-h .side-av i { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #4ec98a; box-shadow: 0 0 0 2.5px var(--page); }
/* panels of the portal (bell, person menu); never the animated parts of the training films, which use .pop too */
.pop:where(:not(.stage-in *)) {
  position: fixed; z-index: 70; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--ink); box-shadow: var(--pop);
}
.pop:where(:not(.stage-in *)):not([hidden]) { animation: pop-in .16s var(--ease); }
.me-menu { width: 280px; padding: 6px; }
.me-h { display: flex; align-items: center; gap: 12px; padding: 12px 12px 14px; }
.me-h > span:last-child { display: grid; min-width: 0; line-height: 1.35; }
.me-h b { font-size: 14px; }
.me-h small { overflow: hidden; color: var(--ink3); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.me-menu a { display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink); font-size: 14px; text-decoration: none; }
.me-menu a:hover { background: var(--sunken); }
.me-menu a.me-look { display: none; }
:root[data-look="kiki"] .me-menu a.me-look { display: flex; }
.me-menu a .ic { width: 18px; height: 18px; color: var(--ink2); }
.me-menu hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--line); }

/* Statement on phones: one compact block per message - time, fan and status on top, kind and rate below, then the text */
@media (max-width: 600px) {
  .st-statement thead { display: none; }
  .st-statement, .st-statement tbody { display: block; }
  .st-statement tr { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; column-gap: 10px; row-gap: 3px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .st-statement td { padding: 0; border: 0; }
  .st-statement td:nth-child(1) { grid-area: 1 / 1; color: var(--ink3); }
  .st-statement td:nth-child(2) { grid-area: 1 / 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .st-statement td:nth-child(6) { grid-area: 1 / 3; justify-self: end; }
  .st-statement td:nth-child(3) { grid-area: 2 / 2; color: var(--ink3); font-size: 12.5px; }
  .st-statement td:nth-child(5) { grid-area: 2 / 3; justify-self: end; color: var(--ink2); font-size: 12.5px; }
  .st-statement td:nth-child(4) { grid-area: 3 / 2 / 4 / 4; min-width: 0; }
  .st-statement tr.st-day { display: block; padding: 18px 0 6px; }
  .st-statement tr.st-day td { display: block; }
  .st-statement tr:first-child.st-day { padding-top: 0; }
}
/* overview cards carry h2 (no section headings between page title and card) - same look as the h3 of statistiken.css */
.st-page .card-h h2 { margin: 0; font-size: 15px; font-weight: 600; }

/* ---- Owner and partner overviews (admin/dashboard, partner/overview) on the model overview's parts ---- */
.ow-alert { margin: 0 0 16px; }
.ow-alert a { color: inherit; font-weight: 600; }
.ow-todo { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; }
.ow-todo a {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-size: 13.5px; text-decoration: none; transition: background-color .15s, border-color .15s;
}
.ow-todo a:hover { border-color: var(--accent); background: var(--accent-soft); }
.ow-todo b { font-variant-numeric: tabular-nums; }
.ow-todo .bad a { border-color: var(--bad-line); color: var(--bad); }
.ow-todo .bad a:hover { background: var(--bad-soft); }
.ow-done { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); color: var(--ink2); font-size: 13.5px; }
.ow-done .ic { color: var(--ok); }
.lg-big.ow-neg { color: var(--bad); }
.fr-bar .ow-review, .k.ow-review { background: color-mix(in srgb, var(--c2) 35%, var(--sunken)); }
.ow-models .more { margin-top: auto; padding-top: 14px; }
@media (min-width: 1120px) {
  .ov-owner .dash > .ledger, .ov-partner .dash > .ledger { grid-column: span 7; }
  .ov-owner .dash > .frame, .ov-partner .dash > .frame { grid-column: span 5; }
}
@media (min-width: 1600px) {
  .ov-owner .dash > .trend, .ov-partner .dash > .trend { grid-column: span 12; }
}
@media (max-width: 700px) {
  .live-f { flex-wrap: wrap; row-gap: 12px; }
  .live-f > div { min-width: 0; flex: 1 1 40%; padding: 0 14px; }
}
/* partner team in the status card: everyone with a dot - green writing now, amber rules unsigned, red blocked */
.pt-team { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); list-style: none; }
.pt-team li { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.pt-team .side-av { width: 30px; height: 30px; font-size: 11.5px; }
.pt-team .side-av i { width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--surface); background: var(--ink3); }
.pt-team .is-online .side-av i { background: var(--ok); }
.pt-team .is-rules .side-av i { background: var(--warn); }
.pt-team .is-blocked { border-color: var(--bad-line); }
.pt-team .is-blocked .side-av i { background: var(--bad); }
.pt-who { display: grid; line-height: 1.25; }
.pt-who b { font-size: 13.5px; font-weight: 600; }
.pt-who small { color: var(--ink3); font-size: 12px; }
.pt-team .is-online .pt-who small { color: var(--ok); }
.pt-team .is-blocked .pt-who small { color: var(--bad); }
.pt-team + .ow-todo { border-top: 0; padding-top: 4px; }
/* ranking with bars */
.pt-rank { margin: 0; padding: 0; list-style: none; }
.pt-rank li { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(60px, 1.2fr) auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pt-rank li:first-child { border-top: 0; }
.pt-rank-no { color: var(--ink3); font-family: var(--font-d); font-weight: 700; }
.pt-rank li:nth-child(-n+3) .pt-rank-no { color: var(--ink); }
.pt-rank-who { display: grid; min-width: 0; }
.pt-rank-who b { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.pt-rank-who small { color: var(--ink3); font-size: 12px; }
.pt-rank-bar { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.pt-rank-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c2); }
.pt-rank-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ow-neg-t { color: var(--bad); }
@media (min-width: 1120px) {
  .ov-partner .dash > .pt-best, .ov-partner .dash > .pt-months { grid-column: span 6; }
}

/* ---- Owner pages: filter bar (search + status links) ---- */
.ak-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 16px; }
.ak-search {
  position: relative; display: flex; align-items: center; flex: 1 1 280px; max-width: 420px; height: 40px; padding: 0 12px 0 38px;
  border: 1px solid var(--line2); border-radius: 10px; background: var(--surface);
}
.ak-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ak-search > .ic { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--ink3); }
.ak-search input { width: 100%; height: 100%; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.ak-filter .range { flex-wrap: wrap; }

/* a whole page inside the wide dialog (data-drawer-url): its own padding goes, the dialog has enough */
dialog.pdrawer.xwide { width: min(1180px, calc(100vw - 32px)); }
.pdrawer-page > main, .pdrawer-page > div { padding: 0; max-width: none; }
.pdrawer-page .mhead { margin-bottom: 16px; }
.pdrawer-page .mhead h1 { font-size: 22px; }
/* links inside tables (a name that opens something) and plain facts in dialogs */
.ak-link { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.ak-link:hover { text-decoration-color: var(--accent); }
.ak-link-btn { padding: 0; border: 0; background: none; color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; }
.ak-link-btn:hover { text-decoration-color: var(--accent); }
.m-table tr.is-muted td { color: var(--ink3); }
.m-table tr.is-muted td b { color: var(--ink2); }
.ak-facts { display: grid; gap: 0; margin: 0; }
.ak-facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.ak-facts > div:first-child { border-top: 0; }
.ak-facts dt { color: var(--ink3); font-size: 13px; }
.ak-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ak-reports td:first-child { min-width: 240px; }
/* owner pages: two cards side by side, price lists, the price dialog, pager, sortable heads */
.ak-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .ak-two { grid-template-columns: minmax(0, 1fr); } }
.ak-price { margin: 0; }
.ak-price > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.ak-price > div:first-child { border-top: 0; }
.ak-price dt { color: var(--ink2); font-size: 13.5px; }
.ak-price dd { margin: 0; font-family: var(--font-d); font-size: 17px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ak-note { margin: 12px 0 0; }
.ak-price-edit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ak-price-edit fieldset { display: grid; gap: 12px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ak-price-edit legend { margin-bottom: 4px; padding: 0; font-weight: 700; }
@media (max-width: 700px) { .ak-price-edit { grid-template-columns: minmax(0, 1fr); } }
.pdrawer .ak-ct { grid-template-columns: minmax(0, 1fr) 110px; align-items: center; }
.pdrawer .ak-ct > span:first-child { font-weight: 500; font-size: 13.5px; }
.ak-ct-in { position: relative; display: block; }
.pdrawer .ak-ct-in input { padding-right: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.ak-ct-in em { position: absolute; right: 12px; top: 50%; translate: 0 -50%; color: var(--ink3); font-size: 13px; font-style: normal; pointer-events: none; }
.ak-pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ak-pager-b { display: inline-flex; align-items: center; gap: 10px; }
.ak-sortable th[data-sort] { cursor: pointer; user-select: none; }
.ak-sortable th[data-sort]:hover { color: var(--ink); }
.ak-wrap { min-width: 220px; overflow-wrap: anywhere; }
.ak-sortable th.is-sorted-asc::after { content: " ↑"; color: var(--accent-text); }
.ak-sortable th.is-sorted-desc::after { content: " ↓"; color: var(--accent-text); }
/* page head: a long description wraps beside the actions instead of pushing them below */
.m-page .mhead > div:first-child { flex: 1 1 420px; max-width: 760px; }
.m-table td.r .pp-sub, .m-table td .pp-sub.nw { white-space: nowrap; }
.ak-price dt::first-letter, .pdrawer .ak-ct > span:first-child::first-letter { text-transform: uppercase; }
/* owner statistics: six figures in a row on wide screens, charts in two columns */
.ak-kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 16px; }
.ak-charts > .card { min-width: 0; }
.ak-charts .legend { margin-top: 10px; }

/* ---- Owner: read-only conversation (admin/chat) ---- */
.ac-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.ac-queue { display: flex; flex-direction: column; max-height: calc(100dvh - 210px); }
.ac-q { display: grid; gap: 2px; margin: 0 -8px; overflow-y: auto; }
.ac-q a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 8px; padding: 9px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.ac-q a:hover { background: var(--sunken); }
.ac-q a[aria-current="page"] { background: var(--accent-soft); }
.ac-q b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-q small { grid-column: 1; color: var(--ink3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-q-t { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--ink3); font-size: 11.5px; white-space: nowrap; }
.ac-q-t.is-new { color: var(--accent-text); font-weight: 700; }
.ac-queue .more { margin-top: 12px; }
.ac-talk { padding: 0 !important; overflow: hidden; }
.ac-log { display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - 210px); min-height: 360px; padding: 18px; overflow-y: auto; }
.ac-msg { max-width: min(76%, 560px); padding: 9px 13px 8px; border-radius: 16px; background: var(--them); }
.ac-msg.is-fan { align-self: flex-start; border-bottom-left-radius: 6px; }
.ac-msg.is-us { align-self: flex-end; border-bottom-right-radius: 6px; background: var(--us); color: var(--us-ink); }
.ac-msg p { margin: 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ac-msg footer { margin-top: 4px; color: var(--ink3); font-size: 11.5px; }
.ac-msg.is-us footer { color: color-mix(in srgb, var(--us-ink) 78%, transparent); }
.ac-msg .ac-err { color: var(--bad); }
.ac-msg.is-us .ac-err { color: #ffb3a8; }
.ac-msg.is-external { box-shadow: inset 0 0 0 1.5px var(--line2); }
.ac-msg.is-failed { box-shadow: 0 0 0 2px var(--bad); }
.ac-msg.is-flagged { box-shadow: 0 0 0 3px var(--bad), 0 0 0 7px var(--bad-soft); }
.ac-img { display: block; max-width: 220px; max-height: 240px; margin-bottom: 6px; border-radius: 10px; object-fit: cover; }
.ac-side { display: grid; gap: 16px; }
.ac-taboo { margin: 0 0 12px; }
.ac-notes { margin: 0 0 10px; color: var(--ink2); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
@media (max-width: 1240px) { .ac-grid { grid-template-columns: minmax(0, 1fr) 300px; } .ac-queue { display: none; } }
@media (max-width: 860px) { .ac-grid { grid-template-columns: minmax(0, 1fr); } .ac-log { max-height: 70vh; } }
.pdrawer-page .ac-grid { grid-template-columns: minmax(0, 1fr) 300px; }
.pdrawer-page .ac-queue { display: none; }
/* documents of a person */
.ak-docs { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ak-docs a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.ak-docs a:hover { background: var(--sunken); }
.ak-docs .ic { width: 20px; height: 20px; color: var(--ink2); }
.ak-docs span { display: grid; }
.ak-docs small { color: var(--ink3); font-size: 12px; }
/* shared fragments that still use the older table classes (fragments/payout_split) look like m-table in the portal */
.mpage .db-table-wrap { overflow-x: auto; }
.mpage .db-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.mpage .db-table th { padding: 8px 10px; border-bottom: 1px solid var(--line2); color: var(--ink3); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.mpage .db-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.mpage .db-table tr:last-child td { border-bottom: 0; }
.mpage .db-table .is-num { text-align: right; }
.mpage .db-table .is-strong { font-weight: 700; }
.mpage .db-table .db-table-sub { display: block; margin-top: 2px; color: var(--ink3); font-size: 12px; font-weight: 400; }
.m-table td.b { font-weight: 700; }
.mhead-a { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ak-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.ak-two + .ak-two { margin-top: 16px; }
.btn2.danger-t { color: var(--bad); border-color: var(--bad-line); }
.btn2.danger-t:hover { background: var(--bad-soft); }

/* the dialog form parts on portal pages too (settings, mailbox, jobs): same look as in the dialogs */
.mpage .gw-body { display: grid; gap: 14px; }
.mpage .db-field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.mpage .db-field > span:first-child { font-size: 13.5px; font-weight: 600; }
.mpage .db-field-hint { color: var(--ink3); font-size: 12px; font-style: normal; font-weight: 400; }
.mpage .db-field input, .mpage .db-field select, .mpage .db-field textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--page); color: var(--ink); font-size: 14px;
}
.mpage .db-field textarea { height: auto; min-height: 84px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.mpage .db-field input:focus, .mpage .db-field select:focus, .mpage .db-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.mpage .db-field.is-bad input, .mpage .db-field.is-bad select, .mpage .db-field.is-bad textarea { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.mpage .db-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.mpage .db-switch { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.5; cursor: pointer; }
.mpage .db-switch input { flex: none; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.mpage .db-inline { margin: 0; }
.mpage .db-form { display: grid; gap: 14px; }
.mpage .db-modal-text { margin: 0; color: var(--ink2); font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.mpage .db-quote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--sunken); font-size: 14px; line-height: 1.55; white-space: pre-wrap; }
.mpage .db-action-list { display: grid; gap: 8px; }
.mpage .db-action { margin: 0; }
.mpage .db-action button { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.mpage .db-action button:hover { background: var(--sunken); }
.mpage .db-action.is-danger button { color: var(--bad); }
.mpage .db-action button span { display: grid; gap: 2px; }
.mpage .db-action button small { color: var(--ink2); font-size: 12.5px; }
.mpage .db-check-grid { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; }
.mpage .db-check-grid > span { width: 100%; }
.mpage .db-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line2); border-radius: 999px; font-size: 13px; cursor: pointer; }
.mpage .db-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.mpage .db-check input { accent-color: var(--accent); }
/* section headings between cards (jobs, mailbox) and grouped actions in dialogs */
.ak-sec { margin: 28px 0 12px; }
.ak-sec h2 { margin: 0; font-family: var(--font-d); font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.ak-sec h3 { margin: 0; font-size: 15px; font-weight: 600; }
.ak-sec p { margin: 4px 0 0; color: var(--ink2); font-size: 13.5px; }
.mpage > .note, .mpage > .ow-alert { margin-bottom: 16px; }
.pdrawer .db-action-group { margin: 10px 0 2px; color: var(--ink3); font-size: 12px; font-weight: 600; }
.pdrawer .db-action-group:first-child { margin-top: 0; }
.pdrawer .db-action.is-form { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.pdrawer .db-action.is-form > b { font-size: 14px; }
.pdrawer .db-action.is-form > small { color: var(--ink2); font-size: 12.5px; }
.pdrawer .db-action-fields { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pdrawer .db-action-fields input, .pdrawer .db-action-fields select {
  flex: 1 1 140px; height: 38px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--page); color: var(--ink); font: inherit; font-size: 14px;
}
.pdrawer .db-action-fields input:focus, .pdrawer .db-action-fields select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.pdrawer .db-action-fields button { flex: none; width: auto; }
.pdrawer .db-action-fields button { display: inline-flex; align-items: center; justify-content: center; width: auto; height: 38px; padding: 0 14px;
  border: 1px solid var(--line2); border-radius: 10px; background: var(--surface); color: var(--ink); font-weight: 600; text-align: center; }
.pdrawer .db-action-fields button:hover { background: var(--sunken); }

/* Older stylesheets (chat, mailbox) on portal colours: their --db-* names mapped to the portal tokens */
:root {
  --db-ink: var(--ink); --db-ink-2: var(--ink2); --db-ink-3: var(--ink3); --db-muted: var(--ink3);
  --db-line: var(--line); --db-line-2: var(--line2); --db-scroll: var(--line2);
  --db-page: var(--page); --db-surface: var(--surface); --db-surface-2: var(--sunken); --db-sunken: var(--sunken); --db-card: var(--surface);
  --db-accent: var(--accent); --db-accent-soft: var(--accent-soft); --db-accent-text: var(--accent-text); --db-on-accent: var(--on-accent);
  --db-accent-ring: color-mix(in srgb, var(--accent) 22%, transparent); --db-row-sel: var(--accent-soft);
  --db-ok: var(--ok); --db-ok-soft: var(--ok-soft); --db-warn: var(--warn); --db-warn-soft: var(--warn-soft); --db-warn-line: var(--warn);
  --db-bad: var(--bad); --db-bad-soft: var(--bad-soft); --db-bad-solid: var(--bad); --db-bad-hover: color-mix(in srgb, var(--bad) 85%, #000);
  --db-dark: var(--us); --db-on-dark: var(--us-ink); --db-on-dark-dim: color-mix(in srgb, var(--us-ink) 58%, transparent);
  --db-on-dark-faint: color-mix(in srgb, var(--us-ink) 50%, transparent);
  --db-pill: var(--toast); --db-pill-ink: #f5f5f4; --db-overlay: var(--scrim); --db-scrim: var(--scrim);
  --db-shadow-c: var(--shadow-c); --db-shadow-c2: var(--pop-c); --db-shadow: var(--shadow); --db-shadow-2: var(--pop);
  --db-radius: 1rem; --db-radius-lg: 1.25rem; --db-gap: 16px; --db-gap-tight: 12px; --db-topbar: 56px;
  --db-ease: var(--ease); --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-spring: cubic-bezier(.32, .72, 0, 1);
  --t-fast: 150ms; --t-base: 240ms; --t-slow: 400ms; --font-sofia: var(--font-d); --font-outfit: var(--font);
}

/* ---- Owner: customer file (tabs, blockers, gallery, history) ---- */
.ak-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 20px 0 16px; border-bottom: 1px solid var(--line); }
.ak-tabs button, .ak-tab-link {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none;
  color: var(--ink2); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; margin-bottom: -1px;
}
.ak-tabs button:hover, .ak-tab-link:hover { color: var(--ink); }
.ak-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.ak-tab-link { margin-left: auto; }
.ak-tab-link .ic { width: 14px; height: 14px; }
.ak-warn-t { color: var(--warn); }
.ak-blockers { display: grid; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.ak-blockers li { display: flex; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 13.5px; }
.ak-persona { font-family: var(--font-d); font-size: 18px; font-weight: 700; }
.ak-gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; margin-top: 14px; }
.ak-gal-i { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--sunken); }
.ak-gal-i img { width: 100%; height: 100%; object-fit: cover; }
/* Kundenakte "Verlauf": one row per event - icon by kind, what happened, the time; a heading over each day (admin-labels.js) */
.ak-timeline { display: grid; margin: 0; }
.ak-tl-day { padding: 18px 0 8px; font-size: 12.5px; font-weight: 600; color: var(--ink3); }
.ak-tl-day:first-child { padding-top: 0; }
.ak-tl { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ak-tl:first-child, .ak-tl-day + .ak-tl { border-top: 0; }
.ak-tl-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--sunken); color: var(--ink2); }
.ak-tl-ic .ic { width: 16px; height: 16px; }
.ak-tl[data-kind="legit"] .ak-tl-ic { background: var(--ok-soft); color: var(--ok); }
.ak-tl[data-kind="money"] .ak-tl-ic { background: var(--accent-soft); color: var(--accent); }
.ak-tl[data-kind="bad"] .ak-tl-ic { background: var(--bad-soft); color: var(--bad); }
.ak-tl-b { display: grid; gap: 2px; min-width: 0; padding-top: 6px; }
.ak-tl-b span { color: var(--ink2); overflow-wrap: anywhere; }
.ak-tl-b span:empty { display: none; }
.ak-tl time { padding-top: 7px; color: var(--ink3); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .ak-tl { grid-template-columns: 32px minmax(0, 1fr); } .ak-tl time { grid-column: 2; padding-top: 0; } }
button.ak-link { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.ak-gap { margin-top: 16px; }
.ak-missing { display: inline-flex; margin: 2px 6px 2px 0; padding: 2px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: 12.5px; font-weight: 600; }

/* Owner: review dialog for a proof (verifications.js) - details beside the proof, a PDF readable in place, one confirm box per step */
.pdrawer .db-facts { display: grid; margin: 0; }
.pdrawer .db-facts > .db-fact { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.pdrawer .db-facts > .db-fact:first-child { border-top: 0; }
.pdrawer .db-facts dt { color: var(--ink3); font-size: 13px; }
.pdrawer .db-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; }
.pdrawer .gw-body h4 { margin: 18px 0 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pdrawer .vfr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 24px; margin-top: 14px; }
.pdrawer .vfr-col h4 { margin-top: 0; }
.pdrawer .vfr-image-link { display: block; overflow: hidden; border: 1px solid var(--line2); border-radius: 12px; background: var(--sunken); }
.pdrawer .vfr-image { display: block; width: 100%; max-height: 460px; object-fit: contain; }
.pdrawer .vfr-pdf { display: block; width: 100%; height: min(56vh, 560px); border: 1px solid var(--line2); border-radius: 12px; background: var(--sunken); }
.pdrawer .vfr-file { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.pdrawer .vfr-file .ic, .pdrawer .vfr-file wa-icon { color: var(--accent-text, var(--accent)); }
.pdrawer .vfr-meta { margin: 6px 0 0; color: var(--ink3); font-size: 12.5px; overflow-wrap: anywhere; }
.pdrawer .vfr-confirm { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 12px; font-size: 13.5px; cursor: pointer; }
.pdrawer .vfr-confirm:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pdrawer .vfr-confirm:has(input:disabled) { opacity: .6; cursor: default; }
.pdrawer .vfr-confirm input { margin: 2px 0 0; accent-color: var(--accent); }
.pdrawer .wa-ic.is-ok, .pdrawer .ic.is-ok { color: var(--ok); }
.pdrawer .wa-ic.is-bad, .pdrawer .ic.is-bad { color: var(--bad); }
.pdrawer .db-table-wrap { overflow-x: auto; }
.pdrawer .db-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pdrawer .db-table th { padding: 8px 10px; border-bottom: 1px solid var(--line2); color: var(--ink3); font-size: 12px; font-weight: 600; text-align: left; }
.pdrawer .db-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.pdrawer .db-table tr:last-child td { border-bottom: 0; }
.pdrawer .db-table .is-num { text-align: right; }
@media (max-width: 720px) { .pdrawer .vfr-grid { grid-template-columns: 1fr; } .pdrawer .db-facts > .db-fact { grid-template-columns: 110px minmax(0, 1fr); } }
.pdrawer .gw-body > h4 { margin: 6px 0 -6px; }
.ak-sec h2.is-sm { font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.ak-tabbar { display: flex; align-items: stretch; flex-wrap: wrap; margin: 20px 0 16px; border-bottom: 1px solid var(--line); }
.ak-tabbar .ak-tabs { flex: 1 1 auto; margin: 0; border-bottom: 0; }
/* Phone: tabs in one swipeable row (soft edge on the right) instead of wrapping onto several lines */
@media (max-width: 720px) {
  .ak-tabbar { flex-wrap: nowrap; }
  .ak-tabs { flex-wrap: nowrap; overflow-x: auto; min-width: 0; scrollbar-width: none; overscroll-behavior-x: contain;
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
  .ak-tabs::-webkit-scrollbar { display: none; }
  .ak-tabs button, .ak-tab-link { flex: none; white-space: nowrap; margin-bottom: 0; padding: 0 12px; }
}

/* Cards stacked directly in a page never touch (grids such as ak-two keep their own gap) */
.mpage > .card + .card { margin-top: 16px; }
/* Dialogs without a footer keep the same bottom padding as the sides */
.pdrawer-body:has(+ .pdrawer-foot[hidden]) { padding-bottom: 22px; }
/* Text boxes grow with their text (no native resize grip); browsers without field-sizing keep the fixed height and scroll */
.pdrawer .db-field textarea, .mpage .db-field textarea { resize: none; field-sizing: content; max-height: 45vh; overflow-y: auto; }

/* Checkboxes in every dialog get the portal box instead of the browser's (lower specificity via :where, so dialogs
   with their own drawn box - e.g. model-konto.css .db-check - keep theirs; owner pages also style page checkboxes) */
:where(.pdrawer) input[type="checkbox"]:where(:not(.sr, .db-visually-hidden)) {
  appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 1px 0 0; border: 1.5px solid var(--line2);
  border-radius: 5px; background: var(--surface) center / 12px no-repeat; cursor: pointer; transition: border-color .15s, background-color .15s;
}
:where(.pdrawer) input[type="checkbox"]:where(:not(.sr, .db-visually-hidden)):hover { border-color: color-mix(in srgb, var(--ink3) 55%, var(--line2)); }
:where(.pdrawer) input[type="checkbox"]:where(:not(.sr, .db-visually-hidden)):checked {
  border-color: var(--accent); background-color: var(--accent);
  background-image: 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.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
:where(.pdrawer) input[type="checkbox"]:where(:not(.sr, .db-visually-hidden)):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(.pdrawer) input[type="checkbox"]:where(:not(.sr, .db-visually-hidden)):disabled { cursor: default; opacity: .6; }
/* an empty state's button keeps a little air above it */
.m-empty > .btn, .m-empty > .btn2 { margin-top: 8px; }
/* KPI tiles in one row: label, value and sub line start at the top, so values line up across the row (tiles with a
   footer line keep their own layout) */
.kpi:not(:has(.kpi-f)) { align-content: start; }
/* the logo link: gradient text on top; without gradient support it falls back to the accent, never the link blue */
a.brand { color: var(--accent); text-decoration: none; }

/* Contact data and platform names in what moderators and partners read (ModeratorMask, Fmt.moderatorMessage): only
   filler characters reach the page, drawn blurred, with the label on top - a short stretch is as wide as the label */
.masked { display: inline-grid; max-width: 100%; cursor: help; }
.masked > * { grid-area: 1 / 1; }
.mk-fill { filter: blur(5px); user-select: none; overflow-wrap: anywhere; }
.mk-tag {
  place-self: center; padding: 0 6px; border-radius: 5px; background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad);
  font-size: 10.5px; font-weight: 700; line-height: 18px; letter-spacing: .04em; white-space: nowrap; user-select: none;
}

/* Moderator pay also in coins (1 coin = 5 ct, always rounded down; Fmt.coins / MMZ.F.coins): a quiet line under the
   euro amount - in tiles, table cells and the partner's ranking */
.coins { display: block; margin-top: 2px; color: var(--ink3); font-family: var(--font); font-size: 12px; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.kpi-v .coins { margin-top: 4px; font-size: 13px; }

/* Period bars with "Individuell" (fragments/range.html, the statement): on phones the choices wrap instead of running
   off the page, the date box stays on screen */
@media (max-width: 700px) {
  .range { flex-wrap: wrap; }
  .range > a, .range > button { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
  .range-pop { width: min(300px, calc(100vw - 32px)); }
}

/* Update notice (portal.js): a calm note while an update is announced, a card over the page while the server restarts */
.upd { position: fixed; z-index: 1000; }
.upd[hidden] { display: none; }
.upd.is-soon {
  left: 50%; top: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; width: max-content;
  max-width: calc(100vw - 32px); padding: 10px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  color: var(--ink); box-shadow: var(--pop); font-size: 13.5px; line-height: 1.45;
}
.upd.is-soon .ic { flex: none; width: 18px; height: 18px; color: var(--accent); }
.upd.is-down, .upd.is-back {
  inset: 0; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--page) 72%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.upd-card {
  display: grid; justify-items: center; gap: 10px; max-width: 420px; padding: 28px 28px 24px; border: 1px solid var(--line);
  border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: var(--pop); text-align: center;
}
.upd-card b { font-size: 17px; }
.upd-card p { margin: 0; color: var(--ink2); font-size: 14px; line-height: 1.5; }
.upd-card .ic { width: 28px; height: 28px; color: var(--ok); }
.upd-spin { width: 28px; height: 28px; border: 3px solid var(--line2); border-top-color: var(--accent); border-radius: 50%; animation: upd-spin .9s linear infinite; }
@keyframes upd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upd-spin { animation-duration: 3s; } }

/* Voice messages (LiveCreator): the fan's recording plays right in the bubble - mask, model portal, partner review, admin */
audio.voice { display: block; width: min(300px, 100%); height: 36px; margin: 2px 0 6px; }

/* An own picture of a moderator account (Merlin, V082) instead of the initials: bar, person menu, team lists */
.side-av img, .me-av img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.me-av:has(img) { background: none; }
