:root {
  --hebleo-keyboard-blue: #004b8e;
  --hebleo-keyboard-blue-soft: #1a5db2;
  --hebleo-keyboard-ink: #172033;
  --hebleo-keyboard-muted: #697386;
  --hebleo-keyboard-border: #d8e0ea;
  --hebleo-keyboard-surface: #ffffff;
  --hebleo-keyboard-page: #f3f7fb;
}

.hebleo-keyboard,
.hebleo-keyboard * {
  box-sizing: border-box;
}

.hebleo-keyboard {
  color: var(--hebleo-keyboard-ink);
  direction: ltr;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  position: fixed;
  z-index: 2147483000;
}

.hebleo-keyboard__launcher {
  align-items: center;
  background: var(--hebleo-keyboard-blue);
  border: 0;
  border-radius: 999px;
  bottom: 22px;
  box-shadow: 0 12px 30px rgba(0, 75, 142, 0.28);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  height: 58px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: fixed;
  right: 22px;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  width: 58px;
  z-index: 1;
}

.hebleo-keyboard__launcher::before {
  content: none;
}

.hebleo-keyboard__launcher-icon {
  aspect-ratio: 32 / 24 !important;
  display: block !important;
  flex: 0 0 auto !important;
  height: auto !important;
  max-height: none !important;
  max-width: none !important;
  width: 50% !important;
}

.hebleo-keyboard__launcher-icon rect {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2px;
}

.hebleo-keyboard__launcher-icon path {
  fill: #ffffff;
}

.hebleo-keyboard__launcher:hover,
.hebleo-keyboard__launcher:focus-visible {
  background: var(--hebleo-keyboard-blue-soft);
  box-shadow: 0 14px 34px rgba(0, 75, 142, 0.34);
  outline: none;
  transform: translateY(-1px);
}

.hebleo-keyboard__panel {
  background: var(--hebleo-keyboard-surface);
  border: 1px solid var(--hebleo-keyboard-border);
  border-radius: 8px 8px 0 0;
  bottom: 0;
  box-shadow: 0 -18px 45px rgba(23, 32, 51, 0.18);
  display: grid;
  gap: 7px;
  left: 50%;
  max-width: 820px;
  opacity: 0;
  padding: 12px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 105%);
  transition: opacity 180ms ease, transform 180ms ease;
  width: min(96vw, 820px);
  z-index: 2;
}

.hebleo-keyboard--open .hebleo-keyboard__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.hebleo-keyboard--open .hebleo-keyboard__launcher {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  z-index: 1;
}

.hebleo-keyboard__header {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto;
  min-height: 38px;
}

