* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  padding: 0.85rem 1.1rem 2rem;
  background: #f3f3f1;
  color: #1a1a1a;
  font: 13px/1.3 ui-sans-serif, system-ui, sans-serif;
}

.top {
  display: flex;
  align-items: flex-end;
  margin: 0 0 0.85rem;
  border-bottom: 1px solid #ddd;
}

.mark {
  order: 2;
  margin: 0 0 -1px auto;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mark a {
  color: inherit;
  text-decoration: none;
}

.mark a:hover { text-decoration: underline; }

.menu {
  order: 1;
  flex: 1;
  display: flex;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
}

.menu a {
  margin-bottom: -1px;
  padding: 0.35rem 0.6rem;
  border-bottom: 2px solid transparent;
  color: inherit;
  text-decoration: none;
}

.menu a[aria-current="page"] {
  border-bottom-color: #222;
  font-weight: 650;
}

.menu button {
  margin: 0 0 -1px auto;
  height: auto;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  font-weight: 650;
}

.menu button:hover,
.menu button:active { border-bottom-color: #222; background: transparent; }

.lead {
  margin: 0 0 0.7rem;
  max-width: 46rem;
  color: #555;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.pin,
#schule-neu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.55rem;
}

.fine {
  margin: 0;
  color: #666;
}

input {
  font: inherit;
  height: 26px;
  min-width: 0;
  padding: 0 0.4rem;
  border: 1px solid #b9b9b4;
  border-radius: 2px;
  background: #fff;
  color: inherit;
}

input[type="radio"] {
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
}

#schule-name { width: 16rem; }

button {
  font: inherit;
  height: 26px;
  padding: 0 0.5rem;
  border: 1px solid #8d8d86;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  cursor: pointer;
}

button[type="submit"] {
  background: #222;
  border-color: #222;
  color: #fff;
}

button:active { background: #ecece8; }
button[type="submit"]:active { background: #000; }

button.is-paused {
  background: #ffd84a;
  border-color: #1a1a1a;
  font-weight: 650;
}

button.is-paused:active { background: #f0c400; }

.error {
  margin: 0 0 0.4rem;
  color: #a32015;
}

.mod-kasten {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid #ddd;
}

.mod-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
}

.mod-kopf-text { min-width: 0; }

.mod-kopf-text .fine { max-width: 36rem; }

.mod-kopf-knopfe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.mod-menu {
  margin: 0.85rem 0 0;
  padding: 0;
  border: 0;
}

.mod-menu legend {
  padding: 0;
  font-weight: 650;
}

.mod-menu .fine { margin: 0.2rem 0 0; }

.mod-menu-wahl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.mod-menu-wahl button[aria-pressed="true"] {
  background: #f6d5d0;
  border-color: #c73e2a;
  color: #7a241c;
}

.mod-titel {
  margin: 0 0 0.2rem;
  font-weight: 650;
}

.mod-anwesend {
  display: flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0;
  line-height: 1;
}

.mod-anwesend strong {
  font-size: 2.1rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.mod-anwesend span {
  color: #666;
  font-size: 12px;
  white-space: nowrap;
}

.mod-panel .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

button.is-on {
  background: #222;
  border-color: #222;
  color: #fff;
}

.mod-heft {
  margin: 0.85rem 0 0;
  padding: 0;
  border: 0;
}

.mod-heft legend {
  padding: 0;
  font-weight: 650;
}

.mod-heft textarea {
  width: 100%;
  min-height: 12rem;
  margin: 0.35rem 0 0.4rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #b9b9b4;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  font: inherit;
  line-height: 1.35;
  resize: vertical;
}

.mod-heft .fine { margin: 0; }

.mod-spiele {
  margin: 0.55rem 0 0.4rem;
  padding: 0;
  border: 0;
}

.mod-spiele legend {
  margin-bottom: 0.25rem;
  font-weight: 650;
}

.mod-trenner {
  margin: 0.55rem 0 0.05rem;
  color: #666;
  font-size: 11px;
  font-weight: 650;
}

.mod-wahl { display: block; }

.mod-kat { margin-top: 0.85rem; }

.mod-screen {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(16rem, 1.15fr);
  gap: 0.7rem;
  align-items: stretch;
}

.mod-segment {
  padding: 0.4rem 0.65rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 2px;
  background: #fff;
}

.mod-segment-titel {
  margin: 0 0 0.35rem;
  padding-bottom: 0.28rem;
  border-bottom: 1px solid #eee;
  font-size: 12px;
  font-weight: 700;
}

.mod-segment-spalten {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.15rem 0.9rem;
}

.mod-spiele label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.15rem 0;
}

@media (max-width: 860px) {
  .mod-screen { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .mod-segment-spalten { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .mod-kopf { flex-wrap: wrap; }

  .mod-anwesend { flex-wrap: wrap; }
}

#mod-wort-stand,
#mod-multi-stand { margin: 0.35rem 0; }

.mod-stimmen { margin: 0.2rem 0 0.55rem; padding: 0; list-style: none; }
.mod-stimmen li { margin: 0.15rem 0; }
.mod-stimmen .ist-richtig { font-weight: 650; }

#mod-multi-hinweis { margin-top: 0.45rem; }

.schulen {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  border-top: 1px solid #ddd;
  overflow-x: auto;
}

.schule,
.schulen > .fine {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #ddd;
}

.schule { display: flex; flex-direction: column; }

.schulen > .fine {
  display: flex;
  align-items: center;
  min-height: 30px;
}

.schule-zeile {
  display: grid;
  grid-template-columns: minmax(7rem, 10rem) 5.5rem 6.2rem 6.8rem 5.6rem minmax(13rem, 1fr);
  align-items: center;
  column-gap: 0.85rem;
  min-height: 30px;
  white-space: nowrap;
}

.schule-zeile > * { min-width: 0; }

.schule-name {
  overflow: hidden;
  font-weight: 650;
  text-overflow: ellipsis;
}

.schule-datum,
.schule-zeilen {
  color: #666;
  font-size: 12px;
}

.schule-zeilen {
  display: flex;
  align-items: center;
  gap: 0.1rem;
}

button.heft-knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #666;
}

button.heft-knopf svg {
  width: 13px;
  height: 13px;
}

button.heft-knopf:hover,
button.heft-knopf[aria-expanded="true"] {
  background: #e4e4e0;
  color: #111;
}

.schule-verbrauch {
  color: #333;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.schule-link {
  overflow: hidden;
  color: #333;
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 12px;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-overflow: ellipsis;
}

.schule-link:hover { text-decoration: underline; }

.schule .row {
  display: flex;
  gap: 0.3rem;
  justify-content: flex-end;
}

.mod-daumen {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid #ddd;
}

.mod-daumen h2 {
  margin: 0 0 0.35rem;
  font-size: 15px;
}

#mod-daumen-zahl:not(:empty)::before {
  content: "· ";
  font-weight: 450;
}

.mod-daumen table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.35rem 0 0.45rem;
}

.mod-daumen th,
.mod-daumen td {
  padding: 0.28rem 0.55rem 0.28rem 0;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}

.mod-daumen td:last-child {
  white-space: pre-wrap;
}

a#mod-daumen-karten {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 0.5rem;
  border: 1px solid #8d8d86;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

a#mod-daumen-karten:active { background: #ecece8; }

@media print {
  body.daumen-druck .top,
  body.daumen-druck .lead,
  body.daumen-druck form,
  body.daumen-druck .schulen,
  body.daumen-druck .mod-kopf,
  body.daumen-druck .mod-menu,
  body.daumen-druck .mod-spiele,
  body.daumen-druck #mod-multi,
  body.daumen-druck #mod-multi-hinweis,
  body.daumen-druck #mod-wort,
  body.daumen-druck #mod-fehler,
  body.daumen-druck .mod-heft,
  body.daumen-druck #mod-daumen-druck,
  body.daumen-druck #mod-daumen-karten {
    display: none !important;
  }
}

.schule-heft,
#detail-heft {
  width: 100%;
  min-height: 7rem;
  margin: 0 0 0.45rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid #b9b9b4;
  border-radius: 2px;
  background: #f7f7f5;
  color: inherit;
  font: inherit;
  line-height: 1.35;
  resize: vertical;
}

.zahlen {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem 1.6rem;
  margin: 0 0 0.9rem;
  padding: 0;
  list-style: none;
}

.zahlen strong {
  display: block;
  font-size: 18px;
  font-weight: 650;
}

.zahlen span { color: #666; }

#public-heft {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  max-width: 46rem;
}

#public-heft textarea {
  width: 100%;
  min-height: 18rem;
  margin: 0;
  padding: 0.35rem 0.45rem;
  border: 1px solid #b9b9b4;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  font: inherit;
  line-height: 1.35;
  resize: vertical;
}

