/* The keyboard sits in its own viewport dock. The form uses its measured height. */
.shed-keyboard-shell {
  --shed-key-accent: #f2bb64;
  --shed-key-accent-ink: #261e11;
  --shed-key-focus: #795119;
  position: fixed;
  z-index: 10000;
  inset: auto 0 0;
  margin: 0;
  padding: 0;
  background: #e7e4df;
  color: #24211d;
  box-shadow: 0 -1px 0 #a4afb44a, 0 -5px 22px #1d2c3419;
  isolation: isolate;
  overscroll-behavior: contain;
}
.shed-keyboard-shell[hidden] { display: none; }
.shed-keyboard {
  --shed-key-height: clamp(45px, 6.8svh, 54px);
  --shed-row-gap: 5px;
  --shed-letter-height: var(--shed-key-height);
  --shed-key-gap: clamp(3px, 1vw, 6px);
  box-sizing: border-box;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 6px max(4px, env(safe-area-inset-right, 0px)) max(7px, env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg,#eeeae4,#e5e0d9 45%,#ded9d2);
  color: #24211d;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.shed-keyboard * { box-sizing: border-box; }
.shed-keyboard .shed-key-rows { display: grid; gap: var(--shed-row-gap); }
.shed-keyboard .shed-key-row { display: flex; align-items: stretch; gap: var(--shed-key-gap); height: var(--shed-letter-height); }
.shed-keyboard .shed-key-home-row { padding-inline: 5%; }
.shed-keyboard .shed-key {
  position: relative;
  display: grid;
  place-items: center;
  flex: 1 1 0;
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #fff;
  color: #24211d;
  box-shadow: 0 1px 0 #aaa399;
  font: inherit;
  font-size: clamp(19px, 5.3vw, 25px);
  font-weight: 450;
  line-height: 1;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  touch-action: manipulation;
  overflow: visible;
}
.shed-keyboard .shed-key:focus-visible { outline: 2px solid var(--shed-key-focus); outline-offset: 1px; z-index: 5; }
.shed-keyboard .shed-key-face { display: inline-flex; align-items: center; justify-content: center; gap: 4px; pointer-events: none; }
.shed-keyboard .shed-key svg { display: block; width: 19px; height: 19px; stroke-width: 1.75; }
.shed-keyboard .shed-key-side,.shed-keyboard .shed-key-mode { background: #cfcac2; }
.shed-keyboard .shed-key-mode,.shed-keyboard .shed-key-space,.shed-keyboard .shed-key-action { font-size: 15px; font-weight: 550; }
.shed-keyboard .shed-key-side { flex: 1.45 1 0; font-size: 15px; font-weight: 610; }
.shed-keyboard .shed-key-side[aria-pressed="true"] { background: #fafcfd; }
.shed-keyboard .shed-key-mode { flex: 0 0 clamp(45px, 14%, 72px); }
.shed-keyboard .shed-key-space { flex: 1 1 auto; font-weight: 450; }
.shed-keyboard .shed-key-action { flex: 0 0 clamp(68px, 19%, 100px); background: #f2e1c8; color: var(--shed-key-accent-ink); box-shadow: 0 1px 0 #b99765; }
.shed-keyboard .shed-key-bottom-row > .shed-key-plain { flex: 0 0 10%; font-size: 19px; }
.shed-keyboard .shed-key-number-grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: var(--shed-row-gap) var(--shed-key-gap); }
.shed-keyboard .shed-key-number-grid > .shed-key { grid-column: span 4; height: var(--shed-key-height); font-size: 24px; font-weight: 500; }
.shed-keyboard .shed-key-number-grid[data-kind="digits"] > [data-key="0"] { grid-column: 5 / span 4; }
.shed-keyboard .shed-key-number-grid[data-kind="number"]:has([data-key="-"]) > .shed-key:nth-child(n+10) { grid-column: span 3; }
/* Keep the button's hit box fixed. The cap and the glyph provide the visual feedback. */
.shed-keyboard button[data-key] { position: relative; isolation: isolate; }
.shed-keyboard button[data-key]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: var(--shed-key-accent);
  box-shadow: inset 0 0 0 1px #d4a453, 0 1px 0 #aa874d;
  opacity: 0;
  pointer-events: none;
}
.shed-keyboard button[data-key] .shed-key-face { position: relative; z-index: 1; }
.shed-keyboard button[data-key][data-active] { z-index: 2; background: var(--shed-key-accent); color: var(--shed-key-accent-ink); }
.shed-keyboard button[data-key][data-active]::before { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .shed-keyboard .shed-key:hover:not([data-active]) { outline: 1px solid #88988e; outline-offset: 0; }
  .shed-keyboard .shed-key:focus-visible { outline: 2px solid var(--shed-key-focus); outline-offset: 1px; }
}
@media (prefers-reduced-motion: no-preference) {
  .shed-keyboard { animation: shed-board-in .18s cubic-bezier(.16,.74,.23,1); }
  .shed-keyboard button[data-key]::before,
  .shed-keyboard button[data-key] .shed-key-face { transition: transform 65ms ease-out; }
  .shed-keyboard button[data-key][data-active]::before { transform: scale(var(--shed-press-width,1.04),1.04); transition-duration: 0s; }
  .shed-keyboard .shed-key-space { --shed-press-width: 1.008; }
  .shed-keyboard button[data-key][data-active] .shed-key-face { transform: scale(1.04); transition-duration: 0s; }
  @keyframes shed-board-in { from { transform: translateY(10px); opacity: .78; } to { transform: none; opacity: 1; } }
}
@media (max-height: 570px) {
  .shed-keyboard { --shed-key-height: 38px; --shed-row-gap: 4px; }
}
@media (max-height: 440px) and (orientation: landscape) {
  .shed-keyboard { --shed-key-height: 33px; --shed-row-gap: 3px; max-width: 650px; padding-top: 4px; padding-bottom: max(2px,env(safe-area-inset-bottom,0px)); }
}
@media (forced-colors: active) {
  .shed-keyboard .shed-key { border: 1px solid ButtonText; }
  .shed-keyboard button[data-key][data-active] { forced-color-adjust: none; color: HighlightText; background: Highlight; }
  .shed-keyboard button[data-key][data-active]::before { background: Highlight; box-shadow: none; }
}

html.keyboard-open { scroll-padding-bottom:calc(var(--keyboard-height, 280px) + 14px); }
html.keyboard-open body { padding-bottom:var(--keyboard-height, 280px); }
.shed-keyboard button:not(.shed-key-plain)[data-key][data-active]::before,
.shed-keyboard button:not(.shed-key-plain)[data-key][data-active] .shed-key-face { transform:none; }
