@font-face {
  font-family: "PrimaeText";
  src: url("schriftarten/PrimaeText-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PrimaeText";
  src: url("schriftarten/PrimaeText-Semibold.otf") format("opentype");
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PrimaeText";
  src: url("schriftarten/PrimaeText-Bold.otf") format("opentype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink:#12304d;
  --muted:#667789;
  --line:#cbd8e6;
  --blue:#0d47a1;
  --task:#fffdf2;
  --task-line:#ead79f;
  --ok:#2e7d32;
  --warn:#956600;
  --bad:#b3261e;
  --radius:18px;
  --shadow:0 14px 32px rgba(30,60,90,.12);
}

* { box-sizing:border-box; }

body {
  margin:0;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:linear-gradient(180deg,#e9f7ef,#eef6ff);
}

button,input { font:inherit; }

.app {
  width:min(1500px,calc(100vw - 24px));
  margin:12px auto;
  background:rgba(255,255,255,.94);
  border:1px solid var(--line);
  border-radius:24px;
  overflow:hidden;
  box-shadow:var(--shadow);
}

.topbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:18px 22px;
  background:white;
  border-bottom:1px solid var(--line);
}

.brand {
  display:flex;
  align-items:center;
  gap:14px;
}

.brand-icon {
  width:56px;
  height:56px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:#d8f5df;
  color:#0b6f35;
  font-size:34px;
  font-weight:900;
}

h1 { margin:0; font-size:40px; line-height:1; }
h2 { margin:0 0 14px; font-size:23px; }
h3 { color:var(--blue); margin:18px 0 10px; font-size:17px; }

button {
  border:1px solid var(--line);
  border-radius:14px;
  background:white;
  min-height:50px;
  padding:13px 17px;
  cursor:pointer;
  box-shadow:0 2px 0 rgba(0,0,0,.04);
}

button:hover { background:#f3f8ff; }

.top-actions,.board-actions {
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.modes {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  padding:12px 18px;
  background:#f6fbff;
  border-bottom:1px solid var(--line);
}

.mode {
  font-size:22px;
  font-weight:900;
}

.mode.active {
  background:#dbeeff;
  color:var(--blue);
  border:2px solid #111;
}

.layout {
  display:grid;
  grid-template-columns:250px 1fr 300px;
  gap:18px;
  padding:18px;
}

.panel {
  background:white;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
}

.settings label {
  display:flex;
  align-items:center;
  gap:10px;
  margin:12px 0;
}

input[type="checkbox"],input[type="radio"] {
  width:22px;
  height:22px;
}

.board {
  min-height:700px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.task-card {
  min-height:142px;
  padding:16px 18px;
  border:1px solid var(--task-line);
  border-radius:var(--radius);
  background:var(--task);
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.task-label {
  color:#6f5200;
  font-weight:900;
  margin-bottom:10px;
  font-size:16px;
}

.task-line {
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.task-line.nowrap { flex-wrap:nowrap; }

.task-icon {
  width:70px;
  height:70px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  border:1px solid #d6e3ef;
  border-radius:18px;
  background:#f7fbff;
  font-size:35px;
  overflow:hidden;
}

.task-icon[contenteditable="true"] { cursor:text; }

.task-icon img {
  width:100%;
  height:100%;
  object-fit:cover;
}

.big-word {
  font-size:clamp(24px,2.5vw,36px);
  font-weight:900;
}

.small-word {
  font-size:24px;
  font-weight:900;
}

.field {
  border:1px solid #cbd9e8;
  border-radius:14px;
  background:white;
  padding:8px 13px;
  font-weight:900;
  font-size:clamp(22px,2vw,30px);
  color:var(--ink);
  min-height:54px;
}

.field:focus {
  outline:3px solid rgba(25,118,210,.18);
  border-color:#6ea9da;
}

.amount-field,.price-field,.paid-field { width:120px; }
.name-field { width:240px; }

.task-help {
  margin-top:10px;
  color:var(--muted);
  font-size:17px;
}

.change-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.change-card {
  min-height:92px;
  border:1px solid #d7e2ef;
  background:white;
  border-radius:16px;
  padding:12px 14px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.change-card label,.change-card .caption {
  color:var(--muted);
  font-weight:800;
  font-size:15px;
  margin-bottom:8px;
}

.value-line {
  display:flex;
  align-items:center;
  gap:8px;
}

.drop-zone {
  position:relative;
  flex:1;
  min-height:360px;
  border:3px dashed #c9d8eb;
  border-radius:var(--radius);
  background:radial-gradient(circle at 20% 20%,rgba(25,118,210,.05),transparent 35%),white;
  overflow:hidden;
}

.drop-zone.drag-over {
  border-color:#1976d2;
  background:#f2f8ff;
}

.placeholder {
  position:absolute;
  inset:0;
  display:grid;
  place-content:center;
  text-align:center;
  color:#8a98a8;
  pointer-events:none;
}

.placeholder strong {
  font-size:30px;
  margin-bottom:8px;
}

.placeholder span {
  font-size:20px;
}

.placed {
  position:absolute;
  width:var(--w);
  touch-action:none;
  cursor:grab;
  user-select:none;
  z-index:5;
}

.placed img {
  width:100%;
  display:block;
  filter:drop-shadow(0 7px 10px rgba(0,0,0,.18));
  pointer-events:none;
}

.status-row {
  display:grid;
  grid-template-columns:1fr 230px;
  gap:12px;
}

.feedback {
  min-height:78px;
  border:1px solid var(--line);
  border-radius:16px;
  display:grid;
  place-items:center;
  text-align:center;
  padding:12px;
  font-size:23px;
  font-weight:900;
}

.feedback.neutral {
  background:#f7fbff;
  color:var(--muted);
}

.feedback.ok {
  color:var(--ok);
  border-color:#9fd2a3;
  background:#e8f5e9;
}

.feedback.warn {
  color:var(--warn);
  border-color:#e0c878;
  background:#fff8e1;
}

.feedback.bad {
  color:var(--bad);
  border-color:#e3a0a7;
  background:#ffebee;
}

.trash-zone {
  min-height:78px;
  border:2px dashed #d9b9b9;
  border-radius:16px;
  background:#fff7f7;
  color:#8e5252;
  display:grid;
  place-content:center;
  text-align:center;
}

.trash-zone.active {
  background:#ffe8e8;
  border-color:#c85353;
}

.trash-zone span {
  font-size:13px;
}

.palette {
  display:grid;
  gap:10px;
}

.palette.coins { grid-template-columns:repeat(3,1fr); }
.palette.notes { grid-template-columns:repeat(2,1fr); }

.money-btn {
  display:grid;
  place-items:center;
  min-height:72px;
  padding:8px;
  border-radius:15px;
}

.money-btn img {
  max-width:100%;
  max-height:78px;
  object-fit:contain;
  pointer-events:none;
}

.money-btn.coin img { max-height:72px; }
.money-btn.hide { display:none; }

.hidden { display:none !important; }

#productList {
  display:grid;
  gap:8px;
}

.product-btn {
  display:grid;
  grid-template-columns:44px 1fr;
  gap:10px;
  align-items:center;
  text-align:left;
  min-height:66px;
  padding:9px 10px;
}

.product-btn.active {
  background:#e8f4ff;
  border-color:#78b7ef;
}

.product-icon {
  width:40px;
  height:40px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:#f6f9ff;
  border:1px solid #dde6f2;
  font-size:24px;
}

.product-text {
  line-height:1.2;
}

.product-text strong {
  color:var(--blue);
}

.version {
  padding:8px 18px 14px;
  color:#8794a3;
  font-size:13px;
  text-align:right;
}

@media (max-width:1120px) {
  .layout { grid-template-columns:1fr 280px; }
  .settings { grid-column:1 / -1; }
}

@media (max-width:820px) {
  .app { width:100%; margin:0; border-radius:0; }
  .topbar { flex-direction:column; align-items:stretch; }
  .modes { grid-template-columns:1fr 1fr; }
  .layout { grid-template-columns:1fr; }
  .status-row { grid-template-columns:1fr; }
  .task-line.nowrap { flex-wrap:wrap; }
  .change-grid { grid-template-columns:1fr; }
}


/* clean-1.1: stabilisierte Aufgabenkarte gegen Springen */
.task-card {
  height: 142px;
  min-height: 142px;
  max-height: 142px;
  overflow: hidden;
}

.task-line {
  min-height: 70px;
  align-items: center;
}

.task-line.nowrap {
  flex-wrap: nowrap;
}

.task-help {
  min-height: 22px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amount-field,
.price-field,
.paid-field,
.name-field {
  flex: 0 0 auto;
}

@media (max-width: 820px) {
  .task-card {
    height: auto;
    max-height: none;
    min-height: 142px;
  }

  .task-line.nowrap {
    flex-wrap: wrap;
  }

  .task-help {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}


/* clean-1.2: gelbe Aufgabenbox in allen Modi fix */
.task-card {
  height: 156px;
  min-height: 156px;
  max-height: 156px;
  overflow: hidden;
  justify-content: center;
}

.task-label {
  height: 20px;
  line-height: 20px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.task-line {
  min-height: 70px;
  max-height: 70px;
}

.task-help {
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  margin-top: 8px;
}

/* Rückgeld muss ebenfalls in dieselbe fixe gelbe Box passen */
.change-grid {
  height: 100px;
  min-height: 100px;
  max-height: 100px;
  align-items: stretch;
}

.change-card {
  min-height: 100px;
  max-height: 100px;
  padding: 10px 12px;
}

.change-card label,
.change-card .caption {
  margin-bottom: 6px;
}

.change-card .field {
  min-height: 48px;
  font-size: 24px;
}

.change-card .big-word {
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.15;
}

/* Damit Betrags-/Jause-/Freies-Üben-Zeilen optisch gleich sitzen */
.task-icon {
  width: 68px;
  height: 68px;
}

.field {
  min-height: 52px;
}

@media (max-width: 820px) {
  .task-card {
    height: auto;
    min-height: 156px;
    max-height: none;
    overflow: visible;
  }

  .task-line,
  .change-grid,
  .change-card {
    height: auto;
    max-height: none;
  }

  .task-help {
    height: auto;
    max-height: none;
    min-height: 22px;
  }
}


/* clean-1.3: gesamtes Mittelraster stabilisiert */
.layout {
  align-items: start;
}

/* Die Mitte ist jetzt ein festes Raster: Aufgabe | Ablage | Rückmeldung | Buttons */
.board {
  display: grid;
  grid-template-rows: 156px minmax(360px, 1fr) 78px auto;
  gap: 14px;
  min-height: 700px;
}

/* Die gelbe Aufgabenbox bleibt wirklich fix und nimmt immer dieselbe Rasterzeile ein */
.task-card {
  height: 156px;
  min-height: 156px;
  max-height: 156px;
  overflow: hidden;
  align-self: stretch;
}

/* Inhalt der Aufgabenbox stabilisieren */
.task-label {
  height: 20px;
  line-height: 20px;
  margin-bottom: 8px;
}

.task-line {
  height: 70px;
  min-height: 70px;
  max-height: 70px;
  align-items: center;
}

.task-help {
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  line-height: 22px;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Rückgeld-Inhalt wird in dieselbe Aufgabenbox gezwungen */
.change-grid {
  height: 100px;
  min-height: 100px;
  max-height: 100px;
  align-items: stretch;
}

.change-card {
  height: 100px;
  min-height: 100px;
  max-height: 100px;
  padding: 10px 12px;
  overflow: hidden;
}

.change-card label,
.change-card .caption {
  height: 18px;
  line-height: 18px;
  margin-bottom: 6px;
}

.change-card .field {
  min-height: 48px;
  height: 48px;
}

.change-card .big-word {
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.15;
}

/* Ablagefläche und Statuszeile dürfen nicht durch andere Modi verschoben werden */
.drop-zone {
  min-height: 360px;
  height: auto;
  align-self: stretch;
}

.status-row {
  height: 78px;
  min-height: 78px;
  max-height: 78px;
}

.feedback,
.trash-zone {
  height: 78px;
  min-height: 78px;
  max-height: 78px;
}

/* Buttons bekommen eine stabile Zeile */
.board-actions {
  min-height: 52px;
  align-items: start;
}

/* Aktiver Modus darf keine Höhenänderung erzeugen */
.mode {
  border-width: 2px;
}

.mode:not(.active) {
  border-color: var(--line);
}

@media (max-width: 820px) {
  .board {
    display: flex;
    min-height: 560px;
  }

  .task-card {
    height: auto;
    min-height: 156px;
    max-height: none;
    overflow: visible;
  }

  .task-line,
  .change-grid,
  .change-card,
  .status-row,
  .feedback,
  .trash-zone {
    height: auto;
    max-height: none;
  }

  .task-help {
    height: auto;
    max-height: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
}


/* clean-1.4: horizontales Hüpfen der gesamten Anwendung verhindern
   Ursache: Browser-Scrollbar erscheint/verschwindet beim Moduswechsel. */
html {
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  overflow-x: hidden;
}

/* Nicht 100vw verwenden, weil 100vw die Scrollbar mitrechnet und dadurch die zentrierte App wandern kann. */
.app {
  width: min(1500px, calc(100% - 24px));
}

/* Auch bei aktiven Tabs keine Breitenänderung durch dickere Rahmen */
.mode {
  border: 2px solid var(--line);
}

.mode.active {
  border: 2px solid #111;
}


/* clean-1.5: Hintergrund im Vollbild sauber durchziehen */
html,
body {
  min-height: 100vh;
}

html {
  background: #eef6ff;
}

body {
  position: relative;
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #e9f7ef 0%, #eef6ff 100%);
  background-attachment: fixed;
}

/* Auch im Fullscreen soll der Hintergrund ohne Bruch bleiben */
:fullscreen body::before,
body:fullscreen::before,
.app:fullscreen ~ body::before {
  background: linear-gradient(180deg, #e9f7ef 0%, #eef6ff 100%);
}


/* clean-1.7: Werkzeug-Buttons unten rechts ausrichten */
.board-actions {
  justify-content: flex-end;
  align-items: center;
}


/* clean-1.8: linkes Einstellungsmenü breiter, damit Texte nicht umbrechen */
.layout {
  grid-template-columns: 285px 1fr 300px;
}

.settings label {
  white-space: nowrap;
}

/* Bei mittleren Breiten darf es weiterhin umbrechen, damit nichts überläuft */
@media (max-width: 1120px) {
  .layout {
    grid-template-columns: 1fr 280px;
  }

  .settings label {
    white-space: normal;
  }
}


/* clean-1.11: Jausenideen ohne feste Preise */
.product-btn {
  grid-template-columns: 48px 1fr;
  min-height: 64px;
}

.product-icon {
  width: 42px;
  height: 42px;
  font-size: 25px;
}

.product-text-name {
  font-size: 21px;
  font-weight: 900;
  color: var(--ink);
}

.product-text strong {
  display: none;
}


/* clean-1.20: Info-Button und Modal */
.info-button {
  width: 52px;
  min-width: 52px;
  height: 52px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #1f9d55;
  border-color: #157a3f;
  color: white;
  font-size: 28px;
  font-weight: 900;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 6px 14px rgba(31, 157, 85, .24);
}

.info-button:hover {
  background: #178348;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 24, 42, .38);
  backdrop-filter: blur(3px);
}

.modal-backdrop.hidden {
  display: none;
}

.info-modal {
  position: relative;
  width: min(760px, calc(100vw - 36px));
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 30px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.info-modal h2 {
  margin: 0 44px 16px 0;
  color: var(--ink);
  font-size: 30px;
}

.info-modal h3 {
  margin: 22px 0 8px;
  color: var(--blue);
  font-size: 19px;
}

.info-modal p {
  margin: 0 0 12px;
  color: #263d54;
  font-size: 18px;
  line-height: 1.5;
}

.info-modal a {
  color: var(--blue);
  font-weight: 900;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
  display: grid;
  place-items: center;
}

body.modal-open {
  overflow: hidden;
}


/* clean-1.22: bessere Touch-Bedienung beim Ziehen aus der Geldleiste */
.money-btn {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.money-btn img {
  user-select: none;
  -webkit-user-drag: none;
}

.drag-ghost {
  position: fixed;
  z-index: 2000;
  width: 96px;
  transform: translate(-50%, -50%) scale(1.08);
  pointer-events: none;
  opacity: .92;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.28));
}

.drag-ghost.note {
  width: 180px;
}

.drag-ghost img {
  width: 100%;
  display: block;
}


/* Footer */
.tool-footer {
  padding: 8px 18px 14px;
  color: #7d8b9a;
  font-size: 14px;
  text-align: right;
}

.tool-footer a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.tool-footer a:hover {
  text-decoration: underline;
}


/* clean-1.27: Icons in Modusleiste und Feedbackbox */
.mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mode-icon {
  font-size: 24px;
  line-height: 1;
}

.feedback {
  gap: 10px;
}

.feedback-icon {
  font-size: 30px;
  line-height: 1;
}


/* clean-1.28: Feedback mit Icon sauber einzeilig ausrichten */
.feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  line-height: 1.2;
  overflow: hidden;
}

.feedback span {
  display: inline-flex;
  align-items: center;
}

.feedback span:not(.feedback-icon) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feedback-icon {
  flex: 0 0 auto;
  font-size: 28px;
}


/* clean-1.29: Modusleiste etwas kompakter */
.mode {
  font-size: 20px;
  gap: 8px;
  padding: 11px 14px;
}

.mode-icon {
  font-size: 22px;
}


/* clean-1.30: neuer Modus "Betrag erkennen" */
.modes {
  grid-template-columns: repeat(5, 1fr);
}

.recognize-field {
  width: 140px;
}

.placed.locked {
  cursor: default;
}

.app.recognize-mode .layout {
  grid-template-columns: 250px 1fr;
}

.app.recognize-mode .money-panel,
.app.recognize-mode .trash-zone {
  display: none;
}

.app.recognize-mode .status-row {
  grid-template-columns: 1fr;
}


/* clean-1.31: Betrag erkennen verhält sich wieder wie die anderen Modi */
.app.recognize-mode .layout {
  grid-template-columns: 285px 1fr 300px;
}

.app.recognize-mode .money-panel {
  display: block;
}

.app.recognize-mode .trash-zone {
  display: grid;
}

.app.recognize-mode .status-row {
  grid-template-columns: 1fr 230px;
}

.placed.locked {
  cursor: grab;
}


/* clean-1.32: Smartphone-/Tablet-Layout repariert */
@media (max-width: 820px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .app {
    width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .topbar {
    padding: 14px;
  }

  .brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 28px;
  }

  h1 {
    font-size: 30px;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .top-actions button {
    min-height: 44px;
    padding: 10px 12px;
  }

  .info-button {
    width: 46px;
    min-width: 46px;
    height: 46px;
    font-size: 24px;
  }

  .modes {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    gap: 8px;
    padding: 10px 12px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .mode {
    flex: 0 0 auto;
    min-width: 175px;
    font-size: 18px;
    padding: 10px 12px;
    scroll-snap-align: start;
  }

  .mode-icon {
    font-size: 20px;
  }

  .layout,
  .app.recognize-mode .layout {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 14px;
    padding: 14px;
  }

  .settings,
  .money-panel,
  .app.recognize-mode .money-panel {
    grid-column: auto !important;
    display: block;
    width: 100%;
  }

  .settings label {
    white-space: normal;
  }

  .board {
    display: flex;
    min-height: 620px;
  }

  .task-card {
    height: auto;
    min-height: 156px;
    max-height: none;
    overflow: visible;
  }

  .task-line,
  .task-line.nowrap {
    height: auto;
    min-height: 0;
    max-height: none;
    flex-wrap: wrap;
  }

  .task-help {
    height: auto;
    min-height: 22px;
    max-height: none;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .big-word {
    font-size: 30px;
  }

  .small-word {
    font-size: 21px;
  }

  .name-field {
    width: min(100%, 260px);
  }

  .amount-field,
  .price-field,
  .paid-field,
  .recognize-field {
    width: 130px;
  }

  .change-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .change-card {
    height: auto;
    min-height: 92px;
    max-height: none;
  }

  .drop-zone {
    min-height: 330px;
  }

  .status-row,
  .app.recognize-mode .status-row {
    grid-template-columns: 1fr !important;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .feedback,
  .trash-zone {
    height: auto;
    min-height: 70px;
    max-height: none;
  }

  .feedback span:not(.feedback-icon) {
    white-space: normal;
  }

  .board-actions {
    justify-content: flex-end;
  }

  .palette.coins {
    grid-template-columns: repeat(4, minmax(72px, 1fr));
  }

  .palette.notes {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .tool-footer {
    text-align: center;
    padding: 12px 14px 18px;
  }
}

/* Schmale Smartphones */
@media (max-width: 480px) {
  .topbar {
    align-items: stretch;
  }

  h1 {
    font-size: 26px;
  }

  .mode {
    min-width: 165px;
  }

  .panel {
    padding: 14px;
  }

  .task-icon {
    width: 62px;
    height: 62px;
    font-size: 31px;
  }

  .big-word {
    font-size: 28px;
  }

  .field {
    font-size: 25px;
  }

  .palette.coins {
    grid-template-columns: repeat(3, minmax(72px, 1fr));
  }

  .palette.notes {
    grid-template-columns: 1fr 1fr;
  }
}


/* clean-1.33: robuster Mobile-/Tablet-Fix auch bei breitem mobilen Viewport */
@media (max-width: 1100px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .app {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .layout,
  .app.recognize-mode .layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    max-width: 100%;
    gap: 14px;
    padding: 14px;
  }

  .panel,
  .settings,
  .board,
  .money-panel,
  .app.recognize-mode .money-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: auto !important;
    display: block;
  }

  .board {
    display: flex;
  }

  .modes {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    gap: 8px;
    padding: 10px 12px;
    -webkit-overflow-scrolling: touch;
  }

  .mode {
    flex: 0 0 auto;
    min-width: 170px;
    max-width: 210px;
    white-space: nowrap;
  }

  .task-card,
  .drop-zone,
  .status-row,
  .board-actions,
  .money-panel {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .task-line,
  .task-line.nowrap {
    flex-wrap: wrap !important;
  }

  .status-row,
  .app.recognize-mode .status-row {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .palette.coins {
    grid-template-columns: repeat(4, minmax(70px, 1fr));
  }

  .palette.notes {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

/* Extra eng: Smartphones */
@media (max-width: 560px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .mode {
    min-width: 160px;
  }

  .palette.coins {
    grid-template-columns: repeat(3, minmax(70px, 1fr));
  }

  .palette.notes {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }
}


/* clean-1.34: Fix für kleinere Laptops / schmale Desktopfenster */
@media (max-width: 1365px) and (min-width: 1101px) {
  .layout,
  .app.recognize-mode .layout {
    grid-template-columns: 255px minmax(0, 1fr) 265px;
    gap: 16px;
  }

  .modes {
    gap: 10px;
  }

  .mode {
    font-size: 18px;
    padding: 10px 12px;
  }

  .mode-icon {
    font-size: 20px;
  }

  .task-card {
    height: auto;
    min-height: 160px;
    max-height: none;
    overflow: visible;
  }

  .task-line,
  .task-line.nowrap {
    flex-wrap: wrap !important;
    row-gap: 10px;
  }

  .task-help {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
  }

  .big-word {
    font-size: clamp(22px, 2vw, 32px);
  }

  .small-word {
    font-size: 22px;
  }

  .field {
    font-size: clamp(20px, 1.8vw, 28px);
    min-height: 50px;
    padding: 7px 12px;
  }

  .name-field {
    width: min(220px, 100%);
  }

  .amount-field,
  .price-field,
  .paid-field,
  .recognize-field {
    width: 110px;
  }

  .status-row,
  .app.recognize-mode .status-row {
    grid-template-columns: minmax(0, 1fr) 210px;
    align-items: stretch;
  }

  .feedback {
    min-height: 84px;
    height: auto;
    max-height: none;
    padding: 12px 16px;
    font-size: clamp(18px, 1.7vw, 22px);
  }

  .feedback span:not(.feedback-icon) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }

  .feedback-icon {
    font-size: 26px;
  }

  .trash-zone {
    min-height: 84px;
    height: auto;
    max-height: none;
    padding: 10px 12px;
  }

  .trash-zone strong,
  .trash-zone span {
    white-space: normal;
  }
}


/* clean-1.35: Preisfeld und Eurozeichen bleiben zusammen */
.money-input-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 1365px) and (min-width: 1101px) {
  .task-card {
    min-height: 178px;
  }

  .task-line,
  .task-line.nowrap {
    align-content: flex-start;
  }

  .task-help {
    margin-top: 10px;
    clear: both;
  }

  .money-input-group {
    flex: 0 0 auto;
  }
}


/* clean-1.36: Geld beim Herausziehen nicht am Rand der Ablagefläche abschneiden */
.drop-zone {
  overflow: visible;
  z-index: 5;
}

.placed.dragging {
  z-index: 1000 !important;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.24));
}

.status-row,
.board-actions,
.money-panel {
  position: relative;
}


/* clean-1.37: Geldfelder für größere Summen verbreitern */
.amount-field,
.paid-field,
.recognize-field {
  width: 150px;
}

@media (max-width: 1365px) and (min-width: 1101px) {
  .amount-field,
  .paid-field,
  .recognize-field {
    width: 145px;
  }
}

@media (max-width: 820px) {
  .amount-field,
  .paid-field,
  .recognize-field {
    width: 145px;
  }
}

@media (max-width: 560px) {
  .amount-field,
  .paid-field,
  .recognize-field {
    width: 138px;
  }
}


/* clean-1.38: Preisfeld bei Einkaufen ebenfalls verbreitern */
.price-field {
  width: 145px;
}

@media (max-width: 1365px) and (min-width: 1101px) {
  .price-field {
    width: 140px;
  }
}

@media (max-width: 820px) {
  .price-field {
    width: 140px;
  }
}

@media (max-width: 560px) {
  .price-field {
    width: 134px;
  }
}


/* clean-1.39: Feedbackbox auf großen Bildschirmen nicht mehr abschneiden */
.feedback {
  min-height: 78px;
  height: auto;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  line-height: 1.25;
  overflow: visible;
  padding: 12px 16px;
}

.feedback span {
  display: inline-flex;
  align-items: center;
}

.feedback span:not(.feedback-icon) {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.feedback-icon {
  flex: 0 0 auto;
}

.status-row,
.app.recognize-mode .status-row {
  grid-template-columns: minmax(0, 1fr) 210px;
}


/* clean-1.40: Statuszeile und Buttons sauber entkoppeln */
.board {
  grid-template-rows: 156px minmax(360px, 1fr) auto auto;
}

.status-row,
.app.recognize-mode .status-row {
  height: auto;
  min-height: 78px;
  max-height: none;
  align-items: stretch;
}

.feedback {
  min-height: 78px;
  height: auto;
  max-height: none;
  align-content: center;
}

.trash-zone {
  min-height: 78px;
  height: auto;
  max-height: none;
}

.board-actions {
  margin-top: 8px;
  align-self: stretch;
  min-height: 54px;
  position: relative;
  z-index: 1;
}

/* Bei langen Rückmeldungen umbrechen, aber ohne Überlappung */
.feedback span:not(.feedback-icon) {
  max-width: 100%;
}


/* clean-1.41: Rückmeldetext bleibt sicher innerhalb der Feedbackbox */
.feedback {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  height: auto;
  max-height: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  justify-items: center;
  column-gap: 10px;
  row-gap: 4px;
  overflow: hidden;
  padding: 12px 18px;
}

.feedback-icon {
  grid-column: 1;
  flex: none;
  min-width: 32px;
  text-align: center;
}

.feedback span:not(.feedback-icon) {
  grid-column: 2;
  display: block;
  min-width: 0;
  max-width: 100%;
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.25;
  text-align: center;
}

/* Ohne Icon soll der Text die ganze Box nutzen */
.feedback.neutral {
  grid-template-columns: minmax(0, 1fr);
}

.feedback.neutral span,
.feedback.neutral {
  text-align: center;
}

/* Längere Fehlermeldungen dürfen die Box höher machen, aber nicht herausragen */
.status-row,
.app.recognize-mode .status-row {
  align-items: start;
}

.board-actions {
  margin-top: 10px;
}


/* clean-1.45-plus-6: eigenes Tablet-Layout für iPad quer / kleine Laptops */
@media (min-width: 901px) and (max-width: 1280px) {
  .app {
    width: min(100%, calc(100vw - 24px));
  }

  .layout,
  .app.recognize-mode .layout {
    grid-template-columns: 285px minmax(0, 1fr) !important;
    gap: 16px;
    align-items: start;
  }

  .settings {
    grid-column: 1;
  }

  .board {
    grid-column: 2;
    min-width: 0;
  }

  .money-panel,
  .app.recognize-mode .money-panel {
    grid-column: 1 / -1;
    width: 100%;
  }

  .money-panel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .palette.coins {
    grid-template-columns: repeat(8, minmax(78px, 1fr));
  }

  .palette.notes {
    grid-template-columns: repeat(7, minmax(120px, 1fr));
  }

  .task-card {
    height: auto;
    min-height: 168px;
    max-height: none;
    overflow: visible;
    justify-content: center;
  }

  .task-line,
  .task-line.nowrap {
    flex-wrap: wrap !important;
    row-gap: 10px;
    min-width: 0;
  }

  .task-help {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.3;
  }

  .change-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .change-card {
    min-width: 0;
    padding: 10px 12px;
  }

  .big-word {
    font-size: clamp(24px, 2.4vw, 34px);
  }

  .small-word {
    font-size: 22px;
  }

  .name-field {
    width: min(240px, 100%);
  }

  .amount-field,
  .price-field,
  .paid-field,
  .recognize-field {
    width: 145px;
  }

  .status-row,
  .app.recognize-mode .status-row {
    grid-template-columns: minmax(0, 1fr) 220px !important;
    align-items: stretch;
    height: auto;
    min-height: 78px;
    max-height: none;
  }

  .feedback {
    height: auto;
    min-height: 78px;
    max-height: none;
    overflow: hidden;
    padding: 12px 16px;
    line-height: 1.25;
  }

  .feedback span:not(.feedback-icon) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }

  .trash-zone {
    height: auto;
    min-height: 78px;
    max-height: none;
    padding: 10px 12px;
  }

  .board-actions {
    margin-top: 8px;
  }
}

/* Etwas schmalere Tablets: Status und Buttons lieber untereinander lesbar */
@media (min-width: 901px) and (max-width: 1080px) {
  .status-row,
  .app.recognize-mode .status-row {
    grid-template-columns: 1fr !important;
  }

  .board-actions {
    justify-content: flex-end;
  }

  .palette.coins {
    grid-template-columns: repeat(6, minmax(78px, 1fr));
  }

  .palette.notes {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }
}


/* clean-1.46-admin-1: Adminbereich, Produktverwaltung und JSON-Import/Export */
.admin-modal {
  width: min(1080px, calc(100vw - 36px));
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}

.admin-toolbar button {
  min-height: 46px;
  padding: 10px 14px;
}

.danger-soft {
  color: #8a1f1f;
  border-color: #e0b6b6;
  background: #fff7f7;
}

.admin-hint {
  margin: 12px 0 18px;
  padding: 12px 14px;
  border: 1px solid #d7e2ef;
  border-radius: 14px;
  background: #f7fbff;
  color: #40566c;
  line-height: 1.4;
}

.admin-product-list {
  display: grid;
  gap: 14px;
}

.admin-product-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: #ffffff;
}

.admin-product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-product-head strong {
  font-size: 19px;
  color: var(--ink);
}

.admin-delete {
  min-height: 40px;
  padding: 8px 12px;
  color: #8a1f1f;
}

.admin-delete:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.admin-product-card label {
  display: grid;
  gap: 6px;
  color: #40566c;
  font-weight: 800;
  margin: 10px 0;
}

.admin-product-card input,
.admin-product-card textarea {
  width: 100%;
  border: 1px solid #cbd9e8;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  font: inherit;
  font-weight: 700;
}

.admin-product-card textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.35;
}

.icon-input {
  max-width: 140px;
  font-size: 28px;
}

.admin-price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .admin-price-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .admin-price-grid {
    grid-template-columns: 1fr;
  }

  .admin-toolbar button {
    width: 100%;
  }
}

/* clean-1.46-admin-2: Adminbereich als eigene Seite und automatische Produktpreis-Berechnung */
.app.admin-open .modes,
.app.admin-open .layout {
  display: none !important;
}

.admin-page {
  padding: 22px;
  background: #f6fbff;
  border-bottom: 1px solid var(--line);
}

.admin-page.hidden {
  display: none !important;
}

.admin-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  box-shadow: 0 4px 18px rgba(30,60,90,.08);
}

.admin-page-head h2 {
  margin: 0 0 8px;
  font-size: 34px;
}

.admin-page-head p {
  margin: 0;
  max-width: 860px;
  color: #40566c;
  font-size: 18px;
  line-height: 1.45;
}

.admin-product-fields {
  display: grid;
  grid-template-columns: 1.25fr .6fr 1fr .85fr .8fr .8fr .8fr;
  gap: 12px;
  align-items: end;
}

.admin-product-card select,
.admin-product-card input {
  width: 100%;
  border: 1px solid #cbd9e8;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  font: inherit;
  font-weight: 700;
  min-height: 46px;
}

.admin-price-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e4edf6;
  color: #40566c;
  font-size: 14px;
  line-height: 1.35;
}

.admin-price-preview span {
  border: 1px solid #d7e2ef;
  border-radius: 12px;
  padding: 8px 10px;
  background: #f7fbff;
}

.admin-price-preview strong {
  color: var(--blue);
}

@media (max-width: 1180px) {
  .admin-product-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-price-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .admin-page {
    padding: 14px;
  }

  .admin-page-head {
    flex-direction: column;
  }

  .admin-page-head button,
  .admin-toolbar button {
    width: 100%;
  }

  .admin-product-fields,
  .admin-price-preview {
    grid-template-columns: 1fr;
  }
}


/* clean-1.47-shop-test: Produktlager, Warenkorb und Budgetmodus als Testaufbau */
.app.shopping-mode .task-card {
  height: auto;
  min-height: 230px;
  max-height: none;
  overflow: visible;
  justify-content: flex-start;
  gap: 10px;
}

.shopping-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.shopping-type,
.soft-btn,
.mini-btn {
  min-height: 36px;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 800;
}

.shopping-type.active {
  background: #dbeeff;
  color: var(--blue);
  border-color: #111;
}

.shopping-task-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .95fr);
  gap: 12px;
  align-items: stretch;
}

.shopping-task-main {
  border: 1px solid #ead79f;
  background: rgba(255,255,255,.6);
  border-radius: 16px;
  padding: 12px;
}

.shop-summary {
  display: inline-block;
  margin-top: 8px;
  font-size: 22px;
  font-weight: 900;
  color: var(--blue);
}

.cart-box {
  border: 1px solid #d7e2ef;
  background: white;
  border-radius: 16px;
  padding: 10px;
  max-height: 260px;
  overflow: auto;
}

.cart-title {
  color: var(--blue);
  font-weight: 900;
  margin-bottom: 6px;
}

.cart-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-top: 1px solid #edf2f7;
  font-size: 15px;
}

.cart-product {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.cart-empty {
  color: var(--muted);
  padding: 10px 0;
}

.cart-controls {
  display: inline-flex;
  gap: 4px;
}

.mini-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
}

.shop-product-btn {
  grid-template-columns: 48px 1fr auto;
}

.product-price {
  color: var(--blue);
  font-size: 18px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 1280px) {
  .shopping-task-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .cart-row {
    grid-template-columns: 1fr auto;
  }
  .cart-row > span:nth-child(3),
  .cart-row > strong {
    display: none;
  }
  .shop-product-btn {
    grid-template-columns: 44px 1fr;
  }
  .product-price {
    grid-column: 2;
  }
}


/* clean-1.47-shop-test-3: Shopping-Aufgabenkarte darf die Ablagefläche nicht überlagern.
   Ursache war die feste Board-Rasterzeile aus den Basisversionen. */
.app.shopping-mode .board {
  grid-template-rows: auto minmax(360px, 1fr) auto auto;
}

.app.shopping-mode .drop-zone {
  align-self: stretch;
}


/* clean-1.47-shop-test-3: Produktlager bleibt innerhalb der linken Seitenleiste
   und wird nach Admin-Änderungen sauber synchronisiert. */
.product-panel,
#productList {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.product-btn,
.shop-product-btn {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.shop-product-btn {
  grid-template-columns: 42px minmax(0, 1fr) max-content;
  column-gap: 8px;
  padding: 8px 9px;
}

.shop-product-btn .product-text,
.shop-product-btn .product-text-name {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.15;
}

.shop-product-btn .product-text-name {
  font-size: clamp(18px, 1.5vw, 21px);
}

.shop-product-btn .product-price {
  justify-self: end;
  font-size: clamp(15px, 1.2vw, 18px);
}

@media (min-width: 901px) and (max-width: 1280px) {
  .shop-product-btn {
    grid-template-columns: 40px minmax(0, 1fr) max-content;
    column-gap: 7px;
  }
}


/* clean-1.47-shop-test-4: lokale Testversion lädt CSS/JS ohne Query-Parameter, damit file://-Öffnen in allen Browsern zuverlässig funktioniert. */


/* clean-1.47-shop-test-5: Produktlager einzeilig stabilisieren.
   Lange Produktnamen sollen nicht mehr mitten im Wort umbrechen; Icon und Preis sind kompakter. */
.shop-product-btn {
  grid-template-columns: 36px minmax(0, 1fr) max-content;
  column-gap: 7px;
  padding: 8px 8px;
}

.shop-product-btn .product-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  font-size: 20px;
  border-radius: 10px;
}

.shop-product-btn .product-text,
.shop-product-btn .product-text-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  line-height: 1.05;
}

.shop-product-btn .product-text-name {
  font-size: clamp(17px, 1.35vw, 19px);
  letter-spacing: -0.01em;
}

.shop-product-btn .product-price {
  justify-self: end;
  font-size: clamp(14px, 1.05vw, 16px);
  letter-spacing: -0.01em;
}

@media (min-width: 901px) and (max-width: 1280px) {
  .shop-product-btn {
    grid-template-columns: 34px minmax(0, 1fr) max-content;
    column-gap: 6px;
  }

  .shop-product-btn .product-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 19px;
  }
}

/* clean-1.47-shop-test-6: Produktlager bleibt einzeilig, aber Namen bis ca. "Neues Produkt" sollen nicht abgeschnitten werden. */
.shop-product-btn {
  grid-template-columns: 32px minmax(0, 1fr) max-content;
  column-gap: 6px;
  padding: 7px 7px;
}

.shop-product-btn .product-icon {
  width: 31px;
  height: 31px;
  min-width: 31px;
  font-size: 18px;
  border-radius: 9px;
}

.shop-product-btn .product-text-name {
  font-size: 18px;
  letter-spacing: -0.025em;
}

.shop-product-btn.name-medium .product-text-name {
  font-size: 16.5px;
  letter-spacing: -0.035em;
}

.shop-product-btn.name-long .product-text-name {
  font-size: 15.5px;
  letter-spacing: -0.045em;
}

.shop-product-btn.name-very-long .product-text-name {
  font-size: 14.5px;
  letter-spacing: -0.045em;
}

.shop-product-btn .product-price {
  font-size: 14.5px;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

@media (min-width: 901px) and (max-width: 1280px) {
  .shop-product-btn {
    grid-template-columns: 30px minmax(0, 1fr) max-content;
    column-gap: 5px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .shop-product-btn .product-icon {
    width: 29px;
    height: 29px;
    min-width: 29px;
    font-size: 17px;
  }

  .shop-product-btn .product-text-name {
    font-size: 17px;
  }

  .shop-product-btn.name-medium .product-text-name {
    font-size: 15.8px;
  }

  .shop-product-btn.name-long .product-text-name {
    font-size: 14.8px;
  }

  .shop-product-btn .product-price {
    font-size: 13.8px;
  }
}


/* clean-1.47-shop-test-7: Produktnamen im Produktlager vollständig lesbar halten.
   Standard bleibt einzeilig. Mehrwort-Namen dürfen bei Bedarf nur zwischen Wörtern umbrechen; keine Auslassungspunkte. */
.shop-product-btn .product-text,
.shop-product-btn .product-text-name {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.shop-product-btn.name-wrap .product-text-name {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.02;
}

.shop-product-btn.name-wrap {
  min-height: 66px;
}

.shop-product-btn.name-wrap .product-price {
  align-self: center;
}


/* clean-1.47-shop-test-8: Einkaufs-Aufgabenkarte robuster gegen abgeschnittene Sätze und zu breite Zeilen. */
.app.shopping-mode .task-card {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.app.shopping-mode .task-line,
.app.shopping-mode .task-line.nowrap {
  height: auto;
  min-height: 0;
  max-height: none;
  flex-wrap: wrap !important;
  align-items: center;
  row-gap: 10px;
}

.app.shopping-mode .task-help {
  height: auto;
  min-height: 0;
  max-height: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
}

.app.shopping-mode .big-word {
  line-height: 1.12;
  overflow-wrap: normal;
  word-break: normal;
}

.app.shopping-mode .shopping-task-main .big-word {
  font-size: clamp(28px, 3.2vw, 40px);
}

.app.shopping-mode .name-field {
  width: min(260px, 100%);
  max-width: 100%;
  flex: 1 1 210px;
}

.app.shopping-mode .price-field {
  width: 130px;
}

.app.shopping-mode .money-input-group {
  flex: 0 0 auto;
}

.app.shopping-mode .shopping-type-row {
  max-width: 100%;
  overflow: visible;
}

.app.shopping-mode .shopping-task-grid {
  min-width: 0;
}

.app.shopping-mode .shopping-task-main,
.app.shopping-mode .cart-box {
  min-width: 0;
}

.app.shopping-mode .shop-summary {
  display: block;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  line-height: 1.25;
}

@media (min-width: 901px) and (max-width: 1280px) {
  .app.shopping-mode .shopping-task-main .big-word {
    font-size: clamp(26px, 3vw, 36px);
  }

  .app.shopping-mode .name-field {
    flex-basis: 180px;
  }
}

@media (max-width: 560px) {
  .app.shopping-mode .shopping-task-main .big-word {
    font-size: 28px;
  }

  .app.shopping-mode .shop-summary {
    font-size: 19px;
  }
}


/* clean-1.47-shop-test-9: Die Einkaufs-Aufgabenkarte zeigt im blauen Hinweis keine dynamischen Warenkorb-/Restbeträge mehr.
   Die Betragsanzeige im Budgetmodus folgt nun ebenfalls der Einstellung „Gelegten Betrag anzeigen“. */
.app.shopping-mode .shop-summary {
  color: var(--blue);
}


/* clean-1.47-grid-test-2: weiterentwickelte Legehilfe mit aktiven Münzspalten und Stapelanzeige */
.drop-zone.grid-guide {
  background:
    linear-gradient(rgba(25, 118, 210, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 118, 210, .07) 1px, transparent 1px),
    radial-gradient(circle at 20% 20%, rgba(25,118,210,.05), transparent 35%),
    #fff;
  background-size: 42px 42px, 42px 42px, auto, auto;
}

.drop-guide {
  position: absolute;
  inset: 14px;
  z-index: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(8, minmax(58px, 1fr));
  gap: 8px;
  opacity: .94;
}

.drop-guide-column {
  min-width: 0;
  border: 2px dashed rgba(13, 71, 161, .22);
  border-radius: 16px;
  background: rgba(246, 251, 255, .62);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 10px 4px 6px;
  color: rgba(18, 48, 77, .76);
}

.drop-guide-column strong {
  font-size: clamp(13px, 1.05vw, 16px);
  line-height: 1.05;
  color: rgba(13, 71, 161, .9);
  white-space: nowrap;
}

.drop-guide-column span {
  font-size: clamp(10px, .85vw, 12px);
  line-height: 1.1;
  text-align: center;
  color: rgba(102, 119, 137, .82);
}

.drop-zone.grid-guide .placeholder {
  opacity: .16;
}

.drop-zone.grid-guide .placed {
  z-index: 5;
}

@media (max-width: 820px) {
  .drop-guide {
    grid-template-columns: repeat(4, minmax(62px, 1fr));
    inset: 12px;
  }
}

@media (max-width: 480px) {
  .drop-guide {
    grid-template-columns: repeat(2, minmax(86px, 1fr));
  }
}


.drop-guide-column {
  justify-content: flex-start;
  overflow: hidden;
}

.drop-guide-summary {
  margin-top: auto;
  padding-top: 8px;
  min-height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 1px;
}

.drop-guide-count {
  font-size: clamp(11px, .9vw, 13px);
  font-weight: 800;
  color: rgba(18, 48, 77, .76);
}

.drop-guide-total {
  font-size: clamp(11px, .95vw, 13px);
  font-weight: 900;
  color: rgba(13, 71, 161, .86);
  min-height: 1.2em;
}

.drop-guide-column.has-items {
  background: rgba(227, 242, 253, .78);
  border-color: rgba(13, 71, 161, .34);
}

.drop-zone.grid-guide .placed.snapped {
  transition: left .16s ease, top .16s ease;
}

@media (max-width: 820px) {
  .drop-guide-column {
    min-height: 132px;
  }
}


/* clean-1.47-shop-price-1: Fixpreise im Adminbereich und editierbares Budget */
.admin-product-card input:disabled {
  opacity: .56;
  background: #f3f6f9;
  cursor: not-allowed;
}

.budget-input-group {
  vertical-align: middle;
  margin: 0 4px;
}

.budget-field {
  width: 150px;
  font-size: inherit;
  min-height: 52px;
}

.app.shopping-mode .shopping-task-main .big-word {
  line-height: 1.2;
}


/* clean-1.47-font-test-1: Schriftumschaltung im Adminbereich */
body.font-primae,
body.font-primae button,
body.font-primae input,
body.font-primae select,
body.font-primae textarea {
  font-family: "PrimaeText", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.admin-font-section {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7fbff;
}

.admin-font-section h3 {
  margin-top: 0;
}

.admin-help {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.4;
}

.admin-field {
  display: grid;
  gap: 6px;
  max-width: 360px;
  font-weight: 800;
}

.admin-field select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: white;
  color: var(--ink);
}


/* clean-1.47-amount-format-1: Adminbereich nach Schriftart-Einstellung sauber trennen */
.admin-font-section {
  margin-bottom: 26px;
}

.admin-font-section + p,
.admin-page .admin-font-section + p {
  margin-top: 28px;
  clear: both;
}

.admin-page > p {
  max-width: 900px;
}


/* clean-1.47-amount-format-1: Betragsdarstellung und zweispaltige Darstellungseinstellungen */
.admin-display-grid {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(260px, 420px);
  gap: 18px;
  align-items: end;
}

.amount-split .currency-suffix {
  display: none;
}

.amount-split .amount-field,
.amount-split .price-field,
.amount-split .paid-field,
.amount-split .recognize-field,
.amount-split .budget-field {
  width: 190px;
}

.amount-split .product-price {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .admin-display-grid {
    grid-template-columns: 1fr;
  }

  .amount-split .amount-field,
  .amount-split .price-field,
  .amount-split .paid-field,
  .amount-split .recognize-field,
  .amount-split .budget-field {
    width: min(100%, 190px);
  }
}


/* clean-1.47-amount-format-2: Initialisierung der Betragsdarstellung repariert */


/* clean-1.47-amount-format-3: Sicherheitsgrenze gegen riesige Münzen nach Umschalten */
.drop-zone.grid-guide .placed.snapped {
  max-width: 96px;
}

.drop-zone.grid-guide .placed.snapped img {
  max-width: 96px;
}


/* clean-1.47-amount-format-4: Platz für Euro-und-Cent-Schreibweise an heiklen Stellen */
.amount-split .field {
  font-size: clamp(20px, 1.7vw, 28px);
}

.amount-split .amount-field,
.amount-split .price-field,
.amount-split .paid-field,
.amount-split .recognize-field,
.amount-split .budget-field {
  width: 215px;
  max-width: 100%;
  padding-left: 12px;
  padding-right: 12px;
  text-align: left;
}

.amount-split .task-line,
.amount-split .task-line.nowrap {
  flex-wrap: wrap !important;
  row-gap: 10px;
}

.amount-split .money-input-group,
.amount-split .budget-input-group {
  min-width: 215px;
}

.amount-split .shopping-task-card .price-field,
.amount-split .shopping-task-card .budget-field,
.amount-split .app.shopping-mode .price-field,
.amount-split .app.shopping-mode .budget-field {
  width: 230px;
}

.amount-split .change-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.amount-split .change-card .field {
  width: 100%;
  min-width: 0;
  font-size: clamp(18px, 1.45vw, 24px);
}

.amount-split .value-line {
  min-width: 0;
}

.amount-split .shop-product-btn {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 8px;
}

.amount-split .product-price {
  font-size: clamp(15px, 1vw, 18px);
  white-space: nowrap;
  justify-self: end;
}

.amount-split .cart-line,
.amount-split .cart-item,
.amount-split .cart-row {
  min-width: 0;
}

.amount-split .cart-price,
.amount-split .cart-total,
.amount-split .cart-item-price {
  white-space: nowrap;
}

/* Euro/Cent-Schreibweise: Warenkorbbeträge nicht umbrechen lassen. */
.amount-split .cart-row {
  grid-template-columns: minmax(84px, 1fr) max-content max-content max-content max-content;
}

.amount-split .cart-qty,
.amount-split .cart-unit-price,
.amount-split .cart-line-total {
  white-space: nowrap;
}

.amount-split .cart-product strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.amount-split .admin-product-fields .admin-input[inputmode="decimal"],
.amount-split .admin-product-fields input[inputmode="decimal"] {
  min-width: 150px;
}

@media (max-width: 1365px) and (min-width: 1101px) {
  .amount-split .amount-field,
  .amount-split .price-field,
  .amount-split .paid-field,
  .amount-split .recognize-field,
  .amount-split .budget-field {
    width: 205px;
  }

  .amount-split .shopping-task-card .price-field,
  .amount-split .shopping-task-card .budget-field,
  .amount-split .app.shopping-mode .price-field,
  .amount-split .app.shopping-mode .budget-field {
    width: 215px;
  }
}

@media (max-width: 900px) {
  .amount-split .amount-field,
  .amount-split .price-field,
  .amount-split .paid-field,
  .amount-split .recognize-field,
  .amount-split .budget-field {
    width: min(100%, 210px);
  }

  .amount-split .shopping-task-card .price-field,
  .amount-split .shopping-task-card .budget-field,
  .amount-split .app.shopping-mode .price-field,
  .amount-split .app.shopping-mode .budget-field {
    width: min(100%, 220px);
  }
}


/* clean-1.47-layout-test-1:
   Kompaktes Desktoplayout für kleinere Laptops/Tablets.
   Ziel: Die Geldleiste bleibt zwischen ca. 1051px und 1280px rechts,
   statt schon zu früh unter die Arbeitsfläche zu wandern. */
@media (min-width: 1051px) and (max-width: 1280px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app {
    width: min(1500px, calc(100% - 18px)) !important;
    max-width: calc(100% - 18px) !important;
    margin: 9px auto !important;
    border-radius: 22px !important;
    border-left: 1px solid var(--line) !important;
    border-right: 1px solid var(--line) !important;
  }

  .layout,
  .app.recognize-mode .layout {
    display: grid !important;
    grid-template-columns: 235px minmax(0, 1fr) 238px !important;
    gap: 12px !important;
    padding: 12px !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .settings {
    grid-column: 1 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 14px !important;
  }

  .board {
    grid-column: 2 !important;
    display: grid !important;
    min-height: 650px !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
  }

  .money-panel,
  .app.recognize-mode .money-panel {
    grid-column: 3 !important;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    padding: 14px !important;
  }

  .modes {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px !important;
    overflow: visible !important;
    padding: 10px 12px !important;
  }

  .mode {
    min-width: 0 !important;
    max-width: none !important;
    width: auto !important;
    white-space: normal !important;
    font-size: clamp(15px, 1.35vw, 17px) !important;
    padding: 10px 8px !important;
    gap: 6px !important;
  }

  .mode-icon {
    font-size: 19px !important;
  }

  .topbar {
    padding: 14px 16px !important;
    gap: 12px !important;
  }

  h1 {
    font-size: clamp(30px, 3vw, 36px) !important;
  }

  .top-actions {
    gap: 8px !important;
  }

  .top-actions button {
    min-height: 44px !important;
    padding: 10px 12px !important;
  }

  .panel h2 {
    font-size: 21px !important;
  }

  .settings label {
    white-space: normal !important;
    font-size: 15px !important;
  }

  .task-card {
    height: auto !important;
    min-height: 166px !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .task-line,
  .task-line.nowrap {
    flex-wrap: wrap !important;
    row-gap: 8px !important;
    min-width: 0 !important;
  }

  .task-help {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.25 !important;
  }

  .task-icon {
    width: 60px !important;
    height: 60px !important;
    border-radius: 16px !important;
    font-size: 30px !important;
  }

  .big-word {
    font-size: clamp(24px, 2.3vw, 32px) !important;
  }

  .small-word {
    font-size: 21px !important;
  }

  .name-field {
    width: min(100%, 220px) !important;
  }

  .amount-field,
  .price-field,
  .paid-field,
  .recognize-field {
    width: 138px !important;
  }

  .amount-split .amount-field,
  .amount-split .price-field,
  .amount-split .paid-field,
  .amount-split .recognize-field,
  .amount-split .budget-field,
  .amount-split .shopping-task-card .price-field,
  .amount-split .shopping-task-card .budget-field,
  .amount-split .app.shopping-mode .price-field,
  .amount-split .app.shopping-mode .budget-field {
    width: min(100%, 205px) !important;
  }

  .change-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .change-card {
    min-width: 0 !important;
    padding: 10px !important;
  }

  .status-row,
  .app.recognize-mode .status-row {
    grid-template-columns: minmax(0, 1fr) 190px !important;
    gap: 10px !important;
  }

  .feedback {
    font-size: clamp(17px, 1.5vw, 21px) !important;
    padding: 10px 12px !important;
  }

  .trash-zone {
    padding: 8px 10px !important;
  }

  .palette.coins {
    grid-template-columns: repeat(2, minmax(70px, 1fr)) !important;
    gap: 8px !important;
  }

  .palette.notes {
    grid-template-columns: repeat(2, minmax(86px, 1fr)) !important;
    gap: 8px !important;
  }

  .money-btn {
    min-height: 66px !important;
    padding: 6px !important;
  }

  .money-btn.coin img {
    max-height: 64px !important;
  }

  .money-btn img {
    max-height: 70px !important;
  }

  .money-panel h3 {
    margin: 14px 0 8px !important;
  }
}

/* Unterhalb davon darf die Oberfläche weiterhin wirklich in das schmale Tablet-/Mobil-Layout wechseln. */
@media (min-width: 901px) and (max-width: 1050px) {
  .money-panel {
    margin-top: 0;
  }
}


/* clean-1.47-euro-info-1: eigene Euro-Infoseite mit Akkordeon */
.euro-info-page {
  margin: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
}

.app.euro-info-open > .layout,
.app.euro-info-open > .modes {
  display: none;
}

.euro-info-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 18px;
  border: 1px solid #d7e2ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7fbff, #ffffff);
}

.euro-info-head h2 {
  margin: 0 0 8px;
  font-size: clamp(28px, 3vw, 40px);
}

.euro-info-head p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
  max-width: 850px;
}

.euro-info-intro {
  margin: 16px 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fffdf2;
  border: 1px solid var(--task-line);
  font-size: 18px;
  line-height: 1.45;
}

.euro-info-intro p {
  margin: 6px 0 0;
}

.euro-accordion {
  display: grid;
  gap: 10px;
}

.euro-accordion details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7fbff;
  overflow: hidden;
}

.euro-accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
  font-size: 21px;
  font-weight: 900;
  color: var(--blue);
  background: #edf6ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.euro-accordion summary::-webkit-details-marker {
  display: none;
}

.euro-accordion summary::after {
  content: "＋";
  flex: 0 0 auto;
  font-size: 22px;
  color: var(--ink);
}

.euro-accordion details[open] summary::after {
  content: "−";
}

.euro-info-content {
  padding: 16px 18px 18px;
  background: white;
  color: #263d54;
  font-size: 18px;
  line-height: 1.55;
}

.euro-info-content p {
  margin: 0 0 10px;
}

.euro-info-content p:last-child {
  margin-bottom: 0;
}

.euro-info-content ul {
  margin: 0;
  padding-left: 22px;
}

.euro-info-content li {
  margin: 6px 0;
}

.euro-info-source {
  margin: 16px 4px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

@media (max-width: 820px) {
  .euro-info-page {
    margin: 14px;
    padding: 14px;
  }

  .euro-info-head {
    flex-direction: column;
  }

  .euro-info-head button {
    align-self: flex-start;
  }

  .euro-accordion summary {
    font-size: 19px;
  }

  .euro-info-content,
  .euro-info-intro {
    font-size: 17px;
  }
}


/* clean-1.47-euro-info-2: ausgebaute Euro-Infoseite mit Geldgrafiken */
.euro-quickfacts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.euro-quickfacts article {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f7fbff;
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  min-height: 92px;
}

.euro-quickfacts strong {
  color: var(--blue);
  font-size: clamp(30px, 3vw, 42px);
  line-height: 1;
}

.euro-quickfacts span {
  color: #40566c;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 800;
}

.euro-coin-grid,
.euro-note-grid {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.euro-coin-grid {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.euro-note-grid {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.euro-money-card {
  border: 1px solid #d7e2ef;
  border-radius: 16px;
  background: #f7fbff;
  padding: 12px;
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
  min-width: 0;
}

.euro-money-card img {
  width: 100%;
  height: 88px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.16));
}

.euro-money-card.coin img {
  max-width: 92px;
}

.euro-money-card.note img {
  max-width: 190px;
}

.euro-money-card strong {
  color: var(--blue);
  font-size: 22px;
  line-height: 1.05;
}

.euro-money-card span {
  color: #263d54;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 800;
}

.euro-money-card em {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  font-style: normal;
}

.euro-calc-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.euro-calc-examples span {
  border: 1px solid #d7e2ef;
  border-radius: 999px;
  background: #fffdf2;
  padding: 8px 12px;
  font-weight: 900;
  color: #12304d;
  white-space: nowrap;
}

.euro-timeline {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.euro-timeline article {
  border-left: 5px solid #8bc5f4;
  background: #f7fbff;
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.euro-timeline strong {
  color: var(--blue);
  font-size: 18px;
}

.euro-timeline span {
  color: #263d54;
  line-height: 1.4;
}

@media (max-width: 1100px) {
  .euro-quickfacts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .euro-coin-grid {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }

  .euro-note-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 620px) {
  .euro-quickfacts,
  .euro-coin-grid,
  .euro-note-grid {
    grid-template-columns: 1fr 1fr;
  }

  .euro-money-card img {
    height: 76px;
  }

  .euro-money-card.note img {
    max-width: 150px;
  }

  .euro-calc-examples span {
    white-space: normal;
  }
}


/* clean-1.47-euro-info-3: weiterführende Links auf der Euro-Info-Seite */
.euro-link-section {
  margin: 18px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
}

.euro-link-section h3 {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 24px;
}

.euro-link-section > p {
  margin: 0 0 14px;
  color: #40566c;
  font-size: 17px;
  line-height: 1.45;
}

.euro-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.euro-link-card {
  display: grid;
  gap: 6px;
  min-height: 112px;
  padding: 14px 16px;
  border: 1px solid #d7e2ef;
  border-radius: 16px;
  background: #f7fbff;
  color: #12304d;
  text-decoration: none;
  box-shadow: 0 2px 0 rgba(0,0,0,.03);
}

.euro-link-card:hover {
  background: #edf6ff;
  border-color: #8bc5f4;
  text-decoration: none;
}

.euro-link-card strong {
  color: var(--blue);
  font-size: 18px;
  line-height: 1.25;
}

.euro-link-card span {
  color: #40566c;
  line-height: 1.35;
}

.euro-link-card::after {
  content: "↗";
  justify-self: end;
  align-self: end;
  color: var(--blue);
  font-weight: 900;
}

.euro-link-kids {
  background: #fffdf2;
  border-color: var(--task-line);
}

.euro-link-kids:hover {
  background: #fff8dd;
}

@media (max-width: 820px) {
  .euro-link-grid {
    grid-template-columns: 1fr;
  }

  .euro-link-card {
    min-height: auto;
  }
}


/* clean-1.47-euro-info-4: Admin- und Euro-Info-Seite strikt trennen */
.app.admin-open > .euro-info-page {
  display: none !important;
}

.app.euro-info-open > .admin-page {
  display: none !important;
}

.app.admin-open > .modes,
.app.admin-open > .layout,
.app.euro-info-open > .modes,
.app.euro-info-open > .layout {
  display: none !important;
}


/* clean-1.47-admin-blocks-5: Admin-Kopf mit Darstellungs- und Produktfilterkarte */
.admin-page-head > div:first-child {
  width: 100%;
}

.admin-font-section {
  max-width: none;
}

.admin-page-head .admin-font-section,
.admin-page-head .admin-filter-section {
  display: inline-block;
  vertical-align: top;
}

.admin-page-head .admin-font-section {
  width: min(860px, 62%);
  margin-right: 18px;
}

.admin-filter-section {
  width: min(420px, 32%);
  margin: 18px 0 26px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7fbff;
}

.admin-filter-section h3 {
  margin-top: 0;
  color: var(--blue);
}

.admin-product-intro {
  margin: 18px 0 14px;
  padding: 16px 18px;
  border: 1px solid #d7e2ef;
  border-radius: 16px;
  background: #ffffff;
  color: #40566c;
  line-height: 1.45;
}

.admin-product-intro strong {
  display: block;
  color: var(--blue);
  margin-bottom: 6px;
  font-size: 18px;
}

.admin-product-intro p {
  margin: 0;
}

.admin-empty {
  padding: 18px;
  border: 1px dashed #aac5e2;
  border-radius: 16px;
  background: #f7fbff;
  color: #40566c;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .admin-page-head .admin-font-section,
  .admin-page-head .admin-filter-section {
    display: block;
    width: 100%;
    margin-right: 0;
  }
}


/* clean-1.47-admin-blocks-5: Standardkategorien sind umbenennbar, aber nicht löschbar. */
#adminPage .admin-category-row-compact.locked .admin-category-edit {
  background:#edf6ff!important;
  color:#004f9e!important;
}


/* clean-1.47-admin-blocks-6: getrennte Filter für Kategorie und Preisart. */
#adminPage .admin-filter-pair {
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}


/* 1.47-admin-blocks-6-meta-style-clean: ausgelagerter Admin-CSS-Block aus index.html */
/* Inhalt unverändert übernommen, damit das Admin-Layout gleich bleibt. */
#adminPage.admin-blocks-page{
  padding:22px!important;
  background:#f6fbff!important;
}
#adminPage .admin-blocks-head{
  display:flex!important;
  justify-content:space-between!important;
  align-items:flex-start!important;
  gap:18px!important;
  margin-bottom:18px!important;
}
#adminPage .admin-blocks-head h2{
  margin:0!important;
  font-size:clamp(32px,3vw,42px)!important;
}
#adminPage .admin-back-button{
  white-space:nowrap!important;
  width:auto!important;
  min-width:132px!important;
  padding:13px 18px!important;
}
#adminPage .admin-block-grid.admin-three-blocks{
  display:grid!important;
  grid-template-columns:minmax(420px,1.35fr) minmax(300px,.85fr) minmax(390px,1.05fr)!important;
  gap:16px!important;
  align-items:start!important;
  width:100%!important;
  margin-bottom:16px!important;
}
#adminPage .admin-block,
#adminPage .admin-font-section,
#adminPage .admin-filter-section,
#adminPage .admin-category-block{
  display:block!important;
  width:auto!important;
  max-width:none!important;
  min-width:0!important;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  padding:16px!important;
  box-sizing:border-box!important;
  border:1px solid #c7d7ea!important;
  border-radius:18px!important;
  background:#f7fbff!important;
  box-shadow:0 2px 10px rgba(30,60,90,.04)!important;
}
#adminPage .admin-block h3{
  margin:0 0 10px!important;
  color:#004f9e!important;
  font-size:18px!important;
}
#adminPage .admin-help{
  margin:0 0 12px!important;
  line-height:1.35!important;
  color:#40566c!important;
  font-size:16px!important;
}
#adminPage .admin-field{
  max-width:none!important;
  width:100%!important;
}
#adminPage .admin-field select{
  width:100%!important;
}
#adminPage .admin-display-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:14px!important;
}
#adminPage .admin-toolbar{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:10px!important;
  margin:0 0 14px!important;
  padding:0!important;
}
#adminPage .admin-toolbar button{
  width:auto!important;
  min-height:44px!important;
  padding:10px 14px!important;
}
#adminPage .admin-category-list{
  display:flex!important;
  flex-direction:column!important;
  gap:6px!important;
  margin:6px 0 0!important;
}
#adminPage .admin-category-row-compact{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto auto!important;
  gap:8px!important;
  align-items:center!important;
  min-height:38px!important;
  padding:7px 8px 7px 10px!important;
  border:1px solid #d7e2ef!important;
  border-radius:12px!important;
  background:#fff!important;
  box-shadow:none!important;
}
#adminPage .admin-category-row-compact.custom{
  background:#fffdf7!important;
  border-color:#ecd999!important;
}
#adminPage .admin-category-row-name{
  min-width:0!important;
  display:flex!important;
  align-items:baseline!important;
  gap:6px!important;
  flex-wrap:wrap!important;
}
#adminPage .admin-category-row-name strong{
  color:#12304d!important;
  font-size:14px!important;
  line-height:1.1!important;
  font-weight:900!important;
}
#adminPage .admin-category-row-name span{
  color:#697b8f!important;
  font-size:12px!important;
  line-height:1.1!important;
}
#adminPage .admin-category-row-count{
  white-space:nowrap!important;
  color:#40566c!important;
  font-size:12px!important;
  font-weight:800!important;
  padding:3px 7px!important;
  border-radius:999px!important;
  background:#edf6ff!important;
}
#adminPage .admin-category-row-actions{
  display:flex!important;
  gap:4px!important;
  justify-content:flex-end!important;
  align-items:center!important;
}
#adminPage .admin-category-badge{
  color:#8c99a8!important;
  font-size:12px!important;
  font-weight:800!important;
}
#adminPage .admin-mini-action{
  width:28px!important;
  height:28px!important;
  min-width:28px!important;
  min-height:28px!important;
  padding:0!important;
  display:inline-grid!important;
  place-items:center!important;
  border-radius:999px!important;
  font-size:16px!important;
  line-height:1!important;
  box-shadow:none!important;
}
#adminPage .admin-category-edit{
  background:#edf6ff!important;
  color:#004f9e!important;
}
#adminPage .admin-category-delete{
  background:#fff7f7!important;
  color:#9d2b2b!important;
  border-color:#e0b6b6!important;
}
#adminPage .admin-category-add{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto!important;
  gap:8px!important;
  margin-top:10px!important;
}
#adminPage .admin-category-add input{
  min-height:38px!important;
  width:100%!important;
  border:1px solid #c7d7ea!important;
  border-radius:12px!important;
  padding:7px 10px!important;
  background:#fff!important;
}
#adminPage .admin-category-add button{
  min-height:38px!important;
  border-radius:12px!important;
  padding:7px 11px!important;
}

#adminPage .admin-filter-pair{
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:10px!important;
}
@media (max-width:1350px){
  #adminPage .admin-block-grid.admin-three-blocks{
    grid-template-columns:1fr 1fr!important;
  }
  #adminPage .admin-category-block{
    grid-column:1 / -1!important;
  }
}
@media (max-width:850px){
  #adminPage .admin-block-grid.admin-three-blocks{
    grid-template-columns:1fr!important;
  }
  #adminPage .admin-category-block{
    grid-column:auto!important;
  }
}
@media (max-width:680px){
  #adminPage .admin-blocks-head{flex-direction:column!important;}
  #adminPage .admin-back-button{width:100%!important;}
  #adminPage .admin-display-grid,
  #adminPage .admin-category-add{grid-template-columns:1fr!important;}
  #adminPage .admin-toolbar button{width:100%!important;}
}
