/* ══════════════════════════════════════
   TOKENS
══════════════════════════════════════ */
:root {
  --bg-0:   #080c09;
  --bg-1:   #0d0f0e;
  --bg-2:   #111512;
  --bg-3:   #171c18;
  --g:      #5cdb7a;
  --g-dim:  rgba(92,219,122,.08);
  --g-mid:  rgba(92,219,122,.14);
  --g-line: rgba(92,219,122,.09);
  --grid-line: rgba(92,219,122,.07);
  --text:   #e8ede9;
  --muted:  #7a8c7d;
  --dim:    #4a5c4d;
  --ff-d:   'Syne', sans-serif;
  --ff-b:   'DM Sans', sans-serif;
  --ff-m:   'DM Mono', monospace;
  --max:    68rem;
}

/* ══════════════════════════════════════
   RESET
══════════════════════════════════════ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
/* The reset above also zeroes the browser's `margin:auto` that centres a modal
   <dialog> — without it every dialog sits in the top-left corner. Restore it
   once, for all dialogs (no per-component transform workarounds), and keep a
   small gutter so a dialog never touches the edges on phones. Sized in % of
   the containing block, not vw/vh: html reserves scrollbar gutters
   (scrollbar-gutter: stable both-edges), so 100vw is wider than the space a
   modal dialog actually gets — it would overflow and sit off-centre. */
dialog:modal{margin:auto;max-width:calc(100% - 1.5rem);max-height:calc(100% - 1.5rem)}
html{scroll-behavior:smooth;background:var(--bg-1);scrollbar-gutter:stable both-edges;color-scheme:dark}
html.light{color-scheme:light}
body{background:transparent;color:var(--text);font-family:var(--ff-b);font-size:1.0625rem;line-height:1.65;-webkit-font-smoothing:antialiased;overflow-x:clip;min-height:100vh;display:flex;flex-direction:column}
/* Sticky footer: #site-footer is the last in-flow flex child, pushed to the
   bottom so it sits at the viewport bottom on short pages and just below the
   content on long ones. (The viewport-locked tools app page is its own case.) */
#site-footer{margin-top:auto}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
button{font-family:inherit;cursor:pointer;border:none;background:none}

