/* UI-V5 (Besitzer: UI-V5) · Holzfäller „Was fällen?“/Bereich (building-v5.js, area-tool.js), Baumschule, Forsthaus-Panel (forest-panel.js) und Umsetzen-Werkzeug
   (transplant-tool.js), Einzellager (Warenwahl, Lager-Panel-Zeilen), Keller/Bronzefelsen (tap-challenge.js .challenge.keller).
   Wird von ui/v5-common.js per <link data-sb="ui-v5"> geladen, solange index.html die Zeile noch nicht hat. Tippziele ≥ 44 px, 360 px ohne waagrechtes Scrollen,
   keine Schrift auf Balken, Kontraste ≥ 4,5 : 1 (dunkle Schrift auf hellen Tönungen statt Weiß auf Grün/Orange). */
#ui { --v5-ok-bg: #E3F4E7; --v5-ok-ink: #1F6F35; --v5-bad-bg: #FDEBEC; --v5-bad-ink: #9E2328; --v5-warn-bg: #FDF0DC; --v5-warn-ink: #7A4A00; --v5-sel: rgba(82, 79, 254, .1); }

/* ===== Gemeinsame Bausteine ===== */
#ui .v5-sec { min-width: 0; }
#ui .v5-sec + .v5-sec { margin-top: 14px; }
#ui .v5-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
#ui .v5-seg-btn { min-height: 46px; padding: 0 10px; font-size: 14px; background: var(--card2); box-shadow: inset 0 0 0 1.5px var(--card3); min-width: 0; }
#ui .v5-seg-btn .btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ui .v5-seg-btn.active { background: var(--v5-sel); color: var(--primary2); box-shadow: inset 0 0 0 2px var(--primary); }
#ui .v5-mini { min-height: 44px; padding: 0 12px; font-size: 13px; border-radius: 12px; flex: none; }
#ui .v5-mini.pulse { animation: v5pulse 1.2s ease-in-out infinite; }
@keyframes v5pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(82, 79, 254, .45); } 50% { box-shadow: 0 0 0 6px rgba(82, 79, 254, 0); } }
#ui .v5-warnline { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: var(--v5-bad-bg); color: var(--v5-bad-ink); font-size: 13px; font-weight: 700; line-height: 1.35; }
#ui .v5-warnline .ico { flex: none; margin-top: 1px; line-height: 0; }
#ui .v5-warnline small { font-weight: 600; }
#ui .v5-warnline.strong { font-size: 14px; padding: 10px 12px; margin: 0 0 8px; }
#ui .v5-hint { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 12px; background: var(--v5-warn-bg); color: var(--v5-warn-ink); font-size: 13px; font-weight: 700; line-height: 1.3; margin-bottom: 8px; }
#ui .v5-hint.danger { background: var(--v5-bad-bg); color: var(--v5-bad-ink); }
#ui .v5-hint .ico { flex: none; line-height: 0; }
#ui .v5-hint .grow { flex: 1 1 auto; min-width: 0; }
#ui .v5-note { display: flex; align-items: flex-start; gap: 8px; padding: 9px 11px; border-radius: 12px; background: var(--card2); color: var(--ink2); font-size: 13px; line-height: 1.35; margin-bottom: 8px; }
#ui .v5-note.ok { background: var(--v5-ok-bg); color: var(--v5-ok-ink); font-weight: 600; }
#ui .v5-note .ico { flex: none; line-height: 0; margin-top: 1px; }
#ui .v5-folgt { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 7px 10px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card3); color: var(--ink2); font-size: 12px; }
#ui .v5-folgt .ico { flex: none; line-height: 0; }
#ui .v5-buildbtn { width: 100%; min-height: 48px; }
#ui .v5-buildwrap { display: flex; flex-direction: column; gap: 4px; }
#ui .v5-why { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--ink2); font-weight: 600; margin-top: 4px; }
#ui .v5-why .ico { flex: none; line-height: 0; }
#ui .v5-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
#ui .v5-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; background: var(--card2); font-size: 13px; font-weight: 700; color: var(--ink); }
#ui .v5-pill.ok { background: var(--v5-ok-bg); color: var(--v5-ok-ink); }
#ui .v5-pill .ico { line-height: 0; }
#ui .v5-tiles, #ui .v5-statrow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
#ui .v5-statrow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#ui .v5-tile { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(43, 42, 51, .08); min-width: 0; }
#ui .v5-tile .ico { flex: none; line-height: 0; color: var(--ink2); }
#ui .v5-tile > div { min-width: 0; display: flex; flex-direction: column; }
#ui .v5-tile b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .v5-tile small { font-size: 11.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .v5-tile.bad b { color: var(--v5-bad-ink); }
#ui .v5-sub { margin: 4px 0 8px; line-height: 1.35; }
#ui .v5-emptyline { padding: 10px 12px; border-radius: 12px; background: var(--card2); color: var(--ink2); font-size: 13px; }
#ui .v5-empty { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 16px; background: #fff; box-shadow: 0 1px 3px rgba(43, 42, 51, .08); margin-bottom: 10px; }
#ui .v5-empty > .grow { flex: 1 1 200px; min-width: 0; }
#ui .v5-empty .btn { flex: 1 1 100%; }
#ui .v5-st-hint { margin-left: auto; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink2); font-size: 11.5px; }