#verbrauch { margin: -0.35rem 0 0.85rem; }

.verbrauch-zeile {
  flex: 1 1 auto;
  min-width: 0;
  color: #666;
  font-size: 12px;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 40rem;
}

.fields label {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.fields input { width: 100%; }

#token-stand { margin: 0 0 0 9rem; }

.note {
  margin: 0.7rem 0 0;
  color: #666;
}

.daumen-satz {
  display: block;
  margin: 1.15rem 0 0.35rem;
}

.daumen-satz:first-child { margin-top: 0; }

.daumen-satz input {
  width: 100%;
  height: 32px;
  font-weight: 650;
}

.daumen-zeile {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0 0 0.4rem;
}

.daumen-zeile .nr {
  flex: 0 0 1.6rem;
  padding-top: 0.2rem;
  color: #666;
  font-variant-numeric: tabular-nums;
}

.daumen-zeile .daumen-kurz {
  flex: 0 0 13.5rem;
  width: 13.5rem;
}

.daumen-zeile textarea {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 3.4rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid #b9b9b4;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  font: inherit;
  resize: vertical;
}

.frage {
  padding: 0.4rem 0;
  border-bottom: 1px solid #ddd;
}

.frage-kopf,
.antwort {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.antwort { margin-top: 0.2rem; }

.nr {
  flex: 0 0 1.4rem;
  color: #666;
}

select {
  font: inherit;
  height: 26px;
  border: 1px solid #b9b9b4;
  border-radius: 2px;
  background: #fff;
  color: inherit;
}

.frage-gebiet { flex: 0 0 10.4rem; }

.frage-text,
.antwort-text,
.warum { flex: 1 1 0; }

main h1 {
  margin: 0.2rem 0 0.2rem;
  font-size: 16px;
  font-weight: 700;
}

.frage-auf { flex: 0 0 auto; }

#runde { width: 4rem; }

.fragen-bar { margin-top: 0.7rem; }

.log {
  list-style: none;
  margin: 0.6rem 0 0.8rem;
  padding: 0;
  max-width: 46rem;
  border-top: 1px solid #ddd;
}

.log li {
  display: grid;
  grid-template-columns: 3.2rem 4.6rem minmax(0, 1fr);
  gap: 0.45rem;
  margin: 0;
  padding: 0.28rem 0;
  border-bottom: 1px solid #ddd;
}

.log time,
.log-art { color: #666; }

.log p {
  margin: 0;
  white-space: pre-wrap;
}

#detail label {
  display: block;
  margin: 0.2rem 0 0.25rem;
}

#detail-heft {
  display: block;
  max-width: 46rem;
}

.log-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.7rem;
}