/* ══════════════════════════════════════
   GLOBAL BACKGROUND — grid + network fabric
   Fixed to the viewport; content scrolls over it.
   Masked so it fades out toward the edges.
══════════════════════════════════════ */
.bg-fixed{
  position:fixed;inset:0;z-index:-1;pointer-events:none;overflow:hidden;
  -webkit-mask-image:radial-gradient(ellipse 80% 65% at 50% 38%,#000 30%,transparent 82%);
  mask-image:radial-gradient(ellipse 80% 65% at 50% 38%,#000 30%,transparent 82%);
}
.bg-fixed::before{
  content:'';position:absolute;inset:-2px;
  background-image:
    linear-gradient(var(--grid-line) 1px,transparent 1px),
    linear-gradient(90deg,var(--grid-line) 1px,transparent 1px);
  background-size:60px 60px;
  opacity:.6;
}
#bg-cv{position:absolute;inset:0;width:100%;height:100%}

/* ══════════════════════════════════════
   UTIL
══════════════════════════════════════ */
.wrap{max-width:var(--max);margin:0 auto;padding:0 2rem}
@media(max-width:640px){.wrap{padding:0 1rem}}

.label{font-family:var(--ff-m);font-size:.67rem;letter-spacing:.22em;text-transform:uppercase;color:var(--g);display:block;margin-bottom:.85rem}

.h2{font-family:var(--ff-d);font-size:clamp(2rem,4.5vw,3.1rem);font-weight:800;line-height:1.1;letter-spacing:-.03em;margin-bottom:.9rem}

.intro{font-size:1rem;color:var(--muted);max-width:46ch;line-height:1.75;margin-bottom:3rem}

/* ══════════════════════════════════════
   SCROLL REVEAL
══════════════════════════════════════ */
.rv{opacity:0;transform:translateY(1.25rem);transition:opacity .55s ease,transform .55s ease}
.rv.d1{transition-delay:.1s}.rv.d2{transition-delay:.2s}.rv.d3{transition-delay:.3s}
.rv.d4{transition-delay:.4s}.rv.d5{transition-delay:.5s}.rv.d6{transition-delay:.55s}
.rv.in{opacity:1;transform:none}
@media(prefers-reduced-motion:reduce){.rv{opacity:1;transform:none;transition:none}}

/* Subtle 3D tilt on homepage cards — composes with the .rv reveal via --rvy */
.trust-card.rv{--rx:0deg;--ry:0deg;--rvy:1.25rem;transform:translateY(var(--rvy)) perspective(900px) rotateX(var(--rx)) rotateY(var(--ry));transform-style:preserve-3d;will-change:transform;transition:transform .4s cubic-bezier(.23,1,.32,1),opacity .55s ease,background .25s ease,box-shadow .35s ease,border-color .25s ease}
.trust-card.rv.in{--rvy:0px}
.trust-card:hover{box-shadow:0 18px 48px -16px rgba(0,0,0,.5)}
@media(prefers-reduced-motion:reduce){.trust-card.rv{transform:none}}

/* ══════════════════════════════════════
   BTN
══════════════════════════════════════ */
.btn{display:inline-flex;align-items:center;gap:.45rem;font-family:var(--ff-b);font-weight:500;font-size:.9rem;padding:.7rem 1.6rem;border-radius:99px;transition:opacity .2s,transform .15s,background .2s,color .2s;white-space:nowrap}
.btn:hover{transform:translateY(-1px);opacity:.88}
.btn-green{background:var(--g);color:var(--bg-0)}
.btn-ghost{border:1px solid var(--g-line);color:var(--muted)}
.btn-ghost:hover{border-color:rgba(92,219,122,.25);color:var(--text);opacity:1}

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
nav{position:fixed;top:0;left:0;right:0;z-index:100;transition:background .3s,border-color .3s;border-bottom:1px solid transparent}
nav.s{background:rgba(8,12,9,.88);backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);border-color:var(--g-line)}
.nav-i{max-width:var(--max);margin:0 auto;padding:1.2rem 2rem;display:flex;align-items:center;justify-content:space-between;gap:2rem}
.nav-logo{display:inline-flex;align-items:center;flex-shrink:0}
/* SVG wordmark logo (vectorized Syne ExtraBold) — two files, theme-switched */
.logo-svg{height:1.05rem;width:auto;display:block}
.foot-logo .logo-svg{height:.95rem}
.logo-light{display:none}
html.light .logo-dark{display:none}
html.light .logo-light{display:block}
.nav-links{display:flex;gap:2rem;list-style:none}
.nav-links a{font-size:.85rem;color:var(--muted);transition:color .2s}
.nav-links a:hover{color:var(--text)}
.nav-links a[aria-current="page"]{color:var(--g)}
.nav-right{display:flex;align-items:center;gap:.75rem}
.nav-cta{font-size:.78rem;font-family:var(--ff-m);letter-spacing:.07em;padding:.5rem 1.1rem;border:1px solid var(--g);color:var(--g);border-radius:99px;white-space:nowrap;transition:background .2s,color .2s}
.nav-cta:hover{background:var(--g);color:var(--bg-0)}
.nav-only-mobile{display:none}
/* hamburger (mobile only) */
.nav-burger{display:none;flex-direction:column;justify-content:center;gap:5px;width:30px;height:30px;background:none;border:none;cursor:pointer;padding:0}
.nav-burger span{display:block;height:2px;width:21px;margin:0 auto;background:var(--text);border-radius:2px;transition:transform .25s,opacity .2s}
#nav.open .nav-burger span:nth-child(1){transform:translateY(7px) rotate(45deg)}
#nav.open .nav-burger span:nth-child(2){opacity:0}
#nav.open .nav-burger span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}
@media(max-width:860px){
  .nav-links{position:absolute;top:100%;left:0;right:0;flex-direction:column;gap:0;align-items:stretch;background:color-mix(in srgb,var(--bg-1) 97%,transparent);-webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);border-bottom:1px solid var(--g-line);padding:0 2rem;max-height:0;overflow:hidden;opacity:0;visibility:hidden;transition:max-height .3s ease,opacity .25s,padding .3s,visibility .3s}
  #nav.open .nav-links{max-height:85vh;opacity:1;visibility:visible;padding:.4rem 2rem 1rem}
  .nav-links li{padding:.9rem 0;border-bottom:1px solid var(--g-line)}
  .nav-links li:last-child{border-bottom:none}
  .nav-links a{font-size:1rem}
  .nav-only-mobile{display:block}
  .nav-only-desktop{display:none}
  .nav-burger{display:flex}
}

