/* INPUT-01: the key binding page. All classes start with kb- */
.kb-page{position:relative;display:flex;flex-direction:column;min-height:0;height:100%;background:var(--panel);border-radius:calc(var(--u) * 14);overflow:hidden;font-size:max(14px,calc(var(--u) * 16))}
.kb-body{display:flex;flex-direction:column;min-height:0;flex:1;overflow:auto;padding:calc(var(--u) * 12)}
.kb-page button{min-height:44px;border-radius:calc(var(--u) * 10);background:#1D2431;border:1px solid rgba(255,255,255,.18);padding:0 calc(var(--u) * 12)}
.kb-page button:disabled{opacity:.4;cursor:default}
.kb-page button:hover:not(:disabled){border-color:rgba(255,255,255,.45)}
.kb-page button:focus-visible,.kb-zone:focus-visible{outline:3px solid #fff;outline-offset:2px}
.kb-page [aria-pressed="true"],.kb-page [aria-selected="true"],.kb-page [aria-checked="true"]{border-color:var(--accent);color:var(--accent);background:#2c2a22}
.kb-head{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.kb-head h2{margin:0 auto 0 0;font-size:1.3em}
.kb-presets,.kb-tabs,.kb-opt [role="group"]{display:flex;flex-wrap:wrap;gap:6px}
.kb-tabs{margin:10px 0 6px}
/* at big text or on short screens the list keeps a usable height and the whole page scrolls instead */
.kb-scroll{flex:1 0 auto;height:max(300px,50vh);overflow:auto;padding:3px}
.kb-options{display:grid;gap:8px;margin-bottom:12px}
.kb-opt{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;justify-content:space-between;padding:8px 12px;border-radius:12px;background:#10141C}
.kb-opt small{display:block;color:var(--mute);font-size:.85em}
.kb-table{width:100%;border-collapse:collapse;table-layout:fixed}
.kb-table thead th{position:sticky;top:-3px;background:var(--panel);font-weight:400;color:var(--mute);font-size:.85em;text-align:center;padding:4px;z-index:1}
.kb-table thead th:first-child{width:34%;text-align:left}
.kb-table thead th:last-child{width:calc(44px + 8px)}
.kb-table tbody th{text-align:left;font-weight:400;padding:4px 8px 4px 0;line-height:1.35}
.kb-table tbody th em{display:inline-block;margin-left:8px;font-style:normal;font-size:.75em;color:var(--blue)}
.kb-table td{padding:3px}
.kb-table tbody tr{border-top:1px solid rgba(255,255,255,.08)}
.kb-page .kb-cell{width:100%;display:flex;align-items:center;justify-content:center}
.kb-cell small{display:none}
.kb-cell kbd{font-size:1.02em;overflow-wrap:anywhere}
.kb-unset kbd{color:var(--mute)}
.kb-page .kb-undo{width:44px;padding:0}
.kb-na{display:block;text-align:center;color:var(--mute);font-size:.8em}
.kb-note{margin:6px 0 0;min-height:1.45em;color:var(--good)}
.kb-foot{margin:2px 0 0;color:var(--mute);font-size:.82em}
.kb-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.kb-veil{position:absolute;inset:0;display:grid;place-items:center;padding:12px;background:rgba(8,11,17,.72);z-index:3;overflow:auto}
.kb-box{width:min(100%,460px);padding:16px;border-radius:16px;background:#1a212e;border:1px solid rgba(255,255,255,.2);text-align:center}
.kb-box h3{margin:0 0 10px}.kb-box h3 kbd{padding:0 8px;border-radius:8px;background:#10141C}
.kb-zone{display:grid;place-items:center;min-height:110px;padding:12px;border-radius:14px;border:2px dashed var(--accent);background:#10141C;cursor:crosshair}
.kb-msg{margin:8px 0;min-height:1.45em;color:#ffc9a0}
.kb-actions{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.kb-page .kb-primary{border-color:var(--accent);color:var(--accent)}
.kb-choices{display:grid;gap:8px}
.kb-page .kb-choices button{padding:8px 12px;text-align:left}
.kb-choices small{display:block;color:var(--mute);font-size:.85em}
/* narrow screens and big text: each action becomes a block with its three cells under the name */
@media (max-width:720px){
  .kb-table,.kb-table tbody,.kb-table tr{display:block}
  .kb-table thead{display:none}
  .kb-table tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:center;padding:6px 0}
  .kb-table tbody th{grid-column:1/-1}
  .kb-page .kb-cell{flex-direction:column;padding:2px 4px;line-height:1.25}
  .kb-cell small{display:block;color:var(--mute);font-size:.72em}
}

/* INTEGRATE-01: the rebinding page inside the game window stack, and the skill picked up on the mastery page */
.kb-window{width:min(920px,96vw);height:min(760px,92vh);height:min(760px,92dvh)}
.da-skill img{width:48px;height:48px}
.ms-slot.da-ok{outline:2px dashed #ffd27a;outline-offset:2px;border-radius:50%}
.ms-slot.da-over{outline:3px solid #fff}