/* Schalterzeile (ganze Zeile tippbar) */
#ui .v5-switch-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 12px; margin: 0 0 8px; border: 0; border-radius: 14px; background: var(--card2); text-align: left; cursor: pointer; }
#ui .v5-switch-row:disabled { opacity: .55; cursor: default; }
#ui .v5-sw-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#ui .v5-sw-text b { font-size: 14px; }
#ui .v5-sw-text small { font-size: 12px; color: var(--ink2); line-height: 1.3; }
#ui .v5-sw { position: relative; flex: none; width: 50px; height: 30px; border-radius: 999px; background: var(--card3); transition: background .15s; }
#ui .v5-sw i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-soft); transition: left .15s; }
#ui .v5-switch-row.on .v5-sw { background: var(--primary); }
#ui .v5-switch-row.on .v5-sw i { left: 23px; }

/* ===== Holzfäller: Was fällen? ===== */
#ui .v5-chips { display: flex; flex-direction: column; gap: 6px; }
#ui .v5-chip { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 10px; border: 0; border-radius: 14px; background: var(--card2); box-shadow: inset 0 0 0 1.5px var(--card3); text-align: left; cursor: pointer; transition: background .12s, box-shadow .12s; }
#ui .v5-chip:disabled { cursor: default; opacity: .65; }
#ui .v5-chip:active:not(:disabled) { transform: scale(.985); }
#ui .v5-chip.on { background: var(--v5-sel); box-shadow: inset 0 0 0 2px var(--primary); }
#ui .v5-chip.warnart.on { background: #FFF4F0; box-shadow: inset 0 0 0 2px #D2692E; }
#ui .v5-chip-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; line-height: 0; color: #6A5034; }
#ui .v5-chip-ic .ic .a { fill: #8CC56B; }
#ui .v5-chip[data-k="urbaum"] .v5-chip-ic .ic .a { fill: #3E8E4F; }
#ui .v5-chip[data-k="busch"] .v5-chip-ic .ic .a { fill: #9BBF4C; }
#ui .v5-chip[data-k="palme"] .v5-chip-ic .ic .a { fill: #7DBE5A; }
#ui .v5-chip-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#ui .v5-chip-name { font-weight: 800; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .v5-chip-sub { font-size: 12px; color: var(--ink2); line-height: 1.25; }
#ui .v5-chip-sub.danger { color: var(--v5-bad-ink); font-weight: 700; }
#ui .v5-chip-count { flex: none; display: flex; flex-direction: column; align-items: flex-end; min-width: 52px; }
#ui .v5-chip-n { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
#ui .v5-chip-ins { font-size: 11px; color: var(--ink2); white-space: nowrap; }
#ui .v5-chip-box { flex: none; width: 28px; height: 28px; border-radius: 9px; background: #fff; box-shadow: inset 0 0 0 2px var(--card3); display: flex; align-items: center; justify-content: center; color: transparent; line-height: 0; }
#ui .v5-chip.on .v5-chip-box { background: var(--primary); box-shadow: none; color: #fff; }
#ui .v5-chip.warnart.on .v5-chip-box { background: #C2551E; }

