/* Dunkelmodus: aktiv mit <html data-theme="dark"> */
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{
  --paper:#1F1719;--fog:#2A2024;--sand:#2A2024;--espresso:#EFE6DA;--ink:#EFE6DA;
  --muted:#CBBFB3;--text-soft:#CBBFB3;--line:rgba(239,230,218,.26);--line-strong:rgba(239,230,218,.5);
  --rose:#D68F9A;--burgundy:#B0636F;--charcoal:#2A1B20;--accent:#D68F9A;--accent-2:#B0636F;--accent-3:#D68F9A;
  background-color:#1F1719;color:#EFE6DA;
}
html[data-theme="dark"] body header{background:rgba(31,23,25,.8);border-bottom-color:rgba(239,230,218,.5)}
@media(max-width:900px){html[data-theme="dark"] body header .navlinks{background:rgba(31,23,25,.97)}}
html[data-theme="dark"] body .closing{background:#2A1B20;color:#EFE6DA}
html[data-theme="dark"] body .closing .cta-btn{background:#EFE6DA;border-color:#EFE6DA;color:#1F1719}
html[data-theme="dark"] body .closing .cta-btn:hover{background:#D68F9A;border-color:#D68F9A;color:#1F1719}
html[data-theme="dark"] body footer{background:#140E10;color:#EFE6DA}
html[data-theme="dark"] body footer .mono,html[data-theme="dark"] body footer a{color:#EFE6DA}
html[data-theme="dark"] body .marquee-strip{background:#2F2327;color:#EFE6DA}
html[data-theme="dark"] body .cta-btn.leaf-cta{background:#B0636F;border-color:#B0636F;color:#1F1719}
html[data-theme="dark"] body .leaf-cta .vine svg{fill:#6F9C82}
html[data-theme="dark"] body input,html[data-theme="dark"] body textarea,html[data-theme="dark"] body select{background:rgba(239,230,218,.06);color:#EFE6DA;border-color:rgba(239,230,218,.4)}
html[data-theme="dark"] body input::placeholder,html[data-theme="dark"] body textarea::placeholder{color:#B5A99D}
html[data-theme="dark"] body input:-webkit-autofill,html[data-theme="dark"] body textarea:-webkit-autofill{-webkit-box-shadow:0 0 0 40px #2A2024 inset;-webkit-text-fill-color:#EFE6DA}
html[data-theme="dark"] body .brand-logo-img,html[data-theme="dark"] body .signature-img{filter:brightness(1.45) saturate(.9)}
html[data-theme="dark"] body img.bot-leaf,html[data-theme="dark"] body .bot-leaf{filter:invert(.92)}
html[data-theme="dark"] body img.bot-leaf[src*="gruen"]{filter:brightness(2.1) saturate(.9)}

/* Hintergrund: flach + feines Korn (beide Modi) */
body[data-layout],body[data-sub]{background-image:url('grain-dunkel.png');background-size:256px 256px;background-attachment:fixed}
html[data-theme="dark"] body[data-layout],html[data-theme="dark"] body[data-sub]{background-color:#1F1719}

/* Umschalter */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:30px;height:28px;margin-right:8px;padding:0;background:transparent;color:var(--espresso,#2A2220);border:1.3px solid var(--espresso,#2A2220);border-radius:3px;cursor:pointer;vertical-align:middle}
.theme-toggle:hover{background:var(--espresso,#2A2220);color:var(--paper,#EFE6DA)}
.theme-toggle svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8}
.theme-toggle .ico-sun{display:none}
html[data-theme="dark"] .theme-toggle .ico-sun{display:block}
html[data-theme="dark"] .theme-toggle .ico-moon{display:none}
.theme-toggle:focus-visible{outline:2px solid #B0636F;outline-offset:3px}

/* Mobil: zwei kleine Buttons unten rechts (Sprache, Hell/Dunkel) */
.header-sub{display:none}
@media(max-width:900px){
  .header-sub{display:flex;flex-direction:row;align-items:center;gap:8px;position:fixed;right:12px;bottom:14px;z-index:40}
  .sub-lang{position:relative}
  .sub-open,.header-sub .theme-toggle{width:34px;height:34px;padding:0;margin:0;border-radius:50%;background:var(--paper,#EFE6DA);color:var(--espresso,#2A2220);border:1.3px solid var(--espresso,#2A2220);cursor:pointer;opacity:.7;box-shadow:0 2px 8px rgba(0,0,0,.15)}
  .sub-open{font:11px/1 inherit;letter-spacing:.04em}
  .header-sub.open .sub-open{opacity:1}
  .sub-panel{display:none;position:absolute;right:0;bottom:calc(100% + 8px);padding:8px;background:var(--paper,#EFE6DA);border:1px solid var(--espresso,#2A2220);border-radius:8px;box-shadow:0 4px 14px rgba(0,0,0,.2)}
  .header-sub.open .sub-panel{display:block}
  .sub-panel .lang-switch{flex-direction:column;gap:5px;font-size:11px}
  .sub-panel .lang-switch a{display:block;width:38px;padding:5px 0;text-align:center}
}

/* Mobil: Nach-oben-Pfeil */
.to-top{display:none}
@media(max-width:900px){
  .to-top{display:flex;align-items:center;justify-content:center;position:fixed;left:20px;bottom:calc(26px + env(safe-area-inset-bottom,0px));width:30px;height:30px;padding:0;z-index:40;background:transparent;color:var(--espresso,#2A2220);border:0;cursor:pointer;opacity:0;pointer-events:none;transition:opacity .25s}
  .to-top.show{opacity:.55;pointer-events:auto}
  .to-top svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
}

/* Mobil: rechts unter dem Header: Hell/Dunkel, darunter Hamburger (Stil wie Sprachbuttons) */
@media(max-width:900px){
  body > .theme-toggle,body .nav-toggle{position:fixed!important;right:20px;z-index:60;width:37px!important;height:30px!important;margin:0;padding:0;background-color:rgba(239,230,218,.55);border:1.3px solid var(--espresso,#2A2220)!important;border-radius:2px!important;box-shadow:none!important;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
  html[data-theme="dark"] body > .theme-toggle,html[data-theme="dark"] body .nav-toggle{background-color:rgba(31,23,25,.55)}
  body > .theme-toggle{bottom:calc(26px + 40px + env(safe-area-inset-bottom,0px));display:flex;color:#2A2220}
  html[data-theme="dark"] body > .theme-toggle{color:#EFE6DA}
  body > .theme-toggle svg{stroke:currentColor}
  body > .theme-toggle svg{width:14px;height:14px}
  body .nav-toggle{bottom:calc(26px + env(safe-area-inset-bottom,0px));display:block!important;overflow:hidden;
    background-image:linear-gradient(#2A2220,#2A2220),linear-gradient(#2A2220,#2A2220),linear-gradient(#2A2220,#2A2220);
    background-size:15px 1px;background-repeat:no-repeat;background-position:center 8px,center 13px,center 18px}
  html[data-theme="dark"] body .nav-toggle{background-image:linear-gradient(#EFE6DA,#EFE6DA),linear-gradient(#EFE6DA,#EFE6DA),linear-gradient(#EFE6DA,#EFE6DA)}
  body .nav-toggle span{display:none!important}
  body .nav-toggle::before,body .nav-toggle::after{content:"";display:none;position:absolute;left:50%;top:50%;width:16px;height:1px;background:#2A2220;margin:-.5px 0 0 -8px}
  html[data-theme="dark"] body .nav-toggle::before,html[data-theme="dark"] body .nav-toggle::after{background:#EFE6DA}
  body.nav-is-open .nav-toggle{background-image:none}
  body.nav-is-open .nav-toggle::before{display:block;transform:rotate(45deg)}
  body.nav-is-open .nav-toggle::after{display:block;transform:rotate(-45deg)}
}

/* Mobil: Menü als Kästchen über dem Hamburger (unten rechts); Nach-oben-Pfeil rechts über dem Farbbutton */
@media(max-width:900px){
  body > .navlinks{display:none!important}
  body.nav-is-open > .navlinks{display:flex!important;position:fixed;right:20px;bottom:calc(26px + 30px + 10px + env(safe-area-inset-bottom,0px));left:auto;top:auto;z-index:59;flex-direction:column;align-items:stretch;gap:0;min-width:200px;max-height:calc(100vh - 160px);overflow-y:auto;padding:6px 20px 14px;background:var(--paper,#EFE6DA);border:1.3px solid var(--espresso,#2A2220);border-radius:2px;box-shadow:0 6px 20px rgba(0,0,0,.25)}
  body > .navlinks a{padding:12px 0;border-bottom:1px solid var(--line,rgba(42,34,32,.2))}
  body > .navlinks a:last-child{border-bottom:0}
  body > .navlinks .mobile-only-cta{display:block!important;margin-top:10px;text-align:center}
  .to-top{left:auto;right:20px;bottom:calc(26px + 40px + 40px + env(safe-area-inset-bottom,0px));width:37px}
}
@media(max-width:900px){
  body.nav-is-open > .theme-toggle,body.nav-is-open > .to-top{display:none!important}
  body.nav-is-open > .navlinks{min-width:250px;padding:8px 24px 18px;font-size:14px}
  body > .navlinks a{padding:15px 0;font-size:14px}
  body > .navlinks .mobile-only-cta{font-size:14px;padding:14px 18px}
}
@media(max-width:900px){
  body > .theme-toggle,body > .theme-toggle:hover,body > .theme-toggle:active,body > .theme-toggle:focus{background:rgba(239,230,218,.55)!important;color:#2A2220!important}
  html[data-theme="dark"] body > .theme-toggle,html[data-theme="dark"] body > .theme-toggle:hover,html[data-theme="dark"] body > .theme-toggle:active,html[data-theme="dark"] body > .theme-toggle:focus{background:rgba(31,23,25,.55)!important;color:#EFE6DA!important}
  body > .theme-toggle svg{width:19px;height:19px}
}
.theme-toggle svg{width:17px;height:17px}

html[data-theme="dark"] body .hero-sub,html[data-theme="dark"] body .about-body,html[data-theme="dark"] body .idx-desc,html[data-theme="dark"] body[data-layout] .hero-sub,html[data-theme="dark"] body[data-layout] .about-body,html[data-theme="dark"] body[data-layout] .idx-desc,html[data-theme="dark"] body[data-sub] .hero-sub,html[data-theme="dark"] body[data-sub] .about-body,html[data-theme="dark"] body[data-sub] .idx-desc{background:transparent!important;background-image:none!important;box-shadow:none!important}
