.kd { --case:#e1e1d9; --surface:#efefe8; --raised:#f7f7f1; --ink:#272a25; --muted:#545b50; --rule:#a7ad9e; --signal:#b33b1d; --power:#30372f; --power-ink:#fffef0; color:var(--ink); font-family:system-ui,sans-serif; color-scheme:light; }
.kd[data-skin=graphite] { --case:#303430; --surface:#383d38; --raised:#444943; --ink:#f3f2e7; --muted:#c4c9ba; --rule:#72796e; --signal:#ffa07e; --power:#dfdfce; --power-ink:#232923; color-scheme:dark; }
.kd[data-skin=slate] { --case:#c5cccf; --surface:#e4e9e9; --raised:#f1f4f4; --ink:#273238; --muted:#506068; --rule:#96a1a5; --signal:#a3371b; --power:#354047; }
.kd *, .kd *::before,.kd *::after {box-sizing:border-box;}
.kd :is(button,input,textarea,select){font:inherit;color:var(--ink);}
.kd :where(button,select,input:not([type=checkbox]),textarea){background:var(--raised);border:1px solid var(--rule);border-radius:5px;max-inline-size:100%;}
.kd :is(button,select){min-height:40px;padding:.44rem .75rem;line-height:1.28;font-size:.92rem;}
.kd button{cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:.45rem;overflow-wrap:anywhere;}
.kd button:enabled:hover,.kd select:enabled:hover {border-color:var(--ink);}
.kd :is(button,select):disabled{cursor:default;opacity:.5;}
.kd :is(button,select,input,textarea,summary):focus-visible{outline:3px solid var(--signal);outline-offset:2px;}
.kd .kd-power {background:var(--power);border-color:var(--power);color:var(--power-ink);font-weight:680;}
.kd .kd-power:enabled:hover{box-shadow:inset 0 0 0 1px var(--power-ink);}
.kd label,.kd h2,.kd h1,.kd p{margin:0;}
.kd h2,.kd h1{font-size:1.08rem;line-height:1.3;letter-spacing:-.02em;color:var(--ink);}
.kd h1{font-size:1.5rem;}
.kd [hidden]{display:none!important;}
.kd-stage{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;align-items:center;justify-items:center;min-height:clamp(570px,78vh,810px);min-height:clamp(570px,78svh,810px);padding:clamp(18px,3vw,34px) 12px 20px;background:var(--surface);border-radius:8px;}
.kd-scenario select{border-radius:99px;background:transparent;font-size:.95rem;font-weight:650;padding-inline:1.15rem;}
.kd-air{display:grid;place-items:center;width:100%;align-self:stretch;}
.kd-wheel{position:relative;width:min(51%,49vh,440px);width:min(51%,49svh,440px);aspect-ratio:1;}
.kd-wheel canvas{display:block;width:100%;aspect-ratio:1;touch-action:none;cursor:grab;-webkit-user-select:none;user-select:none;}
.kd-wheel canvas:active{cursor:grabbing;}
.kd .kd-hub{position:absolute;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:18%;height:18%;min-height:32px;min-width:32px;padding:0;border-radius:50%;border:1px solid #454943;color:#fbfbef;background:#30352f;font-weight:640;font-size:clamp(.65rem,1.9vw,.93rem);letter-spacing:.015em;}
.kd .kd-hub:disabled{opacity:1;color:#c7ccc1;}.kd .kd-hub:enabled:hover{border-color:var(--signal);background:#394035;}
.kd-outcome{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;min-height:54px;gap:.45rem 1rem;max-width:100%;}
.kd-readout{display:flex;align-items:baseline;gap:.6rem;touch-action:pan-y;padding:.45rem .25rem;overflow-wrap:anywhere;}
.kd-readout span{font-size:.77rem;letter-spacing:.04em;color:var(--muted);}.kd-readout strong{font-size:clamp(1.05rem,3vw,1.45rem);line-height:1.25;}
.kd-outcome button{border:0;border-bottom:1px solid var(--rule);border-radius:0;background:transparent;font-size:.85rem;}
.kd-bar{display:flex;align-items:center;justify-content:center;gap:clamp(.38rem,2vw,1.45rem);}
.kd-bar button{display:inline-flex;flex-direction:column;justify-content:center;gap:.28rem;min-width:48px;min-height:48px;border:0;background:transparent;color:var(--muted);font-size:.7rem;}
.kd .kd-bar button:hover,.kd .kd-bar button[aria-pressed=true]{color:var(--ink);background:var(--case);}
.kd-bar svg{width:17px;height:17px;}.kd-silent,#kd-mute[aria-pressed=true] .kd-wave{display:none;}#kd-mute[aria-pressed=true] .kd-silent{display:block;}
.kd-heading,.kd-actions{display:flex;align-items:center;justify-content:space-between;gap:.65rem;flex-wrap:wrap;}
.kd-heading>button{font-size:.83rem;min-height:34px;}
.kd-tools,.kd-switches,.kd-chips,.kd-tags{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;}
.kd-num,.kd-odds,#kd-count{font:500 .78rem/1.35 ui-monospace,SFMono-Regular,Consolas,monospace;font-variant-numeric:tabular-nums;}
.kd-drawer>label,.kd-save>label{display:block;font-size:.85rem;font-weight:650;margin-bottom:.3rem;}.kd-drawer>select,#kd-source,#kd-name,#kd-paste{width:100%;}.kd-drawer>select+label{margin-top:.8rem;}
.kd #kd-list{padding:0;list-style:none;margin:.55rem 0 0;}
.kd #kd-list li{display:grid;grid-template-columns:2ch minmax(0,1fr) max-content;gap:.65rem;align-items:center;border-block-start:1px solid var(--rule);padding-block:.55rem;font-size:.94rem;overflow-wrap:anywhere;}
.kd #kd-list li:has(button){grid-template-columns:2ch minmax(0,1fr) max-content auto auto;gap:.38rem;}
.kd #kd-list li.kd-picked{font-weight:700;}
.kd #kd-list button{min-width:32px;min-height:32px;padding:0;}
.kd-num,.kd-odds{color:var(--muted);}
.kd-odds{text-align:right;}
.kd-options h2{margin-bottom:1rem;}
.kd-options select {width:100%;}
.kd-switches{margin:.65rem 0;}
.kd-switches label,.kd-tags label{display:inline-flex;align-items:center;gap:.4rem;font-size:.92rem;min-height:36px;cursor:pointer;}
.kd input[type=checkbox]{width:1rem;height:1rem;accent-color:var(--power);margin:0;}
.kd details summary{padding-block:.5rem;font-weight:600;cursor:pointer;}
.kd-drawer,.kd-save{color:var(--ink);background:var(--surface);border:1px solid var(--rule);border-radius:13px;width:min(34rem,calc(100% - 24px));max-height:88vh;max-height:88dvh;overflow:auto;overscroll-behavior:contain;padding:clamp(16px,3vw,26px);}
.kd-drawer{margin:auto 0 auto auto;border-radius:13px 0 0 13px;width:min(35rem,100%);height:100%;max-height:100vh;max-height:100dvh;}
.kd :is(dialog)::backdrop{background:rgba(15,20,16,.47);overflow:hidden;overscroll-behavior:contain;}
.kd dialog:modal{overscroll-behavior:contain;}
.kd dialog>.kd-heading:first-child{margin-bottom:1.2rem;}
.kd-tags,.kd-cap,.kd-actions {margin:.75rem 0;}
.kd-tags{gap:.4rem 1rem;}
.kd-cap{justify-content:flex-start;}
.kd-cap button{margin-inline-start:auto;}
.kd-drawer details{padding-block:.25rem;border-block:1px solid var(--rule);margin:.9rem 0;}
.kd-chips{padding:.35rem 0 .65rem;max-height:30vh;overflow:auto;}
.kd-chips button{font-size:.85rem;min-height:35px;}
.kd button[aria-pressed=true]{background:var(--power);color:var(--power-ink);border-color:var(--power);}
.kd textarea,.kd input:not([type=checkbox]){padding:.6rem;}
.kd textarea{resize:vertical;min-height:4rem;line-height:1.5;}
.kd #kd-paste-hint,.kd #kd-weight-hint{margin:.5rem 0;color:var(--muted);font-size:.86rem;}
.kd #kd-error,.kd #kd-store-msg{color:var(--signal);font-size:.89rem;min-height:1.5em;margin-block:.35rem;}
.kd #kd-shelf>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.5rem;padding-block:.4rem;border-top:1px solid var(--rule);}
@media (max-width:680px){.kd-stage{min-height:clamp(550px,84vh,760px);min-height:clamp(550px,84svh,760px);padding:16px 8px;}.kd-wheel{width:min(83%,43vh,335px);width:min(83%,43svh,335px);}.kd-outcome{min-height:46px;}.kd-bar{gap:4px;}}
@media (forced-colors:active){.kd-wheel canvas{forced-color-adjust:none;}.kd button[aria-pressed=true]{outline:2px solid Highlight;}}