/* ===== Holzfäller: Bereich ===== */
#ui .v5-areainfo { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px 6px 11px; border-radius: 12px; background: var(--v5-ok-bg); color: var(--v5-ok-ink); font-size: 13px; font-weight: 700; margin-bottom: 8px; }
#ui .v5-areainfo .grow { flex: 1 1 120px; min-width: 0; }
#ui .v5-areainfo .ico { flex: none; line-height: 0; }
#ui .v5-counts { display: flex; flex-direction: column; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(43, 42, 51, .08); padding: 4px 10px; margin-bottom: 8px; font-size: 13px; }
#ui .v5-crow { display: grid; grid-template-columns: minmax(0, 1fr) 64px 56px; align-items: center; gap: 6px; min-height: 30px; border-bottom: 1px solid var(--card2); }
#ui .v5-crow:last-child { border-bottom: 0; }
#ui .v5-crow > :nth-child(n+2) { text-align: right; font-variant-numeric: tabular-nums; }
#ui .v5-crow.head { min-height: 26px; font-size: 11px; font-weight: 800; color: var(--ink2); text-transform: uppercase; letter-spacing: .03em; }
#ui .v5-crow.sum { font-weight: 800; }
#ui .v5-crow.aus { color: var(--ink3); }
#ui .v5-crow.aus b { font-weight: 600; }
#ui .v5-c-name { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .v5-c-name .ico { flex: none; line-height: 0; }
#ui .v5-counts:not(.mit-bereich) .v5-crow { grid-template-columns: minmax(0, 1fr) 56px; }
#ui .v5-counts:not(.mit-bereich) .v5-c-im { display: none; }

/* ===== Baumschule ===== */
#ui .v5-nursery .v5-tile.next b { color: var(--primary2); }