.hebleo-keyboard__brand {
  align-items: center;
  color: var(--hebleo-keyboard-blue);
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.hebleo-keyboard__mark {
  align-items: center;
  background: transparent url("hebleo-lion-mark.svg") center / contain no-repeat;
  display: inline-flex;
  flex: 0 0 30px;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.hebleo-keyboard__status {
  color: var(--hebleo-keyboard-muted);
  font-size: 12px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hebleo-keyboard__row {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.hebleo-keyboard__row--letters {
  grid-template-columns: repeat(10, minmax(0, 1fr));
}

.hebleo-keyboard__row--1 {
  grid-template-columns: repeat(10, minmax(0, 1fr)) minmax(54px, 0.9fr);
}

.hebleo-keyboard__row--2 {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  padding-inline: 18px;
}

.hebleo-keyboard__row--3 {
  grid-template-columns: repeat(11, minmax(0, 1fr));
  padding-inline: 34px;
}

.hebleo-keyboard__row--tools {
  grid-template-columns: minmax(48px, 0.75fr) minmax(58px, 0.9fr) minmax(150px, 2.35fr) minmax(44px, 0.62fr) minmax(44px, 0.62fr) minmax(48px, 0.75fr);
}

.hebleo-keyboard__key {
  align-items: center;
  background: #f8fafc;
  border: 1px solid var(--hebleo-keyboard-border);
  border-radius: 8px;
  color: var(--hebleo-keyboard-ink);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  height: 46px;
  justify-content: center;
  line-height: 1;
  min-width: 0;
  padding: 0 8px;
  position: relative;
  touch-action: manipulation;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 90ms ease;
  user-select: none;
}

.hebleo-keyboard__key:focus-visible {
  background: #eef5fd;
  border-color: rgba(26, 93, 178, 0.42);
  outline: none;
}

@media (hover: hover) and (pointer: fine) {
  .hebleo-keyboard__key:hover {
    background: #eef5fd;
    border-color: rgba(26, 93, 178, 0.42);
    color: var(--hebleo-keyboard-ink);
  }

  .hebleo-keyboard__key--control:hover {
    color: var(--hebleo-keyboard-blue);
  }
}

.hebleo-keyboard__key--pressed {
  background: #d9ebff;
  border-color: var(--hebleo-keyboard-blue);
  color: var(--hebleo-keyboard-blue);
  transform: translateY(1px);
}

.hebleo-keyboard__key--letter {
  align-items: center;
  direction: rtl;
  font-family: "Arial Hebrew", "Noto Sans Hebrew", Arial, sans-serif;
  font-size: 20px;
  justify-content: center;
}

.hebleo-keyboard__key--control {
  background: #eef3f8;
  color: var(--hebleo-keyboard-blue);
  font-size: 15px;
}

.hebleo-keyboard__close {
  height: 36px;
  width: 40px;
}

.hebleo-keyboard__en {
  bottom: 5px;
  color: #8a94a6;
  display: none;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  font-weight: 700;
  left: 7px;
  line-height: 1;
  opacity: 0.78;
  position: absolute;
  text-transform: uppercase;
}

.hebleo-keyboard__he {
  display: block;
  pointer-events: none;
}

.hebleo-keyboard--show-hints .hebleo-keyboard__en {
  display: block;
}

.hebleo-keyboard__key--hint-toggle[aria-pressed="true"],
.hebleo-keyboard__key--convert-toggle[aria-pressed="true"] {
  background: var(--hebleo-keyboard-blue);
  border-color: var(--hebleo-keyboard-blue);
  color: #ffffff;
}

.hebleo-keyboard__key--hint-toggle[aria-pressed="true"]:hover,
.hebleo-keyboard__key--hint-toggle[aria-pressed="true"]:focus,
.hebleo-keyboard__key--hint-toggle[aria-pressed="true"]:focus-visible,
.hebleo-keyboard__key--convert-toggle[aria-pressed="true"]:hover,
.hebleo-keyboard__key--convert-toggle[aria-pressed="true"]:focus,
.hebleo-keyboard__key--convert-toggle[aria-pressed="true"]:focus-visible {
  background: var(--hebleo-keyboard-blue);
  border-color: var(--hebleo-keyboard-blue);
}

@media (hover: none), (pointer: coarse) {
  .hebleo-keyboard__row--tools {
    grid-template-columns: minmax(58px, 1.1fr) minmax(118px, 2.05fr) minmax(32px, 0.48fr) minmax(32px, 0.48fr) minmax(34px, 0.54fr);
  }

  .hebleo-keyboard__key--convert-toggle {
    display: none;
  }

  .hebleo-keyboard__key:hover,
  .hebleo-keyboard__key:focus,
  .hebleo-keyboard__key:focus-visible {
    background: #f8fafc;
    border-color: var(--hebleo-keyboard-border);
    color: var(--hebleo-keyboard-ink);
  }

  .hebleo-keyboard__key--control:hover,
  .hebleo-keyboard__key--control:focus,
  .hebleo-keyboard__key--control:focus-visible {
    background: #eef3f8;
    color: var(--hebleo-keyboard-blue);
  }

  .hebleo-keyboard__key--pressed,
  .hebleo-keyboard__key--pressed:hover,
  .hebleo-keyboard__key--pressed:focus,
  .hebleo-keyboard__key--pressed:focus-visible {
    background: #d9ebff;
    border-color: var(--hebleo-keyboard-blue);
    color: var(--hebleo-keyboard-blue);
  }

  .hebleo-keyboard__key--hint-toggle[aria-pressed="true"],
  .hebleo-keyboard__key--hint-toggle[aria-pressed="true"]:hover,
  .hebleo-keyboard__key--hint-toggle[aria-pressed="true"]:focus,
  .hebleo-keyboard__key--hint-toggle[aria-pressed="true"]:focus-visible,
  .hebleo-keyboard__key--convert-toggle[aria-pressed="true"],
  .hebleo-keyboard__key--convert-toggle[aria-pressed="true"]:hover,
  .hebleo-keyboard__key--convert-toggle[aria-pressed="true"]:focus,
  .hebleo-keyboard__key--convert-toggle[aria-pressed="true"]:focus-visible {
    background: var(--hebleo-keyboard-blue);
    border-color: var(--hebleo-keyboard-blue);
    color: #ffffff;
  }
}

body.hebleo-keyboard-is-open {
  --hebleo-keyboard-open: 1;
}

.hebleo-keyboard-target-active {
  border-color: rgba(26, 93, 178, 0.72) !important;
  box-shadow: 0 0 0 3px rgba(26, 93, 178, 0.18), 0 0 0 1px rgba(0, 75, 142, 0.1) !important;
  outline: 0 !important;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.hebleo-keyboard-target-active[data-hebleo-keyboard-target="true"] {
  animation: hebleo-keyboard-target-pulse 1400ms ease-in-out infinite;
}

.hebleo-keyboard__field-caret {
  background: var(--hebleo-keyboard-blue);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(26, 93, 178, 0.16);
  display: none;
  pointer-events: none;
  position: fixed;
  width: 2px;
  z-index: 2147483001;
}

.hebleo-keyboard__field-caret--visible {
  animation: hebleo-keyboard-caret-blink 950ms steps(2, start) infinite;
  display: block;
}

@keyframes hebleo-keyboard-target-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(26, 93, 178, 0.15), 0 0 0 1px rgba(0, 75, 142, 0.1);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(26, 93, 178, 0.22), 0 0 0 1px rgba(0, 75, 142, 0.16);
  }
}

@keyframes hebleo-keyboard-caret-blink {
  0%,
  45% {
    opacity: 1;
  }

  46%,
  100% {
    opacity: 0;
  }
}

@media (max-width: 680px) {
  .hebleo-keyboard__launcher {
    bottom: 16px;
    height: 54px;
    right: 16px;
    width: 54px;
  }

  .hebleo-keyboard__panel {
    border-left: 0;
    border-right: 0;
    gap: 5px;
    padding: 9px 7px calc(9px + env(safe-area-inset-bottom));
    width: 100vw;
  }

  .hebleo-keyboard__header {
    grid-template-columns: minmax(0, auto) 1fr auto;
  }

  .hebleo-keyboard__brand {
    font-size: 12px;
  }

  .hebleo-keyboard__status {
    font-size: 11px;
  }

  .hebleo-keyboard__row {
    gap: 4px;
  }

  .hebleo-keyboard__row--2 {
    padding-inline: 8px;
  }

  .hebleo-keyboard__row--3 {
    padding-inline: 15px;
  }

  .hebleo-keyboard__row--tools {
    grid-template-columns: minmax(58px, 1.1fr) minmax(92px, 1.85fr) minmax(32px, 0.48fr) minmax(32px, 0.48fr) minmax(34px, 0.54fr);
  }

  .hebleo-keyboard__key--convert-toggle {
    display: none;
  }

  .hebleo-keyboard__key {
    border-radius: 7px;
    font-size: 14px;
    height: 42px;
    padding: 0 5px;
  }

  .hebleo-keyboard__key--letter {
    font-size: 18px;
  }

  .hebleo-keyboard__en {
    bottom: 4px;
    font-size: 9px;
    left: 5px;
  }
}

@media (max-width: 390px) {
  .hebleo-keyboard__brand span:last-child {
    display: none;
  }

  .hebleo-keyboard__row--1 {
    grid-template-columns: repeat(10, minmax(0, 1fr)) minmax(42px, 0.85fr);
  }

  .hebleo-keyboard__key {
    height: 39px;
  }
}
