/* =====================================================================
   KeyCube — Design System v2 (bold, dark-first "Let's Do." refresh)
   Research-grounded tokens: Vercel motion (animate only transform/opacity,
   never `transition:all`), two-layer ambient+direct shadows + semi-transparent
   borders, Raycast 4–16px radius scale, Carbon status palette, :focus-visible
   + prefers-reduced-motion. Brand (--brand/--brand-hi) stays overridable per
   tenant/tree. Class names preserved so all templates inherit the uplift.
   ===================================================================== */

/* ---- v3 self-hosted fonts (OFL; licenses in /assets/fonts/) ---- */
@font-face{
  font-family:'InterVariable';
  src:url('/assets/fonts/InterVariable.woff2') format('woff2');
  font-weight:100 900; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'JetBrains Mono';
  src:url('/assets/fonts/JetBrainsMono-Regular.woff2') format('woff2');
  font-weight:400; font-style:normal; font-display:swap;
}
@font-face{
  font-family:'JetBrains Mono';
  src:url('/assets/fonts/JetBrainsMono-Medium.woff2') format('woff2');
  font-weight:500; font-style:normal; font-display:swap;
}
/* Metric-matched fallbacks — zero-CLS swap (Chrome/FF/Safari 17+) */
@font-face{
  font-family:'Inter-fallback';
  src:local('Segoe UI');
  size-adjust:107.7%; ascent-override:89.9%; descent-override:22.4%; line-gap-override:0%;
}
@font-face{
  font-family:'Inter-fallback-arial';
  src:local('Arial');
  size-adjust:107.06%; ascent-override:90.49%; descent-override:22.56%; line-gap-override:0%;
}
@font-face{
  font-family:'JBM-fallback';
  src:local('Consolas');
  size-adjust:109.1%; ascent-override:93.5%; descent-override:27.5%; line-gap-override:0%;
}

:root{
  color-scheme: dark;

  /* Brand — official CI cinnabar red; overridable per Firma/Tree (injected inline) */
  --brand:#E41C22; --brand-hi:#FF5358;
  --grad-brand:linear-gradient(135deg, var(--brand) 0%, var(--brand-hi) 100%);
  --brand-soft:color-mix(in srgb, var(--brand) 16%, transparent);
  --brand-glow:color-mix(in srgb, var(--brand) 30%, transparent);

  /* Surfaces — layered dark */
  --bg:#0A0C10; --bg-2:#0D1016;
  --surface:#14181F; --surface-2:#1A1F28; --surface-3:#232A36;
  --glass:rgba(20,24,31,.72);

  /* Borders — semi-transparent for crisp edges (Vercel) */
  --border:rgba(255,255,255,.08); --border-strong:rgba(255,255,255,.15);
  --hairline:rgba(255,255,255,.06);

  /* Text — `--text-dim` is for SECONDARY body text that must still pass AA
     against `--bg`/`--surface` (≥4.5:1). `--text-decor` is reserved for
     genuine chrome/separator labels where 3:1 large-text contrast is enough
     (legend captions, copyright lines). Don't use --text-decor for paragraph
     copy. */
  --text:#F4F6FA; --text-muted:#98A1B2; --text-dim:#8892A3; --text-decor:#6A7382;

  /* Status (IBM Carbon exact hex) */
  --success:#24A148; --danger:#DA1E28; --warning:#F1C21B; --warning-2:#FF832B;
  --info:#0070F3; --info-hi:#3B9EFF; --neutral:#6F6F6F; --accent2:#8A3FFC;

  /* Radius (Raycast scale) */
  --r-xs:4px; --r-sm:6px; --r-md:8px; --r-lg:12px; --r-xl:16px; --r-2xl:22px; --r-full:9999px;

  /* Spacing (4px base) */
  --s1:4px; --s2:8px; --s3:12px; --s4:16px; --s5:20px; --s6:24px; --s8:32px; --s10:40px;

  /* Shadows — two-layer ambient + direct light */
  --shadow-sm:0 1px 2px rgba(0,0,0,.40), 0 1px 1px rgba(0,0,0,.28);
  --shadow:0 6px 18px rgba(0,0,0,.42), 0 2px 5px rgba(0,0,0,.32);
  --shadow-lg:0 24px 60px rgba(0,0,0,.55), 0 6px 16px rgba(0,0,0,.40);
  --glow:0 10px 34px var(--brand-glow);

  /* Motion */
  --ease:cubic-bezier(.2,.7,.2,1); --ease-out:cubic-bezier(.16,1,.3,1);
  --dur-1:.12s; --dur-2:.2s; --dur-3:.34s;

  --font:'InterVariable','Inter-fallback','Inter-fallback-arial','Segoe UI',system-ui,-apple-system,sans-serif;
  --mono:'JetBrains Mono','JBM-fallback',ui-monospace,'SF Mono',Menlo,Consolas,monospace;
  --topbar-h:62px; --sidebar-w:256px; --maxw:1140px;
}

/* ---- Reset / base ---- */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
html{
  font-optical-sizing:auto;
  font-feature-settings:'liga' 1,'calt' 1,'cv05' 1; /* cv05 = tailed l — Ill/1lI disambiguation, matters in a credential vault */
}
/* Aligned numerals for stats/tables/countdowns */
.stat .value, table.tbl td, [data-tabular]{font-variant-numeric:tabular-nums lining-nums}
/* Secrets & codes: mono, slashed zero, NO ligatures (a ligature can mask characters) */
.cred-field .v, .kbd, kbd, code, .pair-code{font-feature-settings:'zero' 1,'calt' 0}
body{
  font-family:var(--font); background:var(--bg); color:var(--text);
  line-height:1.55; min-height:100vh; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  background-image:
    radial-gradient(1100px 520px at 80% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 60%),
    radial-gradient(900px 480px at -10% 0%, color-mix(in srgb, var(--brand-hi) 9%, transparent), transparent 55%);
  background-attachment:fixed;
}
a{color:var(--brand-hi); text-decoration:none; transition:color var(--dur-1) var(--ease)}
a:hover{color:color-mix(in srgb, var(--brand-hi) 70%, #fff)}
h1,h2,h3,h4{line-height:1.2; margin:.2em 0 .5em; letter-spacing:-.012em; font-weight:700}
h1{font-size:clamp(1.5rem,1.2rem + 1.2vw,2rem)} h2{font-size:1.3rem} h3{font-size:1.06rem}
small,.muted{color:var(--text-muted)}
hr{border:none; border-top:1px solid var(--border); margin:var(--s5) 0}
::selection{background:var(--brand-glow); color:#fff}

/* ---- Scrollbars ---- */
*{scrollbar-width:thin; scrollbar-color:var(--surface-3) transparent}
*::-webkit-scrollbar{width:10px;height:10px}
*::-webkit-scrollbar-thumb{background:var(--surface-3); border-radius:var(--r-full); border:2px solid transparent; background-clip:padding-box}

/* ---- Focus (a11y) ---- */
:focus{outline:none}
:focus-visible{outline:2px solid var(--brand-hi); outline-offset:2px; border-radius:var(--r-xs)}

/* ---- Layout shells ---- */
.center-shell{max-width:440px; margin:max(6vh,2rem) auto; padding:0 var(--s4)}
.app{display:grid; grid-template-columns:var(--sidebar-w) 1fr; grid-template-rows:var(--topbar-h) 1fr;
  grid-template-areas:"sidebar topbar" "sidebar main"; min-height:100vh}
.topbar{grid-area:topbar; display:flex; align-items:center; gap:var(--s4); padding:0 var(--s6);
  background:var(--glass); backdrop-filter:blur(14px) saturate(140%); -webkit-backdrop-filter:blur(14px) saturate(140%);
  border-bottom:1px solid var(--border); position:sticky; top:0; z-index:20}
.sidebar{grid-area:sidebar; background:linear-gradient(180deg,var(--surface),var(--bg-2));
  border-right:1px solid var(--border); padding:var(--s5) var(--s3); display:flex; flex-direction:column; gap:2px;
  position:sticky; top:0; height:100vh; overflow:auto}
.main{grid-area:main; padding:var(--s6) var(--s8); max-width:var(--maxw); width:100%}
@media(max-width:860px){
  :root{--topbar-h:56px}
  .app{grid-template-columns:1fr; grid-template-areas:"topbar" "main"}
  .sidebar{display:none}
  .main{padding:var(--s5) var(--s4)}
}

/* ---- Brand / logo ---- */
.brand{display:flex; align-items:center; gap:var(--s3); font-weight:800; color:var(--text); letter-spacing:-.01em}
.brand img{height:34px; width:auto; border-radius:var(--r-md)}
.brand .dot{width:34px; height:34px; border-radius:var(--r-lg); background:var(--grad-brand);
  display:grid; place-items:center; color:#fff; font-weight:800; box-shadow:var(--glow)}
.brand .dot .icon{width:20px; height:20px}
.stat .label .icon{width:15px; height:15px; vertical-align:-2px}

/* ---- Sidebar nav ---- */
.nav-section{font-size:.68rem; text-transform:uppercase; letter-spacing:.1em; color:var(--text-decor);
  margin:var(--s5) var(--s2) var(--s2); font-weight:700}
.nav-link{display:flex; align-items:center; gap:var(--s3); padding:9px 11px; border-radius:var(--r-md);
  color:var(--text-muted); font-weight:550; position:relative;
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease)}
.nav-link:hover{background:var(--surface-2); color:var(--text)}
.nav-link.active{background:var(--brand-soft); color:var(--text)}
.nav-link.active::before{content:""; position:absolute; left:0; top:18%; bottom:18%; width:3px; border-radius:var(--r-full); background:var(--grad-brand)}
.nav-link .ico{width:1.15em; display:inline-flex; justify-content:center; color:currentColor}
.nav-link .icon{width:18px;height:18px}
/* Inset focus ring — an outline would clip inside the sidebar's scroll container (PR-P) */
.nav-link:focus-visible{outline:none; box-shadow:inset 0 0 0 2px var(--brand-hi)}

/* ---- Topbar user menu ---- */
/* .usermenu is defined once in the v3.6 block below (PR-P dedupe). */
.spacer{flex:1}
.avatar{width:34px; height:34px; border-radius:var(--r-full); background:var(--grad-brand);
  display:grid; place-items:center; font-weight:700; color:#fff; box-shadow:var(--shadow-sm)}

/* ---- Cards ---- */
.card{background:linear-gradient(180deg, color-mix(in srgb,var(--surface) 92%, #fff 2%), var(--surface));
  border:1px solid var(--border); border-radius:var(--r-xl); padding:var(--s6); box-shadow:var(--shadow)}
.card+.card{margin-top:var(--s4)}
.card h2,.card h3{margin-top:0}
.grid{display:grid; gap:var(--s4)}
/* (#23 PR-P) true column counts — auto-fill produced 4 narrow tracks in a wide main */
.grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width:720px){.grid.cols-2,.grid.cols-3{grid-template-columns:1fr}}

/* ---- KPI / stat cards ---- */
.stat-grid{display:grid; gap:var(--s4); grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); margin-bottom:var(--s5)}
.stat{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); padding:var(--s5);
  position:relative; overflow:hidden; transition:transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease)}
/* (#12 PR-P) only LINK stats lift — static div.stat cards no longer pretend to be clickable.
   The chevron affordance uses ::before because .stat::after already hosts the radial decor. */
a.stat{color:inherit}
a.stat::before{content:"→"; float:right; color:var(--text-decor); font-size:1.05rem; line-height:1; position:relative; z-index:1}
@media (hover:hover) and (pointer:fine){
  a.stat:hover{transform:translateY(-2px); border-color:var(--border-strong)}
}
.stat::after{content:""; position:absolute; inset:0 0 auto auto; width:120px; height:120px;
  background:radial-gradient(circle at 70% 30%, var(--brand-soft), transparent 70%)}
.stat .label{font-size:.78rem; color:var(--text-muted); text-transform:uppercase; letter-spacing:.06em; font-weight:600}
.stat .value{font-size:2rem; font-weight:800; letter-spacing:-.02em; margin-top:var(--s1)}
.stat .sub{font-size:.82rem; color:var(--text-dim)}

/* ---- Tree tiles (icon + colour recognition) ---- */
.tree-tile{display:flex; flex-direction:column; gap:var(--s3); padding:var(--s5); border-radius:var(--r-xl);
  background:var(--surface); border:1px solid var(--border); position:relative; overflow:hidden;
  transition:transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease)}
.tree-tile::before{content:""; position:absolute; inset:0 0 auto 0; height:3px; background:var(--tile-accent,var(--grad-brand)); opacity:.9}
.tree-tile:hover{transform:translateY(-3px); border-color:var(--border-strong); box-shadow:var(--shadow-lg)}
.tree-icon{width:52px; height:52px; border-radius:var(--r-lg); display:grid; place-items:center; font-size:1.5rem; color:#fff;
  box-shadow:var(--shadow-sm)}
.tree-icon .icon{width:26px;height:26px}
.tree-tile .title{font-weight:700; color:var(--text); letter-spacing:-.01em}
.tree-tile .meta{font-size:.8rem; color:var(--text-muted); display:flex; gap:var(--s2); align-items:center}

/* ---- Buttons ---- */
.btn{display:inline-flex; align-items:center; justify-content:center; gap:var(--s2); padding:9px 16px; border-radius:var(--r-md);
  border:1px solid transparent; font:inherit; font-weight:650; cursor:pointer; white-space:nowrap;
  transition:transform var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease),
    border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), filter var(--dur-1) var(--ease)}
.btn:active{transform:translateY(1px)}
.btn .icon{width:17px;height:17px}
.btn-primary{background:var(--grad-brand); color:#fff; box-shadow:var(--shadow-brand)}
.btn-ghost{background:var(--surface-2); color:var(--text); border-color:var(--border)}
.btn-ghost:hover{background:var(--surface-3); border-color:var(--border-hover)}
.btn-sm{padding:6px 11px; font-size:.85rem; border-radius:var(--r-sm)}
/* Hover states gated to real pointers (PR-P): lift + overlay-white brighten.
   The overlay trick keeps text crisp — filter:brightness() blurs glyph edges. */
@media (hover:hover) and (pointer:fine){
  .btn:hover{transform:translateY(-1px)}
  .btn-primary:hover{background-image:linear-gradient(rgba(255,255,255,.08),rgba(255,255,255,.08)),var(--grad-brand); box-shadow:var(--glow)}
}
/* Disabled last so it beats :hover/:active at equal specificity */
.btn[disabled],.btn[aria-disabled=true]{opacity:.45; cursor:not-allowed; box-shadow:none; transform:none; filter:none}

/* ---- Forms ---- */
.field{margin-bottom:var(--s4)}
label{display:block; font-weight:600; margin-bottom:var(--s2); font-size:.9rem}
input[type=text],input[type=email],input[type=password],input[type=url],input[type=search],
input[type=number],input[type=date],input[type=datetime-local],input[type=time],input[type=month],
input[type=week],input[type=tel],select,textarea{
  width:100%; padding:10px 12px; background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--r-md); color:var(--text); font:inherit;
  transition:border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease)}
/* Calendar/clock pickers ship a system icon — invert in dark mode for contrast. */
input[type=date]::-webkit-calendar-picker-indicator,
input[type=datetime-local]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator,
input[type=week]::-webkit-calendar-picker-indicator{filter:invert(.9); cursor:pointer; opacity:.7}
body.theme-light input[type=date]::-webkit-calendar-picker-indicator,
body.theme-light input[type=datetime-local]::-webkit-calendar-picker-indicator,
body.theme-light input[type=time]::-webkit-calendar-picker-indicator,
body.theme-light input[type=month]::-webkit-calendar-picker-indicator,
body.theme-light input[type=week]::-webkit-calendar-picker-indicator{filter:none}
input::placeholder,textarea::placeholder{color:var(--text-dim)}
input:hover,select:hover,textarea:hover{border-color:var(--border-hover)}
input:disabled,select:disabled,textarea:disabled{opacity:.55; background:var(--bg-2)}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline:none; border-color:var(--brand-hi);
  box-shadow:0 0 0 3px var(--brand-soft)}
input[type=color]{padding:3px; height:42px; width:56px; cursor:pointer; background:var(--surface-2)}
.help{font-size:.8rem; color:var(--text-muted); margin-top:var(--s2)}
.field-error{color:var(--danger); font-size:.82rem; margin-top:var(--s2)}
.inline{display:flex; gap:var(--s3); align-items:center; flex-wrap:wrap}

/* ---- Tables ---- */
/* (#24 PR-P) horizontal-scroll wrapper for wide admin tables (PR-Q adds the div) */
.tbl-scroll{overflow-x:auto; -webkit-overflow-scrolling:touch}
table.tbl{width:100%; border-collapse:separate; border-spacing:0}
table.tbl th,table.tbl td{padding:11px 12px; text-align:left; border-bottom:1px solid var(--hairline)}
/* (#25 PR-P) sticky header offsets below the sticky topbar instead of sliding under it */
table.tbl thead th{position:sticky; top:var(--topbar-h); background:var(--surface); color:var(--text-muted); font-size:var(--fs-2xs);
  text-transform:uppercase; letter-spacing:.06em; z-index:1}
/* FIX: inside the .tbl-scroll wrapper (overflow:auto) the sticky offset is
   measured from the WRAPPER, not the viewport topbar — so top:var(--topbar-h)
   shoved the header 62px down onto the first data row (visible at scrollY:0).
   Pin the header to the wrapper's own top instead. */
.tbl-scroll table.tbl thead th{top:0}
table.tbl tbody tr{transition:background-color var(--dur-1) var(--ease)}
/* (#43 PR-P) hover tint only on actionable tables — read-only tables (audit log)
   no longer imply clickability. PR-Q adds `has-actions` to tables with buttons. */
table.tbl.has-actions tbody tr:hover td{background:var(--surface-2)}
table.tbl tbody tr:last-child td{border-bottom:none}

/* ---- Badges (Carbon-tinted) ----
   (#11 PR-P) borderless — buttons keep borders, so status pills stop reading as
   controls. (#9) status foregrounds sit on the theme-aware *-text tokens so the
   light theme stays AA (the old hardcoded dark-theme hexes washed out on white). */
.badge{display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:var(--r-full); font-size:.74rem; font-weight:650;
  background:var(--surface-3); color:var(--text-muted); border:1px solid transparent}
.badge::before{content:""; width:6px; height:6px; border-radius:var(--r-full); background:currentColor}
.badge.ok{color:var(--success-text); background:color-mix(in srgb,var(--success) 16%, transparent)}
.badge.warn{color:var(--warning-text); background:color-mix(in srgb,var(--warning) 14%, transparent)}
.badge.bad{color:var(--danger-text); background:color-mix(in srgb,var(--danger) 15%, transparent)}
.badge.info{color:var(--info-hi); background:color-mix(in srgb,var(--info) 16%, transparent)}
.badge.plain::before{display:none}
/* (#15 PR-P) micro badge — replaces the one-off inline font-size styles in the editor */
.badge.xs{font-size:var(--fs-2xs); padding:2px 7px}
/* legacy "NEU!" badge, modernised. (#14 PR-P) blinks 3× then rests — infinite
   blinking is a WCAG 2.2.2 distraction. */
.new-badge{display:inline-block; margin-left:6px; padding:1px 6px; border-radius:var(--r-xs); font-size:.62rem;
  font-weight:800; color:#fff; background:var(--danger); letter-spacing:.04em; animation:blink 1.4s ease-in-out 3}
@keyframes blink{0%,100%{opacity:1}50%{opacity:.5}}

/* ---- Credential rows (tree view) ----
   .cred itself is defined once in the v3.1 vault block below (PR-P dedupe). */
.cred .secret{font-family:var(--mono)}
.copy-feedback{color:var(--success-text); font-weight:700}

/* ---- Flash / toasts ---- */
.flash-stack{position:fixed; top:var(--s4); right:var(--s4); z-index:80; display:flex; flex-direction:column; gap:var(--s2); max-width:380px}
/* (#33 PR-P) the public tree parks a fixed share disc at top/right 14px z-80 —
   drop the toast stack below it so they never overlap. */
body.public-tree .flash-stack{top:72px}
.toast{padding:11px 15px; border-radius:var(--r-md); background:var(--overlay); border:1px solid var(--border); box-shadow:var(--shadow-lg);
  animation:slidein var(--dur-3) var(--ease-out); display:flex; gap:var(--s2); align-items:center}
.toast.success{border-left:3px solid var(--success)}
.toast.error{border-left:3px solid var(--danger)}
.toast.error,.toast.bad{border-left-width:4px}
.toast.info{border-left:3px solid var(--brand-hi)}
.toast{transition:opacity .3s var(--ease)}
.toast-msg{flex:1; min-width:0; font-size:.9rem}
.toast-x{flex:none; width:24px; height:24px; margin:-3px -5px -3px 4px; border:none; background:transparent;
  color:var(--text-dim); font-size:1.25rem; line-height:1; cursor:pointer; border-radius:var(--r-sm);
  display:grid; place-items:center; position:relative; transition:color 140ms var(--ease), background 140ms var(--ease)}
/* (#32 PR-P) invisible tap-area extension — 24px visual, ~40px touchable */
.toast-x::after{content:""; position:absolute; inset:-8px}
.toast-x:hover{color:var(--text); background:color-mix(in srgb, var(--text) 12%, transparent)}
.toast-x:focus-visible{outline:none; box-shadow:0 0 0 2px var(--brand-soft)}
@keyframes slidein{from{opacity:0; transform:translateX(16px)}to{opacity:1; transform:none}}

/* ---- Modals ----
   (#26 PR-P) tall modals scroll instead of clipping: the backdrop scrolls as a
   fallback, the card itself caps at the viewport and scrolls internally. */
.modal{position:fixed; inset:0; background:var(--scrim); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  display:none; place-items:center; z-index:90; padding:24px 12px; overflow:auto}
.modal.open{display:grid; animation:fade var(--dur-2) var(--ease)}
@keyframes fade{from{opacity:0}to{opacity:1}}
.modal-card{background:var(--overlay);
  border:1px solid var(--border-strong); border-radius:var(--r-2xl); padding:var(--s6); max-width:460px; width:100%;
  max-height:calc(100dvh - 48px); overflow:auto;
  box-shadow:var(--shadow-lg), var(--inset-hi); animation:pop var(--dur-3) var(--ease-out)}
@keyframes pop{from{opacity:0; transform:translateY(10px) scale(.98)}to{opacity:1; transform:none}}

/* ---- Detail drawer (right-side slide-over, W3 PR9) ----
   Presentation-only variant of .modal driven by KeyCube.drawer → KeyCube.dialog
   (same scrim + a11y: role=dialog, aria-modal, focus trap, ESC, scrim-click,
   focus restore). The only difference: the card is a full-height panel pinned
   to the right edge that slides in. prefers-reduced-motion drops the slide. */
.drawer{position:fixed; inset:0; background:var(--scrim); backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  display:none; justify-content:flex-end; z-index:95}
.drawer.open{display:flex; animation:fade var(--dur-2) var(--ease)}
.drawer-card{background:var(--overlay); border-left:1px solid var(--border-strong);
  width:min(560px, 92vw); height:100%; max-height:100dvh; overflow:hidden;
  display:flex; flex-direction:column;
  box-shadow:var(--shadow-lg), var(--inset-hi); animation:drawer-in var(--dur-3) var(--ease-out)}
@keyframes drawer-in{from{transform:translateX(100%)}to{transform:none}}
.drawer-head{display:flex; align-items:center; justify-content:space-between; gap:var(--s3);
  padding:var(--s4) var(--s5); border-bottom:1px solid var(--border); background:var(--overlay)}
.drawer-title{font-weight:700; font-size:1.05rem; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.drawer-body{padding:var(--s5); overflow:auto; flex:1}
.drawer-loading{display:flex; align-items:center; gap:var(--s2); color:var(--text-dim); padding:var(--s4) 0}
.drawer-spin{display:inline-block; width:14px; height:14px; border:2px solid currentColor; border-right-color:transparent;
  border-radius:50%; animation:ld-btn-spin 600ms linear infinite}
@media (prefers-reduced-motion: reduce){
  .drawer.open{animation:none}
  .drawer-card{animation:none}
  .drawer-spin{animation:none; width:auto; height:auto; border:0; border-radius:0}
  .drawer-spin::before{content:'…'}
}

/* ---- Night-mode switch ---- */
.switch{position:relative; display:inline-block; width:44px; height:24px}
.switch input{display:none}
.switch .slider{position:absolute; inset:0; background:var(--surface-3); border:1px solid var(--border);
  border-radius:var(--r-full); cursor:pointer; transition:background-color var(--dur-2) var(--ease)}
.switch .slider::before{content:""; position:absolute; width:18px; height:18px; left:2px; top:2px; border-radius:var(--r-full);
  background:#fff; box-shadow:var(--shadow-sm); transition:transform var(--dur-2) var(--ease)}
.switch input:checked+.slider{background:var(--grad-brand); border-color:transparent}
.switch input:checked+.slider::before{transform:translateX(20px)}

/* ---- Segmented control ---- */
.seg{display:inline-flex; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--r-md); padding:3px}
.seg button{background:none; border:none; color:var(--text-muted); font:inherit; font-weight:600; padding:6px 14px;
  border-radius:var(--r-sm); cursor:pointer; transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease)}
.seg button.active{background:var(--surface-3); color:var(--text); box-shadow:var(--shadow-sm)}

/* ---- Icon (Lucide sprite) ---- */
.icon{width:1em; height:1em; display:inline-block; vertical-align:-.125em; fill:none; stroke:currentColor;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round}

/* ---- Icon / emoji picker ---- */
.iconpick{display:flex; align-items:center; gap:var(--s3)}
.iconpick-preview{width:54px; height:54px; border-radius:var(--r-lg); display:grid; place-items:center; font-size:1.6rem;
  color:#fff; border:1px solid var(--border); box-shadow:var(--shadow-sm)}
.iconpick-preview .icon{width:28px;height:28px}
.picker{position:absolute; z-index:95; margin-top:var(--s2); width:320px; max-width:92vw; background:var(--glass);
  backdrop-filter:blur(18px) saturate(150%); -webkit-backdrop-filter:blur(18px) saturate(150%);
  border:1px solid var(--border-strong); border-radius:var(--r-xl); box-shadow:var(--shadow-lg); padding:var(--s3)}
.picker[hidden]{display:none}
.picker-search{margin-bottom:var(--s2)}
.picker-grid{display:grid; grid-template-columns:repeat(7,1fr); gap:4px; max-height:240px; overflow:auto; padding:2px}
.picker-grid button{aspect-ratio:1; display:grid; place-items:center; font-size:1.25rem; background:none; border:1px solid transparent;
  border-radius:var(--r-sm); cursor:pointer; color:var(--text);
  transition:background-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease)}
.picker-grid button .icon{width:22px;height:22px}
.picker-grid button:hover{background:var(--surface-3); transform:scale(1.08)}
.picker-grid button:focus-visible{background:var(--surface-3); transform:scale(1.08); outline:2px solid var(--brand-hi); outline-offset:2px}
.picker-empty{padding:var(--s5); text-align:center; color:var(--text-dim); font-size:.85rem}

/* ---- Empty states ---- */
.empty{text-align:center; color:var(--text-muted); padding:var(--s10) var(--s4)}
.empty .big{font-size:2.6rem; opacity:.7; margin-bottom:var(--s2)}
.empty .big .icon{width:56px;height:56px}

/* ---- Hero (auth / landing) ---- */
.hero{position:relative; overflow:hidden}
.hero h1{font-size:clamp(1.7rem,1.3rem + 2vw,2.4rem); background:linear-gradient(180deg,#fff,var(--text-muted));
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent}

/* ---- Footer (full layout defined in v3.6 block below) ---- */
@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.18)}}

/* ---- Utilities ---- */
.row{display:flex; gap:var(--s4); align-items:center}
.between{justify-content:space-between}
.wrap{flex-wrap:wrap}
.mt{margin-top:var(--s4)}.mt2{margin-top:var(--s6)}.mb{margin-bottom:var(--s4)}
.text-center{text-align:center}
.hidden{display:none !important}
.tag{font-size:.78rem; color:var(--text-dim)}
.kbd{font-family:var(--mono); font-size:.75rem; background:var(--surface-3); border:1px solid var(--border);
  border-bottom-width:2px; border-radius:var(--r-xs); padding:1px 6px}
/* .drag-handle is defined once in the v3.1 block below (PR-P dedupe). */
.sortable-ghost{opacity:.4}
/* (#31 PR-P) visually-hidden live region for keyboard-reorder announcements —
   the class was used in tree/show.php but never styled, so it rendered visibly. */
.sr-announce{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0}

/* Drag-handle buttons (PR-K: keyboard-operable reorder).
   Strip native button chrome — handles must look identical to the legacy <span>. */
button.drag-handle{
  background:transparent; border:0; padding:0 var(--s2) 0 0; margin:0;
  font:inherit; color:var(--text-dim); cursor:grab;
  display:inline-flex; align-items:center;
  position:relative;
  -webkit-appearance:none; appearance:none;
}
button.drag-handle:active{cursor:grabbing}
button.drag-handle:focus{outline:none}
button.drag-handle:focus-visible{outline:2px solid var(--brand-hi); outline-offset:2px; border-radius:var(--r-xs)}
.drag-handle .dh-hint{
  position:absolute; left:50%; top:calc(100% + 6px); transform:translateX(-50%);
  background:var(--surface-3); color:var(--text); border:1px solid var(--border);
  border-radius:var(--r-xs); padding:3px 8px; font-size:.72rem; line-height:1.2;
  white-space:nowrap; pointer-events:none; opacity:0; z-index:50;
  box-shadow:0 4px 16px rgba(0,0,0,.18);
}
button.drag-handle:focus-visible .dh-hint{opacity:1}
@media (prefers-reduced-motion: reduce){
  .drag-handle .dh-hint{transition:none}
}

/* ---- Light theme (night-mode switch OFF) ----
   Token values live in the v3 body.theme-light block further down (merged);
   only the softened background wash stays here. */
body.theme-light{background-image:
  radial-gradient(1100px 520px at 80% -10%, color-mix(in srgb,var(--brand) 5%, transparent), transparent 60%)}

/* ---- Reduced motion ----
   Previous rule was `* { animation-duration:.001ms; transition-duration:.001ms }`
   — that nukes EVERY transition (button colour shifts, focus-ring fade, hover
   tints), which makes the UI feel BROKEN rather than calmer. WCAG 2.3.3 only
   asks us to remove non-essential motion (parallax, looping pulses, spinning
   covers). Short colour/opacity/box-shadow transitions are not motion.

   Strategy: kill the noisy infinite loops, freeze decorative entrance
   keyframes to their end-state (no slide-in, just appear), but leave plain
   transitions alone. Feature-specific opt-outs (player spin, gate shake,
   public-tree stagger, view-transitions) stay in their respective blocks. */
@media (prefers-reduced-motion: reduce){
  .new-badge,.footer .heart{animation:none}
  /* Cap looping decorative animations to one cycle and skip slide/scale
     entrances — but use animation-name:none only for the global enter-stagger,
     not transitions. */
  *,*::before,*::after{animation-iteration-count:1 !important}
}

/* =====================================================================
   v3 — "2026 high-end" layer. Refines v2 (later rules win); class names
   preserved. True-dark OLED base, lit edges, spotlight cards, spring motion,
   cross-page View Transitions, command palette.
   ===================================================================== */