/* ===== Einzellager: Warenwahl ===== */
#ui .v5-cur { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--v5-sel); box-shadow: inset 0 0 0 2px var(--primary); margin-bottom: 6px; }
#ui .v5-cur-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; line-height: 0; }
#ui .v5-cur .grow { min-width: 0; display: flex; flex-direction: column; }
#ui .v5-cur b { font-size: 17px; }
#ui .v5-cur small { font-size: 12.5px; color: var(--ink2); font-variant-numeric: tabular-nums; }
#ui .v5-resgroups { display: flex; flex-direction: column; gap: 8px; }
#ui .v5-group-title { font-size: 11px; font-weight: 800; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; margin: 2px 2px 4px; }
#ui .v5-resgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 6px; }
#ui .v5-res { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 72px; min-width: 0; padding: 6px 4px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(43, 42, 51, .1); cursor: pointer; }
#ui .v5-res:disabled { cursor: default; opacity: .65; }
#ui .v5-res:active:not(:disabled) { transform: scale(.97); }
#ui .v5-res.on { background: var(--v5-sel); box-shadow: inset 0 0 0 2.5px var(--primary); }
#ui .v5-res .ico { line-height: 0; }
#ui .v5-res-name { max-width: 100%; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .v5-res-n { font-size: 11px; color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* Lager-Panel V3: vier Sprungknöpfe (Vorräte · Lagerhäuser · Speziallager · Einzellager) passen bis 480 px nur ohne Symbol (sonst 3 px Überlauf bei 430 px) */
#ui .lg3-jump { padding: 0 3px; }
#ui .lg3-more { padding-right: 3px; }
#ui .lg3-row .st-sell { margin-right: 3px; }   /* Trefferflächen-Erweiterung .btn-small::after (ui-v2.css, ±3 px) nicht über den Rand → kein Querscrollen */
@media (max-width: 480px) { #ui .lg3-jump { gap: 4px; } #ui .lg3-jump .btn { padding: 0 4px; } #ui .lg3-jump .btn .btn-ic { display: none; } }
/* Lager-Panel V3: Zeile je Einzellager */
#ui .v5-elrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(43, 42, 51, .08); margin-bottom: 6px; min-width: 0; }
#ui .v5-elrow.leer { background: var(--v5-bad-bg); box-shadow: none; }
#ui .v5-elrow .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#ui .v5-el-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--card2); display: flex; align-items: center; justify-content: center; line-height: 0; }
#ui .v5-el-name { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .v5-elrow.leer .v5-el-name { color: var(--v5-bad-ink); }
#ui .v5-el-sub { font-size: 12px; color: var(--ink2); line-height: 1.3; }
#ui .v5-el-btn { flex: none; min-height: 44px; padding: 0 12px; font-size: 13px; }

/* ===== Keller (Meisterquartier) ===== */
#ui .v5-keller-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; border-radius: 16px; cursor: pointer; text-align: left;
  background: linear-gradient(135deg, #3B2F28, #5B4636); color: #FBEBD2; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25), 0 2px 8px rgba(59, 47, 40, .35); }
#ui .v5-keller-btn:active:not(:disabled) { transform: scale(.98); }
#ui .v5-keller-btn:disabled, #ui .v5-keller-btn.off { opacity: .55; filter: grayscale(.4); cursor: default; }
#ui .v5-keller-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; background: rgba(243, 194, 122, .18); display: flex; align-items: center; justify-content: center; line-height: 0; color: #F3C27A; }
#ui .v5-keller-ic .ic .a { fill: #C98A3E; }
#ui .v5-keller-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
#ui .v5-keller-t b { font-size: 17px; color: #fff; }
#ui .v5-keller-t small { font-size: 12.5px; color: #F1DDBF; line-height: 1.3; }
#ui .v5-keller-arrow { flex: none; line-height: 0; color: #F3C27A; }
#ui .v5-keller-stats { margin-top: 6px; }

/* QA-V5-02: erstes Zeichnen billig halten – deckender Hintergrund mit EINEM Verlauf, keine Einblend-Animation (Deckkraft über der Welt), keine Flecken-Ebene,
   kein drop-shadow am Ring, Laterne ohne Weichzeichner-Schatten, Fels-SVG mit flachen Farben (tap-challenge.js) */
#ui .challenge.keller { background: radial-gradient(ellipse at 50% 30%, #4A3A2E 0%, #241C17 48%, #120E0C 100%); animation: none; }
#ui .ch-keller-rock { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; pointer-events: none; display: flex; justify-content: center; }
#ui .ch-keller-rock svg { width: min(100%, 560px); height: 100%; }
#ui .ch-keller-lamp { position: absolute; top: calc(var(--sat) + 86px); right: 18px; width: 14px; height: 22px; border-radius: 4px 4px 8px 8px; background: #F2B134; outline: 6px solid rgba(242, 177, 52, .22); pointer-events: none; }
#ui .challenge.keller .ch-ring, #ui .challenge.keller .ch-reward { position: relative; z-index: 1; }
#ui .challenge.keller .ch-top, #ui .challenge.keller .ch-tap { z-index: 2; }   /* bleiben absolut (ui.css) */
#ui .challenge.keller .ch-tap { color: #FBEBD2; text-shadow: 0 2px 6px rgba(0, 0, 0, .8); }
#ui .challenge.keller .ch-ring .fgc { stroke: #E0A458; filter: none; }
#ui .challenge.keller .ch-ring .decay { display: none; }
#ui .challenge.keller .ch-ring .bgc { fill: rgba(20, 14, 10, .45); stroke: rgba(243, 194, 122, .22); }
#ui .challenge.keller .ch-count { color: #fff; text-shadow: none; }
#ui .challenge.keller .ch-count small { font-size: 18px; }
#ui .challenge.keller .ch-icon .ic .a { fill: rgba(224, 164, 88, .55); }
#ui .challenge.keller .ch-ring.round { animation: v5round .5s ease-out; }
@keyframes v5round { 0% { transform: scale(1); } 35% { transform: scale(1.06); } 100% { transform: scale(1); } }
#ui .ch-up { flex: none; min-height: 48px; padding: 0 16px; border-radius: 16px; background: rgba(247, 242, 234, .96); box-shadow: var(--shadow); color: var(--ink); }
#ui .ch-coinfly { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: #F2B134; color: #3B2600;
  font-weight: 900; font-size: 20px; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); pointer-events: none; animation: v5coin 1.15s ease-out forwards; z-index: 2; }
#ui .ch-coinfly .ico, #ui .ch-coinfly svg { line-height: 0; }
@keyframes v5coin { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.8); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 100% { opacity: 0; transform: translate(-50%, -90px) scale(1); } }

