/* Diagramm-Tafelbild · erstestun.de – baut auf main_v2.css auf */
@font-face { font-family: 'Grundschrift'; src: url('../fonts/grundschrift.ttf') format('truetype'); }

.dg-container {
  background: var(--surface, #fff);
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 22px 22px;
  margin: 18px auto 10px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  width: 92%; max-width: 1180px; min-width: 300px;
  box-sizing: border-box;
}
.dg-container .top-toolbar { flex-wrap: wrap; gap: 4px; justify-content: space-between; }
.dg-container .toolbar-left, .dg-container .toolbar-right { flex-wrap: wrap; align-items: center; }
.dg-container .tool-icon { font-size: 18px; }
.dg-container .tool-icon-text { font-size: 14px; }
.dg-container .sicht { font-family: var(--font-hand); font-size: 18px; padding: 2px 6px; }

.dg-frage {
  font-family: var(--font-hand); font-size: 2.3rem; font-weight: 700; color: var(--ink);
  text-align: center; margin: 4px auto 6px; padding: 0 10px; outline: none;
  border-bottom: 2px dashed transparent; min-width: 6em;
}
.dg-frage:hover, .dg-frage:focus { border-bottom-color: var(--hairline, #e8e2d3); }

.dg-main { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(320px, 1.25fr); gap: 22px; align-items: start; }
.dg-main.ohne-strich, .dg-main.ohne-dia { grid-template-columns: 1fr; }
.dg-main.ohne-strich.ohne-dia { display: none; }
[hidden] { display: none !important; }

/* Strichliste */
.dg-zeilen { display: flex; flex-direction: column; gap: 6px; }
.dg-zeile {
  display: grid; grid-template-columns: 2.2em minmax(6em, 9em) 1fr 2.4em 2.2em 1.8em; align-items: center; gap: 6px;
  border: 1.5px solid var(--hairline, #e8e2d3); border-radius: var(--radius-btn, 14px); padding: 4px 8px; background: #fffdf7;
  cursor: pointer; user-select: none; transition: background .12s;
}
.dg-zeile:hover { background: #fff5d2; }
.dg-zeile.blitz { background: #ffe9a6; }
.dg-nr { font: 600 13px var(--font-text); color: var(--ink-soft, #6b665c); text-align: center; border: 1.5px solid var(--hairline); border-radius: 50%; width: 1.8em; height: 1.8em; line-height: 1.6em; }
.dg-name {
  font-family: var(--font-hand); font-size: 1.6rem; font-weight: 700; color: var(--ink);
  border: 0; background: transparent; width: 100%; padding: 0 2px; cursor: text;
}
.dg-name:focus { outline: 2px solid #ffd64a; border-radius: 6px; }
.dg-striche { min-height: 40px; display: flex; align-items: center; }
.dg-striche svg { height: 40px; width: auto; max-width: 100%; }
.dg-zahl { font: 700 1.5rem var(--font-text); text-align: right; color: var(--ink); }
.dg-zahl.schule, .schule .dg-zahl { font-family: 'Grundschrift', cursive; font-weight: 400; font-size: 1.8rem; }
.dg-minus, .dg-weg {
  all: unset; cursor: pointer; text-align: center; font-size: 20px; line-height: 1; color: #bbb;
  width: 1.6em; height: 1.6em; border-radius: 50%;
}
.dg-minus:hover { color: var(--ink); background: #f1ece0; }
.dg-weg:hover { color: #d84a7c; background: #fbe6ee; }
.dg-neu {
  margin-top: 8px; font-family: var(--font-hand); font-size: 1.3rem; background: transparent;
  border: 1.5px dashed var(--ink-soft, #6b665c); border-radius: var(--radius-btn, 14px); padding: 2px 16px; cursor: pointer; color: var(--ink);
}
.dg-neu:hover { background: #fff5d2; }
.dg-tipp { color: var(--ink-soft, #6b665c); font-size: .85rem; margin: 10px 0 0; }

/* Diagramm */
.dg-dia #dia svg { width: 100%; height: auto; display: block; }
.dg-einteilung { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--font-hand); font-size: 1.25rem; margin-top: 6px; }
.dg-einteilung select { font-size: 1rem; padding: 3px 8px; border: 1.5px solid var(--ink); border-radius: var(--radius-btn, 14px); background: #fff; }
.dg-summe { margin-left: auto; color: var(--ink-soft, #6b665c); }

/* Häufigkeitstabelle */
.dg-tabelle { overflow-x: auto; }
.dg-tab { border-collapse: collapse; margin: 6px auto 0; font-size: 1.35rem; background: #fff; }
.dg-tab th, .dg-tab td { border: 1.5px solid var(--ink); padding: 6px 14px; text-align: center; }
.dg-tab th { font-family: var(--font-hand); font-size: 1.5rem; background: #fff8de; text-align: left; }
.dg-tab td { font-family: var(--font-hand); font-size: 1.6rem; font-weight: 700; }
.dg-tab td.z { font-family: var(--font-text); font-weight: 700; font-size: 1.4rem; }
.schule .dg-tab td.z { font-family: 'Grundschrift', cursive; font-weight: 400; font-size: 1.7rem; }

@media (max-width: 860px) {
  .dg-main { grid-template-columns: 1fr; }
  .dg-container { width: auto; margin: 12px 10px; padding: 12px 12px 18px; }
  .dg-frage { font-size: 1.8rem; }
  .dg-zeile { grid-template-columns: 1.8em minmax(5em, 7em) 1fr 2em 2em 1.6em; padding: 3px 6px; }
  .dg-name { font-size: 1.35rem; }
  .dg-tab { font-size: 1.1rem; } .dg-tab th, .dg-tab td { padding: 4px 8px; }
}
@media print {
  .topnav, .footer, .top-toolbar, .dg-neu, .dg-tipp, .dg-minus, .dg-weg, .dg-einteilung select { display: none !important; }
  .dg-container { box-shadow: none; width: 100%; }
}