:root{
  --bg:#06070A; --bg-2:#0A0C11;
  --surface:#0F1318; --surface-2:#161B22; --surface-3:#202833;
  --glass:rgba(13,17,22,.64);
  --border:rgba(255,255,255,.07); --border-strong:rgba(255,255,255,.14); --hairline:rgba(255,255,255,.05);
  --text:#F5F7FB; --text-muted:#9BA4B4; --text-dim:#8892A3; --text-decor:#69727F;
  --inset-hi:inset 0 1px 0 0 rgba(255,255,255,.055);
  --ring:0 0 0 3px var(--brand-soft);
  --ease-spring:cubic-bezier(.22,1.18,.36,1); --ease-out:cubic-bezier(.16,1,.3,1);
  --shadow-sm:0 1px 2px rgba(0,0,0,.5);
  --shadow:0 10px 28px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4);
  --shadow-lg:0 32px 74px rgba(0,0,0,.62), 0 8px 22px rgba(0,0,0,.46);
  /* v3 additions */
  --overlay:#1B2029;                         /* popovers, menus, toasts, modal cards (above --surface) */
  --scrim:rgba(5,7,11,.62);                  /* modal backdrop */
  --border-hover:rgba(255,255,255,.12);      /* interactive borders on hover (between --border and --border-strong) */
  --shadow-brand:0 1px 2px rgba(0,0,0,.32), 0 4px 16px color-mix(in srgb, var(--brand) 30%, transparent);
  --success-text:#5BD98A; --warning-text:#F4D35E; --danger-text:#FF6B70; /* status FOREGROUNDS (dark theme) */
  /* Type scale (16px root): 11/12/13/14/16/18/20/24/30 */
  --fs-2xs:.6875rem; --fs-xs:.75rem; --fs-sm:.8125rem; --fs-base:.875rem; --fs-md:1rem;
  --fs-lg:1.125rem; --fs-xl:1.25rem; --fs-2xl:1.5rem; --fs-3xl:1.875rem;
  --fs-h3:var(--fs-2xl);                     /* referenced by .empty-onboard-h — defined here */
}
body.theme-light{
  color-scheme:light;
  /* Brand: FILLS keep CI red; text/links/focus rings get the darkened shade (6.1:1 on white).
     --grad-brand pinned so filled buttons keep the official E41C22→FF5358 gradient. */
  --brand-hi:#C4161C;
  --grad-brand:linear-gradient(135deg,#E41C22 0%,#FF5358 100%);
  --brand-soft:color-mix(in srgb, var(--brand) 10%, transparent);
  --brand-glow:color-mix(in srgb, var(--brand) 22%, transparent);
  --bg:#F6F7F9; --bg-2:#EFF1F5;
  --surface:#FFFFFF; --surface-2:#F6F7F9; --surface-3:#EAEDF2;
  --overlay:#FFFFFF; --scrim:rgba(23,26,33,.40); --glass:rgba(255,255,255,.78);
  --hairline:rgba(16,24,40,.06); --border:rgba(16,24,40,.09);
  --border-hover:rgba(16,24,40,.14); --border-strong:rgba(16,24,40,.18);
  --text:#171A21; --text-muted:#4E5766; --text-dim:#6B7587; --text-decor:#8A93A3;
  /* Status — Carbon light-theme variants (dark hexes fail on white) */
  --success:#198038; --warning:#B28600; --warning-2:#BA4E00;
  --info:#0043CE; --info-hi:#0F62FE; --neutral:#525252;
  --success-text:#116329; --warning-text:#7A5C00; --danger-text:#BA1B23;
  --inset-hi:inset 0 1px 0 0 rgba(255,255,255,.7);
  --shadow-sm:0 1px 2px rgba(16,24,40,.06), 0 1px 1px rgba(16,24,40,.04);
  --shadow:0 4px 12px rgba(16,24,40,.08), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg:0 20px 48px rgba(16,24,40,.16), 0 6px 16px rgba(16,24,40,.08);
  --shadow-brand:0 1px 2px rgba(16,24,40,.08), 0 4px 14px color-mix(in srgb, var(--brand) 24%, transparent);
}

/* fine grain + refined ambient for richness (sits above bg, below content) */
body{background-image:
  radial-gradient(1200px 560px at 82% -12%, color-mix(in srgb,var(--brand) 16%, transparent), transparent 60%),
  radial-gradient(1000px 520px at -12% 4%, color-mix(in srgb,var(--brand-hi) 10%, transparent), transparent 56%),
  linear-gradient(180deg, var(--bg-2), var(--bg) 40%)}
body::after{content:""; position:fixed; inset:0; pointer-events:none; z-index:0; opacity:.03; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}
.app,.center-shell{position:relative; z-index:2}
/* .flash-stack keeps its own position:fixed + z-index:80 (do not force relative here) */

/* Lit edges + spotlight on premium surfaces */
.card,.modal-card,.picker{box-shadow:var(--shadow), var(--inset-hi)}
.stat,.tree-tile{box-shadow:var(--shadow-sm), var(--inset-hi)}
[data-spotlight]{position:relative; isolation:isolate}
[data-spotlight]::after{content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; z-index:-1; opacity:0;
  transition:opacity var(--dur-3) var(--ease); background:radial-gradient(360px circle at var(--mx,50%) var(--my,0%),
    color-mix(in srgb,var(--brand) 18%, transparent), transparent 60%)}
[data-spotlight]:hover::after{opacity:1}

/* Tabular numerals for data */
.stat .value,table.tbl td,.kbd{font-variant-numeric:tabular-nums}

/* Premium primary button with a moving sheen.
 * Animate transform (compositor-only) rather than `left` (layout-thrashing) so
 * the sheen stays buttery on low-power devices. */
.btn-primary{position:relative; overflow:hidden}
.btn-primary::after{content:""; position:absolute; top:0; left:0; width:60%; height:100%;
  background:linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform:translateX(-220%) skewX(-18deg); transition:transform var(--dur-3) var(--ease); will-change:transform}
@media (hover:hover){.btn-primary:hover::after{transform:translateX(280%) skewX(-18deg)}}

/* Refined inputs: subtle inset + focus glow ring */
input[type=text],input[type=email],input[type=password],input[type=url],input[type=search],
input[type=number],input[type=date],input[type=datetime-local],input[type=time],input[type=month],
input[type=week],input[type=tel],select,textarea{box-shadow:inset 0 1px 1px rgba(0,0,0,.18)}
/* Focus keeps the soft halo AND a 3:1-passing inner border shift (PR-P) */
input:focus-visible,select:focus-visible,textarea:focus-visible{box-shadow:var(--ring), inset 0 0 0 1px var(--brand-hi)}

/* Cross-page View Transitions (Chromium); progressive enhancement */
@view-transition{ navigation:auto; }
::view-transition-old(root){animation:vt-out .22s var(--ease) both}
::view-transition-new(root){animation:vt-in .34s var(--ease-out) both}
@keyframes vt-out{to{opacity:0; transform:translateY(-4px)}}
@keyframes vt-in{from{opacity:0; transform:translateY(8px)}}

/* Page enter + gentle stagger for primary content */
@keyframes enter{from{opacity:0; transform:translateY(8px)}to{opacity:1; transform:none}}
.main>h1,.main>.row,.main>.card,.main>.stat-grid,.main>.grid,.main>#category-list,.main>#tree-grid{animation:enter .42s var(--ease-out) both}
.main>*:nth-child(2){animation-delay:.04s}
.main>*:nth-child(3){animation-delay:.08s}
.main>*:nth-child(4){animation-delay:.12s}

/* Command palette (⌘K / Ctrl+K) */
.cmdk-backdrop{position:fixed; inset:0; z-index:120; background:rgba(4,6,9,.55); backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px); display:none; align-items:flex-start; justify-content:center; padding:12vh 16px 16px}
.cmdk-backdrop.open{display:flex; animation:fade var(--dur-2) var(--ease)}
.cmdk{width:min(620px,96vw); background:var(--glass); backdrop-filter:blur(24px) saturate(160%);
  -webkit-backdrop-filter:blur(24px) saturate(160%); border:1px solid var(--border-strong); border-radius:var(--r-xl);
  box-shadow:var(--shadow-lg), var(--inset-hi); overflow:hidden; animation:pop var(--dur-3) var(--ease-spring)}
.cmdk-input{display:flex; align-items:center; gap:var(--s3); padding:var(--s4) var(--s5); border-bottom:1px solid var(--border)}
.cmdk-input .icon{width:18px; height:18px; color:var(--text-dim)}
.cmdk-input input{border:none; background:none; box-shadow:none; padding:0; font-size:1.05rem; color:var(--text)}
.cmdk-input input:focus-visible{box-shadow:none; outline:none}
.cmdk-list{max-height:54vh; overflow:auto; padding:var(--s2)}
.cmdk-item{display:flex; align-items:center; gap:var(--s3); padding:10px 12px; border-radius:var(--r-md); cursor:pointer; color:var(--text)}
.cmdk-item .icon{width:18px; height:18px; color:var(--text-muted)}
.cmdk-item small{color:var(--text-dim); margin-left:auto}
.cmdk-item[aria-selected="true"]{background:var(--brand-soft)}
.cmdk-empty{padding:var(--s6); text-align:center; color:var(--text-dim)}
.cmdk-hint{display:flex; gap:var(--s3); padding:8px var(--s5); border-top:1px solid var(--border); color:var(--text-dim); font-size:.76rem}

/* Topbar search affordance (opens palette) */
.cmd-trigger{display:inline-flex; align-items:center; gap:var(--s2); padding:7px 12px; border-radius:var(--r-md);
  background:var(--surface-2); border:1px solid var(--border); color:var(--text-muted); cursor:pointer; font:inherit; font-size:.85rem;
  transition:border-color var(--dur-1) var(--ease), background-color var(--dur-1) var(--ease)}
.cmd-trigger:hover{border-color:var(--border-strong); background:var(--surface-3)}
.cmd-trigger .icon{width:15px; height:15px}
@media(max-width:560px){.cmd-trigger .label{display:none}}

@media (prefers-reduced-motion: reduce){
  .btn-primary::after{animation:none; display:none}
  .main>*{animation:none !important}
  ::view-transition-old(root),::view-transition-new(root){animation:none !important}
}

/* =====================================================================
   v3.1 — Tree editor masterpiece: calm controls, premium credential vault.
   ===================================================================== */
/* Uniform, calm icon buttons (replace loud red/amber edit+delete).
   (#32 PR-P) hit targets: 34→40px; .sm 28→34px visual + an invisible ::after
   tap-extension to ~44px. Status colours on theme-aware *-text tokens. */
.btn-icon{display:inline-grid; place-items:center; width:40px; height:40px; border-radius:var(--r-md);
  background:transparent; border:1px solid transparent; color:var(--text-muted); cursor:pointer;
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease)}
.btn-icon:hover{background:var(--surface-3); color:var(--text); border-color:var(--border)}
.btn-icon.danger:hover{color:var(--danger-text); background:color-mix(in srgb,var(--danger) 15%, transparent); border-color:color-mix(in srgb,var(--danger) 30%, transparent)}
.btn-icon.copy.copied{color:var(--success-text); background:color-mix(in srgb,var(--success) 16%, transparent); border-color:color-mix(in srgb,var(--success) 32%, transparent)}
.btn-icon .icon{width:18px; height:18px}
.btn-icon.sm{width:34px; height:34px; position:relative} .btn-icon.sm .icon{width:15px; height:15px}
.btn-icon.sm::after{content:""; position:absolute; inset:-5px}

/* Category card header */
.category{padding:var(--s4) var(--s5)}
.cat-head{display:flex; align-items:center; gap:var(--s3); margin-bottom:var(--s3)}
.cat-head .title{font-weight:700; font-size:1.02rem; letter-spacing:-.01em}
.toggle-pill{display:inline-flex; align-items:center; gap:7px; font-size:.82rem; color:var(--text-muted); user-select:none}
.toggle-pill input{width:auto; box-shadow:none}
.drag-handle{display:inline-flex; cursor:grab; color:var(--text-dim); padding-right:var(--s2)}
.drag-handle .icon{width:16px; height:16px}
.drag-handle:active{cursor:grabbing}

/* Item row (.item-list is defined once in the v3.5 block below — PR-P dedupe) */
.item{padding:10px 12px; border-radius:var(--r-lg); background:var(--surface-2); border:1px solid var(--border);
  transition:border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease)}
.item:hover{border-color:var(--border-strong); box-shadow:var(--shadow-sm)}
.item-actions{display:flex; gap:2px; margin-left:auto}
.item-actions form{margin:0}
.new-badge{margin-left:8px}

/* Credential vault block (merged v2 duplicate: colour + size folded in, PR-P) */
.cred{display:flex; align-items:center; flex-wrap:wrap; gap:var(--s3); margin-top:10px; padding:10px 12px;
  color:var(--text-muted); font-size:.9rem;
  border-radius:var(--r-md); background:color-mix(in srgb,var(--brand) 7%, var(--surface)); border:1px solid color-mix(in srgb,var(--brand) 22%, var(--border))}
.cred-lock{display:inline-flex; align-items:center; gap:7px; color:var(--text-muted); font-size:.85rem; font-weight:600}
.cred-lock .icon{width:16px; height:16px; color:var(--brand-hi)}
.cred-revealed{display:flex; flex-direction:column; gap:7px; width:100%}
.cred-field{display:flex; align-items:center; gap:10px}
.cred-field .k{font-size:.68rem; color:var(--text-decor); text-transform:uppercase; letter-spacing:.06em; width:70px; flex:none}
.cred-field .v{font-family:var(--mono); font-size:.9rem; background:var(--surface-3); border:1px solid var(--border);
  padding:5px 11px; border-radius:var(--r-sm); color:var(--text); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.cred-revealed .hide-btn{align-self:flex-start}
/* tiny "Kopiert" toast bubble on the copy button */
.copy-flash{position:fixed; transform:translate(-50%,-130%); background:var(--success); color:#04210f; font-weight:700;
  font-size:.72rem; padding:3px 8px; border-radius:var(--r-sm); pointer-events:none; opacity:0; z-index:130;
  animation:copyflash 1.3s var(--ease-out) forwards}
@keyframes copyflash{0%{opacity:0; transform:translate(-50%,-90%)}15%{opacity:1; transform:translate(-50%,-130%)}80%{opacity:1}100%{opacity:0; transform:translate(-50%,-160%)}}

/* Section sub-cards (share / csv) icon headers */
.subcard-head{display:flex; align-items:center; gap:9px; margin-bottom:6px}
.subcard-head .icon{width:18px; height:18px; color:var(--brand-hi)}
.subcard-head h3,.subcard-head h2{margin:0; font-size:1rem}

/* =====================================================================
   v3.2 — Public share-page legacy CSS block: superseded by v3.7+ (.pt-*)
   and removed in PR-F. The historical rules below were never selected by
   the current template; the v3.7 block (further down) governs the page.
   ===================================================================== */

/* Non-production environment badge (staging / local) */
.env-badge{position:fixed; left:12px; bottom:12px; z-index:100; display:inline-flex; align-items:center; gap:6px;
  padding:5px 11px; border-radius:var(--r-full); font-size:.72rem; font-weight:800; letter-spacing:.06em;
  background:color-mix(in srgb,var(--warning) 18%, var(--surface)); color:var(--warning-text);
  border:1px solid color-mix(in srgb,var(--warning) 40%, transparent); box-shadow:var(--shadow-sm); backdrop-filter:blur(8px)}
.env-badge .icon{width:13px; height:13px}

/* =====================================================================
   v3.3 — High-end footer (two-zone: brand · made-in-BAVARIA).
   ===================================================================== */
.footer{margin-top:var(--s10); padding:var(--s6) var(--s2) var(--s8); position:relative;
  color:var(--text-muted); font-size:.86rem; border-top:none; text-align:left}
.footer::before{content:""; position:absolute; top:0; left:5%; right:5%; height:1px;
  background:linear-gradient(90deg, transparent, var(--border-strong) 18%, var(--border-strong) 82%, transparent)}
.footer-inner{display:flex; align-items:center; justify-content:space-between; gap:var(--s5) var(--s8);
  flex-wrap:wrap; max-width:var(--maxw); margin:0 auto}
.footer-brand{display:flex; align-items:center; gap:var(--s3); text-decoration:none}
.footer-brand:hover{text-decoration:none}
/* .footer-logo is defined once in the v4.0 CI-logo block below (PR-P dedupe). */
.footer-logo .icon{width:21px; height:21px}
.footer-brand-text{display:flex; flex-direction:column; line-height:1.2}
.footer-name{font-weight:800; color:var(--text); letter-spacing:-.01em; font-size:.95rem}
.footer-tag{font-size:.74rem; color:var(--text-decor); letter-spacing:.02em}
.footer-made{display:flex; flex-direction:column; gap:3px; text-align:right}
.footer-bavaria-line{font-weight:600; color:var(--text-muted)}
.footer-copy{font-size:.74rem; color:var(--text-decor)}
.footer .heart{color:var(--danger); display:inline-block; animation:pulse 1.6s ease-in-out infinite; margin:0 2px}
.footer .bavaria{color:var(--brand-hi); font-weight:800; letter-spacing:.03em}
@media(max-width:600px){
  .footer-inner{flex-direction:column; text-align:center; gap:var(--s4)}
  .footer-made{text-align:center; align-items:center}
}

/* =====================================================================
   v3.4 — Sticky footer: footer always sits at the bottom, never mid-page.
   ===================================================================== */
body{min-height:100vh; display:flex; flex-direction:column}
.app{flex:1 0 auto}                      /* app grid fills the viewport */
.main{display:flex; flex-direction:column; min-width:0}
.page-body{flex:1 0 auto; min-width:0}   /* content grows, pushing footer down */
/* base layout (auth/public/errors): a growing wrapper vertically centres the
   card while the footer stays pinned to the bottom. center-shell keeps its
   intended width (as a bare flex item, margin:auto would shrink it to content). */
.page-center{flex:1 0 auto; display:flex; align-items:center; justify-content:center; width:100%; padding:var(--s6) var(--s4)}
.center-shell{flex:none; width:min(440px, 100%); margin:0; padding:0}
.footer{margin-top:0}                    /* spacing now comes from its own padding + the grow */
/* keep the staggered page-enter on the content wrapper */
.page-body>h1,.page-body>.row,.page-body>.card,.page-body>.stat-grid,.page-body>.grid,.page-body>#category-list,.page-body>#tree-grid{animation:enter .42s var(--ease-out) both}
.page-body>*:nth-child(2){animation-delay:.04s}
.page-body>*:nth-child(3){animation-delay:.08s}
.page-body>*:nth-child(4){animation-delay:.12s}

/* =====================================================================
   v3.5 — Tree page: beautiful VIEW mode by default + edit toggle.
   ===================================================================== */
.tree-root{max-width:640px; margin:0 auto}
.tv-toolbar{display:flex; align-items:center; gap:var(--s2); margin-bottom:var(--s5)}
.edit-switch{display:inline-flex; cursor:pointer; user-select:none}
.edit-switch input{display:none}
.edit-switch-track{display:inline-flex; align-items:center; gap:7px; padding:8px 15px; border-radius:var(--r-full);
  background:var(--surface-2); border:1px solid var(--border); color:var(--text-muted); font-weight:650; font-size:.85rem;
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease)}
.edit-switch-track .icon{width:16px; height:16px}
.edit-switch:hover .edit-switch-track{border-color:var(--border-strong); color:var(--text)}
.edit-switch input:checked + .edit-switch-track{background:var(--grad-brand); color:#fff; border-color:transparent; box-shadow:var(--glow)}

.tv-hero{text-align:center; margin-bottom:var(--s6)}
.tv-avatar{width:88px; height:88px; border-radius:var(--r-2xl); display:grid; place-items:center; margin:0 auto var(--s3);
  color:#fff; box-shadow:var(--shadow-lg), var(--inset-hi); position:relative}
.tv-avatar .icon{width:44px; height:44px}
.tv-avatar::after{content:""; position:absolute; inset:-1px; border-radius:inherit; pointer-events:none;
  background:linear-gradient(180deg, rgba(255,255,255,.3), transparent 55%);
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; padding:1px; opacity:.5}
.tv-title{font-size:1.85rem; margin:0; letter-spacing:-.02em}
.tv-meta{display:flex; gap:var(--s2); align-items:center; justify-content:center; margin-top:var(--s2); color:var(--text-dim)}

.tv-cat{margin-bottom:var(--s5)}
.tv-cat-head{display:flex; align-items:center; gap:var(--s2); margin-bottom:var(--s3)}
.tv-cat-title{font-size:.74rem; text-transform:uppercase; letter-spacing:.1em; color:var(--text-decor); font-weight:700; display:inline-flex; align-items:center; gap:7px}
.tree-root:not(.editing) .tv-cat-head{justify-content:center}

.item-list{list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:11px}
.tv-item-row{display:flex; align-items:center; gap:10px}
.tv-link{flex:1; min-width:0; display:flex; align-items:center; gap:11px; padding:15px 18px; border-radius:var(--r-lg);
  background:var(--lc,var(--brand)); color:var(--lt,#fff); font-weight:700; text-decoration:none;
  box-shadow:var(--shadow-sm), var(--inset-hi);
  transition:transform var(--dur-2) var(--ease-spring), filter var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease)}
.tv-link:hover{transform:translateY(-2px) scale(1.012); filter:brightness(1.07); box-shadow:var(--shadow); text-decoration:none}
.tv-link:active{transform:scale(.99)}
.tv-link-ico{display:inline-flex; opacity:.9} .tv-link-ico .icon{width:18px; height:18px}
.tv-link-title{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tv-link-ext{display:inline-flex; opacity:.65} .tv-link-ext .icon{width:15px; height:15px}
.tv-item-actions{display:flex; gap:2px; flex:none}
.tv-item-actions form{margin:0}
.tv-empty{color:var(--text-dim); font-size:.85rem; padding:4px 2px; text-align:center; list-style:none}

/* edit-only elements: hidden in view mode, shown when editing */
.tree-root:not(.editing) .edit-only{display:none !important}

/* ===================== v3.6 — labeled theme toggle + premium settings form ===================== */

/* Account cluster: labeled sun/moon theme toggle (replaces the unlabeled night switch) */
.usermenu{display:flex; align-items:center; gap:10px}
.um-name{font-size:.9rem; color:var(--text-dim); max-width:170px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.um-divider{width:1px; height:22px; background:var(--border); flex:none; margin:0 2px}
.theme-toggle{display:inline-flex; align-items:center; gap:7px; padding:7px 13px; border-radius:var(--r-full);
  background:var(--surface-2); border:1px solid var(--border); color:var(--text-dim);
  font-size:.8rem; font-weight:650; cursor:pointer; line-height:1;
  transition:background var(--dur-1) var(--ease), color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease)}
.theme-toggle:hover{background:var(--brand-soft); color:var(--text); border-color:var(--border-strong)}
.theme-toggle .icon{width:16px; height:16px}
.theme-toggle-ico{display:inline-flex; color:var(--brand-hi)}
@media (max-width:760px){ .theme-toggle-label, .um-name{display:none} .theme-toggle{padding:7px} .um-divider{display:none} }

/* Premium "Tree-Einstellungen" form */
.settings-card .subcard-head{display:flex; align-items:center; gap:9px; margin-bottom:var(--s4)}
.settings-card .subcard-head h3,.settings-card .subcard-head h2{margin:0; font-size:1.02rem}
.settings-card .subcard-head .icon{width:18px; height:18px; color:var(--brand-hi)}
.settings-form .settings-grid{display:flex; flex-wrap:wrap; gap:var(--s4); align-items:flex-end}
.settings-form .settings-grid .field{margin:0}
.settings-form .settings-grid label{display:block; font-size:.7rem; text-transform:uppercase; letter-spacing:.07em;
  color:var(--text-dim); font-weight:700; margin-bottom:8px}
.field-title{flex:1 1 220px; min-width:200px}
.field-visibility{flex:0 0 auto; min-width:160px}
.field-icon, .field-color{flex:0 0 auto}
.color-field{display:flex; align-items:center; gap:10px}
.color-field input[type=color]{-webkit-appearance:none; appearance:none; width:48px; height:42px; padding:4px;
  border:1px solid var(--border); border-radius:var(--r-md); background:var(--surface-2); cursor:pointer}
.color-field input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.color-field input[type=color]::-webkit-color-swatch{border:none; border-radius:7px}
.color-field input[type=color]::-moz-color-swatch{border:none; border-radius:7px}
.color-hex{font-family:var(--mono); font-size:.8rem; color:var(--text-decor); letter-spacing:.03em; min-width:64px}
.settings-foot{display:flex; align-items:center; gap:var(--s2); margin-top:var(--s5); padding-top:var(--s4); border-top:1px solid var(--border)}
/* Calm danger: neutral until hover (house rule — no loud red buttons) */
.danger-ghost{color:var(--text-dim)}
.danger-ghost:hover{color:var(--danger); background:color-mix(in srgb, var(--danger) 12%, transparent);
  border-color:color-mix(in srgb, var(--danger) 38%, transparent)}

/* Brand logos (Simple Icons) are fill-based, unlike the stroke-based Lucide set */
.brand-ico{fill:currentColor; stroke:none}

/* ===================== v3.7 — public "link-in-bio" share page (the flagship) ===================== */
body.public-tree{min-height:100dvh; display:flex; flex-direction:column; overflow-x:hidden}
body.public-tree .page-center{display:block; flex:1; padding:0; min-height:0}
body.public-tree .center-shell{width:100%; max-width:none; margin:0}

.pt{width:100%; max-width:600px; margin:0 auto}
/* Lift the whole content column above the full-bleed cover. Without this, the
   .pt-anim entrance leaves an identity-matrix transform on .pt-hero (fill-mode
   both) — itself a stacking context — which would trap the avatar (z-index:2)
   below the cover's z-index:1 ::after wash, hiding the avatar behind the banner. */
.pt-inner{position:relative; z-index:1; padding:0 var(--s5) calc(var(--s10) + env(safe-area-inset-bottom))}

/* Full-bleed cover wash that dissolves into the page.
 * Restraint (PR-F, masterplan 2.1.2a): the no-image cover was red-on-red, which
 * fought with the avatar + featured card. Soften to a near-neutral surface with
 * a hint of brand colour so the brand punctuates rather than paints. */
.pt-cover{position:relative; width:100vw; margin-left:calc(50% - 50vw); height:clamp(176px,30vh,264px); overflow:hidden}
.pt-cover::before{content:""; position:absolute; inset:0;
  background:
    radial-gradient(120% 150% at 50% -12%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 4%, var(--bg-2)) 0%, var(--bg) 100%)}
/* with a tree profile image: use it as a rich, blurred backdrop (safe <img>, no CSS injection) */
.pt-cover.has-cover::before{display:none}
.pt-cover-img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  filter:blur(30px) saturate(1.15) brightness(.6); transform:scale(1.28)}
.pt-cover::after{content:""; position:absolute; inset:0; z-index:1; background:linear-gradient(to bottom, transparent 42%, var(--bg))}
.pt-cover.has-cover::after{background:linear-gradient(to bottom, rgba(10,12,16,.28), transparent 28%, var(--bg))}
.pt-grain{position:absolute; inset:0; opacity:.07; mix-blend-mode:overlay; pointer-events:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E")}

/* Hero */
.pt-hero{text-align:center}
/* Clean, fixed-size avatar — overflow-clipped so the image can never distort.
 * Restraint (PR-F, masterplan 2.1.2a): a thin translucent neutral ring + soft
 * brand-tinted halo behind it, instead of the saturated red ring that used to
 * fight with the photo. Shape defaults to circle; .shape-squircle opts back in. */
.pt-avatar{position:relative; z-index:2; width:118px; height:118px; margin:-64px auto 0; overflow:hidden;
  display:grid; place-items:center; line-height:1;
  background:var(--grad-brand); color:#fff; font-size:2.6rem;
  border-radius:50%;
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 5.5px rgba(255,255,255,.10),
    0 18px 44px color-mix(in srgb, var(--brand) 24%, transparent),
    var(--shadow-lg)}
.pt-avatar.shape-circle{border-radius:50%}
.pt-avatar.shape-squircle{border-radius:34px}
.pt-avatar .icon{width:50px; height:50px}
.pt-title{font-size:clamp(1.75rem,6.4vw,2.5rem); font-weight:800; letter-spacing:-.025em; margin:var(--s10) 0 0; text-wrap:balance}
.pt-meta{display:inline-flex; gap:9px; align-items:center; justify-content:center; margin-top:var(--s3);
  color:var(--text-dim); font-size:.9rem; font-weight:500}
.pt-dot{width:7px; height:7px; border-radius:var(--r-full); background:var(--brand-hi); box-shadow:0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent)}

/* Category label (editorial) */
.pt-cat{text-align:center; font-size:.72rem; text-transform:uppercase; letter-spacing:.16em; font-weight:700;
  color:var(--text-dim); margin:var(--s8) 0 var(--s3)}

/* Link cards.
 * Restraint (PR-F, masterplan 2.1.2a + d/e): drop the per-link red rail by
 * default — only show one when the owner sets an explicit button colour or the
 * link is featured (toggled on via .has-rail). Match hover-in/out timing so
 * the card doesn't feel gummy on hover-out, and gate hover lifts behind
 * (hover:hover) so touch devices don't get stuck-up states after every tap. */
.pt-links{display:flex; flex-direction:column; gap:var(--s3)}
/* Common single-category case: no social row / player / category header sits
 * between the hero and the list, so the "N Links" meta would otherwise butt
 * flush against the first card. Give the list breathing room only in that exact
 * adjacency — the multi-category (.pt-cat) and grid (.pt-grid) paths already
 * carry their own top spacing, so they're deliberately left untouched. */
.pt-hero + .pt-links{margin-top:var(--s6)}
.pt-link{position:relative; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:var(--s3);
  min-height:62px; padding:13px 16px 13px 18px; border-radius:var(--r-xl); text-decoration:none; color:var(--text);
  background:var(--glass); -webkit-backdrop-filter:blur(14px) saturate(150%); backdrop-filter:blur(14px) saturate(150%);
  border:1px solid var(--border); box-shadow:var(--inset-hi), var(--shadow-sm);
  transition:transform 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out)}
.pt-link.has-rail::before{content:""; position:absolute; left:0; top:13px; bottom:13px; width:3px; border-radius:var(--r-full);
  background:var(--bc, var(--brand)); opacity:.85}
.pt-link:active{transform:translateY(-1px); transition-duration:60ms}
@media (hover:hover){
  .pt-link:hover{transform:translateY(-2px); border-color:var(--border-strong); box-shadow:var(--inset-hi), var(--shadow); text-decoration:none}
  .pt-link:hover .pt-link-arrow{transform:translate(2px,-2px); color:var(--text)}
}
.pt-link-chip{width:38px; height:38px; border-radius:var(--r-lg); flex:none; display:grid; place-items:center;
  background:color-mix(in srgb, var(--bc, var(--brand)) 22%, var(--surface-2)); color:var(--tc, var(--brand-hi))}
