.kpo-options{display:flex;flex-direction:column;gap:18px;margin:4px 0 20px;width:100%;min-width:0;max-width:100%;clear:both;box-sizing:border-box;padding:18px;background:#fff;color:#1d2327;border-radius:8px}
.kpo-options label,.kpo-options legend,.kpo-options span,.kpo-options li{color:#1d2327}
.kpo-options .kpo-finish-opt.is-on{border-color:#d9621f;box-shadow:inset 0 0 0 1px #d9621f}
.kpo-options input[type=text],.kpo-options textarea,.kpo-options select{background:#fff;color:#1d2327;border:1px solid #c3c4c7;border-radius:4px;padding:8px}
.kpo-field{display:flex;flex-direction:column;gap:6px;border:0;margin:0;padding:0;min-width:0}
.kpo-field>label,.kpo-field legend{font-weight:700;padding:0;margin:0 0 2px}
.kpo-help{font-size:.875em;opacity:.8}
.kpo-field input[type=text],.kpo-field input[type=number],.kpo-field textarea,.kpo-field select{width:100%;max-width:100%;box-sizing:border-box}
.kpo-finish-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:8px}
.kpo-finish-opt{position:relative;display:flex;flex-direction:column;gap:2px;padding:10px 12px;border:2px solid rgba(128,128,128,.35);border-radius:6px;cursor:pointer;line-height:1.3}
.kpo-finish-opt input{position:absolute;opacity:0;pointer-events:none}
.kpo-finish-opt.is-on{border-color:currentColor}
.kpo-finish-opt:focus-within{outline:2px solid currentColor;outline-offset:2px}
.kpo-finish-name{font-weight:700}
.kpo-adj,.kpo-days,.kpo-note{font-size:.8em;opacity:.8}
.kpo-color{margin:6px 0 0}
.kpo-color[hidden]{display:none!important}
.kpo-files{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}
.kpo-files li{display:flex;align-items:center;gap:10px;padding:6px 8px;border:1px solid rgba(128,128,128,.35);border-radius:6px}
.kpo-files img,.kpo-files .kpo-ext{width:48px;height:48px;flex:none;object-fit:cover;border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:.75em;font-weight:700;background:rgba(128,128,128,.15)}
.kpo-fname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kpo-status{font-size:.8em;opacity:.8}
.kpo-files li.is-error{border-color:#d63638}
.kpo-files li.is-error .kpo-status{color:#d63638;opacity:1}
.kpo-remove{background:none;border:0;font-size:20px;line-height:1;cursor:pointer;padding:0 4px;color:inherit}
.kpo-count-total{margin:4px 0 0;font-weight:700}
/* Element speller and periodic table */
.kpo-spell-row{display:flex;flex-wrap:wrap;gap:8px}
.kpo-spell-row input{flex:1 1 180px;min-width:0}
.kpo-options button.kpo-spell-add,.kpo-options .kpo-ptable-actions button,.kpo-options .kpo-spell-alt button{background:#1d2327;color:#fff;border:0;border-radius:4px;padding:8px 12px;cursor:pointer;font-size:.875em;line-height:1.2}
.kpo-options button.kpo-spell-add[disabled]{opacity:.45;cursor:default}
.kpo-options .kpo-spell-alt button{background:#f0f0f1;color:#1d2327;margin:0 6px 6px 0;padding:5px 9px}
.kpo-options .kpo-ptable-actions .kpo-clear{background:#f0f0f1;color:#1d2327}
.kpo-spell-word{margin-top:6px}
.kpo-spell-alt{margin:6px 0 0;font-size:.85em}
.kpo-spell-err{color:#b32d2e;font-size:.875em;margin:4px 0 0}
.kpo-tiles{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0}
.kpo-tile{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;width:62px;height:62px;border-radius:4px;background:#2b3035;color:#fff;line-height:1.05;box-sizing:border-box;padding:4px}
.kpo-options .kpo-tile i,.kpo-options .kpo-tile b,.kpo-options .kpo-tile small{color:#fff;font-style:normal}
.kpo-tile i{position:absolute;top:3px;left:5px;font-size:10px;opacity:.8}
.kpo-tile b{font-size:22px}
.kpo-tile small{font-size:8.5px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kpo-tile.is-bad{background:#b32d2e}
.kpo-options .kpo-tile-x{position:absolute;top:-6px;right:-6px;width:20px;height:20px;border-radius:50%;border:0;background:#fff;color:#1d2327;box-shadow:0 0 0 1px #c3c4c7;font-size:14px;line-height:20px;padding:0;cursor:pointer}
.kpo-ptable{margin-top:8px;min-width:0;max-width:100%;width:100%;contain:inline-size}
.kpo-ptable-h{margin:0;font-weight:700}
.kpo-pgrid{display:grid;width:100%;max-width:100%;box-sizing:border-box;grid-template-columns:repeat(18,minmax(30px,1fr));grid-template-rows:repeat(7,auto) 10px repeat(2,auto);gap:2px;overflow-x:auto;margin-top:8px;padding-bottom:4px}
.kpo-options .kpo-cell{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;aspect-ratio:1;min-width:30px;border:1px solid #c3c4c7;background:#f6f7f7;color:#1d2327;border-radius:3px;padding:0;cursor:pointer;line-height:1}
.kpo-options .kpo-cell:hover,.kpo-options .kpo-cell:focus-visible{border-color:#d9621f}
.kpo-options .kpo-cell.is-on{background:#2b3035;border-color:#2b3035}
.kpo-options .kpo-cell.is-on b,.kpo-options .kpo-cell.is-on i{color:#fff}
.kpo-cell i{position:absolute;top:1px;left:2px;font-size:7px;font-style:normal;color:#50575e}
.kpo-cell b{font-size:12px;color:#1d2327}
.kpo-options .kpo-cell em{position:absolute;bottom:-5px;right:-4px;font-size:9px;font-style:normal;background:#d9621f;color:#fff;border-radius:6px;padding:0 3px}
.kpo-options .kpo-cell em:empty{display:none}
.kpo-ptable-actions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 0}
/* Bulk tiers */
.kpo-tiers{background:#f6f7f7;border-radius:6px;padding:10px 12px}
.kpo-tiers-h{font-weight:700}
.kpo-tiers ul{margin:0;padding-left:18px;font-size:.9em}
.kpo-tier-hint{margin:0;font-size:.875em;color:#1a7f37;font-weight:600}
.kpo-tier-hint:empty{display:none}
.kpo-options input[type=number]{background:#fff;color:#1d2327;border:1px solid #c3c4c7;border-radius:4px;padding:8px}
/* Custom elements */
.kpo-tile.is-custom{border:2px dashed #d9621f}
.kpo-options .kpo-tile u{position:absolute;bottom:2px;right:4px;font-size:10px;text-decoration:none;color:#d9621f}
.kpo-spell-note{margin:4px 0 0;font-size:.875em}
.kpo-modes{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.kpo-options button.kpo-mode{background:#f0f0f1;color:#1d2327;border:1px solid #c3c4c7;border-radius:4px;padding:5px 10px;font-size:.85em;cursor:pointer}
.kpo-options button.kpo-mode.is-on{background:#d9621f;border-color:#d9621f;color:#fff}
.kpo-custom{margin-top:6px}
.kpo-custom-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0}
.kpo-options button.kpo-custom-open,.kpo-options button.kpo-custom-add{background:#d9621f;color:#fff;border:0;border-radius:4px;padding:8px 12px;cursor:pointer;font-size:.875em}
.kpo-options button.kpo-custom-add[disabled]{opacity:.45;cursor:default}
.kpo-custom-form{margin-top:8px}
.kpo-custom-form[hidden]{display:none!important}
.kpo-custom-fields{display:grid;grid-template-columns:70px 1fr 90px;gap:8px;margin:6px 0}
.kpo-custom-fields label{display:flex;flex-direction:column;gap:3px;font-size:.8em;font-weight:600}
.kpo-custom-fields input{width:100%;box-sizing:border-box;min-width:0}
.kpo-custom-preview{margin:6px 0}
.kpo-custom-actions{margin:0}
.kpo-promo{margin:0 0 6px;font-weight:700;color:#d9621f}
