/* Computer class (js/screens/keys.js, js/keys.js): Mouse Meadow, Keyboard
   Cove, and Clicky's Computer. The round's card holds a little job (bubbles,
   a basket, a pretend desktop); under it, for typing, a glowing keyboard and
   two hands colored by finger. Class prefix .kp- (the round) and .kk- (keys). */

/* ——— The worlds' colors (level picker tabs and the round) ——— */
.wt-mouse, .wp-mouse, .w-mouse { --w: #3fb8e8; --w-deep: #1f8fbf; --w-soft: #cdeefb; --w-bg: linear-gradient(140deg, #a8e4fb, #3fb8e8); }
.wt-keys, .wp-keys, .w-keys { --w: #8a6cf0; --w-deep: #6a4bd6; --w-soft: #e5ddff; --w-bg: linear-gradient(140deg, #cbbcff, #8a6cf0); }
.wt-desk, .wp-desk, .w-desk { --w: #2fbf9a; --w-deep: #1d977a; --w-soft: #ccf3e7; --w-bg: linear-gradient(140deg, #9ff0d8, #2fbf9a); }
.w-mouse .card { border-color: #cdeefb; box-shadow: 0 10px 0 #a9dcf2, 0 22px 40px rgba(30, 120, 170, 0.18); }
.w-keys .card { border-color: #e5ddff; box-shadow: 0 10px 0 #cbbcff, 0 22px 40px rgba(110, 70, 200, 0.18); }
.w-desk .card { border-color: #ccf3e7; box-shadow: 0 10px 0 #a5e6d2, 0 22px 40px rgba(30, 150, 120, 0.18); }
.keys-play .level-tag { background: var(--w-soft); color: var(--w-deep); }

/* Finger colors, shared by the keys and the hands. */
.keys-play {
  --f-pinky: #ff9cc8;
  --f-ring: #ffbd7a;
  --f-middle: #ffe066;
  --f-lindex: #7fe0b8;
  --f-rindex: #8fcfff;
  --f-thumb: #cdb6ff;
}

/* ——— The card ——— */
.keys-play { width: 100%; }
.kp-card { padding: 46px 16px 16px; }
.kp-ask {
  min-height: 30px;
  margin: 0 auto 10px;
  max-width: 600px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  text-wrap: balance;
}
.kp-ask b { color: var(--w-deep, var(--lilac-deep)); }
.kp-ask kbd, .feedback kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 6px;
  border-radius: 8px;
  border: 2px solid #d9cdee;
  border-bottom-width: 4px;
  background: #fff;
  font: inherit;
  font-size: 0.9em;
  line-height: 1.4;
  color: var(--ink);
}
.kp-big { font-size: 34px; vertical-align: middle; }
.kp-area { position: relative; min-height: 290px; display: flex; align-items: center; justify-content: center; }
.kp-ring { animation: kp-ring 1.1s ease-in-out infinite; border-radius: 14px; }
@keyframes kp-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 197, 61, 0.9); }
  50% { box-shadow: 0 0 0 10px rgba(255, 197, 61, 0); }
}

/* ——— 🫧 Bubble Pop ——— */
.kp-sky {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 26px;
  overflow: hidden;
  cursor: crosshair;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.9) 0 26px, transparent 27px),
    radial-gradient(circle at 82% 70%, rgba(255, 255, 255, 0.7) 0 20px, transparent 21px),
    linear-gradient(180deg, #d6f2ff, #f2fbff 70%, #dff7e8);
}
.kp-bubble {
  position: absolute;
  width: var(--s);
  height: var(--s);
  translate: -50% -50%;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.95) 0 14%, transparent 15%),
    radial-gradient(circle at 50% 50%, rgba(255, 140, 200, 0.25) 0 55%, rgba(255, 95, 162, 0.75) 72%, rgba(255, 255, 255, 0.9) 74%);
  box-shadow: 0 6px 16px rgba(224, 64, 138, 0.25);
  animation: kp-bob 2.4s ease-in-out infinite, pop-in 0.4s var(--bounce);
  animation-delay: calc(var(--i) * -0.4s), 0s;
}
.kp-bubble.decoy {
  background:
    radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.95) 0 14%, transparent 15%),
    radial-gradient(circle at 50% 50%, rgba(120, 190, 255, 0.25) 0 55%, rgba(79, 158, 232, 0.75) 72%, rgba(255, 255, 255, 0.9) 74%);
  box-shadow: 0 6px 16px rgba(40, 110, 200, 0.25);
}
.kp-bubble:hover { scale: 1.08; }
.kp-bubble.drift { animation: kp-drift var(--dur) ease-in-out infinite alternate; }
.kp-bubble.popped { pointer-events: none; animation: kp-pop 0.3s ease-out forwards; }
.kp-sky.helping .kp-bubble.good:not(.popped) { scale: 1.3; outline: 4px dashed var(--gold); outline-offset: 6px; animation-play-state: paused; }
@keyframes kp-bob { 50% { transform: translateY(-8px); } }
@keyframes kp-drift { from { transform: translate(0, 0); } to { transform: translate(var(--dx), var(--dy)); } }
@keyframes kp-pop { to { scale: 1.6; opacity: 0; } }