.pt-link-chip .icon{width:20px; height:20px}
.pt-link-title{min-width:0; font-weight:650; letter-spacing:-.01em; display:flex; align-items:center; gap:9px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.pt-link-arrow{display:inline-flex; color:var(--text-dim); transition:transform 140ms var(--ease), color 140ms var(--ease)}
.pt-link-arrow .icon{width:18px; height:18px}
.pt-new{flex:none; font-size:.6rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; padding:2px 7px;
  border-radius:var(--r-full); background:var(--brand-soft); color:var(--brand-hi)}

/* One featured 3D "expensive" hero link (the first link on the page) */
.pt-link.featured{min-height:74px; color:#fff; border:none; background:var(--grad-brand);
  box-shadow:var(--shadow-lg), var(--inset-hi); transform:translateY(-2px);
  transition:transform 600ms cubic-bezier(.3,.7,.4,1), box-shadow 600ms cubic-bezier(.3,.7,.4,1)}
.pt-link.featured::before{display:none}
.pt-link.featured::after{content:""; position:absolute; inset:0; z-index:-1; border-radius:inherit;
  transform:translateY(8px); filter:blur(15px); opacity:.55; background:color-mix(in srgb, var(--brand) 62%, #000)}
.pt-link.featured .pt-link-chip{background:rgba(255,255,255,.18); color:#fff}
.pt-link.featured .pt-link-arrow{color:rgba(255,255,255,.85)}
.pt-link.featured .pt-new{background:rgba(255,255,255,.22); color:#fff}
@media (hover:hover){
  .pt-link.featured:hover{transform:translateY(-6px); transition-duration:250ms; transition-timing-function:cubic-bezier(.3,.7,.4,1.5); box-shadow:var(--shadow-lg), var(--inset-hi)}
}
.pt-link.featured:active{transform:translateY(-1px); transition-duration:34ms}

/* ---- Public music player (entitlement-gated block) ---- */
.pt-player{position:relative; margin:var(--s6) 0 var(--s5); padding:var(--s5) var(--s5) var(--s4);
  border-radius:var(--r-2xl); background:var(--glass); -webkit-backdrop-filter:blur(16px) saturate(150%);
  backdrop-filter:blur(16px) saturate(150%); border:1px solid var(--border); box-shadow:var(--inset-hi), var(--shadow)}
.pt-player::after{content:""; position:absolute; left:50%; top:34px; width:180px; height:180px; transform:translateX(-50%);
  border-radius:var(--r-full); background:radial-gradient(circle, color-mix(in srgb, var(--brand) 40%, transparent), transparent 70%);
  filter:blur(40px); opacity:.6; pointer-events:none; z-index:0}
.pt-player > *{position:relative; z-index:1}
.pp-cover{position:relative; width:220px; max-width:62vw; aspect-ratio:1; margin:0 auto var(--s4)}
.pp-cover img, .pp-cover-ph{position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:60%; height:60%; border-radius:var(--r-full); object-fit:cover;
  box-shadow:0 12px 34px rgba(0,0,0,.5), 0 0 0 1px var(--border-strong), inset 0 0 0 6px rgba(0,0,0,.18)}
.pp-cover-ph{display:grid; place-items:center; background:var(--grad-brand); color:#fff}
.pp-cover-ph .icon{width:40px; height:40px}
.pp-viz{position:absolute; inset:0; width:100%; height:100%; pointer-events:none}
.playing .pp-cover img{animation:pp-spin 11s linear infinite}
@keyframes pp-spin{to{transform:translate(-50%,-50%) rotate(360deg)}}
.pp-np{display:flex; align-items:center; justify-content:space-between; gap:10px}
.pp-eyebrow{font-size:.64rem; letter-spacing:.16em; text-transform:uppercase; font-weight:700; color:var(--brand-hi)}
.pp-pos{font-size:.74rem; color:var(--text-dim); font-variant-numeric:tabular-nums; flex:none}
.pp-artist{margin:6px 0 -3px; font-size:.82rem; font-weight:600; letter-spacing:.02em; color:var(--brand-hi);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.pp-artist[hidden]{display:none}
.pp-title{font-size:1.05rem; font-weight:700; letter-spacing:-.01em; margin:6px 0 var(--s4); min-height:1.3em; text-wrap:balance}
.pp-loading{color:var(--text-muted); font-size:.88rem}
.pp-nojs{list-style:none; margin:var(--s2) 0 0; padding:0; display:flex; flex-direction:column; gap:10px; text-align:left}
.pp-nojs-t{display:block; font-weight:600; font-size:.9rem; margin-bottom:4px}
.pp-nojs audio{width:100%}
.pp-seek{display:flex; align-items:center; gap:10px}
.pp-t{font-size:.72rem; color:var(--text-muted); font-variant-numeric:tabular-nums; flex:none; width:34px}
.pp-t:last-child{text-align:right}
.pp-seek .pp-bar{flex:1}
.pp-bar{-webkit-appearance:none; appearance:none; height:6px; border-radius:var(--r-full); cursor:pointer; outline:none;
  background:linear-gradient(90deg, var(--brand-hi) var(--p,0%), color-mix(in srgb, var(--text) 15%, transparent) var(--p,0%))}
.pp-bar::-webkit-slider-thumb{-webkit-appearance:none; appearance:none; width:14px; height:14px; border-radius:var(--r-full);
  background:#fff; border:2px solid var(--brand-hi); box-shadow:0 1px 5px rgba(0,0,0,.55); transition:transform 120ms var(--ease)}
.pp-bar::-moz-range-thumb{width:14px; height:14px; border-radius:var(--r-full); background:#fff; border:2px solid var(--brand-hi); box-shadow:0 1px 5px rgba(0,0,0,.55)}
.pp-bar:active::-webkit-slider-thumb{transform:scale(1.25)}
.pp-bar:focus-visible{box-shadow:0 0 0 3px var(--brand-soft)}
.pp-transport{display:flex; align-items:center; gap:var(--s3); margin-top:var(--s4)}
.pp-tb{width:42px; height:42px; border-radius:var(--r-full); display:grid; place-items:center; flex:none;
  border:1px solid var(--border); background:var(--surface-2); color:var(--text); cursor:pointer;
  transition:transform 140ms var(--ease), background 140ms var(--ease), border-color 140ms var(--ease)}
.pp-tb svg{width:20px; height:20px; fill:currentColor}
@media (hover:hover){.pp-tb:hover{background:var(--surface-3, var(--surface-2)); border-color:var(--border-strong)}}
.pp-tb:active{transform:scale(.93)}
.pp-tb:focus-visible{outline:none; box-shadow:0 0 0 3px var(--brand-soft)}
.pp-main{width:56px; height:56px; background:var(--grad-brand); color:#fff; border:none; box-shadow:var(--shadow)}
.pp-main svg{width:26px; height:26px}
.pp-vbtn{margin-left:auto; width:38px; height:38px; border-radius:var(--r-full); display:grid; place-items:center; flex:none;
  border:none; background:transparent; color:var(--text-dim); cursor:pointer; transition:color 140ms var(--ease)}
@media (hover:hover){.pp-vbtn:hover{color:var(--text)}} .pp-vbtn svg{width:20px; height:20px; fill:currentColor}
.pp-vbtn:focus-visible{outline:none; box-shadow:0 0 0 3px var(--brand-soft)}
.pp-vol{width:78px; flex:none; height:5px}
.pp-list{list-style:none; margin:var(--s4) 0 0; padding:var(--s4) 0 0; border-top:1px solid var(--border);
  display:flex; flex-direction:column; gap:2px}
.pp-item{width:100%; display:flex; align-items:center; gap:var(--s3); padding:9px 10px; border-radius:var(--r-md);
  background:transparent; border:none; color:var(--text-dim); cursor:pointer; text-align:left; font:inherit;
  transition:background 140ms var(--ease), color 140ms var(--ease)}
@media (hover:hover){.pp-item:hover{background:var(--surface-2); color:var(--text)}}
.pp-item[aria-current=true]{color:var(--text); background:color-mix(in srgb, var(--brand) 13%, transparent)}
.pp-item:focus-visible{outline:none; box-shadow:0 0 0 2px var(--brand-soft)}
.pp-num{width:20px; flex:none; text-align:center; font-size:.82rem; font-variant-numeric:tabular-nums; color:var(--text-dim)}
.pp-item[aria-current=true] .pp-num{color:var(--brand-hi); font-weight:700}
.pp-it-title{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-weight:600; font-size:.92rem;
  display:flex; align-items:center; gap:8px}
.pp-badge{font-size:.56rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase; padding:2px 6px;
  border-radius:var(--r-full); background:var(--brand-soft); color:var(--brand-hi); flex:none}
.pp-eq{display:none; gap:2px; align-items:flex-end; height:14px; width:16px; flex:none}
.playing .pp-item[aria-current=true] .pp-eq{display:flex}
.pp-eq i{width:3px; height:30%; background:var(--brand-hi); border-radius:2px; animation:pp-eq .9s ease-in-out infinite}
.pp-eq i:nth-child(2){animation-delay:.3s} .pp-eq i:nth-child(3){animation-delay:.6s}
@keyframes pp-eq{0%,100%{height:25%}50%{height:100%}}
@media (prefers-reduced-motion:reduce){
  .playing .pp-cover img{animation:none}
  .pp-eq i{animation:none; height:55%}
}

/* Owner-side player management (tree editor) */
.player-upload{display:flex; align-items:center; flex-wrap:wrap; margin-top:var(--s2)}
.track-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px}
.track-row{display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:var(--r-md);
  background:var(--surface-2); border:1px solid var(--border)}
.track-handle{cursor:grab; color:var(--text-dim); display:inline-flex} .track-handle:active{cursor:grabbing}
.track-num{display:inline-flex; color:var(--brand-hi)} .track-num .icon{width:16px; height:16px}
.track-meta{flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.25}
.track-title{font-weight:600; font-size:.92rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.track-artist{font-size:.78rem; color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}

/* ---- PIN gate (protected public tree) ---- */
.gate{min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:var(--s5); padding:var(--s6) var(--s4); position:relative}
.gate-glow{position:absolute; top:16%; left:50%; transform:translateX(-50%); width:min(520px,90vw); height:340px; pointer-events:none;
  background:radial-gradient(circle, color-mix(in srgb, var(--brand) 38%, transparent), transparent 68%); filter:blur(60px); opacity:.7}
.gate-card{position:relative; z-index:1; width:min(382px,92vw); padding:34px var(--s6) var(--s6); text-align:center;
  border-radius:var(--r-2xl); background:var(--glass); -webkit-backdrop-filter:blur(20px) saturate(150%); backdrop-filter:blur(20px) saturate(150%);
  border:1px solid var(--border); box-shadow:var(--inset-hi), var(--shadow-lg)}
.gate-avatar{position:relative; width:84px; height:84px; margin:0 auto var(--s4)}
.gate-avatar img, .gate-avatar-ph{width:84px; height:84px; border-radius:var(--r-full); object-fit:cover;
  box-shadow:0 8px 24px rgba(0,0,0,.45), 0 0 0 1px var(--border-strong)}
.gate-avatar-ph{display:grid; place-items:center; background:var(--grad-brand); color:#fff}
.gate-avatar-ph .icon{width:38px; height:38px}
.gate-lock{position:absolute; right:-4px; bottom:-4px; width:32px; height:32px; border-radius:var(--r-full); display:grid; place-items:center;
  background:var(--brand); color:#fff; box-shadow:0 4px 12px rgba(0,0,0,.5), 0 0 0 3px var(--bg)}
.gate-lock .icon{width:16px; height:16px}
.gate-title{font-size:1.3rem; font-weight:800; letter-spacing:-.02em; margin:0; text-wrap:balance}
.gate-sub{color:var(--text-dim); font-size:.9rem; margin:6px 0 var(--s5)}
.pin-dots{display:flex; gap:14px; justify-content:center; margin:0 0 var(--s4)}
.pin-dot{width:14px; height:14px; border-radius:var(--r-full); background:transparent;
  border:2px solid color-mix(in srgb, var(--text) 28%, transparent);
  transition:transform 220ms var(--ease-spring), background 160ms var(--ease), border-color 160ms var(--ease)}
.pin-dot.on{background:var(--brand-hi); border-color:var(--brand-hi); transform:scale(1.18)}
.pin-error{color:var(--danger); font-size:.84rem; font-weight:600; margin:0 0 var(--s4); min-height:1.1em}
.pin-error[hidden]{display:block; visibility:hidden}
.pin-fallback{display:flex; gap:8px; align-items:center; justify-content:center; flex-wrap:wrap; margin:0 0 var(--s4)}
.pin-fallback[hidden]{display:none} /* class display:flex would otherwise beat the UA [hidden] rule */
.pin-text{width:140px; text-align:center; letter-spacing:.4em; font-size:1.2rem; padding:10px 12px; border-radius:var(--r-md);
  background:var(--surface-2); border:1px solid var(--border); color:var(--text)}
.pin-text:focus-visible{outline:none; box-shadow:0 0 0 3px var(--brand-soft); border-color:var(--brand)}
.pinpad{display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:var(--s2)}
.pin-key{height:62px; border-radius:var(--r-lg); border:1px solid var(--border); background:var(--surface-2); color:var(--text);
  font-size:1.4rem; font-weight:600; cursor:pointer; display:grid; place-items:center; -webkit-user-select:none; user-select:none;
  transition:transform 120ms var(--ease), background 120ms var(--ease), border-color 120ms var(--ease)}
@media (hover:hover){.pin-key:hover{background:var(--surface-3); border-color:var(--border-strong)}}
.pin-key:active{transform:scale(.93); background:color-mix(in srgb, var(--brand) 24%, var(--surface-2)); border-color:var(--brand)}
.pin-key:focus-visible{outline:none; box-shadow:0 0 0 3px var(--brand-soft)}
.pin-ghost{background:transparent; border-color:transparent; color:var(--text-dim)}
@media (hover:hover){.pin-ghost:hover{background:var(--surface-2); color:var(--text)}}
.pin-key .icon{width:24px; height:24px}
.gate-foot{position:relative; z-index:1; color:var(--text-muted); font-size:.76rem; margin:0}
.sr-only{position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0}
.gate.checking .gate-card{opacity:.55; pointer-events:none; transition:opacity 160ms var(--ease)}
@keyframes gate-shake{10%,90%{transform:translateX(-2px)}20%,80%{transform:translateX(4px)}30%,50%,70%{transform:translateX(-9px)}40%,60%{transform:translateX(9px)}}
.gate-card.shake{animation:gate-shake .5s cubic-bezier(.36,.07,.19,.97)}
@media (prefers-reduced-motion:reduce){.gate-card.shake{animation:none} .pin-dot{transition:background 120ms,border-color 120ms}}

.pt-empty{text-align:center; color:var(--text-dim); padding:var(--s8) 0}
.pt-empty .icon{width:40px; height:40px; opacity:.5; margin-bottom:var(--s2)}

/* Share / QR affordance */
.pt-share{max-width:340px; margin:var(--s8) auto 0}
.pt-share summary{list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:center; gap:8px;
  padding:11px 16px; border-radius:var(--r-full); background:var(--surface-2); border:1px solid var(--border);
  color:var(--text-dim); font-weight:650; font-size:.85rem; transition:color 140ms var(--ease), border-color 140ms var(--ease)}
.pt-share summary::-webkit-details-marker{display:none}
@media (hover:hover){.pt-share summary:hover{color:var(--text); border-color:var(--border-strong)}}
.pt-share summary .icon{width:16px; height:16px}
.pt-share[open] summary{color:var(--text)}
.pt-share-panel{margin-top:var(--s3); padding:var(--s5); border-radius:var(--r-xl); background:var(--surface);
  border:1px solid var(--border); text-align:center; box-shadow:var(--shadow-sm)}
.pt-share-panel img{width:176px; height:176px; border-radius:var(--r-md); background:#fff; padding:9px; box-shadow:var(--shadow-sm)}
.pt-share-url{display:flex; gap:8px; margin-top:var(--s4)}
.pt-share-url input{flex:1; min-width:0; font-family:var(--mono); font-size:.78rem; padding:9px 11px;
  border-radius:var(--r-md); border:1px solid var(--border); background:var(--surface-2); color:var(--text-dim)}
.pt-copy{flex:none; display:inline-flex; align-items:center; gap:6px; padding:9px 13px; border-radius:var(--r-md);
  border:1px solid var(--border); background:var(--surface-2); color:var(--text); font-weight:650; font-size:.8rem; cursor:pointer;
  transition:background 140ms var(--ease), border-color 140ms var(--ease)}
@media (hover:hover){.pt-copy:hover{border-color:var(--border-strong)}}
.pt-copy.ok{color:var(--success); border-color:color-mix(in srgb, var(--success) 40%, transparent)}
.pt-copy .icon{width:15px; height:15px}

/* Staggered entrance (cheap props only, honoured per design system) */
@keyframes ptRise{from{opacity:0; transform:translateY(13px)} to{opacity:1; transform:none}}
body.public-tree .pt-anim{animation:ptRise .6s cubic-bezier(.34,1.56,.64,1) both; animation-delay:calc(var(--i,0) * 60ms)}
@media (prefers-reduced-motion:reduce){
  body.public-tree .pt-anim{animation:none}
  .pt-link, .pt-link-arrow, .pt-copy, .pt-share summary{transition:none}
}

/* Link-metadata "auto title" affordance in the item editor */
.meta-suggest{display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap; margin:-4px 0 var(--s4)}
.meta-suggest .meta-status{font-size:.8rem; color:var(--text-dim)}
.meta-suggest .btn .icon{color:var(--brand-hi)}

/* ===================== v3.8 — preview imagery (link thumbnails + tree avatar) ===================== */
/* Hero avatars show the tree's profile image when set */
.tv-avatar{overflow:hidden}
.tv-avatar-img{width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block}
.pt-avatar-img{width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block}

/* Link-card leading slot: thumbnail when present, else the brand/generic icon */
.tv-link-ico .tv-thumb{width:26px; height:26px; border-radius:7px; object-fit:cover; display:block}
.pt-link-chip.has-thumb{background:none; overflow:hidden}
.pt-link-chip .pt-thumb{width:100%; height:100%; object-fit:cover; border-radius:inherit; display:block}

/* Editor metadata preview thumbnail + remove button */
.meta-thumb{position:relative; display:inline-block; width:104px; height:58px; margin:-2px 0 var(--s4);
  border-radius:var(--r-md); overflow:hidden; border:1px solid var(--border); background:var(--surface-2)}
.meta-thumb img{width:100%; height:100%; object-fit:cover; display:block}
.meta-thumb-x{position:absolute; top:4px; right:4px; width:20px; height:20px; border-radius:var(--r-full); border:none;
  background:rgba(0,0,0,.55); color:#fff; cursor:pointer; line-height:1; font-size:15px; display:grid; place-items:center;
  transition:background var(--dur-1) var(--ease)}
.meta-thumb-x:hover{background:rgba(0,0,0,.82)}

/* Tree-settings "Profilbild" row */
.settings-image{margin-top:var(--s4)}
.settings-image > label{display:block; font-size:.7rem; text-transform:uppercase; letter-spacing:.07em;
  color:var(--text-dim); font-weight:700; margin-bottom:8px}
.settings-image .meta-source{flex:1; min-width:170px}

/* File-upload button (hidden input inside a styled label) */
.upload-label{cursor:pointer}
.upload-label input[type=file]{display:none}

/* ===================== v3.9 — featured media hero card (public tree) ===================== */
.pt-featured-media{display:block; overflow:hidden; border-radius:var(--r-xl); text-decoration:none; color:#fff;
  background:var(--grad-brand); box-shadow:var(--shadow-lg), var(--inset-hi); position:relative; transform:translateY(-2px);
  transition:transform 600ms cubic-bezier(.3,.7,.4,1), box-shadow 600ms cubic-bezier(.3,.7,.4,1)}
.pt-featured-media .fm-cover{display:block; width:100%; aspect-ratio:16/9; object-fit:cover; background:rgba(0,0,0,.22)}
.pt-featured-media .fm-bar{display:flex; align-items:center; gap:var(--s3); padding:13px 16px 14px}
.pt-featured-media .fm-chip{width:34px; height:34px; border-radius:var(--r-md); flex:none; display:grid; place-items:center; background:rgba(255,255,255,.18)}
.pt-featured-media .fm-chip .icon{width:19px; height:19px}
.pt-featured-media .fm-chip .brand-ico{fill:#fff}
.pt-featured-media .fm-title{flex:1; min-width:0; font-weight:700; letter-spacing:-.01em; display:flex; align-items:center; gap:9px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.pt-featured-media .fm-arrow{display:inline-flex; color:rgba(255,255,255,.85); transition:transform 140ms var(--ease), color 140ms var(--ease)}
.pt-featured-media .fm-arrow .icon{width:18px; height:18px}
.pt-featured-media .pt-new{background:rgba(255,255,255,.22); color:#fff}
@media (hover:hover){
  .pt-featured-media:hover{transform:translateY(-6px); transition-duration:250ms; transition-timing-function:cubic-bezier(.3,.7,.4,1.5)}
  .pt-featured-media:hover .fm-arrow{transform:translate(2px,-2px); color:#fff}
}
.pt-featured-media:active{transform:translateY(-1px); transition-duration:34ms}

/* Bigger thumbnail for non-featured links that carry an image */
.pt-link.has-media{min-height:70px}
.pt-link.has-media .pt-link-chip{width:48px; height:48px; border-radius:var(--r-md)}

/* Featured-link indicator (owner tree view) */
.feat-badge{display:inline-flex; align-items:center; flex:none; color:var(--warning)}
.feat-badge .icon{width:14px; height:14px}

/* ===================== v3.10 — public tree content & identity (bio · socials · brand chips · featured CTA) ===================== */
/* a) Bio/tagline under the title — small, italic-feel, line-spaced, centred. */
body.public-tree .pt-bio{
  margin:.55rem auto 0; max-width:32rem; padding:0 1rem;
  font-size:.96rem; line-height:1.5; color:var(--text-dim); text-align:center;
  font-style:italic; letter-spacing:-.005em;
}
@media (prefers-reduced-motion: no-preference){
  body.public-tree .pt-bio{opacity:.92}
}
/* b) Social-icon row — sits between hero and link list. */
body.public-tree .pt-socials{
  display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin:14px auto 4px;
  max-width:32rem; padding:0 1rem;
}
body.public-tree .pt-social{
  --bc:#222; width:44px; height:44px; border-radius:50%;
  display:grid; place-items:center; background:var(--bc); color:#fff;
  box-shadow:var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,.16);
  transition:transform 180ms var(--ease), box-shadow 180ms var(--ease), filter 180ms var(--ease);
  text-decoration:none;
}
body.public-tree .pt-social .brand-ico{width:22px; height:22px; fill:#fff}
body.public-tree .pt-social:focus-visible{outline:2px solid var(--brand-hi); outline-offset:3px}
@media (hover:hover){
  body.public-tree .pt-social:hover{transform:translateY(-2px); filter:brightness(1.08); box-shadow:var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.22)}
}
body.public-tree .pt-social:active{transform:translateY(0); transition-duration:60ms}
/* visually-hidden label (sr-only) for the icon-only links */
.sr-only{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0}
/* c) Brand-pure circular link chips — only on plain (non-featured, non-image) link rows. */
body.public-tree .pt-link-chip.pt-link-chip--brand{
  background:var(--bc-brand,#222); border-radius:50%; color:#fff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}
body.public-tree .pt-link-chip.pt-link-chip--brand .brand-ico{fill:#fff}
body.public-tree .pt-link-chip.pt-link-chip--brand .icon{color:#fff}
/* d) Featured card — eyebrow, description, CTA pill stacked inside .fm-bar. */
body.public-tree .pt-featured .fm-bar{align-items:flex-start; padding:14px 16px 16px; gap:12px}
body.public-tree .pt-featured .fm-title-wrap{flex:1; min-width:0; display:flex; flex-direction:column; gap:4px}
body.public-tree .pt-featured .fm-title-wrap .fm-title{white-space:normal; overflow:visible; text-overflow:clip; font-size:1.08rem; line-height:1.25}
body.public-tree .pt-featured .pt-eyebrow{
  display:inline-block; font-size:.66rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase;
  color:rgba(255,255,255,.85); padding:2px 8px; border-radius:999px; background:rgba(255,255,255,.16);
  align-self:flex-start;
}
body.public-tree .pt-featured .pt-desc{
  font-size:.88rem; line-height:1.45; color:rgba(255,255,255,.88); margin-top:2px;
}
body.public-tree .pt-featured .pt-cta{
  align-self:flex-end; flex:none; display:inline-flex; align-items:center; gap:6px;
  padding:8px 14px; border-radius:999px;
  background:rgba(255,255,255,.18); color:#fff; font-weight:600; font-size:.82rem; letter-spacing:.01em;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22);
  transition:background 160ms var(--ease), transform 160ms var(--ease);
}
body.public-tree .pt-featured .pt-cta .icon{width:14px; height:14px}
@media (hover:hover){
  body.public-tree .pt-featured:hover .pt-cta{background:rgba(255,255,255,.28); transform:translate(2px,-1px)}
}

/* =====================================================================
   v4.9 — W4 PR15: public polish (verified badge · plain-link subtitle ·
   scheduled teaser · IntersectionObserver scroll-in entrance). All token-driven
   so it tracks the active public-tree palette (AA both themes); cheap
   props only; reduced-motion honoured. No class renames.
   ===================================================================== */
/* Verified badge — subtle, brand-tinted check beside the tree title. */
body.public-tree .pt-verified{display:inline-flex; vertical-align:middle; margin-left:.26em; color:var(--brand-hi)}
body.public-tree .pt-verified .icon{width:.72em; height:.72em}

/* Plain-link subtitle — a second line under the title from the owner's
   per-link description. Wrapper becomes the grid's flexible column. */
body.public-tree .pt-link-body{min-width:0; display:flex; flex-direction:column; gap:2px}
body.public-tree .pt-link-sub{font-size:.82rem; line-height:1.35; color:var(--text-dim); font-weight:500;
  overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical}
body.public-tree .pt-link.featured .pt-link-sub{color:rgba(255,255,255,.82)}

/* Scheduled teaser — "bald verfügbar" placeholder, calm + non-interactive.
   Leak-safe: only a lock glyph + relative publish time, never the target. */
body.public-tree .pt-teaser{position:relative; display:grid; grid-template-columns:auto 1fr auto; align-items:center;
  gap:var(--s3); min-height:62px; padding:13px 15px 13px 16px; border-radius:var(--r-xl);
  border:1px dashed var(--border-strong); background:color-mix(in srgb, var(--surface-2) 55%, transparent); color:var(--text-dim)}
body.public-tree .pt-teaser-ico{width:38px; height:38px; border-radius:var(--r-lg); flex:none; display:grid; place-items:center;
  background:var(--surface-3); color:var(--text-muted)}
body.public-tree .pt-teaser-ico .icon{width:19px; height:19px}
body.public-tree .pt-teaser-body{min-width:0; display:flex; flex-direction:column; gap:1px}
body.public-tree .pt-teaser-label{font-weight:650; letter-spacing:-.01em; color:var(--text)}
body.public-tree .pt-teaser-when{font-size:.82rem; color:var(--text-dim)}
body.public-tree .pt-teaser-lock{flex:none; color:var(--text-decor)}
body.public-tree .pt-teaser-lock .icon{width:16px; height:16px}

/* Inline rich-media embed card (§2.2) — a lazy, sandboxed iframe that plays in
   place. Same glass shell as .pt-link so an embed sits calmly in the list; the
   frame body carries the provider aspect (video 16:9 · tall portrait · fixed
   audio height via --emh). Non-interactive shell (it's a <figure>), only the
   head "öffnen" link + the iframe itself are clickable. */
body.public-tree .pt-embed{position:relative; margin:0; overflow:hidden; border-radius:var(--r-xl);
  background:var(--glass); -webkit-backdrop-filter:blur(14px) saturate(150%); backdrop-filter:blur(14px) saturate(150%);
  border:1px solid var(--border); box-shadow:var(--inset-hi), var(--shadow-sm)}
body.public-tree .pt-embed-head{display:flex; align-items:center; gap:var(--s3); padding:11px 13px 10px 14px; min-width:0}
body.public-tree .pt-embed-chip{width:32px; height:32px; border-radius:var(--r-lg); flex:none; display:grid; place-items:center;
  background:color-mix(in srgb, var(--bc-brand, var(--brand)) 20%, var(--surface-2)); color:var(--text)}
body.public-tree .pt-embed-chip .icon{width:18px; height:18px}
body.public-tree .pt-embed-chip .brand-ico{fill:var(--bc-brand, currentColor)}
body.public-tree .pt-embed-title{flex:1; min-width:0; font-weight:650; letter-spacing:-.01em; display:flex; align-items:center;
  gap:8px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--text)}
body.public-tree .pt-embed-open{flex:none; display:inline-flex; color:var(--text-dim); border-radius:var(--r-md); padding:4px;
  transition:transform 140ms var(--ease), color 140ms var(--ease)}
body.public-tree .pt-embed-open .icon{width:18px; height:18px}
body.public-tree .pt-embed-open:focus-visible{outline:2px solid var(--brand-hi); outline-offset:2px}
@media (hover:hover){
  body.public-tree .pt-embed-open:hover{transform:translate(2px,-2px); color:var(--text)}
}
body.public-tree .pt-embed-frame{position:relative; width:100%; background:rgba(0,0,0,.22)}
body.public-tree .pt-embed--video .pt-embed-frame{aspect-ratio:16/9}
body.public-tree .pt-embed--tall .pt-embed-frame{aspect-ratio:9/16; max-height:640px; margin-inline:auto; max-width:340px}
body.public-tree .pt-embed--audio .pt-embed-frame{height:var(--emh, 152px)}
body.public-tree .pt-embed-frame iframe{position:absolute; inset:0; width:100%; height:100%; border:0; display:block}
body.public-tree .pt-embed--audio .pt-embed-frame iframe{position:static}

/* Scroll-in entrance for cards past the load-stagger cap. Armed only when JS +
   motion are available (body.js-inview), so no-JS visitors see everything.
   Cheap props only (opacity/transform) → the card keeps its box, no CLS. */
body.public-tree.js-inview .pt-inview{opacity:0; transform:translateY(14px);
  transition:opacity .5s var(--ease), transform .5s var(--ease)}
body.public-tree.js-inview .pt-inview.is-visible{opacity:1; transform:none}
@media (prefers-reduced-motion:reduce){
  body.public-tree.js-inview .pt-inview{opacity:1; transform:none; transition:none}
}

/* =====================================================================
   v4 W5 · "Canvas" — bento-grid layout (masterplan §3.1, PR 21)
   A second public-tree layout: a resizable tile grid (2-col mobile /
   4-col desktop) of link / media / embed / capture tiles. Additive pt-*
   classes only; list layout is untouched (byte-stable when layout='list').
   Per-tile footprint rides on inline --cs (col-span 1-2) / --rs (row-span).
   ===================================================================== */
body.public-tree .pt-grid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--s3); grid-auto-rows:minmax(122px,auto); grid-auto-flow:row dense; margin-top:var(--s5)}
@media (min-width:640px){ body.public-tree .pt-grid{grid-template-columns:repeat(4,minmax(0,1fr))} }
/* Tile shell: only owns grid placement + the positioning context; each variant
   brings its own surface/layout so nothing conflicts with reused blocks. */
body.public-tree .pt-tile{position:relative; min-width:0;
  grid-column:span min(var(--cs,1),2); grid-row:span min(var(--rs,1),2)}

/* Link tile — glass card that fills its cell. */
body.public-tree .pt-tile--link{display:grid; grid-template-columns:auto 1fr auto; align-content:center;
  align-items:center; gap:var(--s3); padding:15px 16px; border-radius:var(--r-xl); text-decoration:none;
  color:var(--text); background:var(--glass); -webkit-backdrop-filter:blur(14px) saturate(150%);
  backdrop-filter:blur(14px) saturate(150%); border:1px solid var(--border); box-shadow:var(--inset-hi), var(--shadow-sm);
  transition:transform 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out)}
body.public-tree .pt-tile--link.has-rail::before{content:""; position:absolute; left:0; top:14px; bottom:14px; width:3px;
  border-radius:var(--r-full); background:var(--bc, var(--brand)); opacity:.85}
body.public-tree .pt-tile-chip{width:40px; height:40px; border-radius:var(--r-lg); flex:none; display:grid; place-items:center;
  background:color-mix(in srgb, var(--bc, var(--brand)) 22%, var(--surface-2)); color:var(--tc, var(--brand-hi))}
body.public-tree .pt-tile-chip.pt-link-chip--brand{background:color-mix(in srgb, var(--bc-brand, var(--brand)) 20%, var(--surface-2))}
body.public-tree .pt-tile-chip .icon{width:20px; height:20px}
body.public-tree .pt-tile-chip .brand-ico{width:20px; height:20px; fill:var(--bc-brand, currentColor)}
body.public-tree .pt-tile-body{min-width:0; display:flex; flex-direction:column; gap:2px}
body.public-tree .pt-tile-title{font-weight:650; letter-spacing:-.01em; display:flex; align-items:center; gap:8px;
  min-width:0; overflow:hidden; text-overflow:ellipsis}
body.public-tree .pt-tile-sub{font-size:.82rem; color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
body.public-tree .pt-tile--link .pt-link-arrow{color:var(--text-dim)}
/* Featured link tile — the "expensive" gradient card. */
body.public-tree .pt-tile--link.is-featured{color:#fff; border:none; background:var(--grad-brand); box-shadow:var(--shadow-lg), var(--inset-hi)}
body.public-tree .pt-tile--link.is-featured::before{display:none}
body.public-tree .pt-tile--link.is-featured .pt-tile-chip{background:rgba(255,255,255,.18); color:#fff}
body.public-tree .pt-tile--link.is-featured .pt-tile-sub{color:rgba(255,255,255,.85)}
body.public-tree .pt-tile--link.is-featured .pt-link-arrow{color:rgba(255,255,255,.85)}
body.public-tree .pt-tile--link.is-featured .pt-new{background:rgba(255,255,255,.22); color:#fff}

/* Media tile — full-bleed cover with a gradient caption bar. */
body.public-tree .pt-tile--media{display:block; overflow:hidden; border-radius:var(--r-xl); text-decoration:none; color:#fff;
  background:var(--surface-2); border:1px solid var(--border); box-shadow:var(--inset-hi), var(--shadow-sm);
  transition:transform 220ms var(--ease-out), box-shadow 220ms var(--ease-out)}
body.public-tree .pt-tile--media .pt-tile-cover{position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block}
body.public-tree .pt-tile--media .pt-tile-bar{position:absolute; left:0; right:0; bottom:0; display:flex; align-items:center; gap:var(--s3);
  padding:14px 15px 13px; background:linear-gradient(to top, rgba(0,0,0,.76), rgba(0,0,0,.2) 62%, transparent)}
body.public-tree .pt-tile--media .pt-tile-chip{width:34px; height:34px; border-radius:var(--r-md); background:rgba(255,255,255,.18); color:#fff}
body.public-tree .pt-tile--media .pt-tile-chip .brand-ico{fill:#fff}
body.public-tree .pt-tile--media .pt-tile-titles{flex:1; min-width:0; display:flex; flex-direction:column; gap:1px}
body.public-tree .pt-tile--media .pt-tile-title{font-weight:700; letter-spacing:-.01em; color:#fff; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
body.public-tree .pt-tile--media .pt-eyebrow{color:rgba(255,255,255,.82)}
body.public-tree .pt-tile--media .pt-desc{color:rgba(255,255,255,.82); font-size:.8rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
body.public-tree .pt-tile--media .pt-cta{flex:none; display:inline-flex; align-items:center; gap:5px; font-weight:650; font-size:.82rem; color:#fff}
body.public-tree .pt-tile--media .pt-cta .icon{width:15px; height:15px}
body.public-tree .pt-tile--media.is-featured{box-shadow:var(--shadow-lg), var(--inset-hi), 0 0 0 1px color-mix(in srgb, var(--brand) 55%, transparent)}

/* Embed tile inherits the .pt-embed block; here it just centers the frame. */
body.public-tree .pt-tile--embed{display:flex; flex-direction:column; justify-content:center}
body.public-tree .pt-tile--embed .pt-embed-frame{flex:1; min-height:0}

/* Capture tile inherits .pt-capture; keep its is-done collapse working. */
body.public-tree .pt-tile--capture{justify-content:center}
body.public-tree .pt-tile--capture.is-done .pt-capture-row,
body.public-tree .pt-tile--capture.is-done .pt-capture-consent{display:none}

/* Teaser tile — a compact "bald verfügbar" placeholder. */
body.public-tree .pt-tile--teaser{display:flex; flex-direction:column; gap:6px; justify-content:center; padding:15px 16px;
  border-radius:var(--r-xl); background:var(--glass); border:1px dashed var(--border-strong); color:var(--text)}
body.public-tree .pt-tile--teaser .pt-tile-ico{width:36px; height:36px; border-radius:var(--r-lg); display:grid; place-items:center;
  background:var(--surface-2); color:var(--text-dim)}
body.public-tree .pt-tile--teaser .pt-tile-ico .icon{width:18px; height:18px}
body.public-tree .pt-tile--teaser .pt-teaser-label{font-weight:650; letter-spacing:-.01em}
body.public-tree .pt-tile--teaser .pt-teaser-when{font-size:.82rem; color:var(--text-dim)}
body.public-tree .pt-tile--teaser .pt-tile-lock{position:absolute; top:13px; right:14px; color:var(--text-decor)}
body.public-tree .pt-tile--teaser .pt-tile-lock .icon{width:15px; height:15px}

/* Text/about tile (Bento importer §3.1) — quiet copy card, no navigation. */
body.public-tree .pt-tile--text{display:flex; flex-direction:column; gap:6px; justify-content:center; padding:15px 16px;
  border-radius:var(--r-xl); background:var(--glass); -webkit-backdrop-filter:blur(14px) saturate(150%);
  backdrop-filter:blur(14px) saturate(150%); border:1px solid var(--border); box-shadow:var(--inset-hi), var(--shadow-sm)}
body.public-tree .pt-tile--text .pt-tile-title{font-weight:700; letter-spacing:-.01em; white-space:normal}
body.public-tree .pt-tile--text .pt-tile-text{font-size:.86rem; line-height:1.5; color:var(--text-dim);
  display:-webkit-box; -webkit-line-clamp:6; -webkit-box-orient:vertical; overflow:hidden}
/* Text/about block in the classic list layout. */
body.public-tree .pt-text{padding:2px 4px 6px}
body.public-tree .pt-text .pt-text-title{display:block; font-weight:700; letter-spacing:-.01em; margin-bottom:4px}
body.public-tree .pt-text .pt-text-body{margin:0; color:var(--text-dim); line-height:1.6; font-size:.92rem}

@media (hover:hover){
  body.public-tree .pt-tile--link:hover{transform:translateY(-2px); border-color:var(--border-strong); box-shadow:var(--inset-hi), var(--shadow); text-decoration:none}
  body.public-tree .pt-tile--link:hover .pt-link-arrow{transform:translate(2px,-2px); color:var(--text)}
  body.public-tree .pt-tile--media:hover{transform:translateY(-3px); box-shadow:var(--shadow-lg), var(--inset-hi)}
}
body.public-tree .pt-tile--link:active,
body.public-tree .pt-tile--media:active{transform:translateY(-1px); transition-duration:60ms}

/* ---- Owner editor: layout segmented control + per-tile size control ---- */
.layout-seg{display:inline-flex; gap:6px; padding:4px; border-radius:var(--r-lg); background:var(--surface-2); border:1px solid var(--border)}
.layout-seg-opt{display:inline-flex; align-items:center; gap:7px; padding:8px 14px; border-radius:var(--r-md); cursor:pointer;
  font-weight:600; font-size:.9rem; color:var(--text-dim); transition:background 140ms var(--ease), color 140ms var(--ease)}
.layout-seg-opt .icon{width:17px; height:17px}
.layout-seg-opt input{position:absolute; opacity:0; width:0; height:0}
.layout-seg-opt.is-active{background:var(--brand); color:#fff}
.layout-seg-opt:not(.is-active):hover{color:var(--text)}
.layout-seg-opt:focus-within{outline:2px solid var(--brand-hi); outline-offset:2px}
/* The per-item Canvas size picker only matters in grid layout. */
.item-size{display:none}
.tree-root.layout-grid .item-size{display:inline-flex; align-items:center}
.item-size select{font-size:.78rem; padding:5px 8px; border-radius:var(--r-sm); border:1px solid var(--border);
  background:var(--surface-2); color:var(--text); cursor:pointer}
.item-size select:focus-visible{outline:2px solid var(--brand-hi); outline-offset:1px}

/* ---- "Von Bento importieren" page (Wave-5 PR 22) ---- */
.import-pitch{display:flex; gap:var(--s4); align-items:flex-start; margin-bottom:var(--s4)}
.import-pitch-ico{flex:none; width:44px; height:44px; border-radius:var(--r-lg); display:grid; place-items:center;
  background:color-mix(in srgb, var(--brand) 16%, var(--surface-2)); color:var(--brand-hi)}
.import-pitch-ico .icon{width:22px; height:22px}
.import-pitch-lead{margin:0 0 4px; font-weight:650; letter-spacing:-.01em; font-size:1.02rem}
.import-or{display:flex; align-items:center; gap:var(--s3); margin:var(--s3) 0; color:var(--text-decor);
  font-size:.8rem; text-transform:uppercase; letter-spacing:.08em}
.import-or::before,.import-or::after{content:""; flex:1; height:1px; background:var(--border)}
.import-note{display:flex; gap:var(--s3); align-items:flex-start; margin:var(--s4) 0; padding:var(--s3) var(--s4);
  border-radius:var(--r-lg); background:var(--surface-2); border:1px solid var(--border)}
.import-note-ico{flex:none; color:var(--ok)}
.import-note-ico .icon{width:18px; height:18px}
.import-note .help{margin:0}

/* ===================== v4.0 — official CI logo (LD monogram tile) ===================== */
.brand-logo{display:inline-grid; place-items:center; flex:none}
.brand-logo svg{width:34px; height:34px; display:block; border-radius:var(--r-lg)}
.brand-logo.lg svg{width:54px; height:54px; border-radius:var(--r-xl)}
.brand-logo.bare svg{border-radius:0} /* bare/animated mark draws on a transparent ground */
/* footer brand hosts the self-contained tile (merged v3.3 duplicate, PR-P —
   the old gradient square is gone, so no more !important override needed) */
.footer-logo{width:38px; height:38px; border-radius:var(--r-lg); background:none; display:grid; place-items:center;
  color:#fff; box-shadow:var(--shadow-sm), var(--inset-hi); transition:transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease)}
.footer-logo svg{width:38px; height:38px; display:block; border-radius:var(--r-lg)}
@media (hover:hover) and (pointer:fine){
  .footer-brand:hover .footer-logo{transform:translateY(-2px); box-shadow:none}
}

/* ===================== v4.1 — public-tree analytics dashboard ===================== */
.statbars{display:flex; align-items:flex-end; gap:4px; height:130px; padding-top:var(--s2)}
.statbar{position:relative; flex:1; min-width:3px; height:100%; display:flex; align-items:flex-end; justify-content:center; gap:2px}
.statbar .sb-v{width:46%; background:color-mix(in srgb, var(--brand) 55%, var(--surface-3)); border-radius:3px 3px 0 0; min-height:2px}
.statbar .sb-c{width:46%; background:var(--brand-hi); border-radius:3px 3px 0 0; min-height:0}
.statbars-legend{display:flex; gap:var(--s5); margin-top:var(--s3); font-size:.78rem; color:var(--text-dim)}
.statbars-legend .lg::before{content:""; display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:6px; vertical-align:-1px}
.lg-v::before{background:color-mix(in srgb, var(--brand) 55%, var(--surface-3))}
.lg-c::before{background:var(--brand-hi)}
.bar-inline{display:inline-block; height:6px; border-radius:var(--r-full); background:var(--brand-soft); margin-left:8px; vertical-align:middle; min-width:6px; max-width:90px}
.ref-list{list-style:none; padding:0; margin:0}
.ref-list li{display:flex; justify-content:space-between; gap:var(--s3); padding:9px 0; border-bottom:1px solid var(--border); font-size:.9rem}
.ref-list li:last-child{border-bottom:none}
.ref-host{color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ref-n{color:var(--text-dim); font-variant-numeric:tabular-nums; flex:none}
.btn.active{background:var(--brand-soft); border-color:var(--brand); color:var(--text)}

/* =====================================================================
   v4.2 — PR-F: public-tree visual restraint + bio-*→pt-* rename support.
   New surface: avatar-shape picker in the tree-settings form.
   ===================================================================== */
.avatar-shape-pick{display:flex; gap:var(--s2); flex-wrap:wrap}
.avatar-shape-opt{display:inline-flex; align-items:center; gap:8px; padding:8px 13px; border-radius:var(--r-md);
  background:var(--surface-2); border:1px solid var(--border); cursor:pointer; font-weight:600; font-size:.85rem;
  color:var(--text-muted); transition:border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease)}
.avatar-shape-opt input{position:absolute; opacity:0; pointer-events:none}
.avatar-shape-opt .shape-prev{width:22px; height:22px; flex:none; background:var(--grad-brand);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22); display:inline-block}
.avatar-shape-opt .shape-prev.shape-circle{border-radius:50%}
.avatar-shape-opt .shape-prev.shape-squircle{border-radius:7px}
.avatar-shape-opt.is-active{color:var(--text); border-color:var(--brand-hi); box-shadow:0 0 0 3px var(--brand-soft)}
@media (hover:hover){.avatar-shape-opt:hover{border-color:var(--border-strong); color:var(--text)}}

/* =====================================================================
   v3.11 — PR-G: persistent share button + vCard modal + "Made with KeyCube"
   lockup. The public tree is also our advertising surface (Pepe's pin).
   ===================================================================== */
/* Floating share affordance — top-right, brand-tinted glass disc. */
body.public-tree .pt-share-btn{
  position:fixed; top:max(14px, env(safe-area-inset-top, 14px)); right:max(14px, env(safe-area-inset-right, 14px));
  width:44px; height:44px; border-radius:50%; border:1px solid rgba(255,255,255,.16);
  background:color-mix(in srgb, var(--brand) 18%, rgba(15,17,22,.7)); color:#fff;
  display:grid; place-items:center; cursor:pointer; z-index:80;
  backdrop-filter:blur(10px) saturate(140%); -webkit-backdrop-filter:blur(10px) saturate(140%);
  box-shadow:0 6px 18px -8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.18);
  transition:transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease);
}
body.public-tree .pt-share-btn .icon{width:20px; height:20px}
body.public-tree .pt-share-btn:focus-visible{outline:2px solid var(--brand-hi); outline-offset:3px}
@media (hover:hover){
  body.public-tree .pt-share-btn:hover{transform:translateY(-2px); background:color-mix(in srgb, var(--brand) 28%, rgba(15,17,22,.78))}
}
body.public-tree .pt-share-btn:active{transform:translateY(0); transition-duration:60ms}

/* Centred share modal — full-viewport overlay + glass card. */
.pt-share-modal{position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:1rem}
.pt-share-modal[hidden]{display:none}
.pt-share-backdrop{position:absolute; inset:0; background:rgba(6,7,10,.72); backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px)}
.pt-share-card{
  position:relative; width:min(360px, 100%); border-radius:var(--r-xl);
  background:var(--surface-2); border:1px solid var(--border);
  box-shadow:var(--shadow-lg), 0 30px 90px -30px rgba(0,0,0,.7);
  padding:1.25rem; display:flex; flex-direction:column; gap:1rem;
}
.pt-share-head{display:flex; align-items:center; justify-content:space-between; gap:.5rem}
.pt-share-title{margin:0; font-size:1rem; font-weight:600; color:var(--text); letter-spacing:-.01em}
.pt-share-close{
  background:transparent; border:0; cursor:pointer; color:var(--text-dim);
  width:32px; height:32px; border-radius:50%; display:grid; place-items:center;
  transition:background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.pt-share-close .icon{width:18px; height:18px}
@media (hover:hover){.pt-share-close:hover{background:var(--surface-3); color:var(--text)}}
.pt-share-qr{display:block; margin:0 auto; width:176px; height:176px; border-radius:var(--r-md); background:#fff; padding:8px}
.pt-share-card .pt-share-url{display:flex; gap:.5rem; align-items:stretch}
.pt-share-card .pt-share-url input{
  flex:1; min-width:0; padding:.55rem .75rem; border-radius:var(--r-md);
  background:var(--surface-3); border:1px solid var(--border); color:var(--text); font:inherit;
}
.pt-share-card .pt-copy{
  flex:none; display:inline-flex; align-items:center; gap:.4rem; padding:.55rem .75rem;
  background:var(--brand); color:#fff; border:0; border-radius:var(--r-md); cursor:pointer; font-weight:600;
  transition:filter var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.pt-share-card .pt-copy.ok{background:var(--success)}
.pt-share-card .pt-copy .icon{width:16px; height:16px}
@media (hover:hover){.pt-share-card .pt-copy:hover{filter:brightness(1.08); transform:translateY(-1px)}}
.pt-share-vcard{
  display:inline-flex; align-items:center; justify-content:center; gap:.45rem;
  padding:.7rem 1rem; border-radius:var(--r-md);
  background:var(--surface-3); border:1px solid var(--border); color:var(--text);
  text-decoration:none; font-weight:600; font-size:.92rem;
  transition:border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
}
.pt-share-vcard .icon{width:16px; height:16px; color:var(--brand)}
@media (hover:hover){.pt-share-vcard:hover{border-color:var(--brand); background:var(--brand-soft); transform:translateY(-1px)}}
html.pt-modal-open{overflow:hidden}

/* "Made with KeyCube" lockup — bottom of .pt-inner, opacity-low → 1 on hover. */
body.public-tree .pt-attribution{
  display:flex; align-items:center; justify-content:center; gap:.6rem;
  padding-block:2rem; margin-top:1.5rem;
  text-decoration:none; opacity:.65;
  color:var(--text-dim); font-size:.78rem; letter-spacing:.04em;
  transition:opacity 220ms var(--ease);
}
body.public-tree .pt-attribution:focus-visible{outline:2px solid var(--brand-hi); outline-offset:3px; border-radius:var(--r-sm); opacity:1}
body.public-tree .pt-attribution .pt-attr-mark{display:inline-grid; place-items:center; width:24px; height:24px; flex:none}
body.public-tree .pt-attribution .pt-attr-mark svg{width:24px; height:24px; display:block}
body.public-tree .pt-attribution .pt-attr-text{font-variant:small-caps; letter-spacing:.06em}
body.public-tree .pt-attribution .pt-attr-text strong{color:var(--text); font-weight:700; font-variant:normal; letter-spacing:-.005em; margin-left:.15rem}
body.public-tree .pt-attribution .pt-attr-sub{
  display:inline-flex; align-items:center; gap:.2rem;
  color:var(--brand-hi); font-weight:600;
  transform:translateY(6px); opacity:0; pointer-events:none;
  transition:transform 200ms var(--ease), opacity 200ms var(--ease);
}
body.public-tree .pt-attribution .pt-attr-sub .icon{width:14px; height:14px}
@media (hover:hover){
  body.public-tree .pt-attribution:hover{opacity:1}
  body.public-tree .pt-attribution:hover .pt-attr-sub{transform:translateY(0); opacity:1}
}
@media (prefers-reduced-motion: reduce){
  body.public-tree .pt-attribution .pt-attr-sub{transition:none}
}

/* =====================================================================
   v3.12 — iOS Safari + mobile a11y baseline (masterplan 2.2f).
   - 100vh → 100dvh so iOS doesn't reserve a phantom URL-bar gap.
   - Bump min font-size on mobile inputs to 16px (iOS auto-zooms below that,
     which has been the share-input pain point on the public tree).
   - safe-area-inset-top padding on the sticky topbar so notched devices
     don't park the brand mark under the dynamic island.
   - tap-highlight removal on interactive elements (it conflicts with our
     own :active treatments).
   - 44×44 minimum tap targets on the music-player transports.
   ===================================================================== */
/* dvh where supported — keeps full-bleed shells from bouncing as the URL bar
   collapses on scroll. progressive enhancement: 100vh is the fallback. */
@supports (height:100dvh){
  body{min-height:100dvh}
  .app{min-height:100dvh}
  .sidebar{height:100dvh}
}
/* Sticky topbar honours the iOS notch / dynamic island. */
.topbar{padding-top:env(safe-area-inset-top, 0px)}
@media (max-width:860px){
  /* The grid template's first row is `--topbar-h` — extend the visual height
     so content under the topbar isn't covered by the safe-area inset. */
  :root{--topbar-h:calc(56px + env(safe-area-inset-top, 0px))}
}
/* No mobile auto-zoom: anything ≥16px on touch devices stays as-is in Safari.
   Tightened on the public-tree share URL (the .78rem caused a focus zoom). */
@media (max-width:640px){
  .pt-share-url input{font-size:16px}
  /* Form inputs with explicit smaller sizing should bump to 16px on phones
     for the same reason — anything ≥16px doesn't trigger Mobile Safari zoom. */
  input[type=text],input[type=email],input[type=password],input[type=url],input[type=search],
  input[type=number],input[type=date],input[type=datetime-local],input[type=time],input[type=month],
  input[type=week],input[type=tel],select,textarea{font-size:16px}
}
/* Suppress the grey tap flash — we drive our own :active scale/colour. */
button, a, .btn, [role="button"], [role="option"], summary,
.pin-key, .pp-tb, .pp-main, .pp-vbtn, .pp-item, .pt-copy{
  -webkit-tap-highlight-color:transparent;
}
/* WCAG SC 2.5.5 tap-target size (Level AAA, but trivial to honour). Apply
   only on coarse pointers so desktop hover layout stays compact. */
@media (pointer:coarse){
  .pp-tb, .pp-vbtn{min-width:44px; min-height:44px}
  .pp-main{min-width:56px; min-height:56px}
  /* (#32 PR-P) extend the 44px floor to the small everyday controls */
  .btn-icon, .toast-x, .drag-handle, .meta-thumb-x{min-width:44px; min-height:44px}
}

/* =====================================================================
   v3.13 — mobile hamburger nav (masterplan 2.2a).
   Authed shell on phones (≤860px) hid the sidebar with no replacement.
   This adds an off-canvas drawer pattern: a hamburger button in the
   topbar opens the sidebar as a slide-in drawer with a translucent
   scrim. Focus trap + ESC close + scrim close live in ui.js.
   Above 860px the drawer logic is OFF and these rules don't apply.
   ===================================================================== */
/* Hamburger button — desktop default: hidden. Topbar layout already
   uses flex with a .spacer, so this slots in front of the title. */
.nav-toggle{display:none; align-items:center; justify-content:center;
  width:38px; height:38px; padding:0; margin-right:var(--s2);
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--r-md); color:var(--text); cursor:pointer;
  transition:background-color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease)}
.nav-toggle:hover{background:var(--surface-3); border-color:var(--border-strong)}
.nav-toggle .icon{width:20px; height:20px}

/* Scrim — invisible + non-interactive by default; the .is-open state on
   the sidebar lights it up. `hidden` attribute removed by JS on open so
   the transition can play. */
.nav-scrim{position:fixed; inset:0; background:rgba(0,0,0,.5);
  opacity:0; pointer-events:none; z-index:40;
  transition:opacity 200ms var(--ease)}
.nav-scrim.is-open{opacity:1; pointer-events:auto}

/* Body-scroll lock while drawer is open. */
html.nav-locked, html.nav-locked body{overflow:hidden}

@media (max-width:860px){
  /* Hamburger visible only at the same breakpoint that hides the sidebar
     in the existing layout block (line ~100). */
  .nav-toggle{display:inline-flex}

  /* Off-canvas drawer: fixed slab pinned to the left edge, slid out by
     default. Override the legacy `.sidebar{display:none}` from the layout
     block above so it can be revealed. */
  .sidebar{
    display:flex !important; /* override line ~103 .sidebar{display:none} */
    position:fixed; top:0; left:0; bottom:0;
    width:min(86vw, 320px); height:100dvh;
    z-index:50; /* above scrim (40) */
    transform:translateX(-100%);
    transition:transform 200ms var(--ease);
    box-shadow:var(--shadow-lg);
    /* Keep its own scroll while drawer is open. */
    overflow:auto;
  }
  .sidebar.is-open{transform:translateX(0)}
}

/* Respect users who asked us to stop moving things. WCAG SC 2.3.3. */
@media (prefers-reduced-motion: reduce){
  .sidebar{transition:none}
  .nav-scrim{transition:none}
}

/* ---- Themed confirm dialog (v3.14, masterplan 2.2b) ----
   The native browser `confirm()` is grey, off-brand, and identical for "save"
   and "delete everything". This is the replacement — built on `.modal` + a
   destructive variant for the OK button, plus a typed-confirm input field for
   the truly irreversible operations (tree delete). The CSS is intentionally
   small — it leans on the existing `.modal` / `.modal-card` / `.btn` system. */
.ld-confirm-card{max-width:440px}
.ld-confirm-title{margin:0 0 var(--s2); font-size:1.1rem; font-weight:700; letter-spacing:-.01em}
.ld-confirm-body{margin:0 0 var(--s4); color:var(--text-dim); font-size:.92rem; line-height:1.55}
.ld-confirm-body.hidden{display:none}
.ld-confirm-typed{margin:0 0 var(--s4)}
.ld-confirm-typed.hidden{display:none}
.ld-confirm-typed-label{display:block; margin-bottom:6px; font-size:.82rem; color:var(--text-decor, var(--text-dim));
  letter-spacing:.02em}
.ld-confirm-typed input{width:100%; padding:.55rem .75rem; background:var(--surface-2); color:var(--text);
  border:1px solid var(--border); border-radius:var(--r-md); font:inherit; font-family:var(--mono)}
.ld-confirm-typed input:focus-visible{outline:none; border-color:var(--brand); box-shadow:0 0 0 3px var(--brand-soft, color-mix(in srgb, var(--brand) 25%, transparent))}
.ld-confirm-actions{justify-content:flex-end; gap:var(--s2); margin-top:var(--s3)}
/* Destructive confirm button — outline-danger, not filled (#10 PR-P): the
   Carbon danger red (#DA1E28) and the brand cinnabar (#E41C22) are visual
   twins, so a filled red button read as "primary". Tinted surface + danger
   text + danger border stays unmistakably destructive without impersonating
   the brand CTA. */
.btn.btn-danger{background:color-mix(in srgb, var(--danger) 12%, transparent); color:var(--danger-text);
  border:1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  font-weight:600;
  transition:background-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease)}
.btn.btn-danger:hover{background:color-mix(in srgb, var(--danger) 20%, transparent); transform:translateY(-1px); box-shadow:var(--shadow-sm)}
.btn.btn-danger:focus-visible{outline:none; box-shadow:0 0 0 3px color-mix(in srgb, var(--danger, #e53b3b) 35%, transparent)}
.btn.btn-danger:disabled,.btn.btn-danger[aria-disabled="true"]{opacity:.55; cursor:not-allowed; transform:none; box-shadow:none}

/* Optimistic-undo toast: extra inline button slot. Inherits `.toast` styling. */
.toast .toast-undo{margin-left:var(--s2); background:transparent; border:1px solid color-mix(in srgb, var(--text) 30%, transparent);
  color:var(--text); padding:3px 10px; border-radius:var(--r-sm); cursor:pointer; font:inherit; font-size:.82rem; font-weight:600}
.toast .toast-undo:hover{background:color-mix(in srgb, var(--text) 10%, transparent)}
.toast .toast-undo:focus-visible{outline:none; box-shadow:0 0 0 2px var(--brand-soft, color-mix(in srgb, var(--brand) 25%, transparent))}

/* Pending-delete: row visually fades out during the 6s undo window so the user
   sees the deletion is staged. Keeping the node in the DOM lets us reattach
   cleanly on undo without re-querying the server. */
.ld-pending-delete{opacity:.35; pointer-events:none; transition:opacity var(--dur-2) var(--ease)}
@media (prefers-reduced-motion: reduce){
  .ld-pending-delete{transition:none}
}

/* Submitting state (PR-L / 2.2i): a small inline ring spinner shown inside the
   primary submit button while a form is in flight. Inherits current text
   colour so it works on btn-primary (white text) AND btn-ghost. Replaced by a
   "…" pulse under prefers-reduced-motion (no rotation). */
.btn[data-submitting]{cursor:progress; opacity:.85}
.btn .btn-spin{
  display:inline-block; width:14px; height:14px; vertical-align:-2px;
  border:2px solid currentColor; border-right-color:transparent;
  border-radius:50%;
  animation:ld-btn-spin 600ms linear infinite;
  margin-right:6px;
}
@keyframes ld-btn-spin{ to { transform:rotate(360deg); } }
@media (prefers-reduced-motion: reduce){
  .btn .btn-spin{
    width:auto; height:auto; border:0; border-radius:0;
    animation:ld-btn-pulse 1.2s ease-in-out infinite;
  }
  .btn .btn-spin::before{ content:'…'; }
  @keyframes ld-btn-pulse{ 0%,100%{opacity:.45} 50%{opacity:1} }
}

/* ===================== v3.15 — empty states as onboarding (masterplan 2.3) =====================
   NN/g: a passive empty card ("Keine Einträge") loses 84 % of first-time owners
   before they understand what to do. Replace it with a calm, generous-air
   onboarding pattern: large brand-tinted illustration, a clear headline, a
   3-step numbered preview of the journey, then a primary CTA + a secondary
   "Demo importieren" escape hatch. The vibe is editorial-clean (Linear-like) —
   no confetti, no animation tricks. */
.empty-onboard{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  padding-block:5rem; padding-inline:var(--s4);
  max-width:680px; margin-inline:auto; gap:var(--s4);
}
.empty-onboard-illu{
  width:96px; height:96px; display:grid; place-items:center;
  color:var(--brand); opacity:.78;
  background:radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--brand) 18%, transparent), transparent 70%);
  border-radius:50%;
  margin-bottom:var(--s2);
}
.empty-onboard-illu .icon{width:96px; height:96px}
.empty-onboard-h{
  margin:0; font-size:var(--fs-h3, 1.5rem); font-weight:700;
  letter-spacing:-.015em; color:var(--text);
}
.empty-onboard-sub{
  margin:0; max-width:46ch; color:var(--text-dim);
  font-size:1rem; line-height:1.6;
}
.empty-onboard-steps{
  list-style:none; padding:0; margin:var(--s2) 0 var(--s3);
  display:flex; flex-direction:column; gap:var(--s2);
  width:100%; max-width:560px;
}
.empty-onboard-steps .step{
  display:flex; align-items:center; gap:var(--s3);
  padding:var(--s3) var(--s4);
  background:var(--surface-2, color-mix(in srgb, var(--text) 4%, transparent));
  border:1px solid var(--border, color-mix(in srgb, var(--text) 10%, transparent));
  border-radius:var(--r-lg, 14px);
  text-align:left;
}
.empty-onboard-steps .step-num{
  flex:0 0 28px; width:28px; height:28px; border-radius:50%;
  background:color-mix(in srgb, var(--brand) 18%, transparent);
  color:var(--brand);
  display:grid; place-items:center;
  font-weight:700; font-size:.85rem;
  font-feature-settings:"tnum";
}
.empty-onboard-steps .step-ico{
  display:grid; place-items:center;
  width:22px; height:22px; color:var(--text-dim);
}
.empty-onboard-steps .step-ico .icon{width:20px; height:20px}
.empty-onboard-steps .step-label{
  font-weight:500; color:var(--text); font-size:.95rem;
}
@media (min-width: 720px){
  /* On comfortable widths arrange the three steps as a row of equal cards —
     reads left-to-right as a journey. Below 720px stays a stacked column so
     the steps remain comfortably tappable on phones. */
  .empty-onboard-steps{flex-direction:row; gap:var(--s3)}
  .empty-onboard-steps .step{flex:1; flex-direction:column; align-items:flex-start; gap:var(--s2)}
  .empty-onboard-steps .step-num{margin-bottom:var(--s1)}
}
.empty-onboard-cta{
  display:flex; flex-wrap:wrap; justify-content:center; gap:var(--s2);
  margin-top:var(--s2);
}
.empty-onboard-demo{margin:0}
.empty-onboard-foot{margin:var(--s2) 0 0; color:var(--text-decor, var(--text-dim))}

/* The "Wechsle in den Bearbeiten-Modus" hint should ONLY show when the tree
   editor is NOT in edit mode — invert of `.edit-only`. */
.tree-root.editing .view-only{display:none}

/* Music-player empty state (masterplan 2.3 D): same calm centred pattern,
   but smaller scale since it lives inside a card. */
.player-empty{
  display:flex; flex-direction:column; align-items:center; text-align:center;
  padding:var(--s5) var(--s4); gap:var(--s2);
  border:1px dashed var(--border, color-mix(in srgb, var(--text) 14%, transparent));
  border-radius:var(--r-lg, 14px);
  margin-top:var(--s3);
}
.player-empty.is-dragover{
  border-color:var(--brand);
  background:color-mix(in srgb, var(--brand) 8%, transparent);
}
.player-empty-illu{
  width:48px; height:48px; display:grid; place-items:center;
  color:var(--brand); opacity:.75;
}
.player-empty-illu .icon{width:40px; height:40px}
.player-empty-h{margin:0; font-weight:600; color:var(--text)}

/* =====================================================================
   v3.16 — Public sales landing ("Vertriebsseite"). All classes .mk-*,
   all tokens scoped under body.landing so nothing leaks into the app or
   the public-tree (pt-*). Dark, red *punctuates* (<=5 roles). Motion via
   .mk-reveal (IntersectionObserver in landing.js). CSP-safe: no external
   assets, pure CSS/SVG.
   ===================================================================== */
body.landing{
  --mk-bg-0:#080A0E; --mk-bg-1:#0C0F15;
  --mk-h1:clamp(2.6rem, 6vw, 4.6rem);
  --mk-h2:clamp(1.9rem, 4vw, 3rem);
  --mk-h3:clamp(1.2rem, 2vw, 1.5rem);
  --mk-lead:clamp(1.02rem, 1.4vw, 1.2rem);
  --mk-maxw:1120px;
  background:var(--mk-bg-0);
  background-image:
    radial-gradient(1200px 600px at 82% -8%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 62%),
    radial-gradient(900px 520px at -8% 2%, color-mix(in srgb, var(--accent2) 8%, transparent), transparent 58%);
  background-attachment:fixed;
}
body.landing .mk-shell{max-width:var(--mk-maxw); margin-inline:auto; padding-inline:clamp(1rem,4vw,2rem); width:100%}
body.landing main{display:block}

.mk-skip{position:absolute; left:-9999px; top:0; z-index:120; background:var(--surface-3); color:var(--text); padding:10px 16px; border-radius:0 0 var(--r-md) 0}
.mk-skip:focus{left:0}

/* ---- Sticky nav ---- */
.mk-nav{position:sticky; top:0; z-index:80; padding-top:env(safe-area-inset-top);
  background:color-mix(in srgb, var(--mk-bg-0) 78%, transparent); backdrop-filter:blur(14px) saturate(1.4);
  border-bottom:1px solid transparent; transition:border-color var(--dur-2), background var(--dur-2)}
.mk-nav.is-scrolled{border-bottom-color:var(--hairline); background:color-mix(in srgb, var(--mk-bg-0) 90%, transparent)}
.mk-nav-inner{max-width:var(--mk-maxw); margin-inline:auto; padding:12px clamp(1rem,4vw,2rem); display:flex; align-items:center; gap:18px}
.mk-brand{display:inline-flex; align-items:center; gap:10px; text-decoration:none; color:var(--text); font-weight:700; letter-spacing:-.01em}
.mk-brand-mark{width:34px; height:34px; display:grid; place-items:center}
.mk-brand-mark .brand-svg{width:34px; height:34px}
.mk-nav-links{display:flex; gap:6px; margin-left:14px}
.mk-nav-links a{color:var(--text-muted); text-decoration:none; font-weight:500; font-size:.94rem; padding:8px 12px; border-radius:var(--r-sm); transition:color var(--dur-1), background var(--dur-1)}
.mk-nav-links a:hover{color:var(--text); background:var(--surface-2)}
.mk-nav-cta{margin-left:auto}
.mk-burger{display:none; margin-left:auto; background:var(--surface-2); border:1px solid var(--border); color:var(--text); width:42px; height:42px; border-radius:var(--r-md); align-items:center; justify-content:center; cursor:pointer}
.mk-burger .icon{width:22px; height:22px}
.mk-scrim{position:fixed; inset:0; z-index:70; background:rgba(0,0,0,.5); backdrop-filter:blur(2px)}

/* ---- Section rhythm ---- */
.mk-section{position:relative; padding-block:clamp(4rem,11vh,8rem)}
.mk-section.mk-alt{background:var(--mk-bg-1); border-top:1px solid var(--hairline); border-bottom:1px solid var(--hairline)}
.mk-eyebrow{font-family:var(--mono); font-size:.72rem; letter-spacing:.16em; text-transform:uppercase; color:var(--text-decor); margin:0 0 12px}
.mk-h1{font-size:var(--mk-h1); line-height:1.02; letter-spacing:-.03em; margin:0 0 20px; text-wrap:balance; font-weight:800}
.mk-h2{font-size:var(--mk-h2); line-height:1.08; letter-spacing:-.02em; margin:0 0 18px; text-wrap:balance; font-weight:750}
.mk-h3{font-size:var(--mk-h3); margin:0 0 10px; font-weight:650}
.mk-lead{font-size:var(--mk-lead); color:var(--text-muted); line-height:1.6; margin:0 0 24px; max-width:46ch}
.mk-accent{color:var(--brand)}

/* ---- Hero ---- */
.mk-hero{position:relative; overflow:hidden; padding-block:clamp(5rem,13vh,9rem) clamp(3rem,8vh,6rem)}
.mk-hero-wash{position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(680px 380px at 78% 12%, var(--brand-glow), transparent 66%),
    radial-gradient(520px 320px at 20% 90%, color-mix(in srgb, var(--accent2) 22%, transparent), transparent 62%);
  opacity:.5}
.mk-hero-grid{position:relative; display:grid; grid-template-columns:1.05fr .95fr; gap:clamp(2rem,5vw,4rem); align-items:center}
.mk-hero-cta{display:flex; flex-wrap:wrap; gap:12px; margin-bottom:14px}
.mk-hero-cta.mk-center{justify-content:center}
.mk-hero-incentive{font-size:.9rem; color:var(--text-dim); margin:0 0 20px}
.mk-microtrust{list-style:none; display:flex; flex-wrap:wrap; gap:8px 16px; margin:0; padding:0}
.mk-microtrust li{display:inline-flex; align-items:center; gap:6px; font-family:var(--mono); font-size:.74rem; color:var(--text-dim)}
.mk-microtrust .icon{width:15px; height:15px; color:var(--brand)}
.mk-microtrust-line{font-family:var(--mono); font-size:.74rem; letter-spacing:.06em; color:var(--text-dim); margin:18px 0 0}

/* ---- Phone mockup ---- */
.mk-hero-visual,.mk-app-visual{display:flex; justify-content:center}
.mk-phone{width:clamp(232px,26vw,312px)}
.mk-phone-frame{position:relative; aspect-ratio:9/19; border-radius:42px; padding:10px;
  background:linear-gradient(160deg,#1b2029,#0d1016); border:1px solid var(--border-strong);
  box-shadow:var(--shadow-lg), 0 0 0 1px rgba(0,0,0,.6) inset}
.mk-phone-island{position:absolute; top:16px; left:50%; transform:translateX(-50%); width:34%; height:20px; background:#000; border-radius:12px; z-index:3}
.mk-phone-screen{height:100%; border-radius:33px; overflow:hidden; background:var(--mk-bg-0); position:relative}
.mk-mini{height:100%; display:flex; flex-direction:column; align-items:center; padding:12px 12px 16px; text-align:center}
.mk-mini-cover{position:absolute; top:0; left:0; right:0; height:34%;
  background:radial-gradient(120% 100% at 50% 0, var(--brand-glow), transparent 70%), linear-gradient(180deg,#191d26,transparent)}
.mk-mini-avatar{position:relative; z-index:2; width:60px; height:60px; margin-top:30px; border-radius:50%; background:var(--surface-3);
  display:grid; place-items:center; border:2px solid rgba(255,255,255,.12); box-shadow:0 8px 24px rgba(0,0,0,.5)}
.mk-mini-avatar .brand-svg{width:34px; height:34px}
.mk-mini-title{position:relative; z-index:2; font-weight:700; font-size:.92rem; margin-top:8px}
.mk-mini-sub{position:relative; z-index:2; font-size:.66rem; color:var(--text-dim); margin-top:2px}
.mk-mini-links{position:relative; z-index:2; width:100%; display:flex; flex-direction:column; gap:7px; margin-top:14px}
.mk-mini-link{display:flex; align-items:center; gap:8px; padding:8px 10px; border-radius:12px; background:var(--glass);
  border:1px solid var(--border); font-size:.72rem; font-weight:600; color:var(--text); backdrop-filter:blur(4px)}
.mk-mini-link .mk-mini-go{margin-left:auto; color:var(--text-dim)}
.mk-mini-link .mk-mini-go .icon,.mk-mini-link .mk-mini-chip .icon{width:13px; height:13px}
.mk-mini-chip{width:22px; height:22px; border-radius:7px; background:var(--surface-3); display:grid; place-items:center; color:var(--text-muted)}
.mk-mini-feat{background:var(--grad-brand); border-color:transparent; color:#fff; box-shadow:0 8px 20px var(--brand-glow)}
.mk-mini-feat .mk-mini-chip{background:rgba(255,255,255,.2); color:#fff}
.mk-mini-feat .mk-mini-go{color:rgba(255,255,255,.85)}
.mk-rv{padding:26px 16px; display:flex; flex-direction:column; gap:12px; height:100%}
.mk-rv-head{display:flex; align-items:center; gap:10px; margin-top:8px}
.mk-rv-ico{width:38px; height:38px; border-radius:11px; background:var(--brand-soft); color:var(--brand); display:grid; place-items:center}
.mk-rv-ico .icon{width:20px; height:20px}
.mk-rv-meta{display:flex; flex-direction:column}
.mk-rv-meta strong{font-size:.86rem}
.mk-rv-meta span{font-size:.66rem; color:var(--text-dim)}
.mk-rv-field{display:flex; justify-content:space-between; align-items:center; padding:10px 12px; border-radius:10px; background:var(--surface-2); border:1px solid var(--border); font-size:.74rem}
.mk-rv-k{color:var(--text-dim)}
.mk-rv-v{font-family:var(--mono); color:var(--text)}
.mk-rv-blur{filter:blur(5px); user-select:none}
.mk-rv-unlock{margin-top:4px; display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:11px; border-radius:11px;
  background:var(--grad-brand); color:#fff; border:none; font:inherit; font-weight:650; font-size:.8rem; box-shadow:0 8px 22px var(--brand-glow)}
.mk-rv-unlock .icon{width:16px; height:16px}
.mk-rv-note{display:flex; align-items:center; gap:6px; font-size:.66rem; color:var(--text-dim); margin:auto 0 4px}
.mk-rv-note .icon{width:13px; height:13px; color:var(--success)}

/* ---- Trust bar ---- */
.mk-trustbar{background:var(--mk-bg-1); border-top:1px solid var(--hairline); border-bottom:1px solid var(--hairline); padding-block:20px}
.mk-trustrow{display:flex; flex-wrap:wrap; justify-content:center; gap:10px 22px}
.mk-trustchip{display:inline-flex; align-items:center; gap:8px; font-size:.82rem; color:var(--text-muted)}
.mk-trustchip .icon{width:17px; height:17px; color:var(--brand)}
.mk-trustchip em{font-family:var(--mono); font-style:normal; font-size:.72rem; color:var(--text-dim)}

/* ---- Cards / grids ---- */
.mk-grid3{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:32px}
.mk-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-xl); padding:var(--s6)}
.mk-card h3{margin:0 0 8px; font-size:1.05rem; font-weight:650}
.mk-card p{margin:0; color:var(--text-dim); line-height:1.6; font-size:.94rem}
.mk-card-ico{width:44px; height:44px; border-radius:12px; background:var(--brand-soft); color:var(--brand); display:grid; place-items:center; margin-bottom:14px}
.mk-card-ico .icon{width:22px; height:22px}

/* solution strip */
.mk-solution{display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap;
  margin-top:22px; padding:22px 26px; border-radius:var(--r-xl); background:var(--surface);
  border:1px solid var(--border); border-left:3px solid var(--brand)}
.mk-solution p{margin:0; color:var(--text-dim); line-height:1.6; max-width:60ch}
.mk-solution .mk-eyebrow{margin-bottom:6px}
.mk-solution .mk-h3{margin-bottom:6px}

/* ---- Bento ---- */
.mk-bento{display:grid; grid-template-columns:repeat(4,1fr); grid-auto-flow:dense; gap:16px; margin-top:32px}
.mk-tile{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-xl); padding:var(--s6); position:relative; overflow:hidden}
.mk-tile h3{margin:0 0 8px; font-size:1.04rem; font-weight:650; letter-spacing:-.01em}
.mk-tile p{margin:0; color:var(--text-dim); line-height:1.55; font-size:.9rem}
.mk-tile-hero{grid-column:span 2; grid-row:span 2; display:flex; flex-direction:column;
  background:linear-gradient(165deg, color-mix(in srgb,var(--brand) 12%, var(--surface)), var(--surface))}
.mk-tile-hero::before{content:""; position:absolute; inset:0 0 auto 0; height:3px; background:var(--grad-brand)}
.mk-tile-hero h3{font-size:1.5rem; margin-top:auto}
.mk-tile-hero p{font-size:1rem}
.mk-tile-wide{grid-column:span 2}

/* ---- Audience lanes ---- */
.mk-lanes{display:grid; grid-template-columns:repeat(2,1fr); gap:16px; margin-top:32px}
.mk-lane{display:flex; flex-direction:column; gap:16px}
.mk-lane-head{display:flex; gap:14px; align-items:flex-start}
.mk-lane-head h3{margin:0; font-size:1.3rem}
.mk-lane-sub{margin:2px 0 0; color:var(--text-dim); font-size:.92rem}
.mk-checklist{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px}
.mk-checklist li{display:flex; align-items:flex-start; gap:10px; color:var(--text-muted); font-size:.94rem; line-height:1.45}
.mk-checklist .icon{width:18px; height:18px; color:var(--success); flex:none; margin-top:1px}
.mk-w-full{width:100%; justify-content:center; margin-top:auto}

/* ---- Pricing ---- */
.mk-pricing{text-align:center}
.mk-pricing .mk-eyebrow,.mk-pricing .mk-h2{text-align:center}
.mk-vat{color:var(--text-dim); font-size:.86rem; margin:0 0 8px}
.mk-price-banner{display:inline-flex; align-items:center; gap:8px; background:var(--brand-soft); color:var(--brand-hi);
  border:1px solid color-mix(in srgb,var(--brand) 30%, transparent); border-radius:var(--r-full); padding:8px 16px; font-size:.86rem; margin:0 auto 24px}
.mk-price-banner .icon{width:16px; height:16px}
.mk-price-controls{display:flex; justify-content:center; flex-wrap:wrap; gap:12px; margin-bottom:28px}
.mk-price-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; text-align:left; align-items:stretch}
.mk-price{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-xl); padding:24px; display:flex; flex-direction:column; gap:10px; position:relative}
.mk-price h3{margin:0; font-size:1.2rem}
.mk-price-for{margin:0; color:var(--text-dim); font-size:.86rem}
.mk-price-num{margin:8px 0 0; display:flex; align-items:baseline; gap:6px; flex-wrap:wrap}
.mk-amount{font-size:2rem; font-weight:800; letter-spacing:-.02em}
.mk-per{color:var(--text-dim); font-size:.9rem}
.mk-pre{color:var(--text-dim); font-size:.9rem; align-self:center}
.mk-price-save{margin:0; font-size:.8rem; color:var(--success); font-weight:600; min-height:1em}
.mk-price .mk-checklist{margin:8px 0 16px}
.mk-price .mk-checklist li{font-size:.9rem}
.mk-price-trust{margin:0; font-size:.74rem; color:var(--text-decor); text-align:center}
.mk-price.featured{border-color:var(--brand); box-shadow:0 0 0 1px var(--brand), 0 20px 50px color-mix(in srgb,var(--brand) 16%,transparent); transform:translateY(-6px)}
.mk-badge-pop{position:absolute; top:-11px; left:50%; transform:translateX(-50%); background:var(--grad-brand); color:#fff; font-size:.72rem; font-weight:700; padding:4px 12px; border-radius:var(--r-full); white-space:nowrap; box-shadow:0 6px 16px var(--brand-glow)}
.mk-oneshot{margin-top:16px; flex-direction:row; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:20px;
  background:linear-gradient(120deg, color-mix(in srgb,var(--accent2) 10%, var(--surface)), var(--surface)); border-style:dashed}
.mk-oneshot > div{text-align:left}
.mk-oneshot .mk-checklist{margin:0; flex:1 1 320px}
.mk-checklist-2col{display:grid!important; grid-template-columns:1fr 1fr; gap:8px 18px}
.mk-oneshot-cta{display:flex; flex-direction:column; gap:10px; align-items:stretch}

/* ---- Security ---- */
.mk-secure{background:var(--mk-bg-0)}
.mk-secure-shell{text-align:center}
.mk-secure-shell .mk-lead{margin-inline:auto; max-width:62ch}
.mk-secure .mk-grid3{text-align:left}

/* ---- App section ---- */
.mk-app-grid{display:grid; grid-template-columns:1fr 1fr; gap:clamp(2rem,5vw,4rem); align-items:center}
.mk-app-rows{list-style:none; margin:20px 0 0; padding:0; display:flex; flex-direction:column; gap:18px}
.mk-app-rows li{display:flex; gap:14px; align-items:flex-start}
.mk-app-rows strong{display:block; font-size:1.02rem; margin-bottom:2px}
.mk-app-rows p{margin:0; color:var(--text-dim); font-size:.92rem; line-height:1.55}

/* ---- FAQ ---- */
.mk-faq-shell{max-width:760px}
.mk-faq-list{margin-top:28px; display:flex; flex-direction:column; gap:10px}
.mk-faq{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); overflow:hidden}
.mk-faq summary{list-style:none; cursor:pointer; padding:16px 18px; font-weight:600; display:flex; align-items:center; justify-content:space-between; gap:12px}
.mk-faq summary::-webkit-details-marker{display:none}
.mk-faq-chev{color:var(--text-dim); transition:transform var(--dur-2); flex:none}
.mk-faq-chev .icon{width:18px; height:18px}
.mk-faq[open] .mk-faq-chev{transform:rotate(180deg)}
.mk-faq-body{padding:0 18px 16px}
.mk-faq-body p{margin:0; color:var(--text-dim); line-height:1.6}

/* ---- Final CTA / waitlist ---- */
.mk-final{position:relative; overflow:hidden; background:var(--mk-bg-1)}
.mk-final-wash{position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(720px 380px at 50% 0, var(--brand-glow), transparent 68%); opacity:.55}
.mk-final-shell{position:relative; max-width:560px; margin-inline:auto; text-align:center}
.mk-final-shell .mk-eyebrow,.mk-final-shell .mk-lead{margin-inline:auto; text-align:center}
.mk-final-shell .mk-lead{max-width:48ch}
.mk-waitlist{margin:8px 0 20px; text-align:left}
.mk-waitlist-row{display:flex; gap:10px}
.mk-waitlist-row input[type=email]{flex:1; background:var(--surface); border:1px solid var(--border-strong); color:var(--text);
  border-radius:var(--r-md); padding:13px 15px; font:inherit; font-size:16px}
.mk-waitlist-row input[type=email]:focus-visible{outline:2px solid var(--brand-hi); outline-offset:2px; border-color:var(--brand)}
.mk-waitlist-row .btn{flex:none}
.mk-consent{display:flex; gap:9px; align-items:flex-start; margin-top:12px; font-size:.82rem; color:var(--text-dim); line-height:1.45}
.mk-consent input{margin-top:2px; flex:none}
.mk-consent a{color:var(--text-muted)}
.mk-hp{position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden}
.mk-waitlist-status{margin:10px 0 0; font-size:.86rem; min-height:1.2em}
.mk-waitlist-status.is-err{color:var(--danger)}
.mk-waitlist-done{display:flex; flex-direction:column; align-items:center; gap:12px; padding:22px; background:var(--surface); border:1px solid var(--border); border-radius:var(--r-xl); text-align:center}
.mk-waitlist-done p{margin:0; color:var(--text)}
.mk-final-gets{list-style:none; margin:0 auto; padding:0; display:inline-flex; flex-direction:column; gap:8px; text-align:left}
.mk-final-gets li{display:flex; align-items:center; gap:9px; color:var(--text-muted); font-size:.92rem}
.mk-final-gets .icon{width:17px; height:17px; color:var(--success)}
.mk-confirm{text-align:center}
.mk-confirm-ico{width:56px; height:56px; border-radius:50%; display:grid; place-items:center; margin:0 auto 8px}
.mk-confirm-ico.mk-ok{background:color-mix(in srgb,var(--success) 18%,transparent); color:var(--success)}
.mk-confirm-ico.mk-warn{background:color-mix(in srgb,var(--warning) 18%,transparent); color:var(--warning)}
.mk-confirm-ico .icon{width:28px; height:28px}

/* ---- Footer ---- */
.mk-footer{background:var(--mk-bg-0); border-top:1px solid var(--hairline); padding:clamp(3rem,6vh,4.5rem) 0 2rem}
.mk-footer-inner{max-width:var(--mk-maxw); margin-inline:auto; padding-inline:clamp(1rem,4vw,2rem); display:grid; grid-template-columns:2fr 1fr 1fr 1fr; gap:28px}
.mk-footer-logo .brand-svg{width:44px; height:44px}
.mk-footer-tag{margin:12px 0 6px; font-weight:600; color:var(--text); max-width:24ch}
.mk-footer-made{margin:0; font-size:.82rem; color:var(--text-dim)}
.mk-heart{color:var(--brand)}
.mk-bavaria{color:var(--brand); font-weight:700}
.mk-footer-col h4{margin:0 0 12px; font-size:.82rem; text-transform:uppercase; letter-spacing:.08em; color:var(--text-decor); font-family:var(--mono)}
.mk-footer-col{display:flex; flex-direction:column; gap:9px}
.mk-footer-col a{color:var(--text-muted); text-decoration:none; font-size:.92rem}
.mk-footer-col a:hover{color:var(--text)}
.mk-footer-bar{max-width:var(--mk-maxw); margin:32px auto 0; padding:20px clamp(1rem,4vw,2rem) 0; border-top:1px solid var(--hairline);
  display:flex; flex-wrap:wrap; gap:12px 24px; justify-content:space-between; align-items:center}
.mk-footer-copy{font-size:.82rem; color:var(--text-decor)}
.mk-footer-chips{font-family:var(--mono); font-size:.72rem; color:var(--text-decor); display:flex; gap:8px; flex-wrap:wrap}

/* ---- Legal pages ---- */
.mk-legal-shell{max-width:760px}
.mk-legal-draft{display:flex; align-items:center; gap:8px; background:color-mix(in srgb,var(--warning) 14%,transparent);
  border:1px solid color-mix(in srgb,var(--warning) 40%,transparent); color:var(--warning); border-radius:var(--r-md); padding:12px 16px; font-weight:600; font-size:.9rem; margin-bottom:24px}
.mk-legal-draft .icon{width:18px; height:18px; flex:none}
.mk-legal h3{margin:26px 0 8px; font-size:1.1rem}
.mk-legal p{color:var(--text-muted); line-height:1.7; margin:0 0 8px}
.mk-legal a{color:var(--brand-hi)}
.mk-legal-note{color:var(--text-dim)!important; font-size:.9rem}
.mk-legal-hint{color:var(--text-decor); font-size:.86rem}

/* ---- Reveal motion ---- */
.mk-reveal{opacity:0; transform:translateY(16px)}
.mk-reveal.in{opacity:1; transform:none; transition:opacity .5s var(--ease-out), transform .5s var(--ease-out); transition-delay:calc(var(--i,0)*60ms)}
@media (hover:hover) and (pointer:fine){
  .mk-card:hover,.mk-tile:hover,.mk-lane:hover{transform:translateY(-6px); box-shadow:var(--shadow-lg)}
  .mk-card,.mk-tile,.mk-lane{transition:transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out)}
  .mk-price.featured:hover{transform:translateY(-10px)}
}
@media (prefers-reduced-motion:reduce){
  .mk-reveal{opacity:1; transform:none; transition:none}
  .mk-card:hover,.mk-tile:hover,.mk-lane:hover{transform:none}
}

/* ---- Mobile nav open state ---- */
html.mk-nav-open, html.mk-nav-open body{overflow:hidden}

/* ---- Responsive ---- */
@media (max-width:900px){
  .mk-hero-grid{grid-template-columns:1fr; gap:2.5rem}
  .mk-hero-visual{order:2}
  .mk-app-grid{grid-template-columns:1fr}
  .mk-grid3{grid-template-columns:1fr}
  .mk-lanes{grid-template-columns:1fr}
  .mk-bento{grid-template-columns:repeat(2,1fr)}
  .mk-tile-hero{grid-column:span 2; grid-row:auto}
  .mk-tile-wide{grid-column:span 2}
  .mk-price-grid{grid-template-columns:1fr}
  .mk-price.featured{transform:none}
  .mk-oneshot{flex-direction:column; align-items:stretch}
  .mk-checklist-2col{grid-template-columns:1fr}
  .mk-footer-inner{grid-template-columns:1fr 1fr}
  .mk-footer-brand{grid-column:1 / -1}
}
@media (max-width:820px){
  .mk-nav-links{position:fixed; inset:0 0 0 auto; width:min(78vw,320px); flex-direction:column; gap:4px;
    background:var(--surface); border-left:1px solid var(--border); padding:80px 18px 18px; margin:0;
    transform:translateX(100%); transition:transform var(--dur-2) var(--ease-out); z-index:90}
  html.mk-nav-open .mk-nav-links{transform:none}
  .mk-nav-links a{font-size:1.05rem; padding:12px 14px}
  .mk-burger{display:inline-flex}
  .mk-nav-cta{margin-left:0}
}
@media (min-width:821px){ .mk-scrim{display:none} }
@media (max-width:560px){
  .mk-waitlist-row{flex-direction:column}
  .mk-waitlist-row .btn{width:100%; justify-content:center}
  .mk-bento{grid-template-columns:1fr}
  .mk-tile-hero,.mk-tile-wide{grid-column:auto}
  .mk-footer-inner{grid-template-columns:1fr}
}

/* =====================================================================
   v3.17 — PR-P component primitives. Small reusable helpers that PR-Q
   uses to purge repeated inline styles from the templates (#15/#27/#30),
   plus the reusable admin empty-state pattern (#50).
   ===================================================================== */
.field-grow{flex:1 1 0; min-width:0}
.checkbox{width:auto}                     /* replaces the repeated style="width:auto" */
.form-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:var(--s3); align-items:end}
.card--form{max-width:560px}              /* forms never stretch past 560px — line length */
.card--form-wide{max-width:720px}         /* settings pages */
.page-title{margin:0}                     /* (#7) canonical h1 reset */

/* (#50) Empty-state CTA: icon + one line + primary action. Calm, centred —
   the tree-area .empty-onboard (3-step journey) stays its own richer pattern. */
.empty-cta{display:flex; flex-direction:column; align-items:center; gap:var(--s3); text-align:center;
  padding:var(--s8) var(--s4); color:var(--text-muted)}
.empty-cta .icon{width:36px; height:36px; color:var(--text-dim)}
.empty-cta p{margin:0; max-width:44ch}

/* =====================================================================
   v3.18 — PR-Q per-surface sweep. Small additive helpers that back the
   template sweep (inline-style purge, a11y labels, admin uplift). No
   existing selector renamed or removed.
   ===================================================================== */

/* Login: auth-card title (was an inline font-size overriding the hero clamp) */
.hero .auth-title{font-size:1.3rem}

/* (#29) Show-password toggle inside a password field */
.pw-field{position:relative}
.pw-field input{padding-right:48px}
.pw-field .pw-toggle{position:absolute; right:6px; top:50%; margin-top:-17px; border-color:transparent; background:transparent}

/* (#22) Seat-limit / warning help lines — no more inline colours */
.help.warn{color:var(--warning-text)}

/* (#42) Raw timestamps: readable as data, visually calm */
.ts{font-family:var(--mono); font-size:var(--fs-xs); color:var(--text-dim); font-variant-numeric:tabular-nums}

/* (#42) Licence key: visually truncated, full value stays in data-copy-text */
.lic-key{font-family:var(--mono); max-width:16ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  display:inline-block; vertical-align:bottom}

/* (#8) Card headings promoted h3→h2 for a sane outline keep the h3 size */
.card-h{font-size:1.06rem}

/* (#20) Tree delete moved out of the save form into its own danger block */
.danger-zone{margin-top:var(--s5); padding-top:var(--s4); border-top:1px solid var(--hairline);
  display:flex; align-items:center; gap:var(--s3); flex-wrap:wrap; justify-content:space-between}
.danger-zone .help{margin:0}

/* (#48) Table filter input above admin tables */
.table-filter{max-width:280px; margin-bottom:var(--s3)}
.filter-empty td{color:var(--text-dim); text-align:center; padding:16px 10px}

/* (#49) Create-form disclosure: summary reads like a ghost-button row */
.create-disclosure summary{display:flex; align-items:center; gap:8px; cursor:pointer; font-weight:600;
  list-style:none; padding:4px 2px; border-radius:var(--r-sm); color:var(--text-muted)}
.create-disclosure summary::-webkit-details-marker{display:none}
.create-disclosure summary .icon{width:16px; height:16px; color:var(--brand-hi)}
.create-disclosure summary:hover{color:var(--text)}
.create-disclosure summary:focus-visible{outline:2px solid var(--brand-hi); outline-offset:2px}
.create-disclosure[open] summary{margin-bottom:var(--s4)}

/* (#19) Branding live preview — classes instead of inline styles (the two
   background colours stay inline: they are per-tenant data, synced by JS) */
.brand-preview{border-radius:var(--r-lg); padding:1.2rem; color:#fff}
.brand-preview-logo{display:inline-flex; align-items:center; font-size:1.6rem}
.brand-preview-logo .icon{width:26px; height:26px}
img.brand-preview-logo{height:32px}
.brand-preview-btn{pointer-events:none; margin-top:1rem}

/* (#36) Expired pairing code: grey out + strike, "Neuen Code erzeugen" appears */
.modal-card.is-expired #pair-qr{opacity:.35; filter:grayscale(1)}
.modal-card.is-expired #pair-code{opacity:.55; text-decoration:line-through}

/* =====================================================================
   v3.19 — PR-R landing high-end. Hero choreography (one-shot blur entrance
   = the single sanctioned filter animation, rule 2), phone depth package,
   bento mini-visuals, orbs + parallax-lite, spring CTAs, trust marquee,
   nav section indicator, waitlist-confirmed moment. Everything scoped to
   the mk-* namespace / body.landing; every loop gated on
   prefers-reduced-motion:no-preference. No class renamed or removed.
   ===================================================================== */

/* ---- Shared keyframes (top-level so every gated block can reference) ---- */
@keyframes mk-enter{from{opacity:0; transform:translateY(14px); filter:blur(8px)}to{opacity:1; transform:none; filter:blur(0)}}
@keyframes mk-float{0%,100%{transform:translateY(0) rotate(-.4deg)}50%{transform:translateY(-9px) rotate(.4deg)}}
@keyframes mk-drift-a{to{transform:translate(-60px,40px) scale(1.08)}}
@keyframes mk-drift-b{to{transform:translate(50px,-30px) scale(.94)}}
@keyframes mk-marquee{to{transform:translateX(calc((-100% - 32px)/3))}}
@keyframes mk-viz-pop{from{opacity:0; transform:scale(.9)}to{opacity:1; transform:none}}
@keyframes mk-pin-fill{to{background:var(--brand); border-color:var(--brand); box-shadow:0 0 12px var(--brand-glow)}}
@keyframes mk-pill-cycle{0%,100%{background:#E41C22}25%{background:#3B9EFF}50%{background:#22C55E}75%{background:#EAB308}}
@keyframes mk-vault-peek{0%,20%,80%,100%{opacity:0}40%,60%{opacity:1}}
@keyframes mk-vault-hide{0%,20%,80%,100%{opacity:1}40%,60%{opacity:0}}
@keyframes mk-fid-pulse{0%,20%,80%,100%{box-shadow:0 0 0 0 transparent}40%,60%{box-shadow:0 0 0 6px var(--brand-soft)}}
@keyframes mk-tick{from{opacity:0; transform:scale(.4)}to{opacity:1; transform:none}}

/* ---- R10 typography drama (InterVariable axes — landing only) ---- */
body.landing{font-feature-settings:'cv11' 1,'ss01' 1,'case' 1;
  --mk-spring:linear(0,0.009,0.035 2.1%,0.141,0.281 6.7%,0.723 12.9%,0.938 16.7%,1.017,
  1.077,1.121,1.149 24.3%,1.159,1.163,1.161,1.154 29.9%,1.129 32.8%,1.051 39.6%,1.017 43.1%,0.991,
  0.977 51%,0.974 53.8%,0.975 57.1%,0.997 69.8%,1.003 76.9%,1)}
.mk-h1{font-weight:830; letter-spacing:-.045em; line-height:.98}
.mk-h2{font-weight:760; letter-spacing:-.03em}
.mk-amount{font-variant-numeric:tabular-nums}

/* ---- R2 gradient hero word + off-white H1 (per-line clip: the entrance
   transform/filter on .mk-line makes it a stacking context, so the clip
   must live on the span itself, not the h1 box) ---- */
.mk-line{display:block}
.mk-h1 .mk-line{background:linear-gradient(180deg,#fff 30%,#C6CBD4 100%);
  -webkit-background-clip:text; background-clip:text; color:transparent}
.mk-accent{background:linear-gradient(120deg,var(--brand) 10%,var(--brand-hi) 55%,#FF8A8E 95%);
  -webkit-background-clip:text; background-clip:text; color:transparent}

/* ---- R1 hero text choreography (one-shot blur = sanctioned exception) ---- */
@media (prefers-reduced-motion:no-preference){
  .mk-hero-copy .mk-eyebrow,.mk-hero-copy .mk-line,.mk-hero-copy .mk-lead,.mk-hero-copy .mk-hero-cta,
  .mk-hero-copy .mk-hero-incentive,.mk-hero-copy .mk-microtrust{
    opacity:0; transform:translateY(14px); filter:blur(8px);
    animation:mk-enter .7s var(--ease-out) forwards}
  .mk-hero-copy .mk-line{animation-delay:calc(var(--l,0)*120ms)}
  .mk-hero-copy .mk-lead{animation-delay:.32s}
  .mk-hero-copy .mk-hero-cta{animation-delay:.42s}
  .mk-hero-copy .mk-hero-incentive{animation-delay:.5s}
  .mk-hero-copy .mk-microtrust{animation-delay:.58s}
  .mk-hero-visual{opacity:0; animation:mk-enter .8s var(--ease-out) .25s forwards}
}

/* ---- R3 phone depth package (entrance on .mk-hero-visual, float on
   .mk-phone — never the same element) ---- */
.mk-phone{position:relative}
.mk-phone-screen::after{content:""; position:absolute; inset:0; z-index:4; pointer-events:none;
  background:linear-gradient(115deg,transparent 38%,rgba(255,255,255,.06) 42%,rgba(255,255,255,.02) 50%,transparent 54%);
  border-radius:inherit}
.mk-phone-frame::after{content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  padding:1px; background:linear-gradient(160deg,rgba(255,255,255,.22),transparent 30%,transparent 70%,rgba(255,255,255,.08));
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude}
.mk-phone::before{content:""; position:absolute; left:8%; right:8%; bottom:-26px; height:44px;
  background:radial-gradient(50% 100% at 50% 0,color-mix(in srgb,var(--brand) 30%,transparent),transparent 75%);
  filter:blur(10px); z-index:-1}
.mk-phone-frame{box-shadow:var(--shadow-lg),
  0 40px 90px -20px color-mix(in srgb,var(--brand) 25%,transparent),0 0 0 1px rgba(0,0,0,.6) inset}
@media (prefers-reduced-motion:no-preference){
  .mk-hero-visual .mk-phone{animation:mk-float 7s ease-in-out infinite}
}

/* ---- R4 spotlight + section seams + scroll polish ---- */
.mk-hero-visual{position:relative}
.mk-hero-visual::before{content:""; position:absolute; width:150%; aspect-ratio:1; z-index:-1;
  left:50%; top:50%; transform:translate(-50%,-50%);
  background:radial-gradient(closest-side,color-mix(in srgb,var(--brand) 14%,transparent),
    color-mix(in srgb,var(--accent2) 6%,transparent) 45%,transparent 70%)}
.mk-section.mk-alt{border-top:0; border-bottom:0; position:relative;
  background:radial-gradient(600px 200px at 50% 0,color-mix(in srgb,var(--brand) 5%,transparent),transparent 70%),var(--mk-bg-1)}
.mk-section.mk-alt::before,.mk-section.mk-alt::after{content:""; position:absolute; left:0; right:0; height:1px;
  background:linear-gradient(90deg,transparent,var(--hairline) 18%,var(--hairline) 82%,transparent)}
.mk-section.mk-alt::before{top:0}
.mk-section.mk-alt::after{bottom:0}
.mk-final::before{content:""; position:absolute; top:0; left:0; right:0; height:1px;
  background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--brand) 60%,transparent) 50%,transparent)}
html:has(body.landing){scroll-padding-top:84px}
@media (prefers-reduced-motion:no-preference){html:has(body.landing){scroll-behavior:smooth}}

/* ---- R5 bento mini-visuals (aria-hidden figures; entrance piggybacks on
   .mk-reveal.in — zero new JS; loops gated no-preference) ---- */
.mk-tile-viz{--mk-viz-bg:color-mix(in srgb,var(--mk-bg-0) 55%,var(--surface));
  margin:0 0 14px; height:96px; border-radius:var(--r-lg); position:relative; overflow:hidden;
  background:var(--mk-viz-bg); border:1px solid var(--hairline);
  display:flex; align-items:center; justify-content:center; gap:10px; pointer-events:none}
.mk-tile-hero .mk-tile-viz{height:auto; flex:1 1 auto; min-height:150px}

/* a) QR */
.mk-viz-qr .mk-qr{width:72px; height:72px; color:var(--text-muted)}
.mk-qr-m{fill:currentColor}
.mk-qr-gap{fill:var(--mk-viz-bg)}
.mk-qr-core{fill:var(--brand)}
@media (prefers-reduced-motion:no-preference){
  .mk-viz-qr .mk-qr{opacity:0; transform:scale(.9)}
  .mk-reveal.in .mk-viz-qr .mk-qr{animation:mk-viz-pop .5s var(--ease-out) .2s forwards}
}

/* b) Analytics bars */
.mk-viz-bars{align-items:flex-end; gap:8px; padding:14px 18px}
.mk-viz-bars span{flex:1 1 0; max-width:26px; height:var(--h,50%); border-radius:4px 4px 2px 2px;
  background:var(--surface-3); transform-origin:bottom}
.mk-viz-bars .hot{background:var(--grad-brand); box-shadow:0 4px 14px var(--brand-glow)}
@media (prefers-reduced-motion:no-preference){
  .mk-viz-bars span{transform:scaleY(0); transition:transform .6s var(--ease-out)}
  .mk-reveal.in .mk-viz-bars span{transform:scaleY(1)}
  .mk-viz-bars span:nth-child(1){transition-delay:.15s}
  .mk-viz-bars span:nth-child(2){transition-delay:.2s}
  .mk-viz-bars span:nth-child(3){transition-delay:.25s}
  .mk-viz-bars span:nth-child(4){transition-delay:.3s}
  .mk-viz-bars span:nth-child(5){transition-delay:.35s}
  .mk-viz-bars span:nth-child(6){transition-delay:.4s}
  .mk-viz-bars span:nth-child(7){transition-delay:.45s}
}

/* c) PIN dots (colour/shadow keyframe — rule-compliant) */
.mk-viz-pin{gap:14px}
.mk-viz-pin i{width:16px; height:16px; border-radius:50%; border:2px solid var(--border-strong)}
@media (prefers-reduced-motion:no-preference){
  .mk-reveal.in .mk-viz-pin i{animation:mk-pin-fill .35s var(--ease-out) forwards}
  .mk-reveal.in .mk-viz-pin i:nth-child(1){animation-delay:.3s}
  .mk-reveal.in .mk-viz-pin i:nth-child(2){animation-delay:.55s}
  .mk-reveal.in .mk-viz-pin i:nth-child(3){animation-delay:.8s}
  .mk-reveal.in .mk-viz-pin i:nth-child(4){animation-delay:1.05s}
}
@media (prefers-reduced-motion:reduce){
  .mk-viz-pin i{background:var(--brand); border-color:var(--brand)}
}

/* d) Branding swatches + recolouring pill (ONE loop, gated) */
.mk-viz-brand{flex-direction:column; gap:10px}
.mk-viz-swatches{display:flex; gap:8px}
.mk-viz-swatches i{width:14px; height:14px; border-radius:50%; border:1px solid rgba(255,255,255,.14)}
.mk-viz-swatches i:nth-child(1){background:#E41C22}
.mk-viz-swatches i:nth-child(2){background:#3B9EFF}
.mk-viz-swatches i:nth-child(3){background:#22C55E}
.mk-viz-swatches i:nth-child(4){background:#EAB308}
.mk-viz-pill{padding:7px 16px; border-radius:var(--r-full); background:#E41C22; color:#fff;
  font-size:.74rem; font-weight:650}
@media (prefers-reduced-motion:no-preference){
  .mk-reveal.in .mk-viz-pill{animation:mk-pill-cycle 6s steps(1) infinite}
}

/* e) Vault: dots/plain crossfade + Face-ID pulse (the sync pair = one loop) */
.mk-viz-cred{gap:14px}
.mk-viz-fid{width:40px; height:40px; border-radius:12px; background:var(--brand-soft); color:var(--brand);
  display:grid; place-items:center; flex:none}
.mk-viz-fid .icon{width:22px; height:22px}
.mk-viz-cred-row{display:flex; align-items:center; gap:12px; padding:10px 14px; border-radius:10px;
  background:var(--surface-2); border:1px solid var(--border); font-size:.76rem}
.mk-viz-cred-k{color:var(--text-dim)}
.mk-viz-cred-v{position:relative; font-family:var(--mono); color:var(--text)}
.mk-viz-cred-v .v-plain{position:absolute; inset:0; opacity:0; color:var(--success-text)}
@media (prefers-reduced-motion:no-preference){
  .mk-reveal.in .mk-viz-cred .v-plain{animation:mk-vault-peek 4s ease-in-out .8s infinite}
  .mk-reveal.in .mk-viz-cred .v-dots{animation:mk-vault-hide 4s ease-in-out .8s infinite}
  .mk-reveal.in .mk-viz-cred .mk-viz-fid{animation:mk-fid-pulse 4s ease-in-out .8s infinite}
}

/* f) Public/private link pills (static) */
.mk-viz-pub{flex-direction:column; gap:10px; padding:0 26px}
.mk-viz-plink{display:flex; align-items:center; gap:9px; width:100%; max-width:300px; padding:9px 12px;
  border-radius:11px; background:var(--glass); border:1px solid var(--border);
  font-size:.76rem; font-weight:600; color:var(--text)}
.mk-viz-plink-ico{width:22px; height:22px; border-radius:7px; background:var(--surface-3);
  display:grid; place-items:center; color:var(--text-muted); flex:none}
.mk-viz-plink-ico .icon{width:13px; height:13px}
.mk-viz-plink .mk-viz-tag{margin-left:auto; font-family:var(--mono); font-size:.62rem; color:var(--success-text)}
.mk-viz-plink.is-priv{opacity:.62}
.mk-viz-plink.is-priv .mk-viz-tag{color:var(--text-dim)}

/* g) App/PWA: phone outline + the QR scaled down (static) */
.mk-viz-phone{width:52px; height:88px; border-radius:14px; border:1px solid var(--border-strong);
  background:linear-gradient(160deg,#1b2029,#0d1016); padding:5px; display:grid; place-items:center}
.mk-viz-phone-scr{width:100%; height:100%; border-radius:10px; background:var(--mk-bg-0);
  display:grid; place-items:center; --mk-viz-bg:var(--mk-bg-0)}
.mk-viz-app .mk-qr{width:30px; height:30px; color:var(--text-muted)}

/* h) CSV skeleton bars + mono caption */
.mk-viz-csv{flex-direction:column; gap:9px; padding:0 30px}
.mk-viz-csv-bars{display:flex; flex-direction:column; gap:6px; width:100%; max-width:220px}
.mk-viz-csv-bars i{height:8px; border-radius:4px; background:var(--surface-3); transform-origin:left}
.mk-viz-csv-bars i:nth-child(1){width:88%}
.mk-viz-csv-bars i:nth-child(2){width:70%; opacity:.8}
.mk-viz-csv-bars i:nth-child(3){width:55%; opacity:.6}
.mk-viz-csv-cap{font-family:var(--mono); font-size:.64rem; color:var(--text-dim); letter-spacing:.04em}
@media (prefers-reduced-motion:no-preference){
  .mk-viz-csv-bars i{transform:scaleX(0); transition:transform .55s var(--ease-out)}
  .mk-reveal.in .mk-viz-csv-bars i{transform:scaleX(1)}
  .mk-viz-csv-bars i:nth-child(1){transition-delay:.15s}
  .mk-viz-csv-bars i:nth-child(2){transition-delay:.25s}
  .mk-viz-csv-bars i:nth-child(3){transition-delay:.35s}
}

/* ---- R6 orbs + parallax-lite (keyframes animate transform; the scroll
   parallax writes --mk-sy consumed via the separate translate property so
   the two compose without stacking transforms) ---- */
.mk-orb{position:absolute; border-radius:50%; filter:blur(70px); pointer-events:none; z-index:0; will-change:transform}
.mk-orb-a{width:520px; height:520px; right:-120px; top:-160px;
  background:radial-gradient(circle at 35% 35%,color-mix(in srgb,var(--brand) 26%,transparent),transparent 70%)}
.mk-orb-b{width:420px; height:420px; left:-140px; bottom:-180px;
  background:radial-gradient(circle at 60% 40%,color-mix(in srgb,var(--accent2) 20%,transparent),transparent 70%)}
@media (prefers-reduced-motion:no-preference){
  .mk-orb-a{animation:mk-drift-a 26s ease-in-out infinite alternate}
  .mk-orb-b{animation:mk-drift-b 32s ease-in-out infinite alternate}
  .mk-hero .mk-orb{translate:0 calc(var(--mk-sy,0)*0.10px)}
  .mk-hero-wash{translate:0 calc(var(--mk-sy,0)*0.18px)}
}

/* ---- R7 nav active-section indicator ---- */
.mk-nav-links{position:relative}
.mk-nav-ind{position:absolute; left:0; bottom:0; height:2px; width:0; border-radius:1px;
  background:var(--grad-brand); opacity:0;
  transition:transform .3s var(--ease-out), width .3s var(--ease-out), opacity .2s var(--ease)}
.mk-nav-ind.on{opacity:1}
@media (max-width:820px){.mk-nav-ind{display:none}}

/* ---- R8 springy CTAs + calmer card hover ---- */
body.landing .btn-primary{transition:transform .5s var(--mk-spring), box-shadow .2s var(--ease)}
@media (hover:hover) and (pointer:fine){
  body.landing .btn-primary:hover{transform:scale(1.04)}
  body.landing .btn-primary:active{transform:scale(.97); transition-duration:.15s}
  .mk-card:hover,.mk-tile:hover,.mk-lane:hover{transform:translateY(-2px);
    border-color:var(--border-strong);
    box-shadow:0 0 0 1px color-mix(in srgb,var(--brand) 12%,transparent),var(--shadow-lg)}
}
@media (prefers-reduced-motion:reduce){
  body.landing .btn-primary:hover,body.landing .btn-primary:active{transform:none}
}

/* ---- R9 trust marquee (duplicated track; reduced-motion = the original
   wrapped static row, duplicates hidden) ---- */
.mk-marquee{overflow:hidden}
.mk-marquee-track{display:flex; gap:32px; width:max-content}
.mk-marquee-track .mk-trustrow{flex-wrap:nowrap; gap:32px; flex:none; padding-inline:16px}
@media (prefers-reduced-motion:no-preference){
  .mk-marquee{-webkit-mask-image:linear-gradient(90deg,transparent,#000 10%,#000 90%,transparent);
    mask-image:linear-gradient(90deg,transparent,#000 10%,#000 90%,transparent)}
  .mk-marquee-track{animation:mk-marquee 34s linear infinite}
  .mk-marquee:hover .mk-marquee-track{animation-play-state:paused}
}
@media (prefers-reduced-motion:reduce){
  .mk-marquee-track{display:block; width:auto; animation:none}
  .mk-marquee-track .mk-trustrow[aria-hidden]{display:none}
  .mk-marquee-track .mk-trustrow{flex-wrap:wrap; padding-inline:clamp(1rem,4vw,2rem)}
}

/* ---- R10 waitlist success moment + confirm page choreography ---- */
@media (prefers-reduced-motion:no-preference){
  .mk-waitlist-done{animation:mk-viz-pop .5s var(--ease-out)}
  .mk-confirm > *{opacity:0; transform:translateY(12px); animation:mk-enter .6s var(--ease-out) forwards}
  .mk-confirm > :nth-child(2){animation-delay:.08s}
  .mk-confirm > :nth-child(3){animation-delay:.16s}
  .mk-confirm > :nth-child(4){animation-delay:.24s}
  .mk-confirm > :nth-child(5){animation-delay:.32s}
  .mk-tick{animation:mk-tick .5s var(--mk-spring) .15s both}
}

/* =====================================================================
   v4.1 — admin control-room skin
   ---------------------------------------------------------------------
   Scoped to `body.admin-console` (set in layouts/app.php ONLY for a
   super-admin on the platform host, tenantContext==='platform'). It must
   never leak into the tenant app, the public tree (pt-*), or the landing
   (mk-*). Additive values only — no class/id renames.

   Thesis: "Kontrollraum, kein Dashboard." Red is demoted to alarm; the
   operator's numerics speak JetBrains Mono; a faint blueprint dot-grid
   signals the instrument surface.
   ===================================================================== */
body.admin-console{
  /* Faint blueprint dot-grid (~5% white alpha, cheap CSS gradient, no image).
     Fixed so it reads as a stationary console backdrop while content scrolls. */
  --console-grid:rgba(255,255,255,.05);
  background-image:radial-gradient(var(--console-grid) 1px, transparent 1.4px);
  background-size:22px 22px;
  background-position:0 0;
  background-attachment:fixed;
}
/* Light theme: white dots vanish on a light surface → tint toward ink instead. */
body.admin-console.theme-light{ --console-grid:rgba(20,24,33,.05); }

/* The operator's navigation speaks mono — quiet, tabular, instrument-like. */
body.admin-console .nav-link{ font-family:var(--mono); font-size:.8rem; font-weight:500; letter-spacing:-.01em; }
body.admin-console .nav-section{ font-family:var(--mono); }

/* Red as alarm: kill the decorative brand-glow radial on stat cards inside the
   console so red is reserved for true danger/at-risk/expired states only. */
body.admin-console .stat::after{ display:none; }

/* ---- New reusable type/token utilities (global; used across admin surfaces) ---- */
/* Mono uppercase numbered kicker, e.g. "01 · MANDANTEN". */
.eyebrow{ font:600 .7rem/1 var(--mono); letter-spacing:.12em; text-transform:uppercase; color:var(--text-decor); }
/* Tabular mono for all operator numerics (seats, ids, runway days, timestamps). */
.metric{ font-variant-numeric:tabular-nums; font-family:var(--mono); }

/* =====================================================================
   v4.2 — admin data primitives
   ---------------------------------------------------------------------
   Reusable, theme-aware status widgets consumed by the Wave-2 admin
   surfaces (dashboard tenant-health matrix, tenants/licenses tables) AND
   the Firmenadmin (tenantadmin) seat/license heros. Deliberately NOT
   scoped to `body.admin-console` — the Firmenadmin surfaces are single-
   tenant chrome (no console skin) but reuse the same seat meter + runway.

   Colour semantics reuse the Carbon status tokens (--success / --warning /
   --danger + their *-text foregrounds), so red only ever appears on a
   genuine at-cap / warning / expired state — never as decoration. All
   three animate nothing on their own; a fill width change is not motion.

   Custom-prop / class CONTRACT (Wave 2 wires these into templates):
   • .health-dot  — add ONE of .is-ok / .is-warn / .is-bad; carry the
                    status word in aria-label on the element itself.
   • .meter       — set inline `style="--val:0..1"` (used/licensed). Add
                    .is-full at capacity (amber). Structure:
                    <span class="meter" style="--val:.8" role="progressbar"
                          aria-valuemin="0" aria-valuemax="5" aria-valuenow="4">
                      <span class="meter-track"><span class="meter-fill"></span></span>
                      <span class="meter-label metric">4/5</span></span>
   • .runway      — set inline `style="--val:0..1"` (horizon remaining).
                    Add .is-warn (≤14 d, amber) or .is-expired (red, full).
                    Same track/fill/label structure with the runway-* names.
   ===================================================================== */

/* ---- Health dot: server-computed green / amber / red status pip ---- */
.health-dot{
  display:inline-block; width:8px; height:8px; flex:none; vertical-align:middle;
  border-radius:var(--r-full); background:var(--text-dim);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--text-dim) 16%, transparent);
}
.health-dot.is-ok{ background:var(--success); box-shadow:0 0 0 3px color-mix(in srgb, var(--success) 20%, transparent); }
.health-dot.is-warn{ background:var(--warning); box-shadow:0 0 0 3px color-mix(in srgb, var(--warning) 22%, transparent); }
.health-dot.is-bad{ background:var(--danger); box-shadow:0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }

/* ---- Seat-capacity meter + license runway bar (shared track structure) ---- */
.meter,.runway{ display:inline-flex; align-items:center; gap:var(--s2); min-width:120px; width:100%; }
.meter-track,.runway-track{
  position:relative; flex:1 1 auto; min-width:44px; height:6px; overflow:hidden;
  border-radius:var(--r-full); background:var(--surface-3);
}
.meter-fill,.runway-fill{
  position:absolute; inset:0 auto 0 0; border-radius:inherit;
  width:calc(clamp(0, var(--val,0), 1) * 100%); background:var(--success);
}
.meter-label,.runway-label{
  flex:none; font-family:var(--mono); font-variant-numeric:tabular-nums;
  font-size:.76rem; color:var(--text-dim);
}
/* Seats at capacity → amber (buy-more signal), never brand red. */
.meter.is-full .meter-fill{ background:var(--warning); }
.meter.is-full .meter-label{ color:var(--warning-text); }
/* Runway ≤14 d → amber, expired → red & full. */
.runway.is-warn .runway-fill{ background:var(--warning); }
.runway.is-warn .runway-label{ color:var(--warning-text); }
.runway.is-expired .runway-fill{ background:var(--danger); width:100%; }
.runway.is-expired .runway-label{ color:var(--danger-text); }

/* ---- Utility layer: retire the ad-hoc inline-style escape hatches ---- */
.text-right{ text-align:right; }
.mw-sm{ max-width:280px; }
.m-0{ margin:0; }
.fs-base{ font-size:var(--fs-base); }
/* Eyebrow-styled <legend>/section label + its spacing wrapper for the
   eyebrowed admin form sections (Wave 2 tenant-edit / settings splits). */
.form-legend{
  display:block; padding:0; margin:0 0 var(--s3);
  font:600 .7rem/1 var(--mono); letter-spacing:.12em; text-transform:uppercase;
  color:var(--text-decor);
}
.form-section{ margin:0 0 var(--s6); border:0; padding:0; min-width:0; }
.form-section + .form-section{ padding-top:var(--s5); border-top:1px solid var(--hairline); }
/* Legend icon (shield motif) sits quietly inline with the mono label. */
.form-legend .icon{ width:14px; height:14px; vertical-align:-2px; margin-right:var(--s1);
  color:var(--text-decor); }
/* Security-posture summary line — a calm framed status readout above the
   Zugangsschutz toggles. Amber (is-warn) when protection is off; never red. */
.posture-summary{ display:flex; align-items:center; gap:var(--s2);
  margin:0 0 var(--s5); padding:var(--s3) var(--s4);
  border:1px solid var(--hairline); border-radius:var(--r-md);
  background:var(--surface-2); font-size:.9rem; }
.posture-summary .ps-text{ color:var(--text); font-weight:500; }

/* =====================================================================
   v4.3 — breadcrumbs + page-title eyebrow kicker
   ---------------------------------------------------------------------
   Topbar breadcrumb trail (nav.crumbs, fed by an optional controller
   `$breadcrumb` array of [label, href] pairs — last item current, no
   link) and the block variant of the .eyebrow numbered kicker that sits
   directly above a .page-title. Both GLOBAL: the eyebrow-on-page
   treatment is reused by the Firmenadmin (tenantadmin) single-tenant
   surfaces (company-name kicker), not just the console. No motion —
   only a colour transition on breadcrumb link hover.
   ===================================================================== */
/* Topbar breadcrumb trail — quiet mono; red never appears here. */
.crumbs{ display:flex; align-items:center; flex-wrap:wrap; gap:var(--s2);
  min-width:0; font-family:var(--mono); font-size:.8rem; }
.crumbs .crumb{ color:var(--text-muted); border-radius:var(--r-xs);
  transition:color var(--dur-1) var(--ease); }
.crumbs a.crumb:hover{ color:var(--text); }
.crumbs .crumb.is-current{ color:var(--text); font-weight:600; }
.crumbs-sep{ color:var(--text-decor); font-size:.85em; user-select:none; }

/* Block variant of the .eyebrow kicker sitting directly above a .page-title. */
.eyebrow.page-kicker{ display:block; margin:0 0 var(--s2); }

/* =====================================================================
   v4.4 — dashboard signature (Tenant-Health Matrix + Worklist)
   ---------------------------------------------------------------------
   The Kontrollraum landing surface. A dense mono board — one row per
   tenant — anchored by exactly ONE Inter-800 hero number, plus an
   actionable "Braucht Aufmerksamkeit" worklist and a minimal audit
   event list (PR5 replaces the list with the .stream component).

   Colour semantics reuse the Carbon status tokens (--success/--warning/
   --danger + *-text). Red only ever marks a genuine at-risk / expired /
   alarm state — never decoration. No motion beyond quiet hover colour.
   ===================================================================== */

/* ---- Header hero: one display number + a demoted mono strip ---- */
.console-hero{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:var(--s5); }
.console-hero .hero-figure{ display:flex; align-items:baseline; gap:var(--s3); min-width:0; }
.console-hero .hero-num{
  font-weight:800; font-size:clamp(2.4rem,6vw,3.4rem); line-height:.9;
  letter-spacing:-.03em; font-variant-numeric:tabular-nums; color:var(--text);
}
.console-hero .hero-cap{ font-size:.9rem; color:var(--text-dim); }
.console-hero .hero-strip{ display:flex; flex-wrap:wrap; align-items:center; gap:var(--s2) var(--s3);
  font-size:.82rem; color:var(--text-dim); }
.console-hero .hs-item{ color:var(--text); border-radius:var(--r-xs);
  transition:color var(--dur-1) var(--ease); }
.console-hero a.hs-item:hover{ color:var(--brand); }
.console-hero .hs-lbl{ color:var(--text-decor); font-family:var(--font); }
.console-hero .hs-item.is-warn{ color:var(--warning-text); }
.console-hero .hs-item.is-bad{ color:var(--danger-text); }
.console-hero .hs-sep{ color:var(--text-decor); user-select:none; }

/* ---- Matrix: dense monospaced tenant-health board ---- */
.matrix-scroll{ overflow-x:auto; }
.matrix{ display:flex; flex-direction:column; min-width:640px; }
.matrix-row{
  display:grid; align-items:center; gap:var(--s3);
  grid-template-columns:14px minmax(150px,1.4fr) minmax(96px,1fr) minmax(96px,1fr) minmax(72px,.7fr) minmax(96px,1fr);
  padding:var(--s3) var(--s2); border-top:1px solid var(--hairline);
}
.matrix-row:first-child{ border-top:0; }
/* Header row — quiet mono column labels. */
.matrix-head{
  border-top:0; padding-top:0; padding-bottom:var(--s2);
  font:600 .66rem/1 var(--mono); letter-spacing:.1em; text-transform:uppercase;
  color:var(--text-decor);
}
.matrix-head [role="columnheader"]{ min-width:0; }
/* Data rows are links → whole-row target with a left at-risk hairline. */
a.matrix-row{ color:inherit; text-decoration:none; border-left:2px solid transparent;
  border-radius:var(--r-xs); transition:background var(--dur-1) var(--ease); }
a.matrix-row:hover{ background:var(--surface-2); }
a.matrix-row.is-warn{ border-left-color:color-mix(in srgb, var(--warning) 55%, transparent); }
a.matrix-row.is-bad{ border-left-color:color-mix(in srgb, var(--danger) 60%, transparent); }
a.matrix-row:focus-visible{ outline:2px solid var(--brand-hi); outline-offset:-2px; }
.matrix .mx-dot{ display:flex; justify-content:center; }
.matrix .mx-name{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.matrix .mx-title{ font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.matrix .mx-sub{ font-size:.72rem; color:var(--text-decor); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.matrix .mx-muted{ color:var(--text-decor); }
.matrix .mx-active{ font-size:.78rem; color:var(--text-dim); }
.matrix .mx-anom{ display:flex; flex-wrap:wrap; gap:var(--s1); }

/* Anomaly chip — red/amber ONLY when a count is present. */
.chip{
  display:inline-flex; align-items:center; gap:4px; padding:2px var(--s2);
  font-size:.7rem; line-height:1.3; border-radius:var(--r-full);
  border:1px solid var(--hairline); color:var(--text-dim); background:var(--surface-2);
}
.chip.is-bad{ color:var(--danger-text);
  background:color-mix(in srgb, var(--danger) 12%, transparent);
  border-color:color-mix(in srgb, var(--danger) 34%, transparent); }
.chip.is-warn{ color:var(--warning-text);
  background:color-mix(in srgb, var(--warning) 14%, transparent);
  border-color:color-mix(in srgb, var(--warning) 36%, transparent); }

/* ---- Worklist: actionable, deep-linked attention buckets ---- */
.dash-panels{ align-items:start; }
.worklist{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:var(--s2); }
.worklist-row{
  display:flex; align-items:center; gap:var(--s3); padding:var(--s3);
  border:1px solid var(--hairline); border-left-width:3px; border-radius:var(--r-sm);
  color:var(--text); text-decoration:none; background:var(--surface-2);
  transition:background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.worklist-row:hover{ background:var(--surface-3); }
.worklist-row:focus-visible{ outline:2px solid var(--brand-hi); outline-offset:2px; }
.worklist-row.is-warn{ border-left-color:var(--warning); }
.worklist-row.is-bad{ border-left-color:var(--danger); }
.worklist-row .wl-ico{ display:flex; flex:none; }
.worklist-row.is-warn .wl-ico{ color:var(--warning-text); }
.worklist-row.is-bad .wl-ico{ color:var(--danger-text); }
.worklist-row .wl-label{ flex:1 1 auto; min-width:0; font-size:.88rem; }
.worklist-row .wl-go{ display:flex; flex:none; color:var(--text-decor); }
.worklist-row .wl-ico .icon,.worklist-row .wl-go .icon{ width:16px; height:16px; }
/* Positive empty state — calm, never red. */
.worklist-calm{ display:flex; flex-direction:column; align-items:center; gap:var(--s2);
  padding:var(--s6) var(--s3); text-align:center; color:var(--text-dim); }
.worklist-calm .icon{ width:26px; height:26px; color:var(--success); opacity:.85; }
.worklist-calm p{ margin:0; }

/* =====================================================================
   v4.5 — audit event-stream (severity-laned .stream)
   ---------------------------------------------------------------------
   Shared component (templates/partials/audit-stream.php) rendered by BOTH
   the full /admin/audit page and the /admin dashboard panel (.is-compact).
   A table whose every row carries a left severity lane: alarm = red (failed
   login / lockout / suspension), notice = amber (reveal / license / device
   revoke), neutral = quiet hairline. Colour semantics reuse the Carbon
   status tokens — red ONLY ever marks a genuine alarm, never decoration.
   The single orchestrated motion is the newest row's one-shot highlight
   sweep on load (.is-new), fully reduced-motion gated.
   ===================================================================== */

/* ---- Filter bar: severity seg (anchor variant) + facet form ---- */
.audit-filters{ display:flex; flex-direction:column; gap:var(--s4); }
/* Anchor-based .seg (links, not buttons) so filters work with no JS. */
.seg-links{ flex-wrap:wrap; }
.seg-link{ display:inline-flex; align-items:center; text-decoration:none;
  color:var(--text-muted); font-weight:600; font-size:.82rem; padding:6px 14px;
  border-radius:var(--r-sm); transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.seg-link:hover{ color:var(--text); }
.seg-link.active{ background:var(--surface-3); color:var(--text); box-shadow:var(--shadow-sm); }
.audit-facet-form{ display:flex; flex-wrap:wrap; align-items:flex-end; gap:var(--s3); }
.audit-facet-form .field{ margin:0; min-width:150px; flex:1 1 150px; }
.audit-facet-form .field label{ font-family:var(--mono); font-size:.7rem;
  letter-spacing:.06em; text-transform:uppercase; color:var(--text-decor); }
.audit-facet-actions{ display:flex; gap:var(--s2); align-items:center; flex:0 0 auto; }

/* ---- Result summary + pager ---- */
.stream-summary{ color:var(--text-dim); font-size:.8rem; }
.pager{ display:flex; align-items:center; justify-content:center; gap:var(--s3);
  margin-top:var(--s4); padding-top:var(--s4); border-top:1px solid var(--hairline); }
.pager-pos{ font-size:.8rem; color:var(--text-dim); }
.pager .is-disabled{ opacity:.4; pointer-events:none; }

/* ---- The stream table ---- */
.stream-scroll{ overflow-x:auto; }
.stream{ width:100%; border-collapse:separate; border-spacing:0; min-width:560px; }
.stream.is-compact{ min-width:0; }
.stream thead th{ text-align:left; padding:0 var(--s3) var(--s2); border-bottom:1px solid var(--hairline);
  font:600 .66rem/1 var(--mono); letter-spacing:.1em; text-transform:uppercase; color:var(--text-decor); }
.stream tbody td{ padding:var(--s3); border-bottom:1px solid var(--hairline); vertical-align:top; }
.stream tbody tr:last-child td{ border-bottom:0; }
/* Severity lane — a coloured left border on the first cell of each row. */
.stream-row td:first-child{ border-left:3px solid transparent; }
.stream-row.is-alarm td:first-child{ border-left-color:var(--danger); }
.stream-row.is-notice td:first-child{ border-left-color:var(--warning); }
.stream-row.is-neutral td:first-child{ border-left-color:color-mix(in srgb, var(--text-decor) 40%, transparent); }
.stream-row:hover td{ background:var(--surface-2); }

.stream .st-time{ white-space:nowrap; font-size:.76rem; color:var(--text-decor); }
.stream .st-event{ white-space:nowrap; }
.stream .st-action{ display:inline-block; font-size:.72rem; letter-spacing:.03em;
  color:var(--text); background:var(--surface-2); border:1px solid var(--hairline);
  border-radius:var(--r-xs); padding:2px 6px; }
.stream-row.is-alarm .st-action{ color:var(--danger-text);
  background:color-mix(in srgb, var(--danger) 10%, transparent);
  border-color:color-mix(in srgb, var(--danger) 30%, transparent); }
.stream-row.is-notice .st-action{ color:var(--warning-text);
  background:color-mix(in srgb, var(--warning) 12%, transparent);
  border-color:color-mix(in srgb, var(--warning) 32%, transparent); }

/* Actor — initial avatar chip + name/email stack. */
.stream .st-actor{ display:flex; align-items:center; gap:var(--s2); min-width:0; }
.st-avatar{ display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:24px; height:24px; border-radius:var(--r-full); font-family:var(--mono);
  font-size:.72rem; font-weight:600; color:var(--text);
  background:var(--surface-3); border:1px solid var(--hairline); }
.st-avatar.is-system{ color:var(--text-decor); }
.st-actor-meta{ display:flex; flex-direction:column; gap:1px; min-width:0; }
.st-actor-name{ font-size:.84rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.st-actor-mail{ font-size:.7rem; color:var(--text-decor); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.stream .st-target{ font-size:.82rem; color:var(--text-dim); }
.stream .st-muted{ color:var(--text-decor); }

/* Meta/UA disclosure — lightweight native <details> (Wave 3 upgrades to a drawer). */
.st-detail{ font-size:.8rem; }
.st-detail > summary{ cursor:pointer; color:var(--text-decor); list-style:none;
  font-family:var(--mono); font-size:.72rem; letter-spacing:.04em;
  display:inline-flex; align-items:center; gap:4px; border-radius:var(--r-xs);
  transition:color var(--dur-1) var(--ease); }
.st-detail > summary::-webkit-details-marker{ display:none; }
.st-detail > summary::before{ content:"›"; display:inline-block; transition:transform var(--dur-1) var(--ease); }
.st-detail[open] > summary::before{ transform:rotate(90deg); }
.st-detail > summary:hover{ color:var(--text); }
.st-detail:focus-within > summary{ outline:2px solid var(--brand-hi); outline-offset:2px; }
.st-meta{ margin:var(--s2) 0 0; display:grid; gap:2px 0; font-size:.74rem; }
.st-meta > div{ display:grid; grid-template-columns:minmax(72px,auto) 1fr; gap:var(--s2);
  padding:2px 0; border-top:1px solid var(--hairline); }
.st-meta dt{ color:var(--text-decor); }
.st-meta dd{ margin:0; color:var(--text-dim); word-break:break-word; }
.st-meta .st-ua{ white-space:normal; }

/* Newest-event single highlight sweep on load. */
@keyframes st-sweep{ from{ background:color-mix(in srgb, var(--brand) 14%, transparent); } to{ background:transparent; } }
.stream-row.is-new td{ animation:st-sweep 1.6s var(--ease) 1; }
@media (prefers-reduced-motion:reduce){ .stream-row.is-new td{ animation:none; } }

/* =====================================================================
   v4.6 — Mandanten health table (superadmin/tenants)
   ---------------------------------------------------------------------
   The tenants list rendered as a tenant-HEALTH surface: leading .health-dot
   + a whole-row link (CSS stretched-link, so the trailing icon action stays
   clickable), seat .meter + license .runway reused from the v4.2 primitives.
   Reuses Carbon status tokens only — red never decorates. Sticky name column
   under .tbl-scroll on narrow viewports so the anchor stays visible.
   ===================================================================== */

/* Active deep-link filter banner (?expiring / ?at_capacity). */
.filter-note{
  display:flex; align-items:center; justify-content:space-between; gap:var(--s3);
  flex-wrap:wrap; margin:0 0 var(--s4); padding:var(--s2) var(--s3);
  border:1px solid var(--border); border-radius:var(--r-md);
  background:var(--surface-2); color:var(--text-dim); font-size:.82rem;
}
.filter-note .icon{ width:15px; height:15px; vertical-align:-2px; margin-right:2px; }

/* Whole-row link via a stretched pseudo-element on the name cell. On desktop
   the containing block is the (static) <tr> → the overlay covers the full row;
   the sticky name cell on mobile becomes the containing block → the overlay
   covers the always-visible anchor cell. Either way the trailing action, which
   sits above the overlay, stays clickable. */
.tenants-health tbody tr{ position:relative; }
.tn-name{ min-width:180px; }
.tn-name .health-dot{ margin-right:var(--s2); }
.tn-link{ display:inline-flex; flex-direction:column; gap:1px; vertical-align:middle;
  color:var(--text); text-decoration:none; }
.tn-link::after{ content:""; position:absolute; inset:0; z-index:1; }
.tn-link:focus-visible{ outline:none; }
.tenants-health tbody tr:focus-within{ background:var(--surface-2); }
.tn-title{ font-weight:600; }
.tn-sub{ color:var(--text-decor); font-size:.76rem; }
.tn-muted{ color:var(--text-dim); }

/* Meters/runways in the numeric columns align to the right edge. */
.tenants-health .meter,.tenants-health .runway{ width:auto; min-width:112px; max-width:200px;
  margin-left:auto; }
.tenants-health td.text-right{ white-space:nowrap; }
.seat-over{ margin-left:4px; padding:0 5px; border-radius:var(--r-full);
  background:color-mix(in srgb, var(--danger) 18%, transparent); color:var(--danger-text);
  font-size:.68rem; font-weight:700; }

/* Trailing icon actions sit above the stretched link. Zwei Aktionen (ansehen +
   sperren) brauchen eine Zeile: <form> ist block-level und würde sonst stapeln. */
.tn-act{ position:relative; z-index:2; width:1%; white-space:nowrap; text-align:right; }
.tn-act-row{ display:inline-flex; gap:.3rem; align-items:center; justify-content:flex-end; }
.tn-act-row form{ margin:0; }

/* "Als Mandant ansehen" im Kopf der Mandanten-Detailseite. */
.tenant-idh-imp{ margin-top:.75rem; }
.btn-icon.ok:hover{ color:var(--success-text);
  background:color-mix(in srgb, var(--success) 15%, transparent);
  border-color:color-mix(in srgb, var(--success) 30%, transparent); }

/* Sticky name column so the anchor never scrolls off on small screens. */
@media (max-width:768px){
  .tbl-scroll table.tbl.tenants-health thead th:first-child,
  .tbl-scroll table.tbl.tenants-health tbody td:first-child{
    position:sticky; left:0; z-index:3; background:var(--surface);
    box-shadow:1px 0 0 var(--hairline);
  }
  .tbl-scroll table.tbl.tenants-health thead th:first-child{ z-index:4; }
}

/* =====================================================================
   v4.7 — Licenses portfolio (superadmin/licenses)
   ---------------------------------------------------------------------
   A slim mono summary bar heads the list; the table reuses the v4.2
   .runway primitive for the license horizon. Carbon status tokens only —
   red never decorates, only the ≤30-day expiry figure warms to amber.
   ===================================================================== */
.lic-portfolio{
  display:flex; flex-wrap:wrap; gap:var(--s2) var(--s6);
  margin:0 0 var(--s4); padding:var(--s3) var(--s4);
  border:1px solid var(--border); border-radius:var(--r-lg);
  background:var(--surface-2);
}
.lp-seg{ display:flex; align-items:baseline; gap:var(--s2); }
.lp-k{ font-size:.7rem; text-transform:uppercase; letter-spacing:.09em; color:var(--text-decor); }
.lp-v{ font-size:1rem; font-weight:600; color:var(--text); }
.lp-seg.is-warn .lp-v{ color:var(--warning-text); }

.lic-muted{ color:var(--text-dim); }
.licenses-portfolio .runway{ width:auto; min-width:100px; max-width:170px; margin-left:auto; }
.licenses-portfolio td.text-right{ white-space:nowrap; }
.lic-act{ width:1%; white-space:nowrap; text-align:right; }

/* =====================================================================
   v4.8 — Settings SYSTEM-ZUSTAND panel (superadmin/settings)
   ---------------------------------------------------------------------
   public_site (is the marketing site served at all?) and sales_mode (is
   it selling?) are the platform's biggest levers, so they earn their own
   bordered panel above the eyebrowed form sections. Both .seg segmented
   controls are rebuilt on radios (no-JS safe); JS only mirrors the two
   state lines + fires ONE subtle brand pulse when the site is both up and
   Live — red is earned here, reduced-motion opts out. AA in both themes.
   ===================================================================== */
.sysstate{
  margin:0 0 var(--s6); padding:var(--s5);
  border:1px solid var(--border); border-radius:var(--r-lg);
  background:var(--surface-2);
}
.sysstate .form-legend{ margin-bottom:var(--s3); }

/* One labelled lever per row (public-site kill switch, then sales mode). */
.sysstate-row{
  display:flex; align-items:center; justify-content:space-between;
  gap:var(--s4); flex-wrap:wrap; margin-top:var(--s4);
}
.sysstate-row:first-of-type{ margin-top:0; }
.sysstate-k{ color:var(--text); font-weight:600; }

/* Radio-driven segmented control — same skin as the button .seg. */
.seg-radio{ padding:3px; }
.seg-radio .seg-opt{ margin:0; }
.seg-radio input{ position:absolute; opacity:0; width:1px; height:1px; pointer-events:none; }
.seg-radio .seg-opt > span{
  display:inline-flex; align-items:center; justify-content:center;
  padding:6px 16px; border-radius:var(--r-sm);
  color:var(--text-muted); font-weight:600; cursor:pointer;
  transition:background-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.seg-radio .seg-opt:hover > span{ color:var(--text); }
.seg-radio input:checked + span{
  background:var(--surface-3); color:var(--text); box-shadow:var(--shadow-sm);
}
.seg-radio input:focus-visible + span{
  outline:2px solid var(--brand-hi); outline-offset:2px;
}
/* A mode that exists but cannot be chosen yet (sales_mode="live" until the
   register/checkout route ships). Visibly unavailable rather than hidden — and
   it must not keep the affordances of a live option: no hover lift, no pointer.
   The `.is-locked` rules follow the base ones, so they win on equal specificity. */
.seg-radio .seg-opt.is-locked > span{ opacity:.45; cursor:not-allowed; }
.seg-radio .seg-opt.is-locked:hover > span{ color:var(--text-muted); }

/* The "why is it locked" line. Sits under the segmented control, so it is the
   answer to the disabled radio rather than consequence copy for a chosen mode. */
.sysstate-locked{ display:flex; gap:var(--s2); align-items:flex-start; }
.sysstate-locked .icon{ width:15px; height:15px; margin-top:.2em; flex:none; color:var(--text-decor); }
.sysstate-locked code{ font-family:var(--mono); font-size:.85em; }

/* Consequence copy — only the active mode's line shows. */
.sysstate-copy{ margin:var(--s3) 0 0; color:var(--text-dim); font-size:var(--fs-base); line-height:1.5; max-width:60ch; }
.sysstate-copy strong{ color:var(--text); }
.sysstate-copy .c-live{ display:none; }
.sysstate[data-live="1"] .c-soon{ display:none; }
.sysstate[data-live="1"] .c-live{ display:inline; }
.sysstate-copy .c-pub-off{ display:none; }
.sysstate[data-public="0"] .c-pub-on{ display:none; }
.sysstate[data-public="0"] .c-pub-off{ display:inline; }

.sysstate-state{
  display:flex; align-items:center; gap:var(--s2);
  margin-top:var(--s4); padding-top:var(--s3);
  border-top:1px solid var(--hairline);
  color:var(--text-dim); font-size:.85rem;
}
/* The second state line belongs to the same block — one rule, no second hairline. */
.sysstate-state--sub{ margin-top:var(--s2); padding-top:0; border-top:none; }
.sysstate-state .metric{ color:var(--text); letter-spacing:.06em; }

/* The earned red moment: one subtle pulse on flipping to Live. */
@keyframes sysstate-live-pulse{
  0%{ box-shadow:0 0 0 0 var(--brand-soft); border-color:var(--border); }
  40%{ box-shadow:0 0 0 4px var(--brand-soft); border-color:var(--brand); }
  100%{ box-shadow:0 0 0 0 transparent; border-color:var(--border); }
}
.sysstate.flip-live{ animation:sysstate-live-pulse 1s var(--ease) 1; }
@media (prefers-reduced-motion: reduce){
  .sysstate.flip-live{ animation:none; }
}

/* =====================================================================
   v4.10 — tenant identity header (Systembetreiber tenant-edit / drawer)
   ---------------------------------------------------------------------
   Leads /admin/tenants/{id}: the tenant's name + status + copyable host,
   with a compact health strip that reuses the exact .meter / .runway /
   rel_time vocabulary of the /admin/tenants matrix row (one visual
   language across the surface). Renders identically standalone or lifted
   into the right-side .drawer. No motion — only quiet hover colour.
   ===================================================================== */
.tenant-idh{ display:flex; flex-wrap:wrap; align-items:flex-start;
  justify-content:space-between; gap:var(--s5) var(--s6); }
.tenant-idh-main{ min-width:0; }
.tenant-idh-title{ display:flex; align-items:center; flex-wrap:wrap; gap:var(--s3); }
.tenant-idh-title .health-dot{ flex:none; }
.tenant-idh-sub{ display:flex; align-items:center; gap:var(--s2); margin-top:var(--s2); }
.tenant-idh-host{ color:var(--text-muted); text-decoration:none;
  display:inline-flex; align-items:center; gap:.35em;
  transition:color var(--dur-1) var(--ease); }
a.tenant-idh-host:hover{ color:var(--text); }
.tenant-idh-host .icon{ width:14px; height:14px; }

/* Health strip: label/value stack per metric, mono values, tabular nums. */
.tenant-idh-health{ display:flex; flex-wrap:wrap; gap:var(--s5) var(--s6);
  margin:0; align-items:flex-start; }
.tenant-idh-metric{ display:flex; flex-direction:column; gap:var(--s2); min-width:0; }
.tenant-idh-metric dt{ font:600 .66rem/1 var(--mono); letter-spacing:.1em;
  text-transform:uppercase; color:var(--text-decor); }
.tenant-idh-metric dd{ margin:0; font-variant-numeric:tabular-nums;
  color:var(--text); font-size:.9rem; }

/* Add-on entitlement toggle row (BRANDING section). */
.addon-toggle{ margin-top:var(--s5); padding-top:var(--s4);
  border-top:1px solid var(--hairline); gap:var(--s4); }
.addon-toggle .switch{ flex:none; }

/* =====================================================================
   v4.11 — Firmenadmin seat-capacity hero + license status card
   ---------------------------------------------------------------------
   The /team page HERO and the /team/license status card share ONE
   layout: seats on the left (big mono count + wide .meter), the license
   runway on the right (.runway bar + a plain-language "aktiv bis" line).
   Single-tenant chrome (no console skin) that reuses the exact .meter /
   .runway primitives + Carbon status tokens of the operator matrix — so
   the vault-seat vocabulary reads identically across all three surfaces.
   No motion (a fill-width change is not motion); only quiet colour.
   ===================================================================== */
.seat-hero{ display:grid; grid-template-columns:1fr; gap:var(--s5) var(--s6); }
@media (min-width:640px){
  .seat-hero{ grid-template-columns:minmax(0,1.5fr) minmax(0,1fr); align-items:start; }
  .seat-hero-lic{ border-left:1px solid var(--hairline); padding-left:var(--s6); }
}
.seat-hero-seats,.seat-hero-lic{ display:flex; flex-direction:column; gap:var(--s3); min-width:0; }
.seat-hero-count{ font-size:1.55rem; line-height:1.1; font-weight:600; color:var(--text);
  font-variant-numeric:tabular-nums; }
.seat-hero-unit{ font-family:var(--font); font-size:.9rem; font-weight:500;
  color:var(--text-dim); letter-spacing:0; }
.seat-hero .meter,.seat-hero .runway{ width:100%; min-width:0; }
.seat-hero-runline{ margin:0; font-size:.88rem; color:var(--text-dim); }
.seat-hero-note{ margin:var(--s1) 0 0; font-size:.8rem; color:var(--warning-text); }

/* License status card — the header holds the eyebrow + the big status badge;
   the body is the shared .seat-hero grid. */
.lic-status-head{ display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:var(--s3); margin-bottom:var(--s5); }
.lic-status-badge{ font-size:.8rem; }
.lic-status-body{ padding:var(--s5) 0; border-top:1px solid var(--hairline);
  border-bottom:1px solid var(--hairline); }
.lic-status-meta{ margin-top:var(--s5); }

/* =====================================================================
   v4.12 — Impersonation ("Als Mandant ansehen") banner
   ---------------------------------------------------------------------
   Fixed, full-width status bar shown on EVERY authed page while a super-
   admin holds a view-as window. CALM AMBER (--warning), never brand red:
   red stays reserved for genuine alarms, so it never cries wolf here.
   The bar is fixed to the viewport top; body.imp-active pushes the whole
   app down by --imp-h and re-anchors the sticky chrome (topbar, sidebar,
   table headers) below it so nothing overlaps. Only present during the
   rare, deliberate impersonation state — never regresses normal chrome.
   ===================================================================== */
:root{ --imp-h:44px; }
.imp-bar{ position:fixed; top:0; left:0; right:0; z-index:200; height:var(--imp-h);
  display:flex; align-items:center; gap:var(--s3); padding:0 var(--s5);
  background:color-mix(in srgb,var(--warning) 22%, var(--surface));
  color:var(--warning-text); border-bottom:1px solid color-mix(in srgb,var(--warning) 45%, transparent);
  box-shadow:var(--shadow-sm); backdrop-filter:blur(10px) saturate(140%);
  -webkit-backdrop-filter:blur(10px) saturate(140%); font-size:.82rem; }
.imp-bar-ico{ display:inline-flex; flex:none; color:var(--warning-text); }
.imp-bar-ico .icon{ width:16px; height:16px; }
.imp-bar-text{ display:flex; align-items:center; gap:var(--s3); min-width:0; flex-wrap:wrap; }
.imp-bar-label{ font-weight:700; letter-spacing:.01em; }
.imp-bar-tenant{ font-weight:600; color:var(--text); }
.imp-bar-id{ font-family:var(--mono); font-size:.72rem; color:var(--text-dim);
  background:color-mix(in srgb,var(--warning) 12%, transparent); padding:1px 6px;
  border-radius:var(--r-xs); max-width:min(38vw,320px); overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.imp-bar-note{ margin-left:auto; color:var(--warning-text); font-weight:500; opacity:.9; }
.imp-bar-form{ margin:0; flex:none; }
.imp-bar-end{ background:color-mix(in srgb,var(--warning) 30%, var(--surface));
  color:var(--text); border:1px solid color-mix(in srgb,var(--warning) 55%, transparent); }
.imp-bar-end:hover{ background:color-mix(in srgb,var(--warning) 42%, var(--surface)); }
@media (max-width:640px){
  .imp-bar-note{ display:none; }
  .imp-bar-note+.imp-bar-form,.imp-bar-form{ margin-left:auto; }
}
/* Offset the sticky chrome so the fixed bar overlaps nothing. Scoped to the
   impersonation state only — zero effect on the normal layout. */
body.imp-active{ padding-top:var(--imp-h); }
body.imp-active .topbar{ top:var(--imp-h); }
body.imp-active .sidebar{ top:var(--imp-h); height:calc(100vh - var(--imp-h)); }
body.imp-active table.tbl thead th{ top:calc(var(--topbar-h) + var(--imp-h)); }

/* =====================================================================
   v4.13 — Wave-3 PR14: status ribbon · sortable tables · device polish
   ---------------------------------------------------------------------
   Console-only system-status strip (mono live figures under the topbar),
   progressive table-sort affordances, a has-actions hover tint, and the
   device-list trust polish (platform glyph + live/stale dot + paired-on).
   Additive; no class/id renames. Red appears ONLY on a genuine alarm
   (lockouts today) — amber for an expiry warning, else calm neutral.
   ===================================================================== */

/* ---- System-status ribbon (super-admin console only) ---- */
.ribbon{ display:flex; flex-wrap:wrap; align-items:stretch; gap:var(--s2);
  margin:0 0 var(--s6); padding:var(--s2); border:1px solid var(--border);
  border-radius:var(--r-lg); background:var(--surface-2); }
.rb-fig{ display:flex; flex-direction:column; gap:2px; flex:1 1 auto; min-width:120px;
  padding:var(--s2) var(--s4); border-radius:var(--r-md); text-decoration:none;
  color:var(--text); transition:background var(--dur-1) var(--ease); }
.rb-fig:hover{ background:var(--surface-3); }
.rb-fig:focus-visible{ outline:2px solid var(--brand-hi); outline-offset:2px; }
.rb-k{ font:600 .62rem/1 var(--mono); letter-spacing:.12em; text-transform:uppercase;
  color:var(--text-decor); }
.rb-v{ font-size:1.02rem; font-weight:600; color:var(--text); letter-spacing:.02em; }
.rb-fig.is-live .rb-v{ color:var(--success-text); }
.rb-fig.is-warn .rb-v{ color:var(--warning-text); }
.rb-fig.is-alarm .rb-v{ color:var(--danger-text); }
@media (max-width:640px){ .rb-fig{ min-width:calc(50% - var(--s2)); } }

/* ---- Sortable admin table headers (data-sort-type opt-in) ---- */
th.th-sort{ cursor:pointer; user-select:none; -webkit-user-select:none; padding-right:22px; position:relative; }
th.th-sort:hover{ color:var(--text); }
th.th-sort:focus-visible{ outline:2px solid var(--brand-hi); outline-offset:-2px; }
/* Direction caret: dim double-arrow at rest, solid single arrow when active. */
th.th-sort::after{ content:"↕"; position:absolute; right:8px; top:50%; transform:translateY(-50%);
  font-size:.72rem; color:var(--text-decor); opacity:.5; }
th.th-sort[aria-sort="ascending"]::after{ content:"↑"; opacity:1; color:var(--text); }
th.th-sort[aria-sort="descending"]::after{ content:"↓"; opacity:1; color:var(--text); }
th.th-sort.text-right{ padding-right:22px; }

/* ---- Row hover tint on action-bearing tables ---- */
table.tbl.has-actions tbody tr:hover{ background:var(--surface-2); }

/* ---- Copyable operator identifier (subdomain) in the tenants list ---- */
.tn-copy{ position:relative; z-index:2; margin-left:var(--s1); vertical-align:middle;
  opacity:0; transition:opacity var(--dur-1) var(--ease); }
.tenants-health tbody tr:hover .tn-copy,
.tenants-health tbody tr:focus-within .tn-copy,
.tn-copy:focus-visible,.tn-copy.copied{ opacity:1; }
@media (pointer:coarse){ .tn-copy{ opacity:1; } }

/* ---- Device list: platform glyph + live/stale dot + paired-on ---- */
.dev-id{ display:flex; align-items:flex-start; gap:var(--s3); min-width:0; }
.dev-plat{ display:inline-flex; align-items:center; justify-content:center; flex:none;
  width:40px; height:40px; border-radius:var(--r-md); background:var(--surface-2);
  border:1px solid var(--hairline); color:var(--text-dim); }
.dev-plat .icon{ width:20px; height:20px; }
.dev-meta{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.dev-head{ display:flex; align-items:center; gap:var(--s2); flex-wrap:wrap; }
.dev-facts{ display:flex; align-items:center; gap:var(--s4); flex-wrap:wrap;
  font-size:.82rem; color:var(--text-dim); }
.dev-seen{ display:inline-flex; align-items:center; gap:var(--s2); }
.dev-seen .health-dot{ margin:0; }
.dev-paired{ color:var(--text-decor); }
.dev-paired .metric{ color:var(--text-dim); }
.dev-muted{ color:var(--text-dim); }

/* =====================================================================
   v4 W4 — Public-tree theming layer (masterplan §2.1)
   Owner-selectable presets: small, coherent surface/text/border token
   bundles scoped to body.public-tree[data-theme="…"] (and mirrored onto the
   editor's .theme-preview / .theme-swatch so the picker previews the real
   palette). The DEFAULT "Editorial Dark" emits no data-theme, so every
   existing tree renders byte-identical. Presets never touch --brand/--brand-hi
   (the tenant/tree accent, injected inline) — the owner's colour still
   punctuates whichever palette they pick. Light mode is first-class: proper
   inverted surfaces, AA-tuned text, light shadows/inset.
   ===================================================================== */

/* ---- Dark presets ---- */
body.public-tree[data-theme="editorial-dark"],
.theme-preview[data-theme="editorial-dark"],
.theme-swatch[data-theme="editorial-dark"]{
  --bg:#06070A; --bg-2:#0A0C11;
  --surface:#0F1318; --surface-2:#161B22; --surface-3:#202833;
  --glass:rgba(13,17,22,.64);
  --border:rgba(255,255,255,.07); --border-strong:rgba(255,255,255,.14); --hairline:rgba(255,255,255,.05);
  --text:#F5F7FB; --text-muted:#9BA4B4; --text-dim:#8892A3; --text-decor:#69727F;
}
body.public-tree[data-theme="ocean"],
.theme-preview[data-theme="ocean"],
.theme-swatch[data-theme="ocean"]{
  --bg:#071019; --bg-2:#0A1622;
  --surface:#0E1E2C; --surface-2:#152A3B; --surface-3:#1E3A50;
  --glass:rgba(14,30,44,.66);
  --border:rgba(130,200,255,.10); --border-strong:rgba(130,200,255,.18); --hairline:rgba(130,200,255,.07);
  --text:#EAF4FB; --text-muted:#9DB4C6; --text-dim:#8FA8BB; --text-decor:#6A8093;
}
body.public-tree[data-theme="sunset"],
.theme-preview[data-theme="sunset"],
.theme-swatch[data-theme="sunset"]{
  --bg:#150A12; --bg-2:#1D0E19;
  --surface:#251320; --surface-2:#33192B; --surface-3:#452438;
  --glass:rgba(37,19,32,.66);
  --border:rgba(255,170,210,.10); --border-strong:rgba(255,170,210,.18); --hairline:rgba(255,170,210,.07);
  --text:#FBEEF4; --text-muted:#CBA9BD; --text-dim:#BC9AAE; --text-decor:#8E7182;
}
body.public-tree[data-theme="midnight"],
.theme-preview[data-theme="midnight"],
.theme-swatch[data-theme="midnight"]{
  --bg:#080A14; --bg-2:#0C0F1E;
  --surface:#111528; --surface-2:#181D37; --surface-3:#242B4B;
  --glass:rgba(17,21,40,.66);
  --border:rgba(150,165,255,.09); --border-strong:rgba(150,165,255,.16); --hairline:rgba(150,165,255,.06);
  --text:#EEF0FB; --text-muted:#A0A8C8; --text-dim:#9198B8; --text-decor:#6A7191;
}

/* ---- Shared light-mode chrome (shadows/inset/status/scheme) ---- */
body.public-tree[data-theme="editorial-light"],
body.public-tree[data-theme="warm-paper"],
body.public-tree[data-theme="mono"],
body.public-tree[data-theme="mint"],
.theme-preview[data-theme="editorial-light"],
.theme-preview[data-theme="warm-paper"],
.theme-preview[data-theme="mono"],
.theme-preview[data-theme="mint"],
.theme-swatch[data-theme="editorial-light"],
.theme-swatch[data-theme="warm-paper"],
.theme-swatch[data-theme="mono"],
.theme-swatch[data-theme="mint"]{
  color-scheme:light;
  --inset-hi:inset 0 1px 0 0 rgba(255,255,255,.7);
  --shadow-sm:0 1px 2px rgba(16,24,40,.06), 0 1px 1px rgba(16,24,40,.04);
  --shadow:0 6px 18px rgba(16,24,40,.09), 0 2px 6px rgba(16,24,40,.06);
  --shadow-lg:0 24px 56px rgba(16,24,40,.16), 0 8px 20px rgba(16,24,40,.09);
  --success:#198038; --warning:#B28600; --danger:#DA1E28;
}

/* ---- Light presets (palettes) ---- */
body.public-tree[data-theme="editorial-light"],
.theme-preview[data-theme="editorial-light"],
.theme-swatch[data-theme="editorial-light"]{
  --bg:#F6F7F9; --bg-2:#EFF1F5;
  --surface:#FFFFFF; --surface-2:#F6F7F9; --surface-3:#EAEDF2;
  --glass:rgba(255,255,255,.80);
  --hairline:rgba(16,24,40,.06); --border:rgba(16,24,40,.10); --border-strong:rgba(16,24,40,.18);
  --text:#171A21; --text-muted:#4E5766; --text-dim:#6B7587; --text-decor:#8A93A3;
}
body.public-tree[data-theme="warm-paper"],
.theme-preview[data-theme="warm-paper"],
.theme-swatch[data-theme="warm-paper"]{
  --bg:#F4EFE4; --bg-2:#EDE6D6;
  --surface:#FFFCF5; --surface-2:#F4EFE4; --surface-3:#E8E0CF;
  --glass:rgba(255,252,245,.80);
  --hairline:rgba(74,58,30,.07); --border:rgba(74,58,30,.12); --border-strong:rgba(74,58,30,.20);
  --text:#2A2419; --text-muted:#5F5544; --text-dim:#675C48; --text-decor:#978A70;
}
body.public-tree[data-theme="mono"],
.theme-preview[data-theme="mono"],
.theme-swatch[data-theme="mono"]{
  --bg:#FAFAFA; --bg-2:#F1F1F2;
  --surface:#FFFFFF; --surface-2:#F4F4F5; --surface-3:#E7E7EA;
  --glass:rgba(255,255,255,.82);
  --hairline:rgba(0,0,0,.06); --border:rgba(0,0,0,.10); --border-strong:rgba(0,0,0,.18);
  --text:#18181B; --text-muted:#52525B; --text-dim:#5F5F68; --text-decor:#8A8A93;
}
body.public-tree[data-theme="mint"],
.theme-preview[data-theme="mint"],
.theme-swatch[data-theme="mint"]{
  --bg:#EFF5F0; --bg-2:#E4EEE7;
  --surface:#FFFFFF; --surface-2:#EEF5F0; --surface-3:#DEEAE2;
  --glass:rgba(255,255,255,.80);
  --hairline:rgba(20,54,36,.07); --border:rgba(20,54,36,.12); --border-strong:rgba(20,54,36,.20);
  --text:#14241C; --text-muted:#45564C; --text-dim:#556458; --text-decor:#86988C;
}

/* Light-preset pt fixups: soften the overlay grain and keep the generic
   link-chip glyph + "NEU" badge legible on pale surfaces (the default white
   text/accent-hi would wash out). Body-scoped only. */
body.public-tree[data-theme="editorial-light"] .pt-grain,
body.public-tree[data-theme="warm-paper"] .pt-grain,
body.public-tree[data-theme="mono"] .pt-grain,
body.public-tree[data-theme="mint"] .pt-grain{opacity:.035}
body.public-tree[data-theme="editorial-light"] .pt-link-chip:not(.pt-link-chip--brand):not(.has-thumb),
body.public-tree[data-theme="warm-paper"] .pt-link-chip:not(.pt-link-chip--brand):not(.has-thumb),
body.public-tree[data-theme="mono"] .pt-link-chip:not(.pt-link-chip--brand):not(.has-thumb),
body.public-tree[data-theme="mint"] .pt-link-chip:not(.pt-link-chip--brand):not(.has-thumb){
  background:color-mix(in srgb, var(--brand) 12%, var(--surface-3));
  color:color-mix(in srgb, var(--brand) 62%, var(--text));
}
body.public-tree[data-theme="editorial-light"] .pt-new,
body.public-tree[data-theme="warm-paper"] .pt-new,
body.public-tree[data-theme="mono"] .pt-new,
body.public-tree[data-theme="mint"] .pt-new{color:color-mix(in srgb, var(--brand) 72%, #000)}

/* ---- Editor: theme picker + live preview (owner tree settings) ---- */
.settings-theme{margin-top:var(--s4)}
.settings-theme > label{display:block; font-size:.7rem; text-transform:uppercase; letter-spacing:.07em;
  color:var(--text-dim); font-weight:700; margin-bottom:10px}

.theme-live{margin-bottom:var(--s4)}
.theme-preview{position:relative; border-radius:var(--r-xl); overflow:hidden; border:1px solid var(--border);
  background:var(--bg); box-shadow:var(--shadow-sm), var(--inset-hi); padding:0 0 var(--s5)}
.theme-preview-cover{height:54px; background:
  radial-gradient(120% 150% at 50% -20%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
  linear-gradient(180deg, color-mix(in srgb, var(--brand) 8%, var(--bg-2)), var(--bg))}
.theme-preview-body{display:flex; flex-direction:column; align-items:center; gap:9px; margin-top:-26px; padding:0 var(--s5)}
.theme-preview-avatar{width:52px; height:52px; border-radius:var(--r-full); background:var(--grad-brand);
  box-shadow:0 0 0 3px var(--bg), var(--shadow-sm)}
.theme-preview-title{width:120px; height:11px; border-radius:var(--r-full); background:var(--text); opacity:.92}
.theme-preview-sub{width:80px; height:7px; border-radius:var(--r-full); background:var(--text-dim); opacity:.75; margin-bottom:5px}
.theme-preview-card{width:100%; max-width:280px; height:34px; border-radius:var(--r-lg);
  background:var(--glass); border:1px solid var(--border); box-shadow:var(--inset-hi)}
.theme-preview-card.is-featured{height:40px; background:var(--grad-brand); border:none; box-shadow:var(--shadow-sm), var(--inset-hi)}
@media (prefers-reduced-motion:no-preference){
  .theme-preview, .theme-preview-cover, .theme-preview-avatar, .theme-preview-title,
  .theme-preview-sub, .theme-preview-card{transition:background .32s var(--ease), border-color .32s var(--ease)}
}

.theme-pick{display:grid; grid-template-columns:repeat(auto-fill, minmax(126px,1fr)); gap:var(--s3)}
.theme-opt{position:relative; display:flex; flex-direction:column; gap:7px; padding:8px 8px 9px; cursor:pointer;
  border-radius:var(--r-lg); border:1px solid var(--border); background:var(--surface-2);
  transition:border-color 140ms var(--ease), box-shadow 140ms var(--ease), transform 140ms var(--ease)}
.theme-opt input{position:absolute; opacity:0; width:0; height:0}
@media (hover:hover){.theme-opt:hover{border-color:var(--border-strong); transform:translateY(-1px)}}
.theme-opt.is-active{border-color:var(--brand); box-shadow:0 0 0 2px var(--brand-soft)}
.theme-opt:focus-within{outline:2px solid var(--brand-hi); outline-offset:2px}
.theme-swatch{position:relative; display:block; height:56px; border-radius:var(--r-md); overflow:hidden;
  background:var(--bg); border:1px solid var(--border)}
.theme-swatch::before{content:""; position:absolute; left:0; right:0; top:0; height:22px;
  background:linear-gradient(180deg, color-mix(in srgb, var(--brand) 18%, var(--bg-2)), var(--bg))}
.ts-dot{position:absolute; left:9px; top:13px; width:17px; height:17px; border-radius:var(--r-full);
  background:var(--grad-brand); box-shadow:0 0 0 2px var(--bg)}
.ts-row{position:absolute; left:9px; right:9px; height:8px; border-radius:var(--r-full);
  background:var(--glass); border:1px solid var(--border)}
.ts-row.ts-1{top:34px}
.ts-row.ts-2{top:45px; width:60%; background:var(--grad-brand); border:none}
.theme-opt-name{font-weight:650; font-size:.86rem; color:var(--text); line-height:1.15}
.theme-opt-mode{font-size:.64rem; text-transform:uppercase; letter-spacing:.08em; color:var(--text-dim); font-weight:700}

/* =====================================================================
   v4 W5 · "Publikum" — GDPR audience capture (PR 19)
   Public inline e-mail capture block + owner management card. Values-only,
   pt-* / au-* additive classes; no renames.
   ===================================================================== */

/* ---- Public: inline e-mail capture block on the public tree ---- */
.pt-capture{display:flex; flex-direction:column; gap:var(--s3);
  padding:var(--s5); border-radius:var(--r-xl);
  background:var(--glass); border:1px solid var(--border);
  box-shadow:var(--shadow-sm), var(--inset-hi)}
.pt-capture.is-done .pt-capture-row,
.pt-capture.is-done .pt-capture-consent{display:none}
.pt-capture-head{display:flex; gap:var(--s3); align-items:flex-start}
.pt-capture-ico{flex:none; display:grid; place-items:center; width:38px; height:38px;
  border-radius:var(--r-md); color:var(--brand);
  background:color-mix(in srgb, var(--brand) 16%, transparent)}
.pt-capture-ico .icon{width:20px; height:20px}
.pt-capture-copy{display:flex; flex-direction:column; gap:2px; min-width:0}
.pt-capture-title{font-weight:700; font-size:1.02rem; color:var(--text); line-height:1.25}
.pt-capture-sub{font-size:.86rem; color:var(--text-dim); line-height:1.4}
.pt-capture-row{display:flex; gap:var(--s2); flex-wrap:wrap}
.pt-capture-input{flex:1 1 180px; min-width:0; font-size:16px; padding:11px 13px;
  border-radius:var(--r-md); border:1px solid var(--border); background:var(--bg); color:var(--text)}
.pt-capture-input:focus-visible{outline:2px solid var(--brand-hi); outline-offset:1px; border-color:transparent}
.pt-capture-btn{flex:none; display:inline-flex; align-items:center; gap:6px; font-weight:650;
  padding:11px 16px; border-radius:var(--r-md); border:none; cursor:pointer;
  background:var(--brand); color:#fff}
.pt-capture-btn .icon{width:16px; height:16px}
@media (hover:hover){.pt-capture-btn:hover{background:var(--brand-hi)}}
.pt-capture-btn:disabled{opacity:.6; cursor:progress}
.pt-capture-consent{display:flex; gap:8px; align-items:flex-start; font-size:.78rem;
  color:var(--text-dim); line-height:1.4; cursor:pointer}
.pt-capture-consent input{margin-top:2px; flex:none}
.pt-capture-note{margin:0; font-size:.82rem; padding:8px 11px; border-radius:var(--r-md); color:var(--text);
  background:color-mix(in srgb, var(--success) 15%, transparent)}
.pt-capture-note.is-error{background:color-mix(in srgb, var(--danger) 16%, transparent)}
.pt-capture-status{font-size:.82rem; color:var(--text-dim)}
.pt-capture-status.is-ok{color:var(--success)}
.pt-capture-status.is-error{color:var(--danger)}
/* Honeypot: off-screen, never display:none (bots skip that), never focusable. */
.pt-hp{position:absolute !important; left:-9999px !important; width:1px; height:1px; overflow:hidden}

/* ---- Owner: Publikum management card ---- */
.audience-stats{display:flex; gap:var(--s4); align-items:center; flex-wrap:wrap; margin-top:var(--s3)}
.au-stat{display:flex; flex-direction:column; line-height:1.1}
.au-num{font-family:var(--mono); font-size:1.5rem; font-weight:700; color:var(--text); font-variant-numeric:tabular-nums}
.au-lbl{font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; color:var(--text-dim)}
.au-export{margin-left:auto}
.au-blocks{list-style:none; margin:var(--s4) 0 0; padding:0; display:flex; flex-direction:column; gap:var(--s2)}
.au-block{display:flex; align-items:center; gap:var(--s3); padding:9px 12px; border-radius:var(--r-md);
  border:1px solid var(--border); background:var(--surface-2)}
.au-block-ico{flex:none; color:var(--brand); display:grid; place-items:center}
.au-block-ico .icon{width:18px; height:18px}
.au-block-title{font-weight:600; color:var(--text); flex:1; min-width:0;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tv-block-link{cursor:default}

/* =====================================================================
   v4 W5 · "Optimieren" — analytics recommendations strip (PR 20)
   Calm, actionable hints derived from already-recorded link_events. Tone
   left-rail: warn (attention) / info (insight) / ok (all clear). Additive
   opt-* classes, no renames.
   ===================================================================== */
.opt-strip .help{margin-top:calc(-1 * var(--s1))}
.opt-empty{display:flex; align-items:center; gap:var(--s3); padding:var(--s4) var(--s2); color:var(--text-dim)}
.opt-empty .icon{width:22px; height:22px; flex:none; color:var(--text-decor)}
.opt-empty p{margin:0; font-size:.9rem; line-height:1.45}
.opt-list{list-style:none; margin:var(--s3) 0 0; padding:0; display:flex; flex-direction:column; gap:var(--s3)}
.opt-card{display:flex; gap:var(--s3); padding:var(--s4); border-radius:var(--r-md);
  border:1px solid var(--border); border-left:3px solid var(--neutral); background:var(--surface-2)}
.opt-card.opt-warn{border-left-color:var(--warning); background:color-mix(in srgb, var(--warning) 7%, var(--surface-2))}
.opt-card.opt-info{border-left-color:var(--info-hi); background:color-mix(in srgb, var(--info) 6%, var(--surface-2))}
.opt-card.opt-ok{border-left-color:var(--success); background:color-mix(in srgb, var(--success) 7%, var(--surface-2))}
.opt-ico{flex:none; display:grid; place-items:center; width:34px; height:34px; border-radius:var(--r-sm);
  background:var(--surface-3); color:var(--text-dim)}
.opt-ico .icon{width:19px; height:19px}
.opt-card.opt-warn .opt-ico{color:var(--warning-text); background:color-mix(in srgb, var(--warning) 15%, transparent)}
.opt-card.opt-info .opt-ico{color:var(--info-hi); background:color-mix(in srgb, var(--info) 14%, transparent)}
.opt-card.opt-ok .opt-ico{color:var(--success-text); background:color-mix(in srgb, var(--success) 15%, transparent)}
.opt-body{min-width:0; display:flex; flex-direction:column; gap:3px}
.opt-title{margin:0; font-weight:650; font-size:.95rem; color:var(--text); line-height:1.3}
.opt-text{margin:0; font-size:.86rem; color:var(--text-dim); line-height:1.45}
.opt-cta{display:inline-flex; align-items:center; gap:4px; align-self:flex-start; margin-top:var(--s1);
  font-size:.82rem; font-weight:600; color:var(--brand-hi); text-decoration:none}
.opt-cta .icon{width:14px; height:14px}
@media (hover:hover){.opt-cta:hover{text-decoration:underline}}

/* =====================================================================
   Zwei-Klick-Einbettungen (§ 25 Abs. 1 TDDDG)
   Bis zum Klick steht statt des iFrames ein Platzhalter im Rahmen. Der Rahmen
   verliert dafür seine feste Anbieter-Höhe (.is-consent) und wächst mit dem
   Hinweistext; nach dem Klick entfernt das Skript die Klasse wieder, und das
   iFrame bekommt die gewohnte Höhe bzw. das Seitenverhältnis zurück.
   ===================================================================== */
body.public-tree .pt-embed-frame.is-consent{height:auto; aspect-ratio:auto; max-height:none; max-width:none;
  min-height:var(--emh, 152px)}
body.public-tree .pt-embed-consent{display:flex; flex-direction:column; justify-content:center; gap:var(--s2);
  min-height:inherit; padding:var(--s4); box-sizing:border-box; color:var(--text)}
body.public-tree .pt-embed-consent p{margin:0}
body.public-tree .pt-embed-consent-head{display:flex; align-items:center; gap:8px; font-weight:650; letter-spacing:-.01em}
body.public-tree .pt-embed-consent-head .icon{width:16px; height:16px; flex:none; color:var(--text-dim)}
body.public-tree .pt-embed-consent-text{font-size:.82rem; line-height:1.5; color:var(--text-dim)}
body.public-tree .pt-embed-consent-text a{color:var(--text); text-decoration:underline; text-underline-offset:2px}
body.public-tree .pt-embed-consent-actions{display:flex; flex-wrap:wrap; align-items:center; gap:var(--s2) var(--s4)}
body.public-tree .pt-embed-load{min-height:44px; padding:0 18px; border-radius:var(--r-md); border:1px solid var(--border-strong);
  background:var(--surface-2); color:var(--text); font:inherit; font-weight:650; cursor:pointer;
  transition:background-color 140ms var(--ease), border-color 140ms var(--ease)}
body.public-tree .pt-embed-load:focus-visible{outline:2px solid var(--brand-hi); outline-offset:2px}
@media (hover:hover){
  body.public-tree .pt-embed-load:hover{background:var(--surface-3); border-color:var(--brand)}
}
body.public-tree .pt-embed-remember{display:inline-flex; align-items:center; gap:6px; font-size:.78rem; color:var(--text-dim)}

/* „Publikum": wer für die Anmeldung verantwortlich ist — direkt am Formular. */
.pt-capture-controller{margin:0; font-size:.74rem; line-height:1.45; color:var(--text-dim)}
.pt-capture-controller a{color:inherit; text-decoration:underline; text-underline-offset:2px}
.pt-capture.is-done .pt-capture-controller{display:none}
/* Besitzer-Ansicht: einzelne Adressen mit Löschen-Knopf. */
.au-list summary{cursor:pointer; font-weight:600; font-size:.9rem}
.au-addresses{list-style:none; margin:var(--s3) 0 0; padding:0; display:flex; flex-direction:column; gap:var(--s1);
  max-height:360px; overflow:auto}
.au-address{display:flex; align-items:center; gap:var(--s3); padding:6px var(--s2); border-radius:var(--r-sm); background:var(--surface-2)}
.au-address-mail{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-family:var(--font-mono, monospace); font-size:.84rem}
/* Bestätigungs-/Abmeldeseiten: der leise Hinweis unter dem Haupttext. */
.mk-confirm .mk-note{margin:var(--s4) 0 0; font-size:.86rem; color:var(--text-dim)}
.mk-confirm .mk-note a{color:var(--text)}

/* Einfacher Modus (Mandanten-Einstellung): nur Passwörter verwalten. Alles, was
   mit Teilen, öffentlicher Ansicht und Gestaltung zu tun hat, trägt .nur-voll
   und verschwindet. Die Felder bleiben im Formular und behalten beim Speichern
   ihren Wert — beim Zurückschalten ist alles wie vorher. Der Server lehnt das
   Teilen unabhängig davon ab. */
body.modus-einfach .nur-voll{display:none !important}
body:not(.modus-einfach) .nur-einfach{display:none !important}
.einfach-leiste{display:flex; flex-direction:column; align-items:center; gap:var(--s3); margin:0 0 var(--s6); text-align:center}
.einfach-leiste .btn-lg{min-height:52px; padding:0 var(--s6); font-size:1.02rem}
.einfach-leiste .help{margin:0; max-width:46ch}
.tree-root.editing .einfach-leiste{display:none}

/* =====================================================================
   v5 — Erscheinungsbild nach LETSDO-ONE §7 (2026-11-27)

   Gilt für body.kc: App, Anmeldung, Fehlerseiten. Die öffentliche
   Visitenkarte (body.public-tree) und die Landing (body.landing) haben ihre
   eigene Gestaltung und bleiben unberührt.

   Was sich ändert und warum:
   - Flächen und Text aus der gemeinsamen Basis (Nacht #050508, Flächen
     #0E0E13/#18181F, Text #F4F4F6/#A6A7AE) statt der blaustichigen Töne.
   - Space Grotesk für Überschriften, Inter für Text, JetBrains Mono für Daten.
   - Knöpfe 44 px hoch, Radius 4, einfarbig. Keine Verläufe, kein Glanzlauf.
   - Rot leuchtet nur am Boden oder auf einer Kante: der Schein liegt unten am
     Fenster und an der Unterkante der Anmeldekarte, nicht mehr oben im Raum.
   - Aktive Navigation in der Produktnuance von KeyCube (#E8A33C).
   - Einfacher Modus (body.modus-einfach): größere Schrift, Einträge als ruhige
     Zeilen mit Name, Adresse und beschrifteten Knöpfen statt farbiger Balken.

   Klassen und IDs sind unverändert; diese Ebene überschreibt nur Werte.
   ===================================================================== */
@font-face{
  font-family:'Space Grotesk';
  src:url('/assets/fonts/SpaceGrotesk-Variable.woff2') format('woff2');
  font-weight:300 700; font-style:normal; font-display:swap;
}

/* ---- Das Logo: Original aus der CI. Nie runden, maskieren, beschneiden. ---- */
.ld-logo{border-radius:0 !important; flex:none; display:block; max-width:none}
.ld-logo--hell{display:none}
body.theme-light .ld-logo--dunkel{display:none}
body.theme-light .ld-logo--hell{display:block}
.brand img.ld-logo{height:40px; width:40px}
.footer-brand .ld-logo{height:36px; width:36px}

/* ---- Tokens ---- */
body.kc{
  --display:'Space Grotesk','InterVariable','Inter-fallback','Segoe UI',system-ui,sans-serif;
  --keycube:#E8A33C;
  --rot:#E41C22; --rot-hover:#FF3B42; --rot-aktiv:#B4151A;
  --r-xs:2px; --r-sm:4px; --r-md:4px; --r-lg:8px; --r-xl:8px; --r-2xl:12px;
  --topbar-h:4.5rem; --sidebar-w:17rem; --maxw:70rem;   /* in rem: wächst mit der Schriftgröße */
  --grad-brand:var(--brand);
  --brand-glow:transparent; --glow:none; --shadow-brand:none; --inset-hi:0 0 0 0 transparent;
  --ring:0 0 0 3px color-mix(in srgb, var(--keycube) 30%, transparent);
  font-size:1rem; line-height:1.55;
}
body.kc:not(.theme-light){
  --bg:#050508; --bg-2:#050508;
  --surface:#0E0E13; --surface-2:#18181F; --surface-3:#22222B;
  --overlay:#18181F; --glass:rgba(5,5,8,.86); --scrim:rgba(0,0,0,.68);
  --border:rgba(244,244,246,.10); --border-hover:rgba(244,244,246,.18);
  --border-strong:rgba(244,244,246,.26); --hairline:rgba(244,244,246,.07);
  --text:#F4F4F6; --text-muted:#A6A7AE; --text-dim:#A6A7AE; --text-decor:#7A7B84;
  --danger:#FF5A60; --danger-text:#FF5A60;
  --brand-soft:rgba(244,244,246,.07);
  --shadow-sm:none; --shadow:none; --shadow-lg:0 28px 72px rgba(0,0,0,.66);
}
body.kc.theme-light{
  --bg:#F4F4F6; --bg-2:#F4F4F6;
  --surface:#FFFFFF; --surface-2:#F4F4F6; --surface-3:#E8E8EC;
  --overlay:#FFFFFF; --glass:rgba(255,255,255,.9); --scrim:rgba(11,11,14,.42);
  --border:rgba(11,11,14,.12); --border-hover:rgba(11,11,14,.22);
  --border-strong:rgba(11,11,14,.32); --hairline:rgba(11,11,14,.07);
  --text:#0B0B0E; --text-muted:#4B4C54; --text-dim:#4B4C54; --text-decor:#6E6F78;
  --brand-soft:rgba(11,11,14,.06);
  --keycube:#9A6408;                      /* dieselbe Nuance, auf Weiß lesbar */
  --shadow-sm:none; --shadow:none; --shadow-lg:0 24px 60px rgba(11,11,14,.18);
}
@media (max-width:860px){ body.kc{--topbar-h:3.75rem} }

/* ---- Raum: Rot leuchtet am Boden ---- */
body.kc{
  background-color:var(--bg);
  background-image:radial-gradient(90% 260px at 50% 100%, color-mix(in srgb, var(--rot) 15%, transparent), transparent 72%);
  background-repeat:no-repeat; background-attachment:fixed;
}
body.kc.theme-light{background-image:radial-gradient(90% 220px at 50% 100%, color-mix(in srgb, var(--rot) 7%, transparent), transparent 72%)}
body.kc::after{content:none}

/* ---- Schrift ---- */
body.kc h1, body.kc h2, body.kc h3, body.kc h4,
body.kc .page-title, body.kc .tv-title, body.kc .empty-onboard-h{
  font-family:var(--display); font-weight:600; letter-spacing:-.022em; line-height:1.15;
}
body.kc h1, body.kc .page-title{font-size:clamp(1.75rem, 1.45rem + 1vw, 2.25rem); font-weight:700; letter-spacing:-.03em}
body.kc h2{font-size:1.375rem}
body.kc h3{font-size:1.125rem}
body.kc .help{font-size:.875rem; line-height:1.5; color:var(--text-muted)}
body.kc :is(.main, .center-shell) :is(p, .help, li) a:not([class]){
  color:var(--text); text-decoration:underline; text-decoration-color:var(--border-strong); text-underline-offset:3px;
}
body.kc :is(.main, .center-shell) :is(p, .help, li) a:not([class]):hover{text-decoration-color:var(--keycube)}
body.kc :focus-visible{outline:2px solid var(--keycube); outline-offset:2px}

/* ---- Rahmen: Seitenleiste, Kopfzeile, Inhalt ---- */
body.kc .sidebar{background:var(--surface); border-right:1px solid var(--border); padding:var(--s4); gap:2px}
body.kc .kc-brand{min-height:calc(var(--topbar-h) - var(--s4) - var(--s4)); margin-bottom:var(--s4); gap:var(--s3); padding:0 6px}
body.kc .kc-brand img:not(.ld-logo){height:40px; width:auto; border-radius:var(--r-md)}
body.kc .kc-brand-text{display:flex; flex-direction:column; min-width:0; line-height:1.15}
body.kc .kc-brand-name{font-family:var(--display); font-size:1.3125rem; font-weight:700; letter-spacing:-.03em; color:var(--text)}
body.kc .kc-brand-sub{font-size:.8125rem; font-weight:400; letter-spacing:0; color:var(--text-muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}

body.kc .nav-section{font-size:.8125rem; text-transform:none; letter-spacing:0; font-weight:500;
  color:var(--text-decor); margin:var(--s6) 14px var(--s2)}
body.kc .nav-link{min-height:48px; padding:0 14px; gap:var(--s3); border-radius:var(--r-md);
  font-size:1rem; font-weight:500; color:var(--text-muted)}
body.kc .nav-link .icon{width:20px; height:20px}
body.kc .nav-link:hover{background:var(--surface-2); color:var(--text)}
body.kc .nav-link.active{background:var(--surface-2); color:var(--text); font-weight:600}
body.kc .nav-link.active::before{left:0; top:12px; bottom:12px; width:3px; border-radius:0; background:var(--keycube)}
body.kc .nav-link.active .ico{color:var(--keycube)}
body.kc .nav-link:focus-visible{box-shadow:inset 0 0 0 2px var(--keycube)}

body.kc .topbar{background:var(--glass); border-bottom:1px solid var(--border); padding:0 var(--s8); gap:var(--s5)}
body.kc .topbar>strong{font-family:var(--display); font-size:1.125rem; font-weight:600; letter-spacing:-.015em}
body.kc .cmd-trigger{min-height:40px; padding:0 14px; border-radius:var(--r-md); font-size:.9375rem;
  background:var(--surface); border-color:var(--border); color:var(--text-muted)}
body.kc .cmd-trigger:hover{background:var(--surface-2); border-color:var(--border-hover); color:var(--text)}
body.kc .theme-toggle{min-height:40px; padding:0 14px; border-radius:var(--r-md); font-size:.9375rem;
  background:transparent; border-color:var(--border); color:var(--text-muted)}
body.kc .theme-toggle:hover{background:var(--surface-2); border-color:var(--border-hover); color:var(--text)}
body.kc .theme-toggle-ico{color:var(--text-muted)}
body.kc .avatar{width:40px; height:40px; background:var(--surface-2); color:var(--text); border:1px solid var(--border);
  font-family:var(--display); font-weight:600; box-shadow:none}
body.kc .um-name{font-size:.9375rem; color:var(--text-muted)}

body.kc .main{padding:var(--s10) clamp(var(--s5), 4vw, 56px) var(--s6); margin-inline:auto}
body.kc .page-body>h1, body.kc .page-body>.row, body.kc .page-body>.card, body.kc .page-body>.stat-grid,
body.kc .page-body>.grid, body.kc .page-body>#category-list, body.kc .page-body>#tree-grid{animation:none}
body.kc .app{grid-template-columns:var(--sidebar-w) minmax(0,1fr)}
@media (max-width:860px){
  body.kc .app{grid-template-columns:minmax(0,1fr)}
  body.kc .main{padding:var(--s6) var(--s4) var(--s5)}
  body.kc .topbar{padding:0 var(--s4); gap:var(--s3); min-width:0}
  body.kc .topbar>strong{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
  body.kc .topbar>.spacer{display:none}
  /* Schmal: Kopfzeile nur mit Symbolen, jedes 44 px groß. */
  body.kc .cmd-trigger{width:44px; min-height:44px; padding:0; justify-content:center}
  body.kc .cmd-trigger :is(.label, .kbd){display:none}
  body.kc .usermenu{gap:var(--s2)}
  body.kc .usermenu :is(.avatar, .um-name, .um-divider, .theme-toggle-label){display:none}
  body.kc .theme-toggle{width:44px; min-height:44px; padding:0; justify-content:center}
  body.kc .usermenu form .btn{width:44px; min-height:44px; padding:0; gap:0; font-size:0}
}

/* ---- Bauteile ---- */
body.kc .card{background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:none}
body.kc .modal-card, body.kc .picker{box-shadow:var(--shadow-lg)}
body.kc .stat, body.kc .tree-tile{box-shadow:none}
body.kc .stat::after{content:none}

body.kc .btn{min-height:44px; padding:0 18px; border-radius:var(--r-md); font-size:1rem; font-weight:600; letter-spacing:0}
body.kc .btn .icon{width:18px; height:18px}
body.kc .btn-sm{min-height:36px; padding:0 12px; font-size:.9375rem; border-radius:var(--r-md)}
body.kc .btn-lg{min-height:52px; padding:0 24px; font-size:1.0625rem}
body.kc .btn-primary{background:var(--brand); background-image:none; color:#fff; box-shadow:none}
body.kc .btn-primary::after{content:none}
body.kc .btn-primary:active{background:color-mix(in srgb, var(--brand) 80%, #000)}
body.kc .btn-ghost{background:var(--surface-2); border-color:var(--border); color:var(--text)}
@media (hover:hover) and (pointer:fine){
  body.kc .btn:hover{transform:none}
  body.kc .btn-primary:hover{background:color-mix(in srgb, var(--brand) 84%, #fff); background-image:none; box-shadow:none}
  body.kc .btn-ghost:hover{background:var(--surface-3); border-color:var(--border-hover)}
}
body.kc .btn:active{transform:none}
body.kc .btn-icon{border-radius:var(--r-md)}
body.kc .switch input:checked+.slider{background:var(--keycube)}
body.kc .kbd{border-radius:var(--r-xs)}

body.kc .field>label, body.kc .modal-card .field>label{font-size:.9375rem; font-weight:500; color:var(--text-muted); margin-bottom:6px}
body.kc :is(.field, .pw-field, .meta-suggest) :is(input[type=text],input[type=email],input[type=password],input[type=url],
  input[type=search],input[type=number],input[type=date],input[type=datetime-local],input[type=time],input[type=tel],select){
  min-height:48px; padding:0 14px; border-radius:var(--r-md); font-size:1rem;
  background:var(--bg); border:1px solid var(--border-hover);
}
body.kc .field textarea{padding:12px 14px; border-radius:var(--r-md); font-size:1rem; background:var(--bg); border:1px solid var(--border-hover)}
body.kc .pw-field input{padding-right:52px}
body.kc .pw-field .pw-toggle{right:7px; margin-top:-17px}
body.kc :is(.field, .pw-field, .meta-suggest) :is(input, select, textarea):hover{border-color:var(--border-strong)}
body.kc :is(input, select, textarea):focus-visible{outline:2px solid var(--keycube); outline-offset:1px;
  border-color:var(--keycube); box-shadow:none}
body.kc .field-error{color:var(--danger-text); font-size:.9375rem}

body.kc .modal-card{background:var(--surface); border:1px solid var(--border-hover); border-radius:var(--r-lg); padding:var(--s8)}
body.kc .modal-card h3{font-size:1.5rem; display:flex; align-items:center; gap:var(--s3); margin-bottom:var(--s3)}
body.kc .modal-card h3 .icon{width:24px; height:24px; color:var(--keycube); flex:none}
body.kc .subcard-head .icon, body.kc .settings-card .subcard-head .icon{color:var(--keycube)}
body.kc .subcard-head h2, body.kc .subcard-head h3{font-size:1.125rem}

body.kc .tree-tile{display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; column-gap:var(--s4); row-gap:2px;
  padding:var(--s5); border-radius:var(--r-lg); background:var(--surface); border:1px solid var(--border)}
body.kc .tree-tile::before{content:none}
body.kc .tree-tile .tree-icon{grid-row:1 / span 2; width:56px; height:56px; border-radius:var(--r-lg); box-shadow:none}
body.kc .tree-tile .title{font-family:var(--display); font-size:1.25rem; font-weight:600; letter-spacing:-.02em;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
body.kc .tree-tile .meta{font-size:.875rem}
@media (hover:hover) and (pointer:fine){
  body.kc .tree-tile:hover{transform:none; box-shadow:none; background:var(--surface-2); border-color:var(--border-hover)}
}

body.kc .empty-onboard-illu{color:var(--text-decor)}
body.kc .empty-onboard-illu .icon{width:64px; height:64px}
body.kc .empty-onboard-h{font-size:1.75rem}
body.kc .empty-onboard-sub{font-size:1.0625rem; color:var(--text-muted); max-width:44ch}

/* ---- Fuß: leise ---- */
body.kc .footer{padding:var(--s8) 0 var(--s4)}
body.kc .footer::before{left:0; right:0; background:var(--border)}
body.kc .footer-name{font-family:var(--display); font-weight:600; font-size:1rem}
body.kc .footer-tag{font-size:.8125rem; color:var(--text-muted); letter-spacing:0}
body.kc .footer-bavaria-line{font-size:.875rem; font-weight:400; color:var(--text-muted)}
body.kc .footer-copy{font-size:.8125rem; color:var(--text-decor)}
body.kc .footer .heart{animation:none; color:var(--rot)}
body.kc .footer .bavaria{color:inherit; font-weight:600; letter-spacing:.02em}
@media (hover:hover) and (pointer:fine){ body.kc .footer-brand:hover .ld-logo{transform:none} }

/* ---- Anmeldung ---- */
body.kc .center-shell{width:min(480px, 100%)}
body.kc .auth-card{position:relative; overflow:visible; padding:var(--s10) var(--s8) var(--s8)}
/* Die eine Kante, an der Rot leuchtet. */
body.kc .auth-card::after{content:""; position:absolute; inset:auto 10% -1px 10%; height:1px; pointer-events:none;
  opacity:1; z-index:0; border-radius:0; transition:none;
  background:linear-gradient(90deg, transparent, var(--rot) 30%, var(--rot) 70%, transparent);
  box-shadow:0 0 28px 3px color-mix(in srgb, var(--rot) 60%, transparent)}
body.kc .auth-kopf{display:flex; flex-direction:column; align-items:flex-start; gap:var(--s6); margin-bottom:var(--s2)}
body.kc .auth-kopf .ld-logo{height:34px; width:auto}
body.kc .auth-logo-eigen{max-height:56px; width:auto; border-radius:var(--r-md)}
body.kc .auth-produkt{margin:0; font-family:var(--display); font-size:2.5rem; font-weight:700; letter-spacing:-.04em; line-height:1; color:var(--text)}
body.kc .hero .auth-title{margin:0 0 var(--s6); text-align:left; font-family:var(--font); font-size:1.0625rem; font-weight:400;
  letter-spacing:0; line-height:1.5; color:var(--text-muted);
  background:none; -webkit-background-clip:border-box; background-clip:border-box; -webkit-text-fill-color:currentColor}
body.kc .auth-card .text-center{text-align:left}
body.kc .auth-card .btn-primary{min-height:52px; font-size:1.0625rem; margin-top:var(--s2)}
body.kc .auth-fuss{margin:var(--s5) 0 0; font-size:.9375rem}

/* ---- Tree-Seite ---- */
body.kc .tree-root{max-width:47.5rem}
body.kc .tv-avatar{border-radius:var(--r-2xl); box-shadow:none}
body.kc .tv-avatar::after{content:none}
body.kc .tv-title{font-size:2rem; font-weight:700; letter-spacing:-.03em}
body.kc .tv-cat{margin-bottom:var(--s8)}
body.kc .tv-cat-title{font-family:var(--display); font-size:1.0625rem; text-transform:none; letter-spacing:-.01em; font-weight:600; color:var(--text-muted)}
body.kc .tree-root:not(.editing) .tv-cat-head{justify-content:flex-start}
body.kc .tv-link{border-radius:var(--r-md)}
body.kc .edit-switch-track{min-height:44px; padding:0 18px; border-radius:var(--r-md); font-size:1rem; font-weight:600}
body.kc .edit-switch input:checked + .edit-switch-track{background:var(--keycube); color:#0B0B0E; box-shadow:none}
body.kc .item{border-radius:var(--r-lg); background:var(--surface); box-shadow:none}
body.kc .item:hover{box-shadow:none}
body.kc .cred{border-radius:var(--r-md); background:var(--bg); border-color:var(--border)}
body.kc .settings-form .field>label{text-transform:none; letter-spacing:0}
body.kc .cred-lock .icon{color:var(--keycube)}

/* =====================================================================
   Einfacher Modus — der Passwort-Safe für Menschen, die nichts teilen.
   Größer, ruhiger, jede Aktion beschriftet.
   ===================================================================== */
html:has(body.modus-einfach){font-size:112.5%}

body.modus-einfach .tv-hero{display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center;
  column-gap:var(--s5); row-gap:2px; text-align:left; margin-bottom:var(--s5)}
body.modus-einfach .tv-avatar{grid-row:1 / span 2; width:64px; height:64px; margin:0}
body.modus-einfach .tv-avatar .icon{width:32px; height:32px}
body.modus-einfach .tv-title{align-self:end}
body.modus-einfach .tv-meta{justify-content:flex-start; margin:0; align-self:start; font-size:.9375rem; color:var(--text-muted)}
body.modus-einfach .tv-meta .tag{background:none; border:0; padding:0; color:inherit; font-size:inherit}

body.modus-einfach .einfach-leiste{flex-direction:row; align-items:center; gap:var(--s5); text-align:left;
  margin:0 0 var(--s8); padding:var(--s5); background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg)}
body.modus-einfach .einfach-leiste .btn{flex:none}
body.modus-einfach .einfach-leiste .help{flex:1; max-width:none; margin:0; font-size:.875rem}

body.modus-einfach .item-list{gap:var(--s3)}
body.modus-einfach .tree-root:not(.editing) .tv-item{display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center;
  column-gap:var(--s3); row-gap:var(--s4); padding:var(--s4) var(--s5)}
body.modus-einfach .tv-item-row{min-width:0}
body.modus-einfach .tv-link{display:grid; grid-template-columns:48px minmax(0,1fr) auto; grid-template-areas:"ico title ext" "ico host ext";
  align-items:center; column-gap:var(--s4); row-gap:1px; padding:0; background:none; color:var(--text); box-shadow:none; border:0;
  font-weight:400}
body.modus-einfach .tv-link:hover{transform:none; filter:none; box-shadow:none}
body.modus-einfach .tv-link:active{transform:none}
body.modus-einfach .tv-link-ico{grid-area:ico; width:48px; height:48px; border-radius:var(--r-lg); background:var(--surface-2);
  border:1px solid var(--border); display:grid; place-items:center; opacity:1; color:var(--text-muted)}
body.modus-einfach .tv-link-ico .icon{width:22px; height:22px}
body.modus-einfach .tv-link-ico .tv-thumb{width:100%; height:100%; border-radius:inherit}
body.modus-einfach .tv-link-title{grid-area:title; align-self:end; font-family:var(--display); font-size:1.125rem; font-weight:600;
  letter-spacing:-.015em; color:var(--text)}
body.modus-einfach .tv-link-host{grid-area:host; align-self:start; font-family:var(--mono); font-size:.75rem; color:var(--text-muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
body.modus-einfach .tv-link-ext{grid-area:ext; display:inline-flex; align-items:center; gap:var(--s2); min-height:44px; padding:0 14px;
  border:1px solid var(--border); border-radius:var(--r-md); background:transparent; color:var(--text-muted);
  font-size:.875rem; font-weight:600; opacity:1; white-space:nowrap}
body.modus-einfach .tv-link-ext .icon{width:16px; height:16px}
body.modus-einfach .tv-link:hover .tv-link-ext{background:var(--surface-2); border-color:var(--border-hover); color:var(--text)}
body.modus-einfach .tv-link:hover .tv-link-title{text-decoration:underline; text-decoration-color:var(--border-strong); text-underline-offset:4px}

body.modus-einfach .tv-link :is(.new-badge, .feat-badge, .badge){display:none}
body.modus-einfach .tree-root:not(.editing) .tv-item-row:only-child{grid-column:1 / -1}
body.modus-einfach .tree-root:not(.editing) .tv-item:has(.reveal-btn.hidden) .tv-item-row{grid-column:1 / -1}
body.modus-einfach .tree-tile .title{grid-row:1 / span 2}
body.modus-einfach .tree-root:not(.editing) .cred{display:contents}
body.modus-einfach .tree-root:not(.editing) .reveal-btn{grid-column:2; min-height:44px; padding:0 16px; font-size:.875rem;
  background:var(--surface-2); border-color:var(--border-hover)}
body.modus-einfach .tree-root:not(.editing) .cred-revealed{grid-column:1 / -1; gap:var(--s3); padding-top:var(--s4); border-top:1px solid var(--border)}
body.modus-einfach .cred-field{gap:var(--s3); flex-wrap:wrap}
body.modus-einfach .cred-field .k{width:6.5rem; font-size:.875rem; text-transform:none; letter-spacing:0; color:var(--text-muted)}
body.modus-einfach .cred-field .v{flex:1 1 12rem; min-height:44px; display:flex; align-items:center; padding:0 14px; font-size:1rem;
  background:var(--bg); border:1px solid var(--border-hover); border-radius:var(--r-md); overflow-wrap:anywhere}
body.modus-einfach .cred-revealed :is(.copy, .hide-btn){width:auto; height:auto; min-height:44px; padding:0 14px; gap:var(--s2);
  display:inline-flex; align-items:center; border:1px solid var(--border); border-radius:var(--r-md); background:var(--surface-2);
  color:var(--text); font-size:.875rem; font-weight:600}
body.modus-einfach .cred-revealed :is(.copy, .hide-btn)::after{content:none}
body.modus-einfach .cred-revealed :is(.copy, .hide-btn):hover{background:var(--surface-3); border-color:var(--border-hover)}
body.modus-einfach .cred-revealed .hide-btn{align-self:flex-start; background:transparent; color:var(--text-muted)}
body.modus-einfach .cred-revealed .copy.copied{color:var(--success-text); border-color:color-mix(in srgb, var(--success) 40%, transparent)}

body.modus-einfach .tree-root .grid.cols-2{grid-template-columns:minmax(0,1fr)}
@media (max-width:860px){ html:has(body.modus-einfach){font-size:106.25%} }
@media (max-width:720px){
  body.modus-einfach .einfach-leiste{flex-direction:column; align-items:stretch}
  body.modus-einfach .einfach-leiste .btn{white-space:normal; padding:10px 16px; text-align:center}
  body.modus-einfach .tree-root:not(.editing) .tv-item{grid-template-columns:minmax(0,1fr)}
  body.modus-einfach .tree-root:not(.editing) .reveal-btn{grid-column:1; justify-content:center}
  body.modus-einfach .tv-link-ext>span{display:none}
  body.modus-einfach .tv-link-ext{padding:0 12px}
}
@media (prefers-reduced-motion: reduce){ body.kc .btn, body.kc .nav-link{transition:none} }

/* Große Bildschirme (ab 1800 px Fensterbreite): die Spalte steht mittig statt
   links am Rand, und die Schrift wächst mit — sonst wirkt alles verloren klein. */
@media (min-width:1800px){
  html:has(body.kc){font-size:112.5%}
  html:has(body.modus-einfach){font-size:125%}
}