.log-bar select,
.log-bar input {
  height: 26px;
}

.muster,
.verlauf {
  width: 100%;
  max-width: 64rem;
  border-collapse: collapse;
  margin: 0 0 0.9rem;
}

.muster tr.ist-klick { cursor: pointer; }

.muster tr.ist-klick:hover td { background: #f6f1e4; }

a.schule-log {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 0.5rem;
  border: 1px solid #8d8d86;
  border-radius: 2px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.muster th,
.muster td,
.verlauf th,
.verlauf td {
  padding: 0.28rem 0.45rem 0.28rem 0;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}

.verlauf td.was { white-space: pre-wrap; }

.verlauf { margin-top: 0.3rem; }

.fach-wahl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.8rem;
}

.fach-wahl button {
  height: auto;
  padding: 0.28rem 0.55rem;
}

.fach-werk {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
  margin: 0 0 0.45rem;
}

.fach-werk label { display: inline-flex; align-items: center; gap: 0.35rem; }

.fach-werk input[type="text"],
.fach-werk #klasse {
  width: 9rem;
  height: 26px;
  padding: 0 0.4rem;
  border: 1px solid #8d8d86;
  border-radius: 2px;
  font: inherit;
}

.fach-liste {
  list-style: none;
  margin: 0.4rem 0 1rem;
  padding: 0;
  max-width: 52rem;
}

