/* Klassenzimmer auf dem Handy (Dezember 2026). Nur schmale Bildschirme; am Computer bleibt alles gleich. */
.mtop,.mnav,.mscrim{display:none}

@media (max-width:760px){
  #home{grid-template-columns:1fr!important;grid-template-rows:auto minmax(0,1fr) auto!important;grid-template-areas:"top" "main" "nav"}
  .mtop{grid-area:top;display:flex;align-items:center;gap:10px;padding:calc(8px + env(safe-area-inset-top,0px)) max(16px,env(safe-area-inset-right,0px)) 8px max(16px,env(safe-area-inset-left,0px));background:var(--side,#2b2724);color:var(--chalk,#f3ede4)}
  .mbrand{display:flex;align-items:center;gap:10px;min-height:44px;color:inherit;text-decoration:none}
  .mbrand img{width:40px;height:auto}
  .mbrand b{font-family:"Fraunces",Georgia,serif;font-weight:500;font-size:1.15rem}
  #home .hmain{grid-area:main;padding:16px max(16px,env(safe-area-inset-right,0px)) 28px max(16px,env(safe-area-inset-left,0px))!important;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
  #home .hmain section{gap:16px}

  /* Leiste unten */
  .mnav{grid-area:nav;display:grid;grid-template-columns:repeat(4,1fr);padding:4px max(6px,env(safe-area-inset-right,0px)) calc(4px + env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px));background:var(--side,#2b2724);box-shadow:0 -6px 24px rgba(0,0,0,.18);position:relative;z-index:3}
  .mnav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:54px;border:0;border-radius:14px;background:none;color:rgba(244,239,227,.72);font-size:.7rem;font-weight:700;-webkit-tap-highlight-color:transparent}
  .mnav svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
  .mnav button[aria-current="true"],.mnav button[aria-expanded="true"]{color:var(--chalk,#f3ede4);background:rgba(244,239,227,.1)}
  .mnav button[aria-current="true"] svg{color:var(--peach,#e2694a)}

  /* Seitenleiste wird zum Blatt «Mehr» */
  #home .hside{position:fixed!important;left:0;right:0;bottom:0;z-index:2;flex-direction:column!important;align-items:stretch!important;gap:2px!important;overflow:auto;max-height:70vh;
    padding:14px max(14px,env(safe-area-inset-right,0px)) calc(84px + env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px))!important;border-radius:22px 22px 0 0;
    transform:translateY(105%);transition:transform .25s ease;visibility:hidden;box-shadow:0 -12px 40px rgba(0,0,0,.3)}
  #home.more-open .hside{transform:none;visibility:visible}
  #home .hside::before{content:"";align-self:center;width:40px;height:4px;border-radius:4px;background:rgba(244,239,227,.25);margin-bottom:8px}
  #home .hside .hbrand,#home .hside .hnav[data-sec],#home .hside .grow{display:none!important}
  #home .hside .hnav,#home .hside .torez{min-height:50px;font-size:1rem;margin:0!important}
  #home .hside .torez{justify-content:flex-start}
  .mscrim{display:block;position:fixed;inset:0;z-index:1;background:rgba(0,0,0,.35)}
  .mscrim[hidden]{display:none}

  /* Begrüssung kompakter */
  #home .hello{padding:14px 16px;gap:12px;border-radius:18px}
  #home .hello .hi{width:34px;height:34px}
  #home .hello h1{font-size:1.35rem}
  #home .hello .date{font-size:.85rem;margin-top:2px}
  #home .hello .hclock{font-size:1.5rem}
  #home .hh h2{font-size:1.15rem}

  /* «Neue Tafel» als breiter Knopf statt grosser Karte */
  #home .tpls{grid-auto-flow:row;grid-auto-columns:auto;grid-template-columns:1fr;overflow:visible;padding:0}
  #home .tpl.new{min-height:56px;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px;padding:10px 16px;border-radius:16px}
  #home .tpl.new svg{width:24px;height:24px}
  #home .tpl.new b{font-size:1rem}

  /* Suchen und Sortieren nebeneinander */
  #home .htools{flex-wrap:nowrap;width:100%;gap:8px}
  #home .hh{gap:10px}
  #home .hsearch{flex:1;min-width:0;min-height:44px}
  #home .hsearch input{width:100%;min-width:0;font-size:16px;padding:10px 0}
  #home .hsel{min-height:44px;max-width:46%;font-size:.9rem}

  /* Tafeln zu zweit */
  #home .boards{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  #home .bcard{padding:6px;border-radius:16px;gap:4px}
  #home .bcard .row{padding:0 2px 2px;gap:2px}
  #home .bcard .nm{font-size:.9rem}
  #home .bcard .row button{min-width:36px;min-height:40px}
  #home .bcard .meta{display:none}
  #home .bmenu{right:6px;left:6px;min-width:0}
  #home .bmenu button{min-height:44px}

  #home .clist{grid-template-columns:1fr}
  #home .cnew{min-height:110px}
  #home .hbgs{grid-template-columns:repeat(2,1fr);gap:10px}
  #home input,#home select,#home textarea{font-size:16px}
  #home .hbtn{min-height:44px}
}

/* Tafel selbst auf dem Handy */
@media (max-width:760px), (max-height:500px){
  .rb{width:44px;height:44px}
  #pager .rb{width:40px;height:40px}
  #dock{max-width:calc(100vw - 16px - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px));overflow:hidden!important}
  #dock .dk{min-width:56px;min-height:56px;padding-inline:3px;font-size:.68rem}
  #dock .dk.mhide{display:none!important}
  #wbar{z-index:100001!important}#wmenu{z-index:100002!important}
  #pager{bottom:calc(96px + env(safe-area-inset-bottom,0px))!important}
}

/* Klassenlisten: Speichern-Knopf (PC und Handy) */
#home .ccard .csave{display:inline-flex;align-items:center;gap:6px;background:var(--basil);border-color:var(--basil);color:#fff}
#home .ccard .csave svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
#home .ccard .csave.ok{background:#2f8a57;border-color:#2f8a57}
#home .ccard .row .b{min-height:40px}
@media (max-width:760px){
  #home .ccard .row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}
  #home .ccard .row > span{grid-column:1/-1}
  #home .ccard .row .b{min-height:44px;justify-content:center;display:inline-flex;align-items:center;gap:6px;padding:6px 4px}
}

/* Glücksrad: Leiste unten weg, solange gedreht wird oder der Name steht (PC und Handy) */
.nmplay > .bar.opt{display:none}

/* Klassenlisten: gespeicherte Liste klappt zu, oben Haken «Gespeichert» */
#home .ccard{transition:box-shadow .3s}
#home .ccard .csum{display:none;align-items:center;gap:12px}
#home .ccard.closed .csum{display:flex}
#home .ccard .cinfo{flex:1;min-width:0;display:grid;gap:2px}
#home .ccard .cinfo b{font-family:"Fraunces",Georgia,serif;font-weight:500;font-size:1.15rem;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#home .ccard .cinfo small{font-size:.85rem;color:#2f8a57;font-weight:700}
#home .ccard .cok{flex:none;width:40px;height:40px;color:#2f8a57}
#home .ccard .cok svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#home .ccard .csum{position:relative}
#home .ccard .cdots{flex:none;align-self:flex-start;width:36px;height:36px;margin:-6px -6px 0 0;display:grid;place-items:center;border:0;border-radius:10px;background:none;color:var(--muted)}
#home .ccard .cdots:hover,#home .ccard .cdots[aria-expanded="true"]{background:var(--soft);color:var(--ink)}
#home .ccard .cdots svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2.4;stroke-linecap:round}
#home .ccard .cmenu{position:absolute;right:-4px;top:34px;z-index:5;display:grid;min-width:170px;padding:4px;border-radius:12px;background:var(--card);border:1px solid var(--line);box-shadow:0 10px 30px rgba(0,0,0,.18)}
#home .ccard .cmenu[hidden]{display:none}
#home .ccard .cmenu button{border:0;background:none;text-align:left;padding:10px 12px;min-height:44px;border-radius:8px;font-weight:700;font-size:.92rem;color:var(--ink)}
#home .ccard .cmenu button:hover{background:var(--soft)}
#home .ccard .cmenu .danger{color:var(--stop,#c0392b)}
#home .ccard.closed{overflow:visible}
#home .ccard .cbody{display:grid;grid-template-rows:1fr;transition:grid-template-rows .35s ease,opacity .25s}
#home .ccard .cin{min-height:0;overflow:hidden;display:grid;gap:8px}
#home .ccard.closed .cbody{grid-template-rows:0fr;opacity:0}
#home .clist{align-items:start}
#home .ccard.fresh{animation:csaved .6s ease}
#home .ccard.fresh .cok circle{stroke-dasharray:63;stroke-dashoffset:63;animation:cdraw .45s ease forwards}
#home .ccard.fresh .cok path{stroke-dasharray:16;stroke-dashoffset:16;animation:cdraw .3s .4s ease forwards}
#home .ccard.fresh .cinfo small{animation:cfade .4s .5s ease both}
@keyframes cdraw{to{stroke-dashoffset:0}}
@keyframes cfade{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
@keyframes csaved{0%{box-shadow:0 0 0 0 rgba(47,138,87,.45)}100%{box-shadow:0 0 0 14px rgba(47,138,87,0)}}
@media (prefers-reduced-motion:reduce){#home .ccard .cbody{transition:none}#home .ccard.fresh,#home .ccard.fresh *{animation:none!important;stroke-dashoffset:0!important}}
#home .ccard.closed{gap:0}
#home .cnew{min-height:110px}

/* Übersicht am Computer: unten nur eine schlichte Zeile mit Symbolen */
.hfoot{display:contents}
@media (min-width:761px){
  #home .hfoot{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:0;margin-top:8px;padding-top:10px;border-top:1px solid color-mix(in srgb,currentColor 14%,transparent)}
  #home .hfoot .hnav,#home .hfoot .torez{position:relative;width:34px;height:34px;padding:0;margin:0;justify-content:center;align-items:center;border-radius:10px}
  #home .hfoot .hnav svg{width:18px;height:18px}
  #home .hfoot .hnav > span,#home .hfoot .hnav > .lbl,#home .hfoot .torez::after{position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);z-index:5;padding:4px 8px;border-radius:7px;
    background:#f3ede4;color:#2b2724;box-shadow:0 4px 14px rgba(0,0,0,.25);font-size:.75rem;font-weight:700;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s}
  #home .hfoot .hnav:hover > span,#home .hfoot .hnav:focus-visible > span,#home .hfoot .hnav:hover > .lbl,#home .hfoot .hnav:focus-visible > .lbl,
  #home .hfoot .torez:hover::after,#home .hfoot .torez:focus-visible::after{opacity:1}
  #home .hfoot .torez{display:inline-flex;font-size:0;border:0;background:none;color:#b8432f}
  #home .hfoot .torez::after{content:"Rezepte"}
  #home .hfoot .torez:hover{background:var(--soft);color:#b8432f}
  #home .hfoot .torez svg{width:18px;height:18px}
  /* Alle Symbole passen in die Leiste (Pipo 1.12.): schmaler werden statt überlaufen; Namen am Rand nicht abschneiden */
  #home .hfoot > :is(.hnav,.torez){flex:0 1 34px;min-width:26px;width:auto}
  #home .hfoot > :is(.hnav,.torez):first-child > :is(span,.lbl),#home .hfoot > .torez:first-child::after{left:0;transform:none}
  #home .hfoot > .torez::after{left:auto;right:0;transform:none}
}