/* ——— 🍎 Fruit Basket, and anything dragged ——— */
.kp-field {
  position: relative;
  width: 100%;
  height: 290px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 50% 120%, #b9eaa0 0 45%, transparent 46%),
    linear-gradient(180deg, #e9f8ff, #f7fff0);
}
.kp-field.near { justify-content: center; gap: 70px; }
.kp-fruits { display: flex; flex-wrap: wrap; gap: 14px; max-width: 46%; justify-content: center; }
.kp-fruit, .kp-file {
  touch-action: none;
  cursor: grab;
  user-select: none;
  line-height: 1;
  transition: scale 0.15s;
  animation: pop-in 0.4s var(--bounce) both;
  animation-delay: calc(var(--i, 0) * 0.06s);
}
.kp-fruit { font-size: 64px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.12)); }
.kp-fruit.s-big { font-size: 78px; }
.kp-fruit.s-small { font-size: 40px; }
.kp-fruit:hover, .kp-file:hover { scale: 1.08; }
.dragging { cursor: grabbing; scale: 1.15; z-index: 20; position: relative; filter: drop-shadow(0 14px 12px rgba(0, 0, 0, 0.2)); }
.spring { transition: translate 0.35s var(--bounce); }
.kp-fruit.in, .kp-file.in { animation: kp-in 0.35s ease-in forwards; pointer-events: none; }
@keyframes kp-in { to { scale: 0.2; opacity: 0; } }
.kp-baskets { display: flex; flex-direction: column; gap: 18px; }
.kp-basket {
  position: relative;
  display: grid;
  place-items: center;
  width: 128px;
  height: 108px;
  border-radius: 28px;
  border: 4px dashed rgba(91, 58, 110, 0.18);
  background: rgba(255, 255, 255, 0.6);
  font-size: 70px;
}
.kp-basket .kp-tag { position: absolute; top: -14px; right: -10px; font-size: 32px; }
.kp-basket.bump, .kp-folder.bump, .kp-trash.bump { animation: bump 0.35s var(--bounce); }
.kp-path { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.kp-path path { fill: none; stroke: var(--gold); stroke-width: 5; stroke-dasharray: 4 12; stroke-linecap: round; animation: kp-dash 1s linear infinite; }
.kp-path text { font-size: 34px; animation: kp-go 1.6s ease-in-out infinite; }
@keyframes kp-dash { to { stroke-dashoffset: -32; } }
@keyframes kp-go { 50% { transform: translate(8px, -6px); } }

/* ——— 📜 Scroll Hunt ——— */
.kp-scrollwrap { position: relative; width: 100%; max-width: 440px; }
.kp-scroller {
  height: 290px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 12px;
  border-radius: 24px;
  border: 4px solid #e2f4ff;
  background: linear-gradient(180deg, #f5fbff, #eaf6ff);
  scrollbar-width: auto;
  scrollbar-color: var(--sky) #eaf6ff;
}
.kp-cell { height: 64px; border: none; border-radius: 16px; background: transparent; font-size: 40px; cursor: pointer; }
.kp-cell:not(:disabled):hover { background: #fff; }
.kp-cell.found { background: #fff7cc; animation: bump 0.4s var(--bounce); }
.kp-cell.hint { outline: 4px dashed var(--gold); }
.kp-end { grid-column: 1 / -1; margin: 6px; color: var(--ink-soft); }
.kp-down { position: absolute; right: -8px; bottom: 6px; font-size: 38px; animation: kp-down 1s ease-in-out infinite; pointer-events: none; transition: opacity 0.3s; }
.kp-down.gone { opacity: 0; }
.kp-down.nudge { scale: 1.3; }
@keyframes kp-down { 50% { translate: 0 10px; } }

/* ——— 🎁 Double-Click Gifts ——— */
.kp-gifts { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 30px; padding: 30px 10px; }
.kp-gift {
  position: relative;
  width: calc(var(--s) * 1.1);
  height: calc(var(--s) * 1.2);
  border: none;
  background: none;
  cursor: pointer;
  font-size: var(--s);
  line-height: 1;
  animation: pop-in 0.4s var(--bounce) both;
  animation-delay: calc(var(--i) * 0.08s);
}
.kp-gift > span { position: absolute; left: 50%; translate: -50% 0; }
.kp-box { bottom: 0; }
.kp-lid { bottom: 52%; font-size: 0.5em; transition: translate 0.4s var(--bounce), rotate 0.4s; }
.kp-star { top: -18px; right: -14px; left: auto; translate: none; font-size: 0.36em; animation: twinkle 1.4s ease-in-out infinite; }
.kp-surprise { bottom: 30%; font-size: 0.6em; opacity: 0; transition: translate 0.5s var(--bounce), opacity 0.2s; }
.kp-gift.wiggle { animation: wiggle 0.2s 2; }
.kp-gift.open .kp-lid { translate: 40% -120%; rotate: 30deg; }
.kp-gift.open .kp-surprise { opacity: 1; translate: -50% -95%; }
.kp-gifts.helping .kp-gift.good::after {
  content: '👆👆';
  position: absolute;
  left: 50%;
  bottom: -34px;
  translate: -50% 0;
  font-size: 26px;
  animation: kp-down 0.5s ease-in-out infinite;
}
@keyframes twinkle { 50% { scale: 1.25; } }

/* ——— 🔍 Key Hunt ——— */
.kp-keycap {
  display: grid;
  place-items: center;
  min-width: 150px;
  height: 150px;
  padding: 0 26px;
  border-radius: 30px;
  border: 4px solid #e5ddff;
  border-bottom-width: 14px;
  background: linear-gradient(180deg, #fff, #f6f2ff);
  font-size: 96px;
  font-weight: 700;
  color: var(--lilac-deep);
  animation: pop-in 0.4s var(--bounce);
}
.kp-keycap.wide { min-width: 300px; font-size: 54px; }
.kp-keycap.hit { border-bottom-width: 6px; translate: 0 8px; background: #e9fff5; color: var(--mint-deep); transition: all 0.08s; }

/* ——— ⌨️ Typing ——— */
.kp-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  max-width: 640px;
  padding: 24px 10px;
  font-size: clamp(34px, 7vw, 54px);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #b9a8d6;
}
.kp-ch { position: relative; display: inline-block; min-width: 0.6em; padding: 0 1px; border-radius: 10px; transition: color 0.1s; }
.kp-ch.now { color: var(--ink); background: #fff5c7; }
.kp-ch.now::after {
  content: '';
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -6px;
  height: 6px;
  border-radius: 3px;
  background: var(--lilac);
  animation: kp-caret 0.9s ease-in-out infinite;
}
.kp-ch.ok { color: var(--mint-deep); animation: kp-hop 0.25s var(--bounce); }
.kp-ch.miss { animation: shake 0.3s; color: #ff4d6d; }
.kp-space { color: #d6cbe8; }
.kp-ch.ok .kp-space { color: var(--mint); }
@keyframes kp-caret { 50% { opacity: 0.35; } }
@keyframes kp-hop { 40% { transform: translateY(-8px) scale(1.12); } }

/* ——— The keyboard and hands under the card ——— */
.kp-under {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 10px 14px;
  border-radius: 30px;
  border: 4px solid #fff;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  animation: pop-in 0.4s var(--bounce);
}
.kp-hands svg { width: 240px; height: auto; display: block; }
.kp-hands .palm { fill: #f6ebdf; }
.kp-hands .hf { fill: #f3e2d1; stroke: #e6cdb6; stroke-width: 2; transition: fill 0.15s, translate 0.15s; }
.kp-hands .hf.on { stroke: #fff; stroke-width: 3; translate: 0 -6px; filter: drop-shadow(0 0 6px rgba(255, 197, 61, 0.9)); }
.kp-hands .hf.f-Lpinky.on, .kp-hands .hf.f-Rpinky.on { fill: var(--f-pinky); }
.kp-hands .hf.f-Lring.on, .kp-hands .hf.f-Rring.on { fill: var(--f-ring); }
.kp-hands .hf.f-Lmiddle.on, .kp-hands .hf.f-Rmiddle.on { fill: var(--f-middle); }
.kp-hands .hf.f-Lindex.on { fill: var(--f-lindex); }
.kp-hands .hf.f-Rindex.on { fill: var(--f-rindex); }
.kp-hands .hf.f-thumb.on { fill: var(--f-thumb); }
.kp-finger { min-height: 22px; margin: 0; font-size: 16px; color: var(--ink-soft); }
.kp-finger b { padding: 0 6px; border-radius: 8px; color: var(--ink); }
.kp-finger .f-Lpinky, .kp-finger .f-Rpinky { background: var(--f-pinky); }
.kp-finger .f-Lring, .kp-finger .f-Rring { background: var(--f-ring); }
.kp-finger .f-Lmiddle, .kp-finger .f-Rmiddle { background: var(--f-middle); }
.kp-finger .f-Lindex { background: var(--f-lindex); }
.kp-finger .f-Rindex { background: var(--f-rindex); }
.kp-finger .f-thumb { background: var(--f-thumb); }

.kp-kbd { display: flex; flex-direction: column; gap: 5px; width: 100%; max-width: 640px; }
.kk-row { display: flex; gap: 5px; justify-content: center; }
.kk-row:nth-child(2) { padding-left: 0; }
.kk-row:nth-child(3) { padding-left: 2%; }
.kk-row:nth-child(4) { padding-left: 0; }
.kk {
  position: relative;
  flex: 1 1 0;
  max-width: 52px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 2px solid rgba(91, 58, 110, 0.12);
  border-bottom-width: 5px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  transition: translate 0.08s, border-bottom-width 0.08s;
}
.kk.wide { flex: 1.6 1 0; max-width: 92px; font-size: 13px; color: var(--ink-soft); }
.kk.space { flex: 6 1 0; max-width: 300px; }
.kk.small { flex: 1 1 0; max-width: 52px; }
.kk.bump::after { content: ''; position: absolute; bottom: 7px; width: 12px; height: 3px; border-radius: 2px; background: currentColor; opacity: 0.45; }
/* Light finger tints; the next key glows in its full color. */
.kk.f-Lpinky, .kk.f-Rpinky { background: color-mix(in srgb, var(--f-pinky) 22%, #fff); }
.kk.f-Lring, .kk.f-Rring { background: color-mix(in srgb, var(--f-ring) 22%, #fff); }
.kk.f-Lmiddle, .kk.f-Rmiddle { background: color-mix(in srgb, var(--f-middle) 26%, #fff); }
.kk.f-Lindex { background: color-mix(in srgb, var(--f-lindex) 24%, #fff); }
.kk.f-Rindex { background: color-mix(in srgb, var(--f-rindex) 24%, #fff); }
.kk.f-thumb { background: color-mix(in srgb, var(--f-thumb) 24%, #fff); }
.kk.next { z-index: 1; scale: 1.12; border-color: #fff; color: var(--ink); animation: kk-glow 0.9s ease-in-out infinite; }
.kk.next.f-Lpinky, .kk.next.f-Rpinky { background: var(--f-pinky); }
.kk.next.f-Lring, .kk.next.f-Rring { background: var(--f-ring); }
.kk.next.f-Lmiddle, .kk.next.f-Rmiddle { background: var(--f-middle); }
.kk.next.f-Lindex { background: var(--f-lindex); }
.kk.next.f-Rindex { background: var(--f-rindex); }
.kk.next.f-thumb { background: var(--f-thumb); }
.kk.hit { animation: kk-hit 0.2s; }
.kk.miss { animation: kk-miss 0.35s; }
@keyframes kk-glow { 50% { box-shadow: 0 0 0 5px rgba(255, 197, 61, 0.55), 0 0 18px rgba(255, 197, 61, 0.8); } }
@keyframes kk-hit { 40% { translate: 0 3px; border-bottom-width: 2px; background: #c9f7e4; } }
@keyframes kk-miss { 0%, 100% { background: inherit; } 30% { background: #ffc2cf; translate: -3px 0; } 60% { translate: 3px 0; } }

/* ——— 🖥️ A pretend computer ——— */
.kp-desk {
  position: relative;
  width: 100%;
  height: 300px;
  overflow: hidden;
  border-radius: 22px;
  border: 10px solid #3d3552;
  border-bottom-width: 14px;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.5) 0 40px, transparent 41px),
    radial-gradient(ellipse at 20% 110%, #b6f0d8 0 40%, transparent 41%),
    linear-gradient(160deg, #b9d8ff, #e2d4ff 60%, #ffd9ec);
  text-align: left;
}
.kp-icons { position: absolute; top: 12px; left: 12px; display: flex; flex-direction: column; gap: 8px; }
.kp-icon, .kp-folder, .kp-trash, .kp-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 78px;
  padding: 6px 4px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: none;
  font: inherit;
  cursor: default;
}
.kp-icon span, .kp-folder span, .kp-trash span, .kp-file span { font-size: 40px; line-height: 1; }
.kp-icon small, .kp-folder small, .kp-trash small, .kp-file small {
  padding: 0 6px;
  border-radius: 6px;
  font-size: 12px;
  color: #fff;
  background: rgba(61, 53, 82, 0.55);
  white-space: nowrap;
}
.kp-icon.sel, .kp-folder.sel, .kp-trash.sel { background: rgba(255, 255, 255, 0.5); border-color: rgba(255, 255, 255, 0.9); }
.kp-dock {
  position: absolute;
  bottom: 8px;
  left: 50%;
  translate: -50% 0;
  display: flex;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px);
  font-size: 26px;
}
.kp-win {
  position: absolute;
  top: 34px;
  left: 50%;
  width: min(330px, 76%);
  translate: -50% 0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 16px 30px rgba(40, 20, 80, 0.25);
  animation: pop-in 0.35s var(--bounce);
  transition: scale 0.35s, opacity 0.35s, top 0.35s, left 0.35s, width 0.35s, height 0.35s;
}
.kp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px 6px 12px;
  background: linear-gradient(180deg, #f1ecfb, #e3dbf5);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  touch-action: none;
}
.movable .kp-bar { cursor: grab; }
.kp-btns { display: flex; gap: 6px; }
.kp-b {
  width: 34px;
  height: 28px;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}
.kp-b.min { background: #f6b93b; }
.kp-b.max { background: #3fbf7f; }
.kp-b.close { background: #ff5f6d; }
.kp-b:hover { filter: brightness(1.08); scale: 1.08; }
.kp-body { padding: 18px 14px; min-height: 110px; }
.kp-note, .kp-canvas { font-size: 22px; text-align: center; }
.kp-canvas { font-size: 40px; }
.kp-win.do-close { scale: 0.6; opacity: 0; }
.kp-win.do-min { scale: 0.1; top: 260px; opacity: 0.2; }
.kp-win.do-max { top: 0; left: 50%; width: 100%; height: 100%; border-radius: 0; }
.kp-win.back { top: 22px; left: 36%; }
.kp-win.front { top: 70px; left: 62%; }
.kp-win.back.raised { z-index: 3; box-shadow: 0 20px 40px rgba(40, 20, 80, 0.35); }
.kp-spot { position: absolute; right: 30px; top: 22px; font-size: 40px; animation: twinkle 1.4s ease-in-out infinite; }
.kp-win.movable { top: 120px; left: 40%; }
.kp-win.opening { animation: kp-open 0.4s var(--bounce); }
@keyframes kp-open { from { scale: 0.2; opacity: 0; } }

/* Right-click menus. */
.kp-thing {
  position: absolute;
  left: 50%;
  top: 46%;
  translate: -50% -50%;
  border: none;
  background: none;
  font-size: 96px;
  line-height: 1;
  cursor: context-menu;
  transition: filter 0.4s, scale 0.4s;
}
.kp-thing.copy { left: 70%; pointer-events: none; animation: pop-in 0.4s var(--bounce); }
.kp-thing.fx-paint { filter: hue-rotate(180deg) saturate(1.6); }
.kp-thing.fx-spin { animation: kp-spin 0.8s linear infinite; }
.kp-thing.fx-big { scale: 1.6; }
.kp-thing.fx-copy { left: 32%; }
.kp-thing.fx-delete { scale: 0; opacity: 0; }
.kp-thing.fx-open { scale: 1.3; }
@keyframes kp-spin { to { rotate: 360deg; } }
.kp-menu {
  position: absolute;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  padding: 6px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 28px rgba(40, 20, 80, 0.3);
  animation: pop-in 0.2s var(--bounce);
}
.kp-menu button { padding: 7px 12px; border: none; border-radius: 8px; background: none; font: inherit; font-size: 15px; text-align: left; color: var(--ink); cursor: pointer; }
.kp-menu button:hover { background: var(--sky); color: #fff; }

/* Browser pages: forms and search. */
.kp-browser, .kp-editor {
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  border-radius: 18px;
  border: 3px solid #e3dbf5;
  background: #fff;
  text-align: left;
  box-shadow: 0 10px 24px rgba(91, 58, 110, 0.12);
}
.kp-url { padding: 6px 12px; background: #f4f0fb; font-size: 13px; color: var(--ink-soft); border-bottom: 2px solid #ece5f8; }
.kp-form { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; font-size: 19px; }
.kp-form label { display: flex; align-items: center; gap: 10px; padding: 4px 8px; cursor: pointer; }
.kp-form input[type='checkbox'], .kp-form input[type='radio'] { width: 26px; height: 26px; accent-color: var(--lilac-deep); cursor: pointer; }
.kp-q { margin: 0; font-weight: 600; }
.kp-select { padding: 8px 12px; border-radius: 10px; border: 2px solid #d9cdee; font: inherit; font-size: 18px; color: var(--ink); background: #fff; }
.kp-field-row { flex-direction: column; align-items: stretch !important; gap: 4px !important; font-size: 15px; color: var(--ink-soft); }
.kp-in {
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid #d9cdee;
  font: inherit;
  font-size: 20px;
  color: var(--ink);
  user-select: text;
}
.kp-in:focus { outline: none; border-color: var(--lilac); box-shadow: 0 0 0 4px var(--lilac-soft); }
.kp-chat { display: flex; flex-direction: column; gap: 6px; min-height: 70px; }
.kp-msg { margin: 0; padding: 6px 12px; border-radius: 14px; max-width: 75%; font-size: 17px; animation: pop-in 0.3s var(--bounce); }
.kp-msg.them { align-self: flex-start; background: #f1ecfb; }
.kp-msg.me { align-self: flex-end; background: var(--sky); color: #fff; }
.kp-search { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px; }
.kp-logo { font-size: 28px; font-weight: 700; color: var(--lilac-deep); }
.kp-logo b { color: var(--pink); }
.kp-sform { display: flex; gap: 6px; width: 100%; max-width: 380px; }
.kp-sbox { flex: 1; border-radius: 999px; padding-left: 18px; }
.kp-go { width: 50px; border: none; border-radius: 999px; background: var(--lilac); font-size: 20px; cursor: pointer; }
.kp-results { display: flex; flex-direction: column; gap: 6px; padding: 0 16px 16px; }
.kp-hit {
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 2px solid #ece5f8;
  border-radius: 14px;
  background: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  animation: pop-in 0.3s var(--bounce);
}
.kp-hit span { grid-row: span 2; font-size: 34px; }
.kp-hit b { font-size: 18px; color: #3b6fd6; text-decoration: underline; text-transform: capitalize; }
.kp-hit small { font-size: 12px; color: var(--mint-deep); }
.kp-hit:hover { background: #f8f5ff; }
.kp-hit.found { border-color: var(--mint); background: #e9fff5; }

/* The shortcut editor. */
.kp-editor { position: relative; }
.kp-doc { padding: 22px 20px; min-height: 120px; }
.kp-text { margin: 0; font-size: 26px; line-height: 1.6; }
.kp-text.selected span, .kp-sel { background: #b8d9ff; border-radius: 4px; }
.kp-sel.bold { font-weight: 800; }
.kp-sel.cut { opacity: 0.2; text-decoration: line-through; }
.kp-gone { opacity: 0.18; text-decoration: line-through; transition: opacity 0.3s; }
.kp-gone.back { opacity: 1; text-decoration: none; background: #fff3b0; border-radius: 4px; }
.kp-clip { position: absolute; top: 34px; right: 10px; padding: 4px 10px; border-radius: 999px; background: var(--gold); font-size: 14px; font-weight: 600; color: #6b4300; }
.kp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.kp-target { cursor: text; }
.kp-target .kp-paste { color: var(--ink-soft); font-size: 18px; }
.kp-target.chosen { border-color: var(--lilac); box-shadow: 0 0 0 4px var(--lilac-soft); }
.kp-target.pasted .kp-paste { color: var(--ink); font-size: 26px; background: #fff3b0; border-radius: 4px; }
.kp-w.caret { border-left: 3px solid var(--ink); animation: kp-caret 0.9s steps(1) infinite; }
.kp-w .sel { background: #b8d9ff; }

/* Files and folders. */
.kp-files { position: absolute; top: 16px; left: 16px; display: flex; flex-wrap: wrap; gap: 6px; max-width: 46%; }
.kp-places { position: absolute; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 6px; }
.kp-trash small { background: rgba(255, 95, 109, 0.7); }
.kp-folder, .kp-trash { cursor: pointer; }
.kp-inside { display: flex; flex-wrap: wrap; gap: 4px; }
.kp-inside .kp-file small { color: var(--ink); background: #f1ecfb; }
.kp-file.found { background: #fff3b0; border-radius: 14px; }
.kp-file.saved { animation: bump 0.4s var(--bounce); }

/* ——— "Plug in a keyboard" ——— */
.kp-gate {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 245, 252, 0.82);
  backdrop-filter: blur(4px);
}
.view-play, .view-keys { position: relative; }
.kp-gate-card {
  max-width: 420px;
  padding: 26px 24px;
  border-radius: 32px;
  border: 5px solid #fff;
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow);
  animation: pop-in 0.4s var(--bounce);
}
.kp-gate-card h2 { margin: 6px 0; }
.kp-gate-card p { color: var(--ink-soft); }
.kp-gate-art { font-size: 56px; }
.kp-gate-wait span { display: inline-block; animation: kp-down 1s ease-in-out infinite; }
.kp-gate-card .link-btn { display: block; margin: 10px auto 0; }

@media (max-width: 560px) {
  .kp-ask { font-size: 18px; }
  .kp-area { min-height: 250px; }
  .kp-sky, .kp-field, .kp-desk { height: 260px; }
  .kk { height: 36px; font-size: 15px; border-radius: 8px; }
  .kk-row { gap: 3px; }
  .kp-two { grid-template-columns: 1fr; }
  .kp-hands svg { width: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  .kp-bubble, .kp-bubble.drift, .kk.next, .kp-ch.now::after, .kp-down, .kp-spot { animation: none; }
}