/* Subtle fixed site-status indicator (landing page, bottom-right of viewport) */
.site-status{position:fixed;right:1rem;bottom:1rem;z-index:50;display:inline-flex;align-items:center;gap:.5rem;padding:.4rem .72rem;font-family:var(--ff-m);font-size:.66rem;letter-spacing:.04em;color:var(--muted);background:color-mix(in srgb,var(--bg-2) 86%,transparent);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid var(--g-line);border-radius:99px;text-decoration:none;box-shadow:0 6px 20px -10px rgba(0,0,0,.55);opacity:.82;transition:opacity .25s,border-color .25s}
.site-status:hover{opacity:1;border-color:rgba(92,219,122,.3)}
.ss-dot{width:8px;height:8px;border-radius:50%;background:var(--dim);flex-shrink:0;position:relative}
.site-status.is-ok .ss-dot{background:var(--g)}
.site-status.is-warn .ss-dot{background:#dfb45a}
.site-status.is-down .ss-dot{background:#e06a6a}
.site-status.is-ok .ss-dot::after{content:'';position:absolute;inset:0;border-radius:50%;background:var(--g);animation:sspulse 2.2s ease-out infinite}
@keyframes sspulse{0%{opacity:.55;transform:scale(1)}100%{opacity:0;transform:scale(2.6)}}
@media(max-width:560px){.site-status .ss-label{display:none}.site-status{padding:.45rem}}
@media(prefers-reduced-motion:reduce){.site-status.is-ok .ss-dot::after{animation:none}}

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
#hero{position:relative;min-height:100svh;display:flex;align-items:center}
.hero-c{position:relative;z-index:2;max-width:var(--max);margin:0 auto;padding:8rem 2rem 6rem;width:100%}
.hero-eyebrow{font-family:var(--ff-m);font-size:.65rem;letter-spacing:.24em;text-transform:uppercase;color:var(--g);margin-bottom:1.6rem;display:flex;align-items:center;gap:.7rem}
/* --live-color is set by initStatus() to mirror the bottom-right site-status indicator. */
.live-dot{width:6px;height:6px;border-radius:50%;background:var(--live-color,var(--g));box-shadow:0 0 8px var(--live-color,var(--g));animation:ldot 2.5s ease-in-out infinite}
@keyframes ldot{0%,100%{opacity:1;box-shadow:0 0 8px var(--live-color,var(--g))}50%{opacity:.3;box-shadow:0 0 2px var(--live-color,var(--g))}}

/* one-time theme hint — styled in the COMPLEMENTARY mode (a preview of the other theme) */
.theme-hint{position:fixed;top:4.8rem;right:1rem;max-width:21rem;z-index:200;display:flex;gap:.7rem;align-items:flex-start;border:1px solid;border-left:4px solid;border-radius:.7rem;padding:1rem 1.1rem;font-size:.95rem;line-height:1.5;box-shadow:0 12px 34px rgba(0,0,0,.35);opacity:0;transform:translateY(-8px) scale(.98);transition:opacity .3s,transform .3s}
.theme-hint.show{opacity:1;transform:none}
/* dark UI → light-styled hint (preview of light mode) */
.theme-hint{background:#f4f7f4;color:#16261a;border-color:#d8e3da;border-left-color:#1f9d4d}
/* light UI → dark-styled hint (preview of dark mode) */
html.light .theme-hint{background:#16261a;color:#eaf3ec;border-color:#33453a;border-left-color:#5cdb7a}
.theme-hint-x{background:transparent;border:none;color:inherit;opacity:.6;font-size:1.25rem;line-height:1;cursor:pointer;padding:0 .15rem;flex-shrink:0}
.theme-hint-x:hover{opacity:1}
.hero-h1{font-family:var(--ff-d);font-size:clamp(2rem,8vw,5rem);font-weight:800;line-height:1.06;letter-spacing:-.04em;margin-bottom:1.6rem;max-width:13ch;overflow-wrap:break-word}
.hero-h1 em{font-style:normal;color:var(--g)}
.hero-body{font-size:1.0625rem;color:var(--muted);max-width:42ch;line-height:1.75;margin-bottom:2.5rem}
.hero-acts{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center}

/* ══════════════════════════════════════
   PROBLEME
══════════════════════════════════════ */
#probleme{padding:6rem 0;background:transparent}
/* Probleme cards reuse the trust-card design (see ÜBER / TRUST) */

/* ══════════════════════════════════════
   LEISTUNGEN
══════════════════════════════════════ */
#leistungen{padding:6rem 0;background:transparent}
/* Leistungen phases reuse the trust-card design, laid out in a grid */
.phase-grid{display:grid;grid-template-columns:1fr;gap:1.25rem}
.phase-card{display:flex;flex-direction:column}
.ph-num-big{font-family:var(--ff-d);font-weight:800;font-size:1.4rem;color:var(--g);line-height:1;display:block;margin-bottom:.55rem}
.phase-card h3{font-family:var(--ff-d);font-size:1.05rem;font-weight:700;margin-bottom:.45rem;letter-spacing:-.015em}
.phase-card p{font-size:.86rem;color:var(--muted);line-height:1.65}
.ph-badge{font-family:var(--ff-m);font-size:.58rem;letter-spacing:.1em;text-transform:uppercase;padding:.22rem .6rem;border-radius:99px;align-self:flex-start;white-space:nowrap;margin-top:1rem}
.badge-k{background:var(--g-mid);color:var(--g);border:1px solid rgba(92,219,122,.22)}
.badge-o{background:rgba(255,255,255,.04);color:var(--dim);border:1px solid rgba(255,255,255,.07)}

.ms-box{margin-top:1.5rem;padding:1.75rem 2rem;border:1px solid rgba(92,219,122,.18);border-radius:.5rem;background:var(--bg-2);display:grid;grid-template-columns:1fr auto;gap:2rem;align-items:center}
.ms-box h3{font-family:var(--ff-d);font-size:1.1rem;font-weight:700;margin-bottom:.4rem}
.ms-box p{font-size:.875rem;color:var(--muted);line-height:1.65;max-width:52ch}
.ms-tags{display:flex;flex-wrap:wrap;gap:1rem;margin-top:.75rem}
.ms-tags span{font-family:var(--ff-m);font-size:.62rem;color:var(--dim);letter-spacing:.08em;text-transform:uppercase;display:flex;align-items:center;gap:.35rem}
.ms-tags span::before{content:'●';color:var(--g);font-size:.45rem}

@media(max-width:640px){
  .phase-grid{grid-template-columns:1fr}
  .ms-box{grid-template-columns:1fr}
}
/* very narrow screens: tighter side padding so content isn't over-cramped */
@media(max-width:420px){
  .wrap{padding:0 1.1rem}
  .hero-c{padding:7rem 1.1rem 5rem}
  .nav-i{padding:1rem 1.1rem;gap:1rem}
  .nav-links{padding:0 1.1rem}
  #nav.open .nav-links{padding:.4rem 1.1rem 1rem}
}

/* ══════════════════════════════════════
   ÜBER / TRUST
══════════════════════════════════════ */
#ueber{padding:6rem 0;background:transparent}
.trust-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(16rem,100%),1fr));gap:1.25rem}
.trust-card{padding:1.5rem;background:var(--bg-2);border:1px solid var(--g-line);border-radius:.5rem;transition:border-color .25s,background .25s}
.trust-card:hover{border-color:rgba(92,219,122,.22);background:var(--bg-3)}
.trust-icon{font-size:1.3rem;margin-bottom:.85rem;display:block}
.trust-card h3{font-family:var(--ff-d);font-size:.975rem;font-weight:700;margin-bottom:.4rem;letter-spacing:-.01em}
.trust-card p{font-size:.835rem;color:var(--muted);line-height:1.65}
.trust-tag{font-family:var(--ff-m);font-size:.61rem;color:var(--g);letter-spacing:.08em;margin-top:.6rem;display:inline-block;width:fit-content;text-decoration:none;transition:opacity .2s,transform .2s}
a.trust-tag:hover{opacity:.75;transform:translateX(2px)}

/* ══════════════════════════════════════
   KONTAKT
══════════════════════════════════════ */
#kontakt{padding:6rem 0;background:transparent}
.contact-l{display:grid;grid-template-columns:1fr 1.5fr;gap:4rem;align-items:start}
.contact-l .h2{font-size:clamp(1.7rem,3.5vw,2.5rem)}
.contact-l p{color:var(--muted);font-size:.9375rem;line-height:1.75;margin-bottom:1.25rem}
.c-detail{font-family:var(--ff-m);font-size:.75rem;color:var(--dim);letter-spacing:.05em;display:block;margin-bottom:.35rem}
.c-detail a,.eml a{color:var(--g)}
/* honeypot: off-screen, never shown to humans, hidden from a11y + tab order */
.hp-field{position:absolute!important;left:-9999px!important;width:1px;height:1px;opacity:0;pointer-events:none}
.kontakt-cta{max-width:46rem;margin:0 auto;text-align:center}
.kontakt-cta p{color:var(--muted);font-size:1rem;line-height:1.75;max-width:40rem;margin:0 auto 1.75rem}

.cf{display:flex;flex-direction:column;gap:.9rem}
.f-row{display:grid;grid-template-columns:1fr 1fr;gap:.9rem}
.fg{display:flex;flex-direction:column;gap:.35rem}
.fg label{font-family:var(--ff-m);font-size:.63rem;letter-spacing:.14em;text-transform:uppercase;color:var(--dim)}
.fg input,.fg textarea,.fg select{background:var(--bg-2);border:1px solid var(--g-line);color:var(--text);font-family:var(--ff-b);font-size:.9rem;padding:.65rem 1rem;border-radius:.3rem;outline:none;transition:border-color .2s;width:100%;appearance:none}
.fg input:focus,.fg textarea:focus,.fg select:focus{border-color:rgba(92,219,122,.4)}
.fg textarea{resize:vertical;min-height:7rem}
.f-note{font-size:.78rem;color:var(--dim);line-height:1.55}
.f-status{font-family:var(--ff-m);font-size:.78rem;letter-spacing:.03em;line-height:1.6;display:none}
.f-status.show{display:block}
.f-status.ok{color:var(--g)}
.f-status.err{color:#e06a6a}

@media(max-width:768px){
  .contact-l{grid-template-columns:1fr;gap:3rem}
  .f-row{grid-template-columns:1fr}
}

/* ══════════════════════════════════════
   DIVIDER
══════════════════════════════════════ */
.div{height:1px;background:var(--g-line)}

/* ══════════════════════════════════════
   LEGAL PAGES (Impressum / Datenschutz)
══════════════════════════════════════ */
.legal{padding:9rem 0 6rem;background:transparent}
.legal .h2{margin-bottom:2rem}
.prose{max-width:50rem}
.prose h2{font-family:var(--ff-d);font-size:1.25rem;font-weight:700;letter-spacing:-.015em;margin:2.5rem 0 .75rem}
.prose h3{font-family:var(--ff-d);font-size:1rem;font-weight:700;margin:1.75rem 0 .5rem}
.prose p{color:var(--muted);font-size:.94rem;line-height:1.8;margin-bottom:1rem}
.prose ul{color:var(--muted);font-size:.94rem;line-height:1.8;margin:0 0 1rem 1.25rem}
.prose a{color:var(--g)}
.prose strong{color:var(--text);font-weight:500}
.prose .todo{color:var(--g);background:var(--g-dim);border:1px dashed rgba(92,219,122,.3);padding:.1rem .4rem;border-radius:.25rem;font-family:var(--ff-m);font-size:.85em}
.back-link{font-family:var(--ff-m);font-size:.75rem;letter-spacing:.08em;color:var(--muted);display:inline-block;margin-bottom:2.5rem;transition:color .2s}
.back-link:hover{color:var(--g)}

/* ══════════════════════════════════════
   TOOLS PAGE
══════════════════════════════════════ */
.tools{padding:9rem 0 6rem;background:transparent}
.tools-head{max-width:50rem;margin-bottom:4.5rem}
.tools-head .h2{font-size:clamp(2.2rem,5vw,3.4rem)}

/* Viewport-locked tools app (desktop): header on top, then a two-pane app that
   fills the remaining screen height; sidebar and tool pane scroll independently. */
@media (min-width:861px){
  .tools-app-page{height:100dvh;min-height:0;padding-top:5.25rem;padding-bottom:0;display:flex;overflow:hidden}
  html.has-banner .tools-app-page{height:calc(100dvh - var(--banner-h,0px))}
  .tools-app-page .app-wrap{display:flex;flex-direction:column;flex:1;min-height:0;height:100%;padding-top:0.9rem;padding-bottom:0.75rem}
  .tools-app-page .tools-head{flex:0 0 auto;margin-bottom:0.9rem}
  .tools-app-page .tools-head .label{margin-bottom:0.4rem}
  .tools-app-page .tools-head .h2{font-size:clamp(1.3rem,2.4vw,1.8rem);margin-bottom:0.4rem}
  .tools-app-page .tools-head .intro{font-size:0.82rem;line-height:1.55;margin-bottom:0;max-width:78ch}
  .tools-app-page #tools-app,.tools-app-page #intern-app{flex:1 1 auto;min-height:0}
  .tools-app-page #tools-app>div,.tools-app-page #intern-app>div{height:100%}
}

/* Running-text banner (lib/banner.ts) — first row of the fixed nav; the page
   moves down by its height so nothing sits underneath it */
html.has-banner body{padding-top:var(--banner-h,0px)}
html.has-banner .theme-hint{top:calc(4.8rem + var(--banner-h,0px))}
.site-banner{display:flex;align-items:center;gap:.8rem;min-height:2rem;padding:0 .5rem 0 1rem;
  background:linear-gradient(var(--g-mid),var(--g-mid)),var(--bg-2);border-bottom:1px solid var(--g-line);
  font-family:var(--ff-m);font-size:.78rem;line-height:1.4;color:var(--text)}
.sb-label{flex:0 0 auto;color:var(--g);font-size:.62rem;letter-spacing:.14em;text-transform:uppercase}
.sb-view{flex:1 1 auto;min-width:0;overflow:hidden;white-space:nowrap;outline:none;border-radius:.25rem}
.sb-view:focus-visible{box-shadow:0 0 0 2px rgba(92,219,122,.55)}
.sb-text{display:inline-block;padding-left:100%;animation:sb-marquee var(--sb-dur,20s) linear var(--sb-delay,0s) infinite}
.site-banner:hover .sb-text,.sb-view:focus .sb-text{animation-play-state:paused}
@keyframes sb-marquee{from{transform:translateX(0)}to{transform:translateX(-100%)}}
.sb-x{flex:0 0 auto;width:1.6rem;height:1.6rem;border:none;border-radius:50%;background:transparent;color:var(--muted);font-size:1.05rem;line-height:1;cursor:pointer}
.sb-x:hover,.sb-x:focus-visible{color:var(--text);background:var(--g-dim)}
@media (max-width:600px){.sb-label{display:none}.site-banner{padding-left:.8rem}}
@media print{.site-banner{display:none}html.has-banner body{padding-top:0}}
@media (prefers-reduced-motion:reduce){
  .sb-view{white-space:normal;padding:.35rem 0}
  .sb-text{display:inline;padding-left:0;animation:none}
}

/* printer icon for print buttons (the 🖨 emoji has no text glyph in our fonts → tofu) */
.ic-print{display:inline-block;width:1.05em;height:1.05em;vertical-align:-.15em;margin-right:.4em;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6'/%3E%3Crect x='3' y='9' width='18' height='8' rx='2'/%3E%3Cpath d='M6 14h12v7H6z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6'/%3E%3Crect x='3' y='9' width='18' height='8' rx='2'/%3E%3Cpath d='M6 14h12v7H6z'/%3E%3C/svg%3E") center/contain no-repeat}

/* drag & drop reordering (lib/sortable.ts) */
.sort-handle{display:inline-flex;align-items:center;justify-content:center;width:1.4rem;min-height:1.6rem;flex:0 0 auto;border:none;border-radius:.3rem;background:transparent;color:var(--dim);cursor:grab;touch-action:none;font-size:.95rem;line-height:1;padding:0;user-select:none}
.sort-handle:hover,.sort-handle:focus-visible{color:var(--g);background:var(--g-dim);outline:none}
html.sort-active,html.sort-active *{cursor:grabbing !important;user-select:none}
.sort-dragging{position:relative;z-index:5;opacity:.85;box-shadow:0 8px 24px -10px rgba(0,0,0,.6);background:var(--bg-2);border-radius:.35rem}
.sort-indicator{position:fixed;height:3px;margin-top:-1px;background:var(--g);border-radius:2px;box-shadow:0 0 0 3px var(--g-dim);pointer-events:none;z-index:1200}

/* click-to-copy values (tools/copy.ts) */
.copyable{cursor:copy;border-radius:.25rem;transition:background .15s,box-shadow .15s}
.copyable:hover,.copyable:focus-visible{background:var(--g-dim);box-shadow:0 0 0 2px var(--g-dim);outline:none}
.copyable.copied{animation:copied-flash .7s ease}
@keyframes copied-flash{0%{background:var(--g-mid);box-shadow:0 0 0 3px var(--g-mid)}100%{background:transparent;box-shadow:0 0 0 0 transparent}}

/* Offline / back-online indicator */
.offline-bar{position:fixed;left:50%;bottom:1.25rem;z-index:200;font-family:var(--ff-m);font-size:.8rem;padding:.55rem 1.1rem;border-radius:99px;border:1px solid transparent;transform:translate(-50%,0);transition:opacity .3s ease,transform .3s ease;pointer-events:none;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.offline-bar[data-state='hidden']{opacity:0;transform:translate(-50%,10px)}
.offline-bar[data-state='off']{opacity:1;background:rgba(224,106,106,.16);border-color:#e06a6a;color:#e06a6a}
.offline-bar[data-state='on']{opacity:1;background:var(--g-mid);border-color:rgba(92,219,122,.4);color:var(--g)}

/* Toasts */
.sl-toasts{position:fixed;right:1.25rem;bottom:1.25rem;z-index:210;display:flex;flex-direction:column;gap:.5rem;pointer-events:none}
.sl-toast{font-family:var(--ff-m);font-size:.78rem;padding:.6rem 1rem;border-radius:.5rem;border:1px solid var(--g-line);background:var(--bg-2);color:var(--text);box-shadow:0 8px 24px -8px rgba(0,0,0,.6);opacity:0;transform:translateY(8px);transition:opacity .3s ease,transform .3s ease}
.sl-toast[data-show='true']{opacity:1;transform:none}
.sl-toast[data-kind='ok']{border-color:rgba(92,219,122,.45)}
.sl-toast[data-kind='ok']::before{content:'✓ ';color:var(--g)}
.sl-toast[data-kind='err']{border-color:#e06a6a;color:#e06a6a}

/* BaseSelect — custom listbox dropdown (a themed button + our own popup). Custom
   on purpose: a native <select> can style the closed control but NOT its open
   option menu. Shared by the Svelte component and the vanilla enhancer
   (lib/customSelect.ts), which build the same markup so this styling drives both. */
.bsel{position:relative;min-width:var(--bsel-minw)}
.bsel-native{display:none}
.bsel-btn{display:flex;align-items:center;justify-content:space-between;gap:.6rem;width:100%;min-width:var(--bsel-minw);background:var(--bg-2);color:var(--text);border:1px solid var(--g-line);font-family:var(--ff-m);font-size:.8rem;padding:.55rem .85rem;border-radius:.45rem;outline:none;cursor:pointer;text-align:left;transition:border-color .2s}
.bsel-btn:hover{border-color:rgba(92,219,122,.35)}
.bsel-btn:disabled{opacity:.45;cursor:not-allowed;border-color:var(--g-line)}
/* in-page dialogs (src/lib/dialog.ts) — instead of the browser's alert/confirm/prompt */
.sl-dlg{border:none;padding:0;background:transparent;color:var(--text)}
.sl-dlg::backdrop{background:rgba(0,0,0,.55)}
.sl-dlg-card{background:var(--bg-2);border:1px solid var(--g-line);border-radius:.8rem;padding:1.4rem 1.5rem 1.3rem;width:28rem;max-width:100%;box-shadow:0 18px 50px rgba(0,0,0,.35)}
@media(max-width:480px){.sl-dlg-card{padding:1.2rem 1.1rem 1.1rem}.sl-dlg-actions .btn{flex:1;justify-content:center}}
.sl-dlg-card.danger{border-color:rgba(224,106,106,.55)}
.sl-dlg-title{font-family:var(--ff-d);font-weight:800;font-size:1.05rem;margin:0 0 .7rem;color:var(--text)}
.sl-dlg-text{white-space:pre-line;line-height:1.55;font-size:.92rem;color:var(--muted);margin:0 0 1.1rem}
.sl-dlg-input{width:100%;background:var(--bg-1);border:1px solid var(--g-line);color:var(--text);font-family:inherit;font-size:.9rem;padding:.6rem .8rem;border-radius:.4rem;margin:0 0 1.1rem;outline:none}
textarea.sl-dlg-input{min-height:6.5rem;resize:vertical}
.sl-dlg-input:focus{border-color:rgba(92,219,122,.45)}
.sl-dlg-actions{display:flex;justify-content:flex-end;gap:.6rem;flex-wrap:wrap}
.sl-dlg .btn{padding:.6rem 1.3rem;cursor:pointer;border:none}
.sl-dlg .btn-ghost{border:1px solid var(--g-line);background:transparent}
.btn-danger{background:#d65c5c;color:#fff}
.bsel-btn:focus-visible,.bsel.open .bsel-btn{border-color:rgba(92,219,122,.55)}
.bsel-cur{display:inline-flex;align-items:center;gap:.5rem;min-width:0}
.bsel-cur .bsel-t{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bsel-chev{flex-shrink:0;color:#8a97a8;transition:transform .2s}
.bsel.open .bsel-chev{transform:rotate(180deg)}
.bsel-list{position:absolute;top:calc(100% + .35rem);left:0;right:0;z-index:60;margin:0;padding:.3rem;list-style:none;border:1px solid var(--g-line);border-radius:.5rem;background:color-mix(in srgb,var(--bg-1) 92%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);box-shadow:0 14px 34px -12px rgba(0,0,0,.65);max-height:min(60vh,18rem);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--g-line) transparent;opacity:0;visibility:hidden;transform:translateY(-.3rem);transition:opacity .18s ease,transform .18s ease,visibility .18s}
/* customSelect floats the list (position:fixed + inline top/left/width/max-height) */
.bsel-list.bsel-float{position:fixed;right:auto;z-index:1000}
.bsel.up:not(.open) .bsel-list{transform:translateY(.3rem)}
/* visible at once when opening (only the closing waits for the fade): focus()
   on the searchable list's field fails while visibility is still mid-transition */
.bsel.open .bsel-list{opacity:1;visibility:visible;transform:none;transition:opacity .18s ease,transform .18s ease,visibility 0s}
/* a closed in-flow list must not exist for layout: hidden-but-positioned it
   still stretched scroll containers (catalog table scrolled into nothing).
   Floating lists (customSelect, position:fixed) are measured before opening
   and never stretch anything, so they keep the visibility approach. */
.bsel:not(.open) .bsel-list:not(.bsel-float){display:none}
@starting-style{.bsel.open .bsel-list{opacity:0;transform:translateY(-.3rem)}}
.bsel-list::-webkit-scrollbar{width:6px}
.bsel-list::-webkit-scrollbar-thumb{background:var(--g-line);border-radius:99px}
.bsel-opt{display:flex;align-items:center;gap:.5rem;padding:.5rem .7rem;border-radius:.35rem;font-family:var(--ff-m);font-size:.8rem;color:var(--muted);cursor:pointer;scroll-margin:.35rem}
.bsel-opt .bsel-t{flex:1;min-width:0}
.bsel-opt:hover,.bsel-opt.active{background:var(--bg-2);color:var(--text)}
.bsel-opt.sel{color:var(--g)}
.bsel-opt.bsel-dis{opacity:.45;cursor:not-allowed}
.bsel-opt.bsel-dis:hover{background:transparent;color:var(--muted)}
.bsel-check{color:var(--g);font-size:.85rem;flex-shrink:0}
/* searchable BaseSelect: filter field pinned at the top of the open list */
.bsel-search{position:sticky;top:-.3rem;z-index:1;margin:-.3rem -.3rem .3rem;padding:.4rem;background:var(--bg-1);border-bottom:1px solid var(--g-line)}
.bsel-search input{width:100%;background:var(--bg-2);border:1px solid var(--g-line);color:var(--text);font-family:var(--ff-m);font-size:.8rem;padding:.45rem .65rem;border-radius:.35rem;outline:none}
.bsel-search input:focus{border-color:rgba(92,219,122,.45)}
.bsel-empty{padding:.5rem .7rem;font-family:var(--ff-m);font-size:.76rem;color:var(--dim)}
.bsel-opt:not(.sel) .bsel-check{visibility:hidden}
/* On the contact form, match the surrounding text fields (body font, larger). */
.fg .bsel{width:100%}
.fg .bsel-btn{font-family:var(--ff-b);font-size:.9rem;padding:.65rem 1rem;border-radius:.3rem}
.fg .bsel-list{border-radius:.35rem}
.fg .bsel-opt{font-family:var(--ff-b);font-size:.88rem}

/* Collapsible methodology / assumptions block (used inside tools) */
.methodik{margin-top:1.5rem;border-top:1px solid var(--g-line);padding-top:1rem}
.methodik summary{font-family:var(--ff-m);font-size:.66rem;letter-spacing:.1em;text-transform:uppercase;color:var(--dim);cursor:pointer;list-style:none}
.methodik summary::-webkit-details-marker{display:none}
.methodik summary::before{content:'+ ';color:var(--g)}
.methodik[open] summary::before{content:'– '}
.methodik summary:hover{color:var(--g)}
.methodik .mk{font-size:.76rem;color:var(--dim);line-height:1.65;margin-top:.8rem}
.methodik .mk p{margin-bottom:.5rem}
.methodik .mk a{color:var(--muted);text-decoration:underline}
.methodik .mk strong{color:var(--muted)}

/* Run controls (start / pause / reset) shared by simulations */
.runbar{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap}
.runbar button{font-family:var(--ff-m);font-size:.75rem;letter-spacing:.04em;border-radius:99px;padding:.5rem 1.1rem;background:transparent;border:1px solid var(--g-line);color:var(--muted);transition:all .2s}
.runbar button:hover{border-color:var(--g);color:var(--g)}
.runbar button.primary{background:var(--g);border-color:var(--g);color:var(--bg-0)}
.runbar button.primary:hover{opacity:.88;color:var(--bg-0)}
.runbar button:disabled{opacity:.4;cursor:not-allowed}

/* ══════════════════════════════════════
   LIGHT MODE
══════════════════════════════════════ */
html.light {
  --bg-0:   #e3eae5;
  --bg-1:   #eef3f0;
  --bg-2:   #f7faf8;
  --bg-3:   #e3eae5;
  --g:      #1f9d4d;
  --g-dim:  rgba(31,157,77,.1);
  --g-mid:  rgba(31,157,77,.16);
  --g-line: rgba(0,0,0,.1);
  --grid-line: rgba(0,0,0,.06);
  --text:   #0a160d;
  --muted:  #314c3c;
  --dim:    #5d7468;
}
html.light body{background:transparent}
html.light nav.s{background:rgba(244,247,245,.92);border-color:rgba(0,0,0,.07)}
html.light .btn-green{color:#070f08}
html.light .btn-ghost{border-color:rgba(0,0,0,.12);color:var(--muted)}
html.light .btn-ghost:hover{border-color:rgba(50,140,80,.3);color:var(--text);opacity:1}

/* ══════════════════════════════════════
   DUSK MODE ("Dämmerung") — the blue hour: its own palette, not a lighter
   dark. Brightness comes from colour, not from lifting greys: a saturated
   twilight blue, a sky gradient with a faint warm horizon and periwinkle
   lines; the green stays exactly the logo green (#5cdb7a, as in Dunkel).
   Dark-family on purpose (color-scheme stays dark, no .light overrides apply),
   so canvases and components keep their dark-mode drawing.
══════════════════════════════════════ */
html.dusk {
  --bg-0:   #161c2b;
  --bg-1:   #1c2335;
  --bg-2:   #242c42;
  --bg-3:   #2d3651;
  --g:      #5cdb7a;                /* the logo green — same as Dunkel */
  --g-dim:  rgba(92,219,122,.10);
  --g-mid:  rgba(92,219,122,.17);
  --g-line: rgba(160,172,255,.16);
  --grid-line: rgba(150,165,255,.07);
  --text:   #eceaf4;
  --muted:  #a6abc7;
  --dim:    #767d9f;
  background:#1c2335;
}
/* the sky: cool zenith → deeper blue → a breath of sunset at the horizon. Its
   own fixed layer behind the grid (.bg-fixed is z -1), reaching past the
   scrollbar gutters (html reserves them on both edges) — a fixed html
   background left them as dark strips. */
html.dusk body::before{
  content:"";position:fixed;inset:0 -24px;z-index:-2;pointer-events:none;
  /* glows stay clear of the side edges: the gutters can only show the flat
     html colour, so the sky meets them in that same colour */
  background:
    radial-gradient(42% 60% at 50% 115%, rgba(255,150,112,.17), transparent 100%),
    radial-gradient(38% 40% at 50% -12%, rgba(126,140,255,.15), transparent 100%),
    linear-gradient(180deg, #1b2134 0%, #1c2335 50%, #1e2237 100%);
}
html.dusk nav.s{background:rgba(26,32,52,.8);border-color:var(--g-line)}
html.dusk footer{background:rgba(22,28,43,.92)}

/* ── Theme toggle ── */
#theme-btn{
  width:34px;height:34px;border-radius:50%;
  background:var(--g-dim);border:1px solid var(--g-line);
  color:var(--muted);display:inline-flex;align-items:center;
  justify-content:center;cursor:pointer;
  transition:background .2s,color .2s,border-color .2s;flex-shrink:0
}
#theme-btn:hover{background:var(--g-mid);color:var(--text)}
/* theme picker (src/lib/theme.ts) — floats under the nav button */
.theme-menu{position:fixed;z-index:300;min-width:11.5rem;padding:.3rem;display:flex;flex-direction:column;gap:.1rem;border:1px solid var(--g-line);border-radius:.6rem;background:color-mix(in srgb,var(--bg-2) 94%,transparent);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);box-shadow:0 14px 34px -12px rgba(0,0,0,.55)}
.theme-menu button{display:flex;align-items:center;gap:.6rem;width:100%;padding:.5rem .6rem;border-radius:.4rem;font-family:var(--ff-m);font-size:.78rem;color:var(--muted);text-align:left}
.theme-menu button:hover,.theme-menu button:focus-visible{background:var(--g-dim);color:var(--text);outline:none}
.theme-menu button[aria-checked="true"]{color:var(--g)}
.theme-menu .tm-swatch{width:.95rem;height:.95rem;border-radius:50%;border:1px solid var(--g-line);flex-shrink:0}
.theme-menu .tm-check{margin-left:auto;opacity:0}
.theme-menu button[aria-checked="true"] .tm-check{opacity:1}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
footer{background:var(--bg-0);border-top:1px solid var(--g-line);padding:2rem}
.foot-i{max-width:var(--max);margin:0 auto;display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:1rem}
.foot-logo{display:inline-flex;align-items:center}
.foot-links{display:flex;flex-wrap:wrap;gap:1.5rem;list-style:none}
.foot-links a{font-size:.8rem;color:var(--dim);transition:color .2s}
.foot-links a:hover{color:var(--muted)}
.foot-copy{font-family:var(--ff-m);font-size:.62rem;color:var(--dim);letter-spacing:.05em}

/* success notes fade out (lib/flash.ts): appear, stay a moment, fade */
.msg.msg-flash{animation:msg-in .35s ease-out}
.msg.msg-fading{opacity:0;transition:opacity .6s ease}
@keyframes msg-in{from{opacity:0;transform:translateY(-2px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion: reduce){.msg.msg-flash{animation:none}.msg.msg-fading{transition:none}}

/* long text (notes, assumptions, descriptions): one line to start, grows with its
   lines up to 40 % of the screen — src/lib/autogrow.ts does it where field-sizing is missing */
textarea.grow{field-sizing:content;min-height:2.5em;max-height:40vh;resize:vertical;overflow-y:auto;line-height:1.45}

/* a part of the website switched off (src/lib/sections.ts): „im Aufbau“ instead of its content */
.uc{min-height:calc(100vh - 12rem);padding:8rem 1.25rem 5rem;display:flex;align-items:center;justify-content:center;box-sizing:border-box}
.uc-box{width:100%;max-width:38rem;margin:0 auto;border:1px solid var(--g-line);border-radius:.8rem;background:var(--bg-1);padding:2rem 2.2rem;text-align:center}
.uc-tag{font-family:var(--ff-m);font-size:.7rem;letter-spacing:.12em;color:var(--g);text-transform:uppercase}
.uc-box h1{font-family:var(--ff-d);font-size:1.6rem;margin:.6rem 0 .7rem;line-height:1.2}
.uc-box p{color:var(--muted);line-height:1.65}
.uc-links{display:flex;gap:.7rem;flex-wrap:wrap;margin-top:1.3rem;justify-content:center}

  /* Only the badge is component-specific; everything else uses global.css. */
  .nav-badge.svelte-fkvc1s { font-family: var(--ff-m); font-size: 0.62rem; letter-spacing: 0.14em; color: var(--g); border: 1px solid var(--g-line); border-radius: 99px; padding: 0.2rem 0.6rem; white-space: nowrap; }
  /* phones: logo + badge + theme + "Abmelden" + burger don't fit — the page says "// INTERN" right below anyway */
  @media (max-width: 480px) { .nav-badge.svelte-fkvc1s { display: none; } }