/* ===== Welt-Werkzeuge (Bereich, Umsetzen) ===== */
#ui .v5-tool { position: absolute; inset: 0; display: none; }
#ui .v5-tool.open { display: block; }
#ui .v5-catch { position: absolute; inset: 0; touch-action: none; cursor: crosshair; background: transparent; -webkit-user-select: none; user-select: none; }
#ui .v5-catch.move { cursor: grab; }
#ui .v5-tool-card { position: absolute; left: calc(var(--sal) + 8px); right: calc(var(--sar) + 8px); bottom: calc(var(--sab) + 8px); background: var(--card); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 10px 12px 12px; animation: pop .22s ease-out; touch-action: manipulation; max-height: calc(100% - var(--sat) - 70px); overflow-y: auto; }
#ui .v5-tool-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
#ui .v5-tool-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--card2); display: flex; align-items: center; justify-content: center; flex: none; color: #2F6B3C; }
#ui .v5-tool-ic .ic .a { fill: #9FD39A; }
#ui .v5-tool-titles { flex: 1 1 auto; min-width: 0; }
#ui .v5-tool-title { font-weight: 800; font-size: 18px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ui .v5-tool-count { flex: 0 1 auto; font-size: 13px; color: var(--ink2); text-align: right; white-space: nowrap; }
#ui .v5-tool-count b { font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
#ui .v5-tool-hint { margin: 8px 0 0; padding: 8px 12px; border-radius: 12px; background: var(--card2); font-size: 13px; color: var(--ink2); line-height: 1.35; display: flex; align-items: center; gap: 6px; }
#ui .v5-tool-hint .ico, #ui .v5-tool-hint svg { flex: none; }
#ui .v5-tool-hint.ok { background: var(--v5-ok-bg); color: var(--v5-ok-ink); font-weight: 700; }
#ui .v5-tool-hint.bad { background: var(--v5-bad-bg); color: var(--v5-bad-ink); font-weight: 700; }
#ui .v5-tool.move .v5-tool-hint { background: rgba(82, 79, 254, .1); color: var(--primary2); font-weight: 600; }
#ui .v5-tool-detail { margin-top: 6px; font-size: 12.5px; color: var(--v5-ok-ink); font-weight: 600; }
#ui .v5-tool-detail.leer { color: var(--v5-bad-ink); }
#ui .v5-r-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
#ui .v5-r-mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#ui .v5-r-lab { font-size: 12.5px; color: var(--ink2); text-align: center; }
#ui .v5-r-lab b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
#ui input[type=range].v5-range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 48px; margin: 0; background: transparent; cursor: pointer; touch-action: none; }
#ui input[type=range].v5-range::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; background: var(--card3); }
#ui input[type=range].v5-range::-moz-range-track { height: 10px; border-radius: 999px; background: var(--card3); }
#ui input[type=range].v5-range::-moz-range-progress { height: 10px; border-radius: 999px; background: var(--success); }
#ui input[type=range].v5-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 34px; height: 34px; margin-top: -12px; border-radius: 50%; background: #fff; border: 4px solid var(--success); box-shadow: 0 2px 6px rgba(43, 42, 51, .25); }
#ui input[type=range].v5-range::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 4px solid var(--success); box-shadow: 0 2px 6px rgba(43, 42, 51, .25); }
#ui input[type=range].v5-range:focus-visible { outline: none; }
#ui .v5-step { flex: none; }
#ui .v5-tool-row { display: flex; gap: 8px; margin-top: 8px; }
#ui .v5-tool-btns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 8px; }
#ui .v5-tool-btns .btn { min-height: 48px; min-width: 0; padding: 0 10px; }
#ui .v5-tool-btns .btn .btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ui .v5-tool-btns .btn.v5-move.on { background: var(--primary); color: #fff; }
#ui .v5-tool-nums { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-end; min-width: 0; }
#ui .v5-r-mini { display: none; font-size: 12px; color: var(--ink2); font-weight: 700; white-space: nowrap; }
#ui .v5-tool-row .btn { flex: 1 1 0; min-height: 48px; min-width: 0; padding: 0 10px; }
#ui .v5-tool-row .btn .btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ui .v5-tool-row .btn.v5-move.on { background: var(--primary); color: #fff; }
#ui .v5-tool-row .btn.v5-cancel { flex: 0 1 auto; padding: 0 14px; }   /* Bestätigen bekommt den Rest der Breite (360 px: „Umsetzen · 10 B“ ganz) */
#ui .v5-tool .v5-switch-row { margin: 8px 0 0; background: var(--card2); }
#ui .v5-costline { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--ink2); }
#ui .v5-costline b { color: var(--ink); }
#ui .v5-costline.bad, #ui .v5-costline.bad b { color: var(--v5-bad-ink); }
#ui .v5-mark { position: absolute; left: 0; top: 0; width: 36px; height: 36px; margin: -46px 0 0 -18px; border-radius: 50%; pointer-events: none; will-change: transform;
  display: flex; align-items: center; justify-content: center; background: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .3); }
