/* Larger built-in keys; existing colour, press feedback and handlers are preserved. */
[data-keyboard]{scroll-margin-block:12px;flex-shrink:0}
[data-keyboard="num"]{gap:8px}
[data-keyboard="num"]>button{height:var(--keyboard-key-height,78px);min-height:44px;min-width:0;overflow-wrap:anywhere;aspect-ratio:auto;font-size:24px;border-radius:12px;transition:background-color .12s,color .12s,transform .1s,box-shadow .12s,border-color .12s;touch-action:manipulation}
[data-keyboard="num"]>button.del{font-size:22px}
[data-keyboard="qwerty"] .qwerty-row{gap:5px;margin-bottom:5px}
[data-keyboard="qwerty"] .qwerty-row:last-child{margin-bottom:0}
[data-keyboard="qwerty"] .qwerty-key{height:var(--keyboard-key-height,66px);min-height:44px;font-size:20px;touch-action:manipulation}
[data-keyboard="qwerty"] :is(.qwerty-action,.qwerty-done){font-size:clamp(11px,3.3vw,16px)}
[data-keyboard="qwerty"] .qwerty-space{font-size:0}
@media(max-width:380px){[data-keyboard="qwerty"] .qwerty-row{gap:3px}[data-keyboard="qwerty"] .qwerty-key{font-size:18px}[data-keyboard="qwerty"] .qwerty-action{font-size:11px}}

[data-atabey-ui="access"] :is(.reg-form,.rec-form,.rec-content){max-width:560px;padding-inline:clamp(12px,3vw,24px)}
[data-atabey-ui="access"] :is(.form-card,.rec-card){padding-inline:clamp(12px,4vw,24px)}
[data-atabey-ui="access"] .code-display .code-char{flex:1 1 0;min-width:0;max-width:48px;height:52px;font-size:24px}
.totp-setup-card{max-width:440px}

[data-atabey-ui="access"] :is(.reg-header,.rec-header)>svg{max-width:100%;height:auto}

[data-atabey-ui="access"] :is(.form-card,.rec-card){width:100%;min-width:0;max-width:100%}
[data-atabey-ui="access"] #pwd-keyboard{max-width:100%}

[data-keyboard="num"]>button[id*="clr"]{font-size:clamp(15px,4.8vw,20px)}