.fach-liste li { border-top: 1px solid #ddd; }

.fach-liste label {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.4rem 0;
  cursor: pointer;
}

.fach-liste input { margin-top: 0.2rem; }

.fach-spiel {
  display: block;
  color: #666;
  font-size: 11px;
}

.blatt {
  max-width: 42rem;
  margin: 0.6rem 0 2rem;
  padding: 1rem 1.1rem 1.3rem;
  background: #fff;
  border: 1px solid #ccc;
}

.blatt-kopf,
.blatt-frage,
.blatt-loesung article { break-inside: avoid; }

.blatt-marke { margin: 0; font-weight: 700; }

.blatt-meta { margin: 0.2rem 0 0.8rem; }

.blatt-spiel {
  margin: 0;
  color: #333;
  font-size: 12px;
}

.blatt-text { margin: 0.15rem 0 0.35rem; font-size: 15px; }

.blatt-wahl {
  margin: 0 0 0.4rem;
  padding: 0;
  list-style: none;
}

.blatt-wahl li {
  margin: 0.15rem 0;
  padding-left: 1.2rem;
  position: relative;
}

.blatt-wahl li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 1px solid #222;
  border-radius: 50%;
}

.blatt-nach { margin: 0.35rem 0 0.15rem; }

.blatt-linien { margin: 0 0 0.85rem; }

.blatt-linien span {
  display: block;
  height: 1.35rem;
  border-bottom: 1px solid #222;
}

.blatt-loesung {
  break-before: page;
  margin-top: 1rem;
}

.blatt-loesung h2 { margin: 0 0 0.6rem; font-size: 16px; }

.blatt-loesung article { margin: 0 0 0.7rem; }

.blatt-warum { margin: 0.1rem 0 0; color: #333; }

@media print {
  body[data-page="faecher"] .top,
  body[data-page="faecher"] h1,
  body[data-page="faecher"] .lead,
  body[data-page="faecher"] .fach-wahl,
  body[data-page="faecher"] .fach-werk,
  body[data-page="faecher"] .fine,
  body[data-page="faecher"] .error,
  body[data-page="faecher"] .fach-liste,
  body[data-page="faecher"] #pin-form {
    display: none !important;
  }

  body[data-page="faecher"] {
    padding: 0;
    background: #fff;
    font-size: 12pt;
  }

  body[data-page="faecher"] .blatt {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
  }
}

.web-filter { display: flex; gap: 0.35rem; margin: 0 0 0.8rem; }
.web-filter button[aria-pressed="true"] { background: #222; color: #fff; }
.web-spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.2rem 1.6rem; margin: 0.4rem 0 1.2rem; }
.web-spalten h2 { margin: 0 0 0.35rem; font-size: 13px; }
.stunden { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 0.25rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.stunden li { text-align: center; color: #666; }
.stunden strong { display: block; color: #1a1a1a; font-size: 13px; }
