/* Gestaltung "Spielgefuehl" (Variante A Hell): Inventar-Optik mit hellgrauen Paneelen,
   abgeschraegten Kanten und vertieften Feldern. Eigene Pixel-Optik per box-shadow, keine
   fremden Texturen. Ueberschriften in Pixelify Sans (SIL OFL, siehe schrift/OFL.txt).
   Ersetzt design.css; die Bereichsdateien lesen ihre Farben ueber die Variablen unten. */
@font-face {
  font-family: "Pixelify Sans";
  src: url("/schrift/PixelifySans.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* Spielfarben */
  --hg: #b9c3cc; --hg2: #aeb8c2;
  --panel: #c6c6c6; --panel-hl: #ffffff; --panel-sh: #555555; --edge: #1b1b1b;
  --slot: #8b8b8b; --slot-sh: #373737; --slot-hl: #ffffff; --slot-hover: #a3a3c8;
  --btn: #a8a8a8; --btn-hl: #e6e6e6; --btn-sh: #4b4b4b; --btn-text: #1e1e1e;
  --go: #3f9a2e; --go-hl: #8fe07a; --go-sh: #22571a;
  --sell: #c98a1d; --sell-hl: #f7cf72; --sell-sh: #6f4a0b;
  --blau: #2f6fd6;
  --feld: #000000; --feld-text: #f0f0f0;
  /* Variablen der bisherigen Bereichsdateien */
  --bg: #b4b4b4;
  --surface: #c6c6c6;
  --surface-raised: #b3b3b3;
  --ink: #202020;
  --muted: #474747;
  --line: #8b8b8b;
  --accent: #1a4fa6;
  --lime: var(--accent);
  --green: #1b6e1b;
  --red: #a3221b;
  --nav: #c6c6c6;
  --white: #d4d4d4;
  --focus: #1a4fa6;
  --radius: 4px;
  --sidebar-width: 0px;
  --pixel: "Pixelify Sans", ui-monospace, monospace;
}

/* ---------- Grundlage ---------- */
html {
  min-height: 100%; scrollbar-color: #6f6f6f #c6c6c6;
  /* Fokus und Sprungziele landen nie unter Kopfzeile oder Hotbar. */
  scroll-padding-top: calc(var(--kopf-h, 68px) + 8px);
  scroll-padding-bottom: calc(var(--hotbar-h, 96px) + var(--auswahl-h, 0px) + 8px);
}
body {
  margin: 0;
  font: 15px/1.45 system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background-color: var(--hg);
  background-image: linear-gradient(45deg, var(--hg2) 25%, transparent 25%, transparent 75%, var(--hg2) 75%),
                    linear-gradient(45deg, var(--hg2) 25%, transparent 25%, transparent 75%, var(--hg2) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
  min-height: 100vh;
  /* Unten so viel Platz wie Hotbar und Aktionsleiste hoch sind: nichts verschwindet dahinter. */
  padding-bottom: calc(var(--hotbar-h, 96px) + var(--auswahl-h, 0px) + 16px);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #2f6fd655; color: var(--ink); }
button, input, select, textarea { font: inherit; }
h1, h2, h3, h4, .pixel { font-family: var(--pixel); font-weight: 500; letter-spacing: .5px; color: #303030; }
h1 { font-size: 32px; line-height: 1.1; letter-spacing: 1px; }
h2 { font-size: 22px; line-height: 1.2; }
h3 { font-size: 19px; }
h4 { font-size: 16px; }
p, small { color: var(--muted); }
a { color: var(--accent); }
code { background: #000; color: #f0f0f0; border: 0; border-radius: 0; padding: 1px 5px; }
img.icon, .itemicon img { image-rendering: pixelated; }
.icon.ohne { display: grid; place-items: center; width: 32px; height: 32px; font-family: var(--pixel); color: #eee; font-size: 20px; text-shadow: 2px 2px 0 #333; }
.skiplink { position: fixed; top: 8px; left: 8px; z-index: 100; transform: translateY(-160%); padding: 10px 16px; background: var(--blau); color: #fff; }
.skiplink:focus { transform: translateY(0); }

/* Fokus gut sichtbar, auf hellem wie dunklem Grund */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--blau); outline-offset: 2px;
}

/* ---------- Knoepfe ---------- */
button, .knopf {
  background: var(--btn); color: var(--btn-text); border: 0; border-radius: 0; cursor: pointer;
  min-height: 38px; padding: 8px 14px; font-weight: 600;
  box-shadow: inset 2px 2px 0 var(--btn-hl), inset -2px -2px 0 var(--btn-sh), 0 0 0 2px var(--edge);
  transition: none;
}
button:hover:not(:disabled), .knopf:hover:not(:disabled) { filter: brightness(1.1); background: var(--btn); border-color: transparent; }
button:active:not(:disabled) { box-shadow: inset 2px 2px 0 var(--btn-sh), inset -2px -2px 0 var(--btn-hl), 0 0 0 2px var(--edge); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.secondary { background: var(--btn); color: var(--btn-text); border: 0; }
button.secondary:hover:not(:disabled) { background: var(--btn); }
.knopf.an, button[aria-pressed="true"].knopf { background: var(--blau); color: #fff; }
.knopf.gruen, #submitOrder, #batchConfirm, #linkForm button, #emptyMarket, .work-area .work-primary, .work-dialog .work-primary {
  background: var(--go); color: #fff; border: 0;
  box-shadow: inset 3px 3px 0 var(--go-hl), inset -3px -3px 0 var(--go-sh), 0 0 0 2px var(--edge);
  text-shadow: 1px 1px 0 #1b3e14;
}
.knopf.gelb, #submitOrder[data-side="sell"] {
  background: var(--sell); color: #fff;
  box-shadow: inset 3px 3px 0 var(--sell-hl), inset -3px -3px 0 var(--sell-sh), 0 0 0 2px var(--edge);
  text-shadow: 1px 1px 0 #5a3a00;
}
.knopf.gross { font-size: 18px; padding: 12px 18px; min-height: 54px; width: 100%; }
.knopf.klein, .kopf .knopf { min-height: 32px; padding: 4px 10px; font-size: 13px; }
/* Sprachumschalter in der Kopfzeile: so klein wie .knopf.klein */
.kopf .sprachwahl { min-height: 32px; width: auto; padding: 4px 6px; font-size: 13px; font-family: inherit; cursor: pointer; }
.textbutton { background: transparent; box-shadow: none; color: var(--accent); min-height: 0; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.textbutton:hover:not(:disabled) { background: transparent; filter: none; color: #0f3577; }

/* ---------- Eingabefelder (schwarz wie im Spiel) ---------- */
input, select, textarea {
  background: var(--feld); color: var(--feld-text); border: 0; border-radius: 0;
  min-height: 40px; padding: 8px 11px;
  box-shadow: inset 2px 2px 0 #373737, 0 0 0 2px var(--panel-sh);
  color-scheme: dark;
}
input::placeholder, textarea::placeholder { color: #a8a8a8; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: transparent; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blau); min-height: 0; box-shadow: none; cursor: pointer; color-scheme: light; }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; vertical-align: middle; }
.work-toolbar input, .work-toolbar select, .work-form input, .work-form select,
.work-area .work-pagination select, .work-area [data-job-filter], .auto-network select,
.wagen-menge input, .wagen-setzeile input, .cartadd input, #chestTable input, .ticket input, .ticket select,
#withdrawForm input, #withdrawChest, .loginpanel input {
  background: var(--feld); color: var(--feld-text); border: 0; border-radius: 0;
  box-shadow: inset 2px 2px 0 #373737, 0 0 0 2px var(--panel-sh); color-scheme: dark;
}

/* ---------- Paneele ---------- */
.panel, .work-area .work-section, .emptyhero, .loginpanel, dialog, .work-dialog, .kontomenue, .mehrmenue {
  background: var(--panel); color: var(--ink);
  border: 0; border-radius: 4px;
  box-shadow: inset 3px 3px 0 var(--panel-hl), inset -3px -3px 0 var(--panel-sh), 0 0 0 3px var(--edge);
}
.panel { padding: 16px 18px; }
.work-area .work-section { padding: 18px; }
.vertieft, .work-table-wrap, .ticket, .preview, .feenote, #bankPanel .bankrates, .chestrow, .starterrecipe, .itemcard, .ordercard {
  background: #b9b9b9; border: 0; border-radius: 0;
  box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #e8e8e8;
}
dialog::backdrop, .work-dialog::backdrop { background: rgba(0, 0, 0, .55); backdrop-filter: none; }
dialog { padding: 20px; }
.dialoghead { border-bottom: 2px solid var(--slot); padding-bottom: 12px; }
.dialoghead .close, .work-dialog .close { width: 34px; height: 34px; min-height: 34px; padding: 0; font-size: 20px; }

/* ---------- Seitenrahmen ---------- */
.shell { margin-left: 0; min-width: 0; }
main { max-width: 1200px; margin: 0 auto; padding: 18px 16px 24px; }
main:focus { outline: 0; }
.seitenkopf { margin: 4px 0 14px; }
.seitenkopf h1 { margin: 0; font-size: 34px; color: #2f2f2f; text-shadow: 2px 2px 0 rgba(255, 255, 255, .55); }
.seitenkopf #pageIntro { margin: 4px 0 0; font-size: 14px; color: #3a3a3a; }

/* Kopfzeile */
.kopf {
  position: sticky; top: 0; z-index: 20;
  background: var(--panel); border: 0; padding: 8px 16px;
  box-shadow: inset 0 3px 0 var(--panel-hl), inset 0 -3px 0 var(--panel-sh), 0 3px 0 var(--edge);
  margin-bottom: 8px;
}
.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; flex-wrap: wrap; }
.kopfstatus { display: flex; align-items: center; gap: 12px; padding: 0; min-width: 0; }
.kopfrechts { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.kopfstatus .konto { position: relative; }
.kontoknopf {
  display: flex; align-items: center; gap: 10px; background: transparent; box-shadow: none;
  color: var(--ink); padding: 2px 6px 2px 2px; min-height: 44px; font-size: 16px; font-weight: 700; border: 0;
}
.kontoknopf:hover, .kontoknopf[aria-expanded="true"] { background: rgba(255, 255, 255, .35); filter: none; box-shadow: none; }
.kontoknopf #identity { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kontopfeil { font-size: 11px; color: var(--muted); }
.kopfbild {
  width: 40px; height: 40px; flex: none; image-rendering: pixelated;
  background: repeating-conic-gradient(#9a9a9a 0 25%, #b0b0b0 0 50%) 0 0 / 10px 10px;
  box-shadow: 0 0 0 2px var(--edge);
}
.kopfbild.hat-skin { background: transparent; }
.kontomenue { position: absolute; left: 0; right: auto; top: calc(100% + 8px); z-index: 45; min-width: 250px; padding: 14px; display: grid; gap: 8px; justify-items: start; }
.kontomenue #logout { padding-top: 8px; margin-top: 4px; border-top: 2px solid var(--slot); width: 100%; text-align: left; }
.kontomenue .currency-unit { font-size: 12px; margin: 0; }
.verbindung {
  display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; padding: 0;
  min-height: 0; font-size: 13px; color: var(--muted);
}
.verbindung .verbindungspunkt { width: 10px; height: 10px; font-size: 0; display: inline-block; background: #9a9a9a; box-shadow: 0 0 0 2px var(--edge); }
.verbindung.live .verbindungspunkt { background: #3ecf3e; }
.verbindung.wartet .verbindungspunkt { background: #e2b64a; }
.verbindung.stale { color: var(--red); font-weight: 700; }
.verbindung.stale .verbindungspunkt { background: #d33a2c; }
.geld { display: flex; align-items: center; gap: 8px; font-size: 21px; font-weight: 800; color: #1e1e1e; }
.geld .muenze { width: 24px; height: 24px; display: block; }
.geld .cr { font-size: 15px; font-weight: 700; color: #3a3a3a; }
.geld.plus #kontostand { color: var(--green); }
.geld.minus #kontostand { color: var(--red); }
#explore { display: none !important; }
.kopfwerte { display: none !important; }

/* ---------- Menue "Mehr" (alle Bereiche) ---------- */
.sidebar.mehrmenue {
  position: fixed; inset: auto 12px 104px auto; z-index: 35;
  width: min(380px, calc(100vw - 24px)); max-height: calc(100dvh - 190px); overflow-y: auto;
  padding: 14px; display: flex; flex-direction: column; gap: 10px; color: var(--ink);
}
.sidebar.mehrmenue[hidden] { display: none !important; }
.mehrkopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mehrkopf h2 { margin: 0; font-size: 22px; }
.mehrkopf .zu { min-height: 32px; padding: 2px 10px; }
.mehrmenue nav { display: grid; gap: 12px; overflow: visible; padding: 0; margin: 0; border: 0; max-height: none; grid-template-columns: 1fr; }
.mehrmenue .navliste { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mehrmenue .navgruppe { display: grid; gap: 6px; }
.mehrmenue .navgruppe.ist-zu .navliste { display: none; }
.mehrmenue .navgruppenkopf {
  background: transparent; box-shadow: none; min-height: 24px; padding: 0 2px; display: flex; align-items: center; gap: 6px;
  font-family: var(--pixel); font-size: 16px; color: #3a3a3a; letter-spacing: .5px; font-weight: 500;
}
.mehrmenue .navgruppenkopf:hover { background: transparent; filter: none; }
.mehrmenue nav button[data-page] {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; min-height: 42px; padding: 6px 10px;
  font-size: 14px; color: var(--btn-text); background: var(--btn); border: 0; border-radius: 0; line-height: 1.2;
}
.mehrmenue nav button[data-page].active { background: var(--blau); color: #fff; }
.mehrmenue .navicon { width: 18px; height: 18px; flex: 0 0 18px; display: grid; place-items: center; }
.mehrmenue .navicon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ---------- Hotbar ---------- */
.hotbar {
  position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 30;
  display: flex; gap: 0; padding: 4px; background: rgba(0, 0, 0, .55); box-shadow: 0 0 0 2px #000;
}
.hotbar .hb {
  position: relative; width: 74px; height: 74px; display: grid; place-items: center; grid-template-rows: 1fr auto;
  background: rgba(139, 139, 139, .35); border: 0; border-radius: 0; cursor: pointer; padding: 6px 0 4px; min-height: 0;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .5), inset -2px -2px 0 rgba(255, 255, 255, .25);
  color: #fff; font-weight: 700;
}
.hotbar .hb[hidden] { display: none; }
.hotbar .hb img.icon { width: 34px; height: 34px; display: block; }
.hotbar .hb .hb-name { font-size: 11px; text-shadow: 1px 1px 0 #000; white-space: nowrap; }
.hotbar .hb .hb-taste { position: absolute; left: 5px; top: 3px; font-size: 11px; color: #ddd; text-shadow: 1px 1px 0 #000; font-family: var(--pixel); }
.hotbar .hb:hover:not(:disabled) { background: rgba(200, 200, 255, .35); filter: none; }
.hotbar .hb.active, .hotbar .hb.aktiv-mehr { z-index: 1; box-shadow: 0 0 0 3px #fff, 0 0 0 6px #000, inset 0 0 0 2px #000; background: rgba(255, 255, 255, .22); }
.hotbar .hb-mehr { margin-left: 8px; }
.hotbar .hb:focus-visible { outline: 3px solid #ffd65c; outline-offset: -3px; }

/* ---------- Slots und Raster ---------- */
.slot {
  position: relative; width: 52px; height: 52px; display: grid; place-items: center; flex: none;
  background: var(--slot); border: 0; border-radius: 0; padding: 0; cursor: pointer; min-height: 0; color: #fff;
  box-shadow: inset 2px 2px 0 var(--slot-sh), inset -2px -2px 0 var(--slot-hl);
}
button.slot:hover:not(:disabled), button.slot:focus-visible { background: var(--slot-hover); filter: none; }
button.slot:focus-visible { outline: 3px solid var(--blau); outline-offset: 0; }
.slot img.icon { width: 32px; height: 32px; display: block; }
.slot .anz { position: absolute; right: 3px; bottom: 1px; font-size: 13px; font-weight: 800; color: #fff; text-shadow: 2px 2px 0 #3e3e3e; line-height: 1; pointer-events: none; }
.slot .anz.unendlich { font-size: 17px; }
.slot.leer { cursor: default; }
.slot.markiert { background: var(--slot-hover); box-shadow: inset 2px 2px 0 var(--slot-sh), inset -2px -2px 0 var(--slot-hl), 0 0 0 2px var(--blau); z-index: 1; }

#items.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px 6px; }
.ware { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.ware .slot { width: 64px; height: 64px; }
.ware .slot img.icon { width: 44px; height: 44px; }
.ware .preis { font-size: 12px; font-weight: 700; color: #262626; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ware.gesperrt .slot { filter: grayscale(1); opacity: .65; }
.ware.gesperrt .preis { color: var(--muted); font-weight: 600; }
.leer-meldung { grid-column: 1 / -1; padding: 20px; text-align: center; color: var(--muted); }
.hinweis { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

/* Markt: Werkzeuge */
#inventoryPanel[data-view="market"] { background: var(--panel); padding: 16px 18px; border-radius: 4px; box-shadow: inset 3px 3px 0 var(--panel-hl), inset -3px -3px 0 var(--panel-sh), 0 0 0 3px var(--edge); }
.marktfilter { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 0 0 14px; }
.reiter { display: flex; gap: 6px; flex-wrap: wrap; }
.reiter .knopf { min-height: 34px; padding: 5px 12px; font-size: 14px; }
body:not([data-seite="market"]) .marktfilter, body:not([data-seite="market"]) .markttipp { display: none; }
.markettools { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 12px; }
.markettools label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.searchbox {
  display: flex; align-items: center; gap: 8px; flex: 1 1 280px; min-width: 0; height: auto;
  background: var(--feld); border: 0; border-radius: 0; padding-left: 10px;
  box-shadow: inset 2px 2px 0 #373737, 0 0 0 2px var(--panel-sh);
}
.searchbox .searchicon { width: 18px; height: 18px; fill: none; stroke: #bbb; stroke-width: 1.8; flex: 0 0 18px; }
.searchbox input { flex: 1; min-width: 0; background: transparent; box-shadow: none; border: 0; min-height: 42px; padding: 8px 10px 8px 0; font-size: 15px; }
.searchbox:focus-within { outline: 3px solid var(--blau); outline-offset: 2px; }
.searchbox input:focus, .searchbox input:focus-visible { outline: 0; }
/* Hinweis zur @mod-Eingabe (web/suchhinweis.js): eigene Zeile im Suchfeld */
.searchbox { flex-wrap: wrap; }
.suchhinweis { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; padding: 0 10px 8px 16px; font-size: 13px; color: var(--feld-text); }
.suchhinweis[hidden] { display: none; }
.suchhinweis .chip { min-height: 30px; padding: 3px 9px; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suchhinweis small { opacity: .75; }
/* gegen "#marketTools .searchbox span { color: var(--muted) }": auf schwarzem Feld lesbar */
.searchbox #suchHinweis.suchhinweis > span, .searchbox #suchHinweis.suchhinweis small { color: inherit; }
.marketpagination { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
#pageInfo { font-size: 13px; color: var(--muted); }
.count { background: var(--slot); color: #fff; border: 0; border-radius: 0; padding: 1px 7px; font-size: 13px; box-shadow: inset 1px 1px 0 var(--slot-sh); }

/* Tooltip im Spielstil */
#tooltip {
  position: fixed; z-index: 80; pointer-events: none; max-width: 300px;
  background: rgba(16, 0, 16, .95); color: #fff; padding: 7px 10px; font-size: 14px;
  border: 2px solid #100010; box-shadow: inset 0 0 0 2px #50007f, inset 0 -2px 0 2px #28007f; border-radius: 3px;
}
#tooltip .tt-name { font-weight: 700; margin-bottom: 4px; }
#tooltip .tt-zeile { display: flex; justify-content: space-between; gap: 18px; color: #d0d0d0; }
#tooltip .tt-zeile b { color: #fff; }
#tooltip .tt-kauf b { color: #ffd65c; }
#tooltip .tt-verk b { color: #7cf06a; }
#tooltip .tt-gesperrt { color: #ff9c8f; }
#tooltip .tt-mod { color: #7fa6ff; font-style: italic; font-size: 12px; margin-top: 4px; }

/* ---------- Handelsfenster (wie eine Kiste) ---------- */
dialog.handel { width: min(880px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 16px 18px; }
.handel-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.handel-kopf h2 { margin: 0; font-size: 28px; line-height: 1.1; overflow-wrap: anywhere; }
.handel-kopf small { color: var(--muted); }
.handel-kopf .zu { margin-left: auto; min-height: 34px; padding: 2px 11px; flex: none; }
.handel-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.handel-item .slot { width: 64px; height: 64px; cursor: default; }
.handel-item .slot img.icon { width: 42px; height: 42px; }
.handel-grid { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.kiste h3 { font-size: 19px; margin: 0 0 6px; }
.kiste .slots { display: grid; grid-template-columns: repeat(3, 52px); gap: 0; }
.kiste .slots .slot { cursor: default; }
.kiste .info { font-size: 13px; color: var(--muted); margin-top: 6px; max-width: 156px; }
.mitte { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.modus { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mengen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.menge-feld { display: flex; align-items: center; gap: 8px; }
.menge-feld .knopf { flex: none; width: 42px; padding: 0; }
.menge-feld input { width: 100%; min-width: 0; font-size: 20px; font-weight: 800; text-align: center; }
.rechnung { font-size: 14px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.rechnung .summe { font-size: 21px; font-weight: 800; color: #1e1e1e; }
.warn { color: var(--red); font-size: 13px; min-height: 18px; font-weight: 600; }
.warn.nur-hinweis { color: #6b4a00; }
.handel-mehr { display: flex; gap: 8px; flex-wrap: wrap; }
.handel-mehr .knopf { flex: 1 1 auto; font-size: 13px; min-height: 34px; }
#hHinweis { margin: 0; }

/* ---------- Meldungen ("Fortschritt erzielt") ---------- */
#meldungen {
  position: fixed; top: calc(var(--kopf-h, 68px) + 8px); right: 12px; z-index: 90; width: min(330px, calc(100vw - 24px));
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; pointer-events: none; overflow: hidden;
}
.meldung {
  width: 100%; min-width: 0; display: flex; gap: 10px; align-items: center; padding: 8px 12px 8px 8px;
  background: #212121; color: #fff; border: 2px solid #000; box-shadow: inset 2px 2px 0 #555, inset -2px -2px 0 #0a0a0a;
  animation: rein .35s steps(5) both;
}
.meldung.raus { animation: raus .35s steps(5) both; }
.meldung .slot { width: 44px; height: 44px; cursor: default; }
.meldung .slot img.icon { width: 30px; height: 30px; }
.meldung .slot .muenze { width: 28px; height: 28px; }
.meldung .m-titel { color: #ffd65c; font-weight: 700; font-size: 13px; }
.meldung.kiste-an .m-titel { color: #7cf06a; }
.meldung .m-text { font-size: 14px; color: #fff; }
/* Ein- und Ausblenden an Ort und Stelle: nichts ragt rechts aus dem Bild. */
@keyframes rein { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes raus { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- Depot (depotansicht.js) ---------- */
#inventoryPanel[data-view="depot"] { background: var(--panel); padding: 14px 18px 16px; border-radius: 4px; box-shadow: inset 3px 3px 0 var(--panel-hl), inset -3px -3px 0 var(--panel-sh), 0 0 0 3px var(--edge); }
body:not([data-seite="depot"]) .depotansicht { display: none; }
body[data-seite="depot"] #inventoryPanel > .sectionhead, body[data-seite="depot"] #items { display: none !important; }
.depotansicht[hidden] { display: none; }
/* Kopf kompakt: Figur und drei Werte in einer Zeile */
.depotkopf { display: flex; gap: 10px; align-items: stretch; margin-bottom: 12px; }
.depotkopf .depotfigur { width: 60px; padding: 4px 0; }
.depotkopf .profile-character, .depotkopf .profile-character canvas { width: 40px; height: 80px; }
.wert-leiste { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wert { background: var(--slot); padding: 8px 12px; box-shadow: inset 2px 2px 0 var(--slot-sh), inset -2px -2px 0 var(--slot-hl); color: #fff; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.wert span { display: block; font-size: 12px; color: #f2f2f2; text-shadow: 1px 1px 0 #3e3e3e; }
.wert b { font-size: 20px; line-height: 1.2; text-shadow: 2px 2px 0 #3e3e3e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wert small { display: block; color: #ececec; font-size: 11px; text-shadow: 1px 1px 0 #3e3e3e; }
.wert.haupt b { color: #ffe36b; }
/* Streifen "Unterwegs zu deinen Kisten" */
.unterwegs { margin: 0 0 12px; padding: 8px 10px; background: #b9b9b9; box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #e8e8e8; }
.uw-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.uw-kopf h2 { margin: 0; font-size: 17px; }
.uw-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.uw { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.uw-text { min-width: 0; overflow-wrap: anywhere; }
.uw-status { font-size: 12px; padding: 1px 6px; background: #f6ebc8; color: #5a3f00; box-shadow: 0 0 0 2px var(--panel-sh); white-space: nowrap; }
.uw-angekommen .uw-status { background: #dff0d4; color: #173d10; }
.uw-abgebrochen .uw-status { background: #f6d5d0; color: #6e130d; }
.uw-abbruch_angefragt .uw-status { background: #fbe3c4; color: #6a3500; }
.uw-kiste-weg, .uw-knopf { flex-wrap: wrap; }
.uw-kiste-weg .uw-text, .uw-knopf .uw-text { flex: 1 1 9em; }
.uw-kiste-weg .uw-status { background: #e8e1f2; color: #3a2470; }
.uw-abbrechen { flex: none; }
.uw-mehr { font-size: 13px; color: var(--muted); align-self: center; }
.slot.klein { width: 30px; height: 30px; cursor: default; }
.slot.klein img.icon { width: 22px; height: 22px; }
.lagertitel { margin: 0 0 6px; font-size: 19px; }
/* Werkzeugleiste: klebt unter der Kopfzeile (#depotTools: schlaegt die alte Regel fuer Werkzeugleisten) */
#depotTools.depotleiste {
  position: sticky; top: var(--kopf-h, 68px); z-index: 12;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin: 0 -18px 12px; padding: 8px 18px; background: var(--panel);
  box-shadow: 0 2px 0 var(--panel-sh);
}
.depotleiste[hidden] { display: none; }
.depotleiste .searchbox { flex: 1 1 260px; }
.depotleiste .chips { display: flex; gap: 6px; order: 3; flex: 1 1 100%; min-width: 0; overflow-x: auto; padding: 3px; scrollbar-width: thin; }
.depotleiste .chip { flex: none; min-height: 32px; padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.depotleiste .chip small { color: inherit; opacity: .75; font-weight: 600; }
.leiste-rechts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.leiste-rechts .reiter .knopf, #auswahlKnopf { min-height: 34px; padding: 5px 12px; font-size: 14px; }
.sortwahl select { min-height: 36px; padding: 4px 8px; font-size: 14px; }
/* Raster ueber die volle Breite; Warenfenster rechts daneben */
/* Offenes Warenfenster: der Depotbereich macht rechts Platz, nichts wird verdeckt. */
body.warenfenster-offen #inventoryPanel[data-view="depot"] { padding-right: calc(var(--panel-b) + 34px); }
body.warenfenster-offen #inventoryPanel[data-view="depot"] .depotleiste { margin-right: calc(-1 * var(--panel-b) - 34px); padding-right: calc(var(--panel-b) + 34px); }
.depotinhalt { min-width: 0; }
.lagerraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 0; }
.lagerraster .slot { width: auto; height: auto; aspect-ratio: 1; }
.lagerraster .slot img.icon { width: 34px; height: 34px; }
.slot .haken { display: none; position: absolute; left: 3px; top: 1px; font-size: 14px; font-weight: 900; color: #fff; text-shadow: 1px 1px 0 #000; }
.slot.gewaehlt { background: #6f9be0; box-shadow: inset 2px 2px 0 #24467e, inset -2px -2px 0 #cfe0ff, 0 0 0 2px var(--blau); z-index: 1; }
.slot.gewaehlt .haken { display: block; }
.slot.offen { outline: 3px solid #ffd65c; outline-offset: -3px; z-index: 2; }
.depotansicht.waehlt .lagerraster .slot { cursor: copy; }
/* Beim Scrollen zu einer Ware (Tastatur, Suche) bleibt sie sichtbar: nicht unter der klebenden
   Leiste und nicht unter Hotbar oder Aktionsleiste. */
#depotAnsicht [data-lager], #depotAnsicht [data-markiere] {
  scroll-margin-top: calc(var(--kopf-h, 68px) + var(--leiste-h, 60px) + 8px);
  scroll-margin-bottom: calc(var(--hotbar-h, 96px) + var(--auswahl-h, 0px) + 8px);
}
.lagerliste { background: #bdbdbd; box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #ececec; overflow-x: auto; }
.lagerliste table { width: 100%; border-collapse: collapse; }
.lagerliste th, .lagerliste td { padding: 5px 8px; text-align: left; }
.lagerliste .zahl { text-align: right; white-space: nowrap; }
.lagerliste tr.gewaehlt td { background: rgba(47, 111, 214, .22); }
.lagerliste tr.offen td { background: rgba(255, 214, 92, .35); }
.lager-name { display: flex; align-items: center; gap: 8px; background: transparent; box-shadow: none; min-height: 0; padding: 2px 0; text-align: left; color: var(--ink); font-weight: 600; }
.lager-name:hover:not(:disabled) { color: var(--accent); filter: none; }
.lager-name small { display: block; font-weight: 400; font-size: 12px; }
/* Warenfenster */
:root { --panel-b: 340px; }
/* Warenfenster rechts: fest im Bild zwischen Kopfzeile (bzw. Depotbeginn) und Hotbar. */
.warenpanel {
  position: fixed; z-index: 25; width: var(--panel-b);
  right: calc(max(0px, (100vw - 1200px) / 2) + 34px);
  top: var(--panel-top, calc(var(--kopf-h, 68px) + 10px));
  bottom: calc(var(--hotbar-h, 96px) + var(--auswahl-h, 0px) + 10px);
  overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--panel); box-shadow: inset 3px 3px 0 var(--panel-hl), inset -3px -3px 0 var(--panel-sh), 0 0 0 3px var(--edge);
}
.warenpanel[hidden] { display: none; }
.warenpanel:focus { outline: 0; }
.wp-kopf { display: flex; align-items: center; gap: 10px; }
.wp-kopf .slot { width: 56px; height: 56px; cursor: default; }
.wp-kopf .slot img.icon { width: 38px; height: 38px; }
.wp-titel { min-width: 0; }
.wp-titel h2 { margin: 0; font-size: 19px; line-height: 1.15; overflow-wrap: anywhere; }
.wp-titel small { color: var(--muted); }
.wp-kopf .zu { margin-left: auto; flex: none; min-height: 32px; padding: 2px 10px; }
.wp-werte { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.wp-werte div { background: var(--slot); color: #fff; padding: 5px 8px; box-shadow: inset 2px 2px 0 var(--slot-sh), inset -2px -2px 0 var(--slot-hl); min-width: 0; }
.wp-werte span { display: block; font-size: 11px; text-shadow: 1px 1px 0 #3e3e3e; }
.wp-werte b { font-size: 15px; text-shadow: 1px 1px 0 #3e3e3e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.wp-kurs { display: grid; gap: 2px; }
.wp-kurs svg { width: 100%; height: 34px; color: var(--blau); background: #b9b9b9; box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #e8e8e8; }
.wp-kurs svg.leer { height: 10px; }
.wp-kurs small { font-size: 12px; }
.wp-mengen { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wp-mengen .knopf { padding: 6px 2px; font-size: 13px; min-height: 36px; }
.warenpanel .menge-feld input { font-size: 18px; min-height: 38px; }
.wp-feld { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: -5px; }
#wpKiste { width: 100%; min-height: 38px; font-size: 14px; }
#wpKisteHinweis { margin: -4px 0 0; font-size: 12px; }
.warenpanel .knopf.gross { font-size: 16px; min-height: 48px; padding: 8px 12px; }
.wp-ae { display: flex; gap: 8px; }
.wp-ae select { flex: 1; min-width: 0; }
.wp-ae .knopf { flex: 1 1 auto; }
.wp-unterwegs h3 { margin: 4px 0 6px; font-size: 16px; }
.wp-unterwegs .uw-liste { flex-direction: column; }
.wp-unterwegs .hinweis { font-size: 12px; margin-top: 6px; }
/* Aktionsleiste fuer die Auswahl: ueber der Hotbar, nie dahinter */
.auswahlleiste {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--hotbar-h, 96px) + 8px); z-index: 31;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 8px 10px;
  width: max-content; max-width: calc(100vw - 16px);
  background: var(--panel); box-shadow: inset 3px 3px 0 var(--panel-hl), inset -3px -3px 0 var(--panel-sh), 0 0 0 3px var(--edge);
}
.auswahlleiste[hidden] { display: none; }
#batchToolbar [data-batch-kind][aria-pressed="true"] { background: var(--blau); color: #fff; }
.auswahlleiste b { font-size: 14px; }
.auswahlleiste .knopf { min-height: 36px; padding: 5px 12px; font-size: 14px; }
.auswahlleiste .zu { padding: 2px 10px; }
#investorPanel { margin-top: 16px; }
body[data-seite="depot"] #investorPanel .chart { height: 170px; }
#investorPanel .sectionhead h2 { font-size: 19px; margin: 0; }

/* ---------- Bereiche aus den bisherigen Dateien im neuen Stil ---------- */
.sectionhead { margin-bottom: 14px; align-items: center; }
.sectionhead p { font-size: 13px; margin-top: 4px; }
.itemicon { background: var(--slot); border: 0; border-radius: 0; box-shadow: inset 2px 2px 0 var(--slot-sh), inset -2px -2px 0 var(--slot-hl); }
.itemname { min-height: 0; background: transparent; box-shadow: none; color: var(--ink); padding: 0; text-align: left; }
.itemname:hover:not(:disabled) { background: transparent; color: var(--accent); filter: none; }
.cardactions { border-color: var(--slot); }
.variantlabel { color: var(--accent); }
.marketblocked { color: var(--red); }
.emptyhero { padding: 26px 20px; }
.emptyhero > span, .chestglyph { color: var(--accent); }
.loginpanel { padding: 16px 18px; margin-bottom: 18px; }
.loginpanel strong { color: var(--ink); }
.loginpanel code { background: #000; color: #ffd65c; }
.loginpanel summary { color: var(--accent); cursor: pointer; }
#message, #detailNotice { background: #dff0d4; color: #173d10; border: 0; border-radius: 0; padding: 10px 12px; box-shadow: inset 2px 2px 0 #9cc78a, inset -2px -2px 0 #f4fff0, 0 0 0 2px var(--edge); margin-bottom: 14px; }
#message.error, #detailNotice.error { background: #f6d5d0; color: #6e130d; box-shadow: inset 2px 2px 0 #d48b82, inset -2px -2px 0 #fff4f2, 0 0 0 2px var(--edge); }
table { color: var(--ink); }
th { background: #a9a9a9; color: #262626; font-size: 12px; letter-spacing: .2px; font-weight: 700; }
td { border-bottom: 2px solid #b0b0b0; }
tbody tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(163, 163, 200, .25); }
td button { min-height: 32px; padding: 4px 10px; }
.chestgrid .panel { min-width: 0; }
.feenote { color: var(--muted); padding: 8px 10px; }
.badge { background: #dff0d4; border: 0; color: #173d10; box-shadow: 0 0 0 2px var(--edge); border-radius: 0; }
.badge[data-status="blocked"] { background: #f6d5d0; color: #6e130d; }
.ticket { padding: 14px; }
.ticket label { color: #303030; font-weight: 600; }
.segmented { background: transparent; border: 0; padding: 0; gap: 8px; display: grid; grid-template-columns: 1fr 1fr; }
.segmented button { min-height: 36px; }
.segmented button[aria-pressed="true"] { background: var(--blau); color: #fff; }
.preview { padding: 10px 12px; }
.preview > span { color: var(--muted); }
.preview strong { color: #1e1e1e; font-size: 24px; font-weight: 800; }
.recent summary, details > summary { cursor: pointer; }
.help summary { color: var(--accent); }
.firstdelivery { text-align: left; max-width: 660px; margin: 22px auto 0; padding-top: 18px; border-top: 2px solid var(--slot); }
.firstdelivery ol { margin: 12px 0 18px; padding-left: 20px; color: var(--muted); }
.firstdelivery strong { color: var(--ink); }
.order-status[data-status="open"] { color: var(--accent); }
.buytext { color: var(--green); }
.selltext { color: #8a5a00; }
.quoteaction { background: var(--btn); }
.quoteaction:hover:not(:disabled), .quoteaction:focus-visible { color: var(--btn-text); }
#depotTools .batch-actions button { background: var(--btn); color: var(--btn-text); }
#depotTools [data-batch-kind=buy]:hover:enabled { background: var(--go); color: #fff; }
#depotTools [data-batch-kind=sell]:hover:enabled { background: var(--sell); color: #fff; }

/* Arbeitsbereiche (Welten, Firma, Stadt, Warenkorb, Sets, Autocrafting, Analyse, Verwaltung) */
.work-area { color: var(--ink); }
.work-heading h2, .work-heading h3 { font-family: var(--pixel); font-weight: 500; font-size: 22px; letter-spacing: .5px; color: #303030; }
.work-heading p, .work-note { color: var(--muted); font-size: 13px; }
.work-area button, .work-dialog button {
  background: var(--btn); color: var(--btn-text); border: 0; border-radius: 0; font-size: 13px; font-weight: 650;
  box-shadow: inset 2px 2px 0 var(--btn-hl), inset -2px -2px 0 var(--btn-sh), 0 0 0 2px var(--edge);
}
.work-area button:hover, .work-dialog button:hover { background: var(--btn); border-color: transparent; filter: brightness(1.1); }
.work-area .work-primary:hover, .work-dialog .work-primary:hover { background: var(--go); color: #fff; }
.work-area button[aria-pressed=true] { background: var(--blau); color: #fff; border: 0; }
.work-area th button { background: transparent; box-shadow: none; min-height: 30px; padding: 0; }
.work-area th, .work-dialog th { background: #a9a9a9; color: #262626; font-size: 12px; font-weight: 700; }
.work-area th, .work-area td, .work-dialog th, .work-dialog td { border-bottom: 2px solid #b0b0b0; }
.work-area tbody tr:hover td, .work-dialog tbody tr:hover td { background: rgba(163, 163, 200, .25); }
.work-table-wrap { border-radius: 0; }
.work-asset img { background: var(--slot); border-radius: 0; box-shadow: inset 2px 2px 0 var(--slot-sh), inset -2px -2px 0 var(--slot-hl); }
.work-state { background: #b9b9b9; border: 0; border-radius: 0; color: #303030; box-shadow: 0 0 0 2px var(--panel-sh); }
.work-state[data-state=ready], .work-state[data-state=on] { background: #dff0d4; color: #173d10; }
.work-state[data-state=wait] { background: #f6ebc8; color: #5a3f00; }
.work-status[data-kind=error], .work-message[data-kind=error] { background: #f6d5d0; border-color: #d48b82; color: #6e130d; }
.auto-products .auto-switch[aria-checked=true] { background: #dff0d4; color: #173d10; }
.auto-recipe[aria-pressed=true] { background: #c9d8f2; }
.auto-attention { background: #f6ebc8; border: 0; border-left: 4px solid #c98a1d; border-radius: 0; }
.work-area tr.wagen-fehlt td { background: #f6d5d0; }
/* Welten-Kalender in hellen Feldern */
.welt-slot[data-art=frei] { background: #cfe8c4; color: #173d10; }
.welt-slot[data-art=teilweise] { background: #f1e3b1; color: #4d3800; }
.welt-slot[data-art=voll] { background: #ecc4be; color: #6e130d; }
.welt-slot[data-art=eigen] { background: #2f6fd6; color: #fff; box-shadow: inset 0 0 0 1px #0f3577; }
.welt-key[data-art=frei] { background: #cfe8c4; border-color: #6aa55a; }
.welt-key[data-art=teilweise] { background: #f1e3b1; border-color: #b39540; }
.welt-key[data-art=voll] { background: #ecc4be; border-color: #b8645a; }
.welt-key[data-art=eigen] { background: #2f6fd6; border-color: #0f3577; }

/* Vertiefte Kacheln und Kaesten der Bereichsdateien: eckig, wie Inventarfelder */
.work-metric, .city-info, .city-map-wrap, .ordercard, #ordersPanel .order-scroll, .chartreadout, .work-message,
.work-form fieldset, .auto-network, .auto-details, .auto-recipes, .auto-price-preview, .auto-calculation,
.auto-product-toolbar, #bankPanel .bankrates, .bankrates, .starterrecipe, #detail .books > div, #detail .preview,
#detail .ticket, #batchToolbar #batchPreview .scroll, #inventoryPanel .itemcard, #marketTableWrap, #depotTableWrap {
  border: 0; border-radius: 0; background: #bdbdbd;
  box-shadow: inset 2px 2px 0 #8b8b8b, inset -2px -2px 0 #ececec;
}
.work-metric strong, .work-metric b { color: #1e1e1e; }
.work-status { border: 2px dashed #8b8b8b; border-radius: 0; background: transparent; color: #3a3a3a; }
.marketitem .itemicon, #depotTable .itemicon, #detail .detailidentity .itemicon {
  border: 0; border-radius: 0; background: var(--slot); box-shadow: inset 2px 2px 0 var(--slot-sh), inset -2px -2px 0 var(--slot-hl);
}
.markettable .quoteaction, .marketcard .quoteaction { border: 0; border-radius: 0; background: var(--btn); color: var(--btn-text); box-shadow: inset 2px 2px 0 var(--btn-hl), inset -2px -2px 0 var(--btn-sh), 0 0 0 2px var(--edge); }
.markettools select, .markettools input, #withdrawChest { background: var(--feld); color: var(--feld-text); border: 0; border-radius: 0; box-shadow: inset 2px 2px 0 #373737, 0 0 0 2px var(--panel-sh); }
#chestTable input { border: 0; border-radius: 0; }
#marketTools, #depotTools { background: transparent; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
#marketTools .searchbox, #depotTools .searchbox {
  height: auto; background: var(--feld); border: 0; border-radius: 0;
  box-shadow: inset 2px 2px 0 #373737, 0 0 0 2px var(--panel-sh);
}
#marketTools .searchbox input, #depotTools .searchbox input { background: transparent; color: var(--feld-text); font-size: 15px; height: 42px; box-shadow: none; }
#marketTools .searchbox:focus-within, #depotTools .searchbox:focus-within { border: 0; outline: 3px solid var(--blau); outline-offset: 2px; }
/* Suchfeld und Auswahlfelder (Sortierung, Pro Seite) auf einer Linie: Unterkanten buendig, gleiche Hoehe */
#marketTools, #depotTools { align-items: flex-end; }
#marketTools .searchbox input, #depotTools .searchbox input { height: 40px; min-height: 40px; }
dialog.handel[open] { display: block; height: fit-content; max-height: calc(100dvh - 24px); overflow: auto; }
.hotbar .hb.active, .hotbar .hb.aktiv-mehr { color: #fff; }
.hotbar .hb .hb-taste { font-family: system-ui, sans-serif; font-weight: 800; }
.hotbar .hb { width: 78px; }
.hotbar .hb .hb-name { font-size: 10.5px; letter-spacing: -.2px; max-width: 100%; overflow: hidden; }
@media (max-width: 760px) { .hotbar .hb { width: 50px; } .hotbar .hb .hb-name { font-size: 9px; } }
@media (max-width: 420px) { .hotbar .hb { width: 46px; } .hotbar .hb .hb-name { font-size: 8.5px; } }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 760px) {
  body { font-size: 14px; }
  .kopf { padding: 6px 10px; }
  .kopfzeile { gap: 6px 10px; min-height: 46px; }
  .kopfbild { width: 32px; height: 32px; }
  .kontoknopf { font-size: 14px; gap: 7px; min-height: 40px; }
  .kontoknopf #identity { max-width: 14ch; }
  .verbindung .verbindungstext { display: none; }
  .verbindung.ist-laut .verbindungstext { display: inline; font-size: 11px; }
  .geld { font-size: 17px; gap: 6px; }
  .geld .muenze { width: 20px; height: 20px; }
  .geld .cr { font-size: 13px; }
  .kopfrechts { gap: 8px; }
  main { padding: 12px 10px 20px; }
  .seitenkopf h1 { font-size: 26px; }
  .seitenkopf #pageIntro { font-size: 13px; }
  .panel, #inventoryPanel[data-view="market"], #inventoryPanel[data-view="depot"] { padding: 12px; }
  .work-area .work-section { padding: 12px; }
  #items.raster { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px 4px; }
  .ware .slot { width: 58px; height: 58px; }
  .ware .slot img.icon { width: 38px; height: 38px; }
  .ware .preis { font-size: 11px; }
  .hotbar { bottom: 6px; padding: 3px; }
  .hotbar .hb { width: 50px; height: 62px; padding: 5px 0 3px; }
  .hotbar .hb img.icon { width: 26px; height: 26px; }
  .hotbar .hb .hb-name { font-size: 9px; letter-spacing: -.3px; }
  .hotbar .hb .hb-taste { display: none; }
  .hotbar .hb-mehr { margin-left: 4px; }
  .sidebar.mehrmenue { inset: auto 8px 84px 8px; width: auto; max-height: calc(100dvh - 160px); }
  dialog.handel { padding: 12px; width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .handel-kopf h2 { font-size: 22px; }
  .handel-grid { grid-template-columns: 1fr; gap: 12px; }
  .kiste .slots { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .kiste .slots .slot { width: auto; height: auto; aspect-ratio: 1; }
  .kiste .slots img.icon { width: 22px; height: 22px; }
  .kiste .slots .anz { font-size: 10px; }
  .kiste .info { max-width: none; }
  .kiste-links { order: 2; } .mitte { order: 1; } .kiste-rechts { order: 3; }
  .depotkopf { gap: 6px; }
  .depotkopf .depotfigur { width: 44px; }
  .depotkopf .profile-character, .depotkopf .profile-character canvas { width: 30px; height: 60px; }
  .wert-leiste { gap: 6px; }
  .wert { padding: 5px 6px; }
  .wert span { font-size: 10.5px; }
  .wert b { font-size: 15px; }
  .wert small { display: none; }
  #depotTools.depotleiste { margin: 0 -12px 10px; padding: 6px 12px; gap: 6px 8px; }
  .depotleiste .searchbox { flex-basis: 100%; }
  .depotleiste .chips { flex-basis: 100%; order: 3; }
  .leiste-rechts { margin-left: 0; width: 100%; }
  .leiste-rechts .sortwahl { flex: 1; }
  .leiste-rechts .sortwahl select { width: 100%; }
  .leiste-rechts .reiter .knopf, #auswahlKnopf { padding: 4px 8px; font-size: 13px; }
  .uw-kopf h2 { font-size: 15px; }
  .uw { font-size: 12px; }
  .lagerraster { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .lagerraster .slot img.icon { width: 26px; height: 26px; }
  .lagerraster .slot .anz { font-size: 11px; }
  .lagerliste th:nth-child(4), .lagerliste td:nth-child(4) { display: none; }
  /* Warenfenster als Blatt von unten, ueber der Hotbar */
  body.warenfenster-offen #inventoryPanel[data-view="depot"] { padding-right: 12px; }
  body.warenfenster-offen #inventoryPanel[data-view="depot"] .depotleiste { margin-right: -12px; padding-right: 12px; }
  .warenpanel {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; z-index: 40; max-height: 82dvh;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); border-radius: 6px 6px 0 0;
    box-shadow: inset 0 3px 0 var(--panel-hl), 0 -3px 0 var(--edge), 0 -10px 24px rgba(0, 0, 0, .35);
  }
  .wp-mengen .knopf { font-size: 12px; }
  .auswahlleiste { width: calc(100vw - 16px); }
  .auswahlleiste .knopf { padding: 4px 8px; font-size: 13px; }
  #meldungen { right: 8px; width: calc(100vw - 16px); }
  .mehrmenue .navliste { grid-template-columns: 1fr 1fr; }
  .marktfilter .reiter .knopf { padding: 4px 9px; font-size: 13px; min-height: 32px; }
  dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); padding: 14px; }
}
@media (max-width: 420px) {
  .hotbar .hb { width: 46px; }
  .hotbar .hb .hb-name { font-size: 8.5px; }
  .kopfrechts .knopf.klein, .kopf .sprachwahl { padding: 4px 7px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

/* Allgemeine Navigationsregeln aus style.css gelten nicht fuer die Hotbar-Beschriftung */
.hotbar .hb .hb-name { width: auto; line-height: 1.2; }
.hotbar .hb .hb-taste { width: auto; line-height: 1; }
/* Profi-Auftragsdialog: gewaehlte Seite wie die Knoepfe im Handelsfenster */
#detail #buySide[aria-pressed=true], #detail #sellSide[aria-pressed=true] { background: var(--blau); color: #fff; border: 0; }
/* Kopf mobil: Spieler links, Geld rechts; bei Platzmangel bricht nur der Ton-Knopf um */
.kopfstatus { order: 0; flex: 0 1 auto; }
.kopfrechts { order: 1; }
@media (max-width: 760px) {
  .kopfzeile { flex-wrap: nowrap; }
  .kontoknopf #identity { max-width: 9ch; }
  .kontoknopf .kontopfeil { display: none; }
  /* Der Spieler behaelt seine Breite (Name hoechstens 9 Zeichen, sonst Ellipse); die rechte Seite
     nimmt den Rest und bricht in sich um: Geld bleibt in der ersten Zeile, Sprache/Ton rutschen
     darunter. Vorher stand die rechte Seite starr (flex: none) und schob Muenze und Kontostand
     bei 390 px ueber den Namen. */
  .kopfstatus { gap: 6px; min-width: 0; flex: 0 0 auto; max-width: 55%; }
  .kopfstatus .konto, .kontoknopf { min-width: 0; max-width: 100%; }
  .kontoknopf #identity { min-width: 0; flex: 0 1 auto; max-width: 12ch; }
  .kopfrechts { gap: 6px; flex: 1 1 0; min-width: 0; flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
  .kopfrechts .geld { flex: none; }
}
/* Markierter Text in schwarzen Feldern bleibt lesbar */
input::selection, textarea::selection { background: var(--blau); color: #fff; }
/* Raster/Liste stehen als Knoepfe ueber dem Markt; die alte Auswahlliste bleibt nur als Zustand */
#marketTools label:has(#marketView) { display: none; }
