.kp-demo {
  --kp-ink: #40574e;
  --kp-panel: #e4efe7;
  --kp-key: #fff;
  --kp-mod: #cfdfd2;
  --kp-accent: #488247;
  --kp-note: #eff9df;
  --kp-note-icon: #d6edbc;
  --kp-note-ink: #325a2f;
  --kp-outline: #bdd4c6;
  font-family: var(--sans, Inter, Arial, sans-serif);
  width: 100%;
  min-width: 0;
  color: var(--kp-ink);
  container-type: inline-size;
  text-align: left;
  line-height: 1.25;
}
.kp-demo *, .kp-demo *::before, .kp-demo *::after { box-sizing: border-box; }
.kp-demo [hidden] { display: none!important; }
.kp-demo .kp-symbols { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.kp-icon { display: block; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.kp-stage {
  position: relative; isolation: isolate; overflow: hidden;
  width: 100%; padding: 3.4cqw 6.5cqw 6cqw;
  background: linear-gradient(126deg, #f0fbef 1%, #dcf6e9 65%, #c9efdc);
  border: 1px solid #cce8d8; border-radius: clamp(18px,4.1cqw,27px);
}
.kp-stage::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background-image: radial-gradient(circle, #54866e72 .7px, transparent .9px);
  background-size: 2.85cqw 2.85cqw; background-position: 1cqw 1cqw;
  mask-image: linear-gradient(145deg, #0009, transparent 39%, transparent 65%, #000a);
}
.kp-stage::after {
  content: ""; position: absolute; z-index: -1; top: 19%; right: -16%; width: 66%; height: 77%;
  border: 1px solid #77c39b32; border-radius: 50%; transform: rotate(32deg);
  box-shadow: 0 0 0 2.3cqw #d7f1e338, 0 0 0 calc(2.3cqw + 1px) #7ac5a125, 0 0 0 5.1cqw #d5f2e138, 0 0 0 calc(5.1cqw + 1px) #7ac5a125;
}
.kp-stage-top { display: flex; justify-content: space-between; align-items: center; margin: 0 -2.5cqw 3.1cqw; }
.kp-stage-label { display: inline-flex; align-items: center; gap: 9px; font: 700 clamp(10px,2.2cqw,13px)/1 var(--sans, Inter, Arial, sans-serif); color: #364e40; }
.kp-stage-label i { width: 7px; height: 7px; border-radius: 50%; background: #5d9e56; box-shadow: 0 0 0 3px #cce9d1; }
.kp-demo button { font-family: inherit; cursor: pointer; appearance: none; }
.kp-play { display: grid; place-items: center; width: clamp(28px,5.8cqw,35px); height: clamp(28px,5.8cqw,35px); border: 1px solid #abcdb7; background: #ffffffbd; color: #3a6e48; border-radius: 50%; padding: 0; }
.kp-play .kp-icon { width: 48%; height: 48%; }
.kp-play:hover { background: white; }
.kp-play:focus-visible,.kp-tab:focus-visible {outline: 3px solid #3268a0; outline-offset: 3px;}
.kp-device { position: relative; width: 100%; border: 1px solid #b6cbbd; border-radius: 3.45cqw; overflow: hidden; background: #fff; box-shadow: 0 .4cqw 0 #99b5a75c, 0 3.3cqw 5.5cqw -2.5cqw #487c5d60; }
.kp-composer { padding: 2.8cqw 3.65cqw 2.55cqw; background: #fff; }
.kp-draft-label { display: flex; gap: 1.05cqw; align-items: center; color: #53665c; font-size: clamp(9px,1.95cqw,12px); font-weight: 650; }
.kp-draft-label .kp-icon { width: 2.7cqw; height: 2.7cqw; color: #658a73; }
.kp-message { margin-top: .95cqw; display: flex; align-items: baseline; gap: .28cqw; font-size: clamp(17px,4.35cqw,27px); font-weight: 625; letter-spacing: -.05em; line-height: 1.26; min-height: 5.6cqw; }
.kp-message[lang=ar] { font-family: "Noto Sans Arabic", Tahoma, Arial, sans-serif; line-height: 1.24; letter-spacing: 0; }
.kp-message i { border-radius: 2px; display: inline-block; width: 2px; height: .87em; align-self: center; background: var(--kp-accent); }
.kp-deck { padding: 1.55cqw 1.6cqw 1.8cqw; border-top: 1px solid #dce8df; background: var(--kp-panel); }
.kp-notice { display: flex; gap: 1.5cqw; align-items: center; min-height: 8.9cqw; border: 1px solid #a2bd8b66; border-radius: 1.7cqw; padding: 1cqw 1.8cqw; background: var(--kp-note); color: var(--kp-note-ink); transition: opacity .18s, transform .18s; }
.kp-notice[data-pending] { opacity: 0; transform: translateY(3px); }
.kp-notice-icon { display: grid; place-items: center; flex: none; width: 5.9cqw; height: 5.9cqw; border-radius: 1.55cqw; background: var(--kp-note-icon); }
.kp-notice-icon .kp-icon { width: 62%; height: 62%; }
.kp-notice-copy { display: grid; gap: .38cqw; min-width: 0; }
.kp-notice-copy strong { font-size: clamp(10px,2.36cqw,14px); font-weight: 750; line-height: 1.14; letter-spacing: -.015em; }
.kp-notice-copy > span { font-size: clamp(9px,2.08cqw,13px); font-weight: 500; line-height: 1.25; }
.kp-notice-copy > span[lang=ar] { font-family: "Noto Sans Arabic", Tahoma, Arial, sans-serif; line-height: 1.35; }
.kp-swatches { margin-left: auto; display: flex; gap: 1cqw; }
.kp-swatches i { width: 2.75cqw; height: 2.75cqw; border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 0 1px #4c355b24; background:#9b7db8; }
.kp-swatches i:nth-child(2) {background:#73944b;} .kp-swatches i:nth-child(3) {background:#78abae;}
.kp-tools { display: flex; align-items: center; justify-content: space-around; height: 5.6cqw; color: #52685a; }
.kp-tools .kp-icon { width: 2.65cqw; height: 2.65cqw; }
.kp-layout { display: grid; grid-template-rows: repeat(4,minmax(0,1fr)); gap: .95cqw; height: 27.5cqw; }
.kp-row { min-height: 0; display: flex; gap: .72cqw; align-items: stretch; }
.kp-home-row { margin-inline: 3.85cqw; }
.kp-key { min-width: 0; flex: 1 1 0; display: grid; place-items: center; border: 1px solid #7b98822c; border-bottom-color: #8ea69785; border-radius: 1.13cqw; background: var(--kp-key); box-shadow: 0 .28cqw 0 #91a3968a; color: var(--kp-ink); font-size: clamp(10px,2.85cqw,18px); font-weight: 580; line-height: 1; }
.kp-key .kp-icon { width: 3.1cqw; height: 3.1cqw; stroke-width: 1.65; }
.kp-key.kp-mod { background: var(--kp-mod); color: #36553d; }
.kp-key.kp-wide {flex: 1.45 1 0;}
.kp-key.kp-space {flex: 6.15 1 0; font-size: clamp(8px,2.12cqw,13px);font-weight: 550; letter-spacing: 0;}
.kp-key.kp-digit {flex: 1.6 1 0;font-size: clamp(8px,2.14cqw,13px);}
.kp-key.kp-enter { background: var(--kp-accent); color: #fff; border-bottom-color: #456d4966; box-shadow: 0 .28cqw 0 #497149; }
.kp-key[data-down] { background: var(--kp-accent); color: white; transform: translateY(.3cqw); box-shadow: 0 0 0 .12cqw var(--kp-accent); }
.kp-arabic {grid-template-rows: 2.65cqw repeat(4,minmax(0,1fr));gap:.7cqw;}
.kp-arabic .kp-key {font-family: "Noto Sans Arabic", Tahoma, Arial, sans-serif; font-size: clamp(11px,2.85cqw,18px); font-weight:550; line-height:1;}
.kp-arabic .kp-key.kp-space,.kp-arabic .kp-key.kp-digit {font-size: clamp(9px,2.2cqw,14px);}
.kp-vowels {display:flex; justify-content:space-around; align-items:center; text-align:center; font-family:"Noto Sans Arabic",Tahoma,Arial,sans-serif; font-size:2.65cqw; line-height:1;}
.kp-demo[data-scene=arabic] {--kp-panel:#e0f0ed;--kp-mod:#c9e1d9;--kp-note:#eefcf6;--kp-note-icon:#d1ecdf;--kp-note-ink:#2c604d;--kp-accent:#397c69;}
.kp-demo[data-scene=themes] {--kp-panel:#e9dff4;--kp-key:#f9f3fe;--kp-mod:#dacee6;--kp-note:#f7f0fd;--kp-note-icon:#e6d7f2;--kp-note-ink:#5e4471;--kp-accent:#83679b;--kp-ink:#483557;}
.kp-demo[data-scene=themes] .kp-tools,.kp-demo[data-scene=themes] .kp-mod {color:#695074;}
.kp-demo[data-scene=themes] .kp-key {border-bottom-color:#ad9ab987;box-shadow:0 .28cqw 0 #a394af70;}
.kp-tabs { display: flex; justify-content: center; gap: 4px; width: fit-content; max-width: 100%; margin: clamp(12px,2.6cqw,18px) auto 0; border-radius: 18px; background: #f4f7f4; padding: 4px; border: 1px solid #e0e8e1; }
.kp-tab { display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: #526259; padding: 9px clamp(8px,2.45cqw,16px); font-size: clamp(10px,2.1cqw,13px); line-height: 1.2; font-weight: 650; white-space: nowrap; }
.kp-tab .kp-icon { width: 1.2em; height: 1.2em; }
.kp-tab:hover { color: #285f39; }
.kp-tab[aria-pressed=true] { background: #fff; color: #356e3a; border-color: #d7e4d7; box-shadow:0 2px 4px #34583d13; }
.kp-demo:not([data-ready]) .kp-play,.kp-demo:not([data-ready]) .kp-tabs { visibility: hidden; }
@container (max-width: 400px) {
  .kp-stage {padding: 3.4cqw 3.7cqw 4.6cqw;}
  .kp-stage-top {margin-inline: 0;}
  .kp-notice {min-height: 10.5cqw;}
  .kp-tab {gap:4px;padding-inline:9px;}
  .kp-layout {height:29.7cqw;}
}
@media (prefers-reduced-motion: reduce) { .kp-demo *, .kp-demo *::before, .kp-demo *::after {transition:none!important;animation:none!important;} }