#ui .v5-mark::after { content: ''; position: absolute; left: 50%; bottom: -9px; margin-left: -6px; border: 6px solid transparent; border-top: 8px solid #fff; border-bottom: 0; }
#ui .v5-mark.dst::after { border-top-color: var(--success); }
#ui .v5-mark.dst.bad::after { border-top-color: var(--danger); }
#ui .v5-mark > * { line-height: 0; }
#ui .v5-mark.src { color: #2F6B3C; }
#ui .v5-mark.dst { background: var(--success); color: #fff; }
#ui .v5-mark.dst.bad { background: var(--danger); }
#ui .v5-steps { display: flex; gap: 4px; margin: 0 0 8px; padding: 0; list-style: none; counter-reset: none; }
#ui .v5-steps li { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 10px; background: var(--card2); font-size: 12.5px; font-weight: 700; color: var(--ink2); line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
#ui .v5-steps li b { flex: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ink); }
#ui .v5-steps li.cur { background: var(--v5-sel); color: var(--primary2); box-shadow: inset 0 0 0 1.5px var(--primary); }
#ui .v5-steps li.done { background: var(--v5-ok-bg); color: var(--v5-ok-ink); }
#ui .v5-steps.mini { flex: 0 1 auto; margin: 0; gap: 3px; }
#ui .v5-steps.mini li { flex: none; padding: 4px 6px; font-size: 11px; gap: 3px; white-space: nowrap; }
#ui .v5-steps.mini li b { width: 16px; height: 16px; font-size: 10px; }
@media (max-width: 460px) { #ui .v5-steps.mini li { font-size: 0; gap: 0; padding: 4px; } #ui .v5-steps.mini li b { font-size: 10px; } }
#ui .v5-tool-titles .kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 400px) { #ui .v5-statrow .v5-tile > .ico { display: none; } #ui .v5-statrow .v5-tile { padding: 7px 8px; } #ui .v5-statrow .v5-tile b { font-size: 15px; } #ui .v5-steps li { padding: 6px; font-size: 12px; } }
@media (max-height: 720px) {   /* 360×640 (QA-V5-04): mehr Welt sichtbar – Werkzeugkarte kompakt */
  #ui .v5-area .v5-tool-hint, #ui .v5-area .v5-tool-detail, #ui .v5-area .v5-r-lab { display: none; }
  #ui .v5-area .v5-r-mini { display: block; }
  #ui .v5-tool .kicker { display: none; }
  #ui .v5-tool-head { gap: 8px; }
  #ui .v5-tool-ic { width: 40px; height: 40px; border-radius: 12px; }
  #ui .v5-tool .v5-switch-row { min-height: 44px; padding: 4px 12px; margin-top: 6px; }
  #ui .v5-tool .v5-switch-row small { display: none; }
  #ui .v5-r-row { margin-top: 4px; }
  #ui .v5-r-row .v5-range { height: 44px; }
  #ui .v5-tool-btns { grid-template-columns: 46px 46px 46px minmax(0, 1fr); gap: 6px; margin-top: 6px; }
  #ui .v5-tool-btns .btn { min-height: 46px; padding: 0 8px; }
  #ui .v5-tool-btns .btn.v5-move, #ui .v5-tool-btns .btn.v5-whole, #ui .v5-tool-btns .btn.v5-src, #ui .v5-tool-btns .btn.v5-cancel { padding: 0; }
  #ui .v5-tool-btns .btn.v5-move .btn-label, #ui .v5-tool-btns .btn.v5-whole .btn-label, #ui .v5-tool-btns .btn.v5-src .btn-label, #ui .v5-tool-btns .btn.v5-cancel .btn-label { display: none; }
  #ui .v5-tool-card { padding: 8px 10px 10px; }
  #ui .v5-transplant .v5-tool-hint { margin-top: 6px; padding: 6px 10px; }
  /* solange ein Welt-Werkzeug offen ist: Auftragsleiste/Hinweiskarte und HUD-Zeilen 2–3 aus (die erste HUD-Zeile bleibt) */
  #ui.ui-tool-open .topstack, #ui.ui-tool-open .hud-card .hud-row:nth-child(n+2), #ui.ui-tool-open .hud-details, #ui.ui-tool-open .hud-row-v2 { display: none !important; }
}
@media (min-width: 700px) { #ui .v5-tool-card { left: 50%; right: auto; width: min(560px, calc(100% - 24px)); transform: translateX(-50%); animation: none; } }

/* ===== Forsthaus-Panel ===== */
#ui .v5-forst-top { margin-top: 4px; }
#ui .v5-start { min-height: 50px; }
#ui .v5-job { padding: 8px 10px 10px; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(43, 42, 51, .08); margin-bottom: 6px; }
#ui .v5-job-head { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
#ui .v5-job-head .ico { flex: none; line-height: 0; }
#ui .v5-job-head .grow { min-width: 0; display: flex; flex-direction: column; }
#ui .v5-job-head b { font-size: 14px; line-height: 1.25; overflow-wrap: break-word; }
#ui .v5-job-phase { font-size: 12.5px; color: var(--primary2); font-weight: 700; }
#ui .v5-phases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin: 8px 0 6px; }
#ui .v5-phases span { height: 6px; border-radius: 999px; background: var(--card3); }
#ui .v5-phases span.done { background: var(--success); }
#ui .v5-phases span.cur { background: var(--primary); }
#ui .v5-ub { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 14px; background: #fff; box-shadow: 0 1px 3px rgba(43, 42, 51, .08); margin-bottom: 6px; min-width: 0; }
#ui .v5-ub.busy { background: var(--card2); box-shadow: none; }
#ui .v5-ub-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 6px; border: 0; background: transparent; border-radius: 12px; text-align: left; cursor: pointer; }
#ui .v5-ub-main:active { background: var(--card2); }
#ui .v5-ub-main .ico { flex: none; line-height: 0; color: #2F6B3C; }
#ui .v5-ub-main .ico .ic .a { fill: #3E8E4F; }
#ui .v5-ub-main .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#ui .v5-ub-main b { font-size: 14px; }
#ui .v5-ub-main small { font-size: 12px; color: var(--ink2); line-height: 1.25; overflow-wrap: break-word; }
#ui .v5-ub-main small.v5-ub-where { color: var(--ink); font-weight: 600; }
#ui .v5-ub-main .bar { height: 6px; }
#ui .v5-ub-main .bar .bar-label { display: none; }
#ui .np-forst-hint { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
@media (min-width: 900px) {
  #ui .v5-forst-sheet .sheet-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 16px; align-content: start; }
  #ui .v5-forst-sheet .v5-forst-top, #ui .v5-forst-sheet .v5-steps-sec { grid-column: 1; }
  #ui .v5-forst-sheet .v5-jobs { grid-column: 1; }
  #ui .v5-forst-sheet .v5-trees { grid-column: 2; grid-row: 1 / span 3; margin-top: 10px; }
}

/* ===== QA-V5-08: Arbeiter-✕ „freistellen“ – Trefferfläche 44 × 44 px, sichtbarer Kreis bleibt 22 px an derselben Stelle (ui.css: top −4, right 2) ===== */
#ui .wslot .wx { width: 44px; height: 44px; min-height: 44px; top: -15px; right: -9px; background: transparent; box-shadow: none; border: 0; z-index: 2; }
#ui .wslot .wx::before { content: ""; position: absolute; left: 11px; top: 11px; width: 22px; height: 22px; box-sizing: border-box; border: 2px solid var(--card); border-radius: 50%; background: var(--ink); }
#ui .wslot .wx .btn-ic { position: relative; color: #fff; }

/* ===== QA-V3-14 (Rest): Schalter in den Einstellungen – Element 44 px hoch, sichtbare Spur bleibt 52 × 32 ===== */
#ui .setting .toggle, #ui .setting .toggle.on { height: 44px; background: transparent; box-shadow: none; }
#ui .setting .toggle::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 32px; border-radius: 999px; background: var(--card3); transition: background .15s; }
#ui .setting .toggle.on::before { background: var(--success); }
#ui .setting .toggle .toggle-knob { top: 9px; }
#ui .setting .btn-small { min-height: 44px; }