@media screen{
  [data-keyboard] button:is(.atabey-key-pressed,.kbd-pressed,:active):not(:disabled){
    background:linear-gradient(155deg,#94e9ff,#25bcff 55%,#0879d7)!important;
    border-color:#d6f7ff!important;color:#04182a!important;
    box-shadow:inset 0 1px 0 #fff,inset 0 -2px 0 #075e97,0 0 10px #39ccff,0 0 22px #12a5ffb3!important;
    text-shadow:0 1px 0 #ffffff66;transform:translateY(1px)!important;transition:none!important;
  }
}
@media(prefers-reduced-motion:reduce){[data-keyboard] button:is(.atabey-key-pressed,.kbd-pressed,:active):not(:disabled){transform:none!important}}

@media screen and (orientation:landscape) and (max-height:500px){
  [data-atabey-ui="access"] #screen-l1.active:has(#pwd-keyboard.visible){display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:8px;align-items:center}
  [data-atabey-ui="access"] #screen-l1>.form-card,[data-atabey-ui="access"] #pwd-keyboard{grid-column:1/-1}
  [data-atabey-ui="access"] #pwd-keyboard{padding-block:6px;margin-bottom:0}
  [data-atabey-ui="access"] #screen-l1>.nav-link{grid-column:1;min-width:0;padding-block:4px;overflow-wrap:anywhere}
  [data-atabey-ui="access"] #screen-l1>.login-emergency-tools{grid-column:2;min-width:0;margin-top:0!important;padding-top:0!important;border-top:0!important}
  [data-atabey-ui="access"] #screen-l1 #btn-emergency-quick{margin-bottom:0;padding:12px 10px;font-size:13px;letter-spacing:.5px}
}

/* Satin keycaps: chamfered light edge, restrained base and curved reflection.
   Presentation only; existing key actions and gesture handling are unchanged. */
@media screen {
  [data-keyboard] {
    --keycap-top:#28445f;--keycap-mid:#142e46;--keycap-bottom:#0a1b2d;
    --keycap-edge:#7fceff66;--keycap-light:#d9f3ff70;--keycap-base:#030d19;
    --keycap-ink:#edf8ff;--keycap-accent:#9ee5ff;--keycap-press:#38bdff;
  }
  [data-keyboard] button:not([hidden]) {
    position:relative;isolation:isolate;
    padding-inline:2px;border:1px solid var(--keycap-edge);
    border-radius:13px 13px 11px 11px;
    background:linear-gradient(155deg,var(--keycap-top),var(--keycap-mid) 48%,var(--keycap-bottom));
    color:var(--keycap-ink);font-weight:600;
    text-shadow:0 1px 2px #0009;
    box-shadow:inset 0 1px 0 var(--keycap-light),inset 0 -1px 0 #0006,
      0 4px 0 var(--keycap-base),0 7px 10px #0006;
    transform:translateY(0);
    transition:transform .1s ease,box-shadow .12s ease,border-color .12s ease;
  }
  [data-keyboard] button:not([hidden])::before {
    content:'';position:absolute;pointer-events:none;
    inset:2px 3px auto;height:36%;border-radius:10px 10px 48% 48%;
    background:linear-gradient(145deg,#ffffff21,#ffffff03 58%,transparent);
    border-top:1px solid var(--keycap-light);opacity:.8;
  }
  [data-keyboard] button:is(.qwerty-action,.qwerty-done,.del) {
    color:var(--keycap-accent);border-color:var(--keycap-edge);
  }
  [data-keyboard] button.qwerty-shift-on {
    border-color:var(--keycap-accent);color:var(--keycap-accent)!important;
    box-shadow:inset 0 1px 0 var(--keycap-light),inset 0 -1px 0 #0006,
      0 4px 0 var(--keycap-base),0 0 10px var(--keycap-edge);
  }
  [data-keyboard] button:focus-visible {
    outline:2px solid var(--keycap-accent);outline-offset:3px;
  }
  [data-keyboard] button:is(:active,.kbd-pressed,.atabey-key-pressed):not(:disabled) {
    background:linear-gradient(155deg,#cff6ff,var(--keycap-press) 60%,#9ee5ff)!important;
    border-color:#cff6ff!important;color:#04182a!important;text-shadow:0 1px 0 #ffffff66;
    box-shadow:inset 0 1px 0 #fff9,inset 0 -1px 0 #0003,
      0 1px 0 var(--keycap-base),0 0 12px #2cc3ff8c!important;
    transform:translateY(3px)!important;transition:none!important;
  }
  [data-keyboard] button:disabled {opacity:.45;box-shadow:inset 0 1px 0 var(--keycap-light),0 2px 0 var(--keycap-base);}
}
@media screen and (hover:hover) and (pointer:fine) {
  [data-keyboard] button:not(:disabled):hover {border-color:var(--keycap-accent);}
}
@media(prefers-reduced-motion:reduce) {
  [data-keyboard] button:is(:active,.kbd-pressed,.atabey-key-pressed):not(:disabled) {transform:none!important;transition:none!important;}
}

/* Use the available phone width for the password keyboard. */
[data-atabey-ui="access"] #pwd-keyboard {
  width:calc(100% + 8px);max-width:none;margin-inline:-4px;
  padding-inline:8px;padding-bottom:18px;border-radius:22px;
  background:linear-gradient(150deg,#132c43f5,#0a192bfc);
  border-color:#74ccff66;
  box-shadow:inset 0 1px 0 #d3f3ff24,0 12px 24px #0005;
}
[data-keyboard="qwerty"] .qwerty-key {font-size:22px;}
@media(max-width:380px){[data-keyboard="qwerty"] .qwerty-key{font-size:20px}[data-keyboard="qwerty"] :is(.qwerty-action,.qwerty-done){font-size:11px}}
[data-keyboard="qwerty"] :is(.qwerty-action,.qwerty-done){font-size:clamp(11px,3.3vw,16px)}
[data-keyboard="qwerty"] .qwerty-space{font-size:0;}
[data-keyboard="num"]>button {font-size:28px;}
[data-keyboard="num"]>button.del {font-size:24px;}
[data-keyboard="num"]>button[id*="clr"] {font-size:clamp(15px,4.8vw,20px);}
