* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, "Segoe UI", sans-serif; color: #1b1f24; background: #f4f5f7; }
header { display: flex; gap: 12px; align-items: center; padding: 10px 16px; background: #1f4e78; color: #fff; }
header h1 { font-size: 16px; margin: 0; font-weight: 600; }
header .spacer { flex: 1; }
header input, header select { padding: 5px 8px; border: 0; border-radius: 4px; }
header button { padding: 6px 12px; border: 0; border-radius: 4px; background: #2e7d32; color: #fff; cursor: pointer; }
.filters button { background: #345d86; margin-right: 4px; }
.filters button.active { background: #0d2c47; }
#btn-bulk { background: #345d86; }
#btn-help { background: #345d86; width: 30px; padding: 6px 0; }
.stats { font-size: 12px; opacity: .85; }
#runbanner { background: #f59e0b; color: #3a2b00; padding: 6px 16px; font-size: 13px; }
main { display: grid; grid-template-columns: 400px 1fr; height: calc(100vh - 52px); }
body.running main { height: calc(100vh - 84px); }
#list { overflow-y: auto; border-right: 1px solid #d5d9de; background: #fff; }
.item { padding: 9px 14px; border-bottom: 1px solid #eef0f2; cursor: pointer; position: relative; }
.item:hover { background: #f0f6ff; }
.item.sel { background: #e2efff; box-shadow: inset 3px 0 0 #1f4e78; }
.item .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.item .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { font-size: 12px; color: #5b6570; display: flex; justify-content: space-between; margin-top: 2px; }
.item .rowok { visibility: hidden; border: 1px solid #2e7d32; background: #fff; color: #2e7d32;
               border-radius: 4px; width: 22px; height: 20px; font-size: 12px; line-height: 1;
               cursor: pointer; padding: 0; flex: 0 0 auto; }
.item:hover .rowok { visibility: visible; }
.item .rowok:hover { background: #2e7d32; color: #fff; }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 10px; white-space: nowrap; }
.b-de { background: #d5f0dc; color: #1b5e20; } .b-rc { background: #fff3cd; color: #7a5b00; }
.b-aus { background: #f8d7da; color: #842029; } .b-unk { background: #e2e3e5; color: #41464b; }
.b-bew { background: #fde2f0; color: #8a2c5c; }
.b-conf-low { background: #f8d7da; color: #842029; } .b-conf-mid { background: #fff3cd; color: #7a5b00; }
.b-conf-hi { background: #d5f0dc; color: #1b5e20; }
.b-warn { background: #fff3cd; color: #7a5b00; }
.warnbox { background: #fff8e6; border: 1px solid #f0dfae; border-radius: 6px;
           padding: 6px 10px; margin: 0 0 10px; font-size: 12px; color: #7a5b00; }
.hintline { font-size: 12px; color: #46596e; margin: -6px 0 10px; }
.derived { margin-top: 3px; min-height: 0; }
.derived .chip { font-size: 11px; padding: 1px 8px; border: 1px dashed #9aa3ad;
                 border-radius: 10px; color: #46596e; cursor: pointer; }
.derived .chip:hover { background: #eef6ff; }
.derived .chip.ok { border-style: solid; border-color: #2e7d32; color: #1b5e20;
                    background: #d5f0dc; }
.box.derived-hit { z-index: 5; }
.suggest { background: #eef6ff; border: 1px solid #cfe0f5; border-radius: 6px;
           padding: 8px 10px; margin: 0 0 12px; font-size: 12px; }
.suggest .sugg { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.suggest .fn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest button { border: 1px solid #345d86; background: #fff; color: #345d86;
                  border-radius: 4px; padding: 2px 8px; font-size: 12px; cursor: pointer; }
.suggest button:hover { background: #345d86; color: #fff; }
.dot.ok { color: #2e7d32; font-size: 11px; }
#detail { overflow-y: auto; padding: 14px; }
#detail.empty { display: flex; align-items: center; justify-content: center; color: #9aa3ad; }
.split { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 14px; align-items: start; }
.previewwrap { background: #fff; border: 1px solid #d5d9de; border-radius: 6px; padding: 8px; }
.ptools { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.hintbar { font-size: 12px; color: #5b6570; min-height: 18px; flex: 1; }
.hintbar b { color: #1f4e78; }
.zoomctl { display: flex; align-items: center; gap: 4px; }
.zoomctl button { width: 26px; height: 24px; border: 1px solid #c6ccd3; background: #f4f5f7; border-radius: 4px; cursor: pointer; font-size: 14px; line-height: 1; }
.zoomctl #zfit { width: auto; padding: 0 8px; font-size: 12px; }
.zoomctl #zlvl { font-size: 12px; color: #5b6570; min-width: 42px; text-align: center; }
.stage { position: relative; overflow: auto; height: calc(100vh - 150px); background: #eceff1; border-radius: 4px; cursor: grab; }
.stage.grabbing { cursor: grabbing; }
.viewer { position: relative; transform-origin: top left; width: 100%; }
.viewer img { display: block; width: 100%; user-select: none; -webkit-user-drag: none; }
.box { position: absolute; border: 1px solid rgba(90,90,90,.35); background: rgba(140,140,140,.10);
       cursor: pointer; border-radius: 2px; transition: background .08s; }
.box:hover { background: rgba(31,78,120,.28) !important; }
.box.assigned { border-width: 2px; }
.arm .box:not(.assigned) { background: rgba(245,130,49,.12); }
.form { background: #fff; border: 1px solid #d5d9de; border-radius: 6px; padding: 14px; }
.form h2 { font-size: 14px; margin: 0 0 4px; }
.form .muted { color: #6b7580; font-size: 12px; margin-bottom: 12px; }
.aufschl { background: #eef6ff; border: 1px solid #cfe0f5; border-radius: 6px; padding: 8px 10px; margin: 2px 0 12px; font-size: 12px; }
.aufschl b { color: #1f4e78; }
.aufschl > div { margin-top: 3px; }
.fld { margin-bottom: 9px; }
.fld .lab { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #465059; margin-bottom: 3px; cursor: pointer; }
.fld .lab .sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid #0002; flex: 0 0 auto; background: #e2e3e5; }
.fld .lab .key { font-size: 10px; color: #9aa3ad; border: 1px solid #d5d9de; border-radius: 3px; padding: 0 3px; }
.src { font-size: 10px; padding: 0 6px; border-radius: 8px; white-space: nowrap; }
.src-doc { background: #d5f0dc; color: #1b5e20; }
.src-calc { background: #fdebd3; color: #7a4a00; }
.src-man { background: #dbe7f5; color: #1f4e78; }
.fld input.calc { border-left-style: dashed; }
.fld .lab .clr { margin-left: auto; color: #b02a37; font-size: 12px; visibility: hidden; }
.fld.has .lab .clr { visibility: visible; }
.fld input, .fld select { width: 100%; padding: 6px 8px; border: 1px solid #c6ccd3; border-radius: 4px; border-left-width: 4px; border-left-color: #c6ccd3; }
.fld .hint { font-size: 11px; color: #8a929b; margin-top: 2px; }
.fld.active .lab { font-weight: 700; }
.fld.active input, .fld.active select { outline: 2px solid #f59e0b; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { margin-top: 12px; display: flex; gap: 8px; }
.actions button { flex: 1; padding: 8px; border: 0; border-radius: 4px; cursor: pointer; }
.btn-save { background: #345d86; color: #fff; } .btn-confirm { background: #2e7d32; color: #fff; }
.actions2 { margin-top: 8px; }
.actions2 button { background: #f4f5f7; border: 1px solid #c6ccd3; color: #465059; font-size: 12px; }
.actions2 button:disabled { opacity: .45; cursor: default; }
.learn { font-size: 12px; display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #1b1f24; color: #fff; padding: 8px 16px; border-radius: 6px; opacity: 0; transition: opacity .2s; z-index: 60; }
.toast.show { opacity: .95; }
#cheats, #importbox { position: fixed; inset: 0; background: rgba(15,20,25,.55); z-index: 50;
          display: flex; align-items: center; justify-content: center; }
/* explizites display:flex schlaegt das hidden-Attribut — hier zuruecksetzen */
#cheats[hidden], #importbox[hidden], #runbanner[hidden], #runprogress[hidden] { display: none; }
#cheats .card, #importbox .card { background: #fff; border-radius: 8px; padding: 18px 22px; min-width: 380px;
                max-width: 560px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
#cheats h3, #importbox h3 { margin: 0 0 10px; font-size: 15px; }
.imp-sec { border: 1px solid #e2e5e9; border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.imp-sec label { display: block; font-size: 12px; color: #465059; margin: 8px 0; }
.imp-sec input[type=file] { display: block; margin-top: 3px; font-size: 12px; }
.imp-sec input[type=text], .imp-sec #imp-month { padding: 4px 8px; border: 1px solid #c6ccd3; border-radius: 4px; }
.imp-sec button { margin-top: 4px; padding: 6px 12px; border: 0; border-radius: 4px; background: #345d86; color: #fff; cursor: pointer; }
.imp-note { font-size: 11px; color: #8a929b; margin: 4px 0 8px; }
#runprogress { margin: 8px 0; }
#runbar { height: 8px; background: #e2e5e9; border-radius: 4px; overflow: hidden; position: relative; }
#runbar::after { content: ""; position: absolute; inset: 0; width: var(--p, 0%); background: #2e7d32; transition: width .4s; }
#runlabel { font-size: 12px; color: #465059; margin-top: 4px; }
#runerrors { font-size: 12px; color: #7a5b00; max-height: 140px; overflow-y: auto; }
#cheats table { border-collapse: collapse; font-size: 13px; }
#cheats td { padding: 3px 10px 3px 0; }
#cheats kbd { background: #f4f5f7; border: 1px solid #c6ccd3; border-bottom-width: 2px;
              border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: inherit; }
#cheats .close { margin-top: 12px; font-size: 12px; color: #6b7580; }
