/* ===== БАРДЫК АНИМАЦИЯЛАР ЖАКШЫРТЫЛДЫ ===== */
:root {
  --bg: #edf1f6;
  --surface: rgba(255, 255, 255, .72);
  --surface-strong: rgba(255, 255, 255, .9);
  --border: rgba(255, 255, 255, .86);
  --text: #171923;
  --muted: #647084;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --accent-light: #14b8a6;
  --amber: #b7791f;
  --amber-light: #f59e0b;
  --danger: #dc2626;
  --purple: #7c3aed;
  --purple-light: #a78bfa;
  --pink: #db2777;
  --pink-light: #f472b6;
  --shadow: 0 24px 70px rgba(35, 48, 78, .14), inset 0 1px 0 rgba(255, 255, 255, .72);
  --shadow-hover: 0 32px 90px rgba(35, 48, 78, .2), inset 0 1px 0 rgba(255, 255, 255, .72);
  --arabic: "Noto Naskh Arabic", "Amiri", "Scheherazade New", serif;
  --latin: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { min-height: 100%; scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  padding: 22px 14px 160px;
  color: var(--text);
  font-family: var(--latin);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .12), transparent 36%),
    linear-gradient(225deg, rgba(183, 121, 31, .12), transparent 38%),
    var(--bg);
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(15, 118, 110, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(183, 121, 31, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 20%, rgba(15, 118, 110, 0.04) 0%, transparent 50%);
  animation: floatBackground 25s ease-in-out infinite alternate;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}

@keyframes floatBackground {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); }
  33% { transform: translate(1.5%, -1%) rotate(1deg) scale(1.01); }
  66% { transform: translate(-1%, 1.5%) rotate(-1deg) scale(0.99); }
  100% { transform: translate(0.5%, -0.5%) rotate(0.5deg) scale(1); }
}

button, input { font: inherit; }

.app-shell {
  width: min(960px, 100%);
  margin: 0 auto;
  animation: fadeInUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(60px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== HERO - ЖАКШЫРТЫЛДЫ ===== */
.hero {
  position: relative;
  overflow: hidden;
  margin: 8px 0 18px;
  padding: 40px 30px;
  min-height: 200px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  isolation: isolate;
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, box-shadow;
}

.hero:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: var(--shadow-hover);
}

.hero-background {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.15;
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
}

.hero:hover .hero-image {
  opacity: 0.28;
  transform: scale(1.06);
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(237, 241, 246, 0.4) 0%,
    rgba(237, 241, 246, 0.1) 50%,
    rgba(237, 241, 246, 0.4) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.back-link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, background, box-shadow;
}

.back-link:hover {
  background: rgba(255, 255, 255, .85);
  transform: translateX(-6px) scale(1.05);
  box-shadow: 0 4px 20px rgba(15, 118, 110, .2);
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.02;
  letter-spacing: 0;
  text-shadow: 0 2px 20px rgba(255, 255, 255, .3);
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== SEARCH PANEL - ЖАКШЫРТЫЛДЫ ===== */
.search-panel {
  position: sticky;
  top: 12px;
  z-index: 20;
  padding: 14px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, box-shadow, padding, border-radius;
}

.search-panel:focus-within {
  box-shadow: 0 24px 80px rgba(15, 118, 110, .15), inset 0 1px 0 rgba(255, 255, 255, .72);
  transform: translateY(-2px);
}

.search-panel.shrink {
  padding: 8px 14px;
  border-radius: 20px;
  top: 6px;
}

.search-panel.shrink .search-input {
  height: 44px;
  font-size: 22px;
  padding: 0 14px;
}

.search-panel.shrink .icon-button {
  width: 40px;
  height: 40px;
}

.search-panel.shrink .icon-button svg {
  width: 20px;
  height: 20px;
}

.search-panel.shrink .search-line {
  grid-template-columns: 40px minmax(0, 1fr) 40px;
  gap: 6px;
}

.search-panel.shrink .status-row {
  font-size: 12px;
  min-height: 18px;
  margin-top: 4px;
}

.search-panel.shrink .search-mode {
  margin-top: 6px;
  padding: 3px;
  gap: 4px;
}

.search-panel.shrink .mode-option {
  min-height: 30px;
  font-size: 12px;
}

.search-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  gap: 10px;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.search-input {
  width: 100%;
  height: 62px;
  padding: 0 18px;
  border: 2px solid rgba(15, 118, 110, .15);
  border-radius: 18px;
  outline: none;
  color: var(--text);
  background: var(--surface-strong);
  font-family: var(--arabic);
  font-size: 30px;
  line-height: 1;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, border-color, box-shadow;
}

.search-input.is-kyrgyz {
  font-family: var(--latin);
  font-size: 22px;
}

.search-input::placeholder {
  color: #8d98a8;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px rgba(15, 118, 110, .12), 0 8px 30px rgba(15, 118, 110, .1);
  transform: scale(1.01);
}

/* ===== ICON BUTTON - ЖАКШЫРТЫЛДЫ ===== */
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 16px;
  color: var(--accent-dark);
  background: var(--surface-strong);
  box-shadow: 0 8px 24px rgba(31, 42, 68, .08);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow, color;
}

.icon-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(15, 118, 110, .1);
  transform: translate(-50%, -50%);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.icon-button:hover::before {
  width: 200%;
  height: 200%;
}

.icon-button:active {
  transform: scale(.92);
  transition-duration: 0.08s;
}

.icon-button svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  position: relative;
  z-index: 1;
  transition: all 0.35s ease;
}

.icon-button:hover {
  color: var(--accent);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 30px rgba(15, 118, 110, .2);
}

/* ===== STATUS ROW ===== */
.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-height: 22px;
  margin-top: 10px;
  padding: 0 6px;
  color: var(--muted);
  font-size: 14px;
  transition: all 0.3s ease;
}

#searchStatus {
  transition: all 0.3s ease;
}

#resultCount {
  font-weight: 600;
  color: var(--accent-dark);
  transition: all 0.3s ease;
}

/* ===== SEARCH MODE - ЖАКШЫРТЫЛДЫ ===== */
.search-mode {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(15, 118, 110, .08);
  transition: all 0.3s ease;
}

.mode-option {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.mode-option::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(15, 118, 110, .1);
  transform: translate(-50%, -50%);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.mode-option:hover::before {
  width: 300%;
  height: 300%;
}

.mode-option.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 25px rgba(15, 118, 110, .3);
  transform: scale(1.02);
}

.mode-option:active {
  transform: scale(.96);
  transition-duration: 0.08s;
}

/* ===== RESULTS - ЖАКШЫРТЫЛДЫ ===== */
.results {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.result-card {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, box-shadow;
}

.result-card:hover {
  transform: translateY(-4px) scale(1.005);
  box-shadow: var(--shadow-hover);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== RESULT TOP ===== */
.result-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: linear-gradient(135deg, rgba(15, 118, 110, .03), transparent);
}

.entry-id {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  font-weight: 700;
  font-size: 14px;
  animation: pulseId 3s ease-in-out infinite;
  will-change: transform;
}

@keyframes pulseId {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.arabic-word {
  font-family: var(--arabic);
  direction: rtl;
  text-align: right;
  display: block;
  color: var(--accent-dark);
  font-size: clamp(30px, 7vw, 42px);
  font-weight: 700;
  line-height: 1.7;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, color;
}

.result-card:hover .arabic-word {
  transform: scale(1.02);
  color: var(--accent);
}

/* ===== ACTION BUTTONS - ЖАКШЫРТЫЛДЫ ===== */
.result-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.action-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(15, 118, 110, .1);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .6);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  will-change: transform, color, border-color, box-shadow;
}

.action-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(15, 118, 110, .1);
  transform: translate(-50%, -50%);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.action-btn:hover::before {
  width: 300%;
  height: 300%;
}

.action-btn:hover {
  color: var(--accent-dark);
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 8px 25px rgba(15, 118, 110, .2);
}

.action-btn:active {
  transform: scale(.88);
  transition-duration: 0.08s;
}

.action-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.action-btn.copy-success {
  border-color: var(--accent);
  background: rgba(15, 118, 110, .15);
  animation: copySuccess 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes copySuccess {
  0% { transform: scale(1); }
  30% { transform: scale(1.25) rotate(-8deg); }
  60% { transform: scale(0.92) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

.action-btn.copy-success svg {
  stroke: var(--accent);
}

/* ===== TOAST - ЖАКШЫРТЫЛДЫ ===== */
.toast {
  position: fixed;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%) translateY(30px);
  z-index: 100;
  padding: 14px 28px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-dark), var(--accent-light));
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 12px 50px rgba(15, 118, 110, .4);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  backdrop-filter: blur(10px);
  will-change: transform, opacity;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== TRANSLATION ITEMS - ЖАКШЫРТЫЛДЫ ===== */
.translation-list {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.translation-item {
  overflow: hidden;
  border: 2px solid rgba(15, 118, 110, .08);
  border-radius: 16px;
  background: rgba(255, 255, 255, .5);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, border-color, box-shadow;
}

.translation-item:hover {
  border-color: rgba(15, 118, 110, .25);
  transform: translateX(6px);
  box-shadow: 0 4px 25px rgba(15, 118, 110, .1);
}

.translation-toggle {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  color: var(--text);
  list-style: none;
  text-align: left;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.3s ease;
  position: relative;
}

.translation-toggle::-webkit-details-marker {
  display: none;
}

.translation-toggle:hover {
  background: rgba(15, 118, 110, .04);
}

.translation-number {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  border-radius: 12px;
  color: var(--accent-dark);
  background: rgba(15, 118, 110, .1);
  font-weight: 700;
  font-size: 14px;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  flex-shrink: 0;
  will-change: transform, background;
}

.translation-item:hover .translation-number {
  background: rgba(15, 118, 110, .2);
  transform: scale(1.1) rotate(-3deg);
}

.translation-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, color;
}

.translation-item:hover .translation-text {
  color: var(--accent-dark);
  transform: translateX(4px);
}

.chevron {
  color: var(--muted);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  font-size: 22px;
  font-weight: 300;
  flex-shrink: 0;
}

.translation-item[open] .chevron {
  transform: rotate(180deg) scale(1.2);
  color: var(--accent);
}

/* ===== EXAMPLE PANEL ===== */
.example-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.translation-item[open] .example-panel {
  grid-template-rows: 1fr;
}

.example-inner {
  overflow: hidden;
  padding: 0 16px 18px;
  color: var(--muted);
  animation: expandExamples 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes expandExamples {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.examples-list {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

/* ===== EXAMPLE CARD - ЖАКШЫРТЫЛДЫ ===== */
.example-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(15, 118, 110, 0.05));
  border-left: 4px solid var(--accent);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  animation: exampleFade 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  position: relative;
  overflow: hidden;
  will-change: transform, box-shadow, background;
}

.example-card:nth-child(4n+1) {
  border-left-color: var(--accent);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(15, 118, 110, 0.06));
}

.example-card:nth-child(4n+2) {
  border-left-color: var(--amber);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(183, 121, 31, 0.06));
}

.example-card:nth-child(4n+3) {
  border-left-color: var(--purple);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(124, 58, 237, 0.06));
}

.example-card:nth-child(4n+4) {
  border-left-color: var(--pink);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(219, 39, 119, 0.06));
}

.example-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.example-card:hover::before {
  transform: scale(1.5);
  opacity: 0.5;
}

.example-card:hover {
  transform: translateX(8px) scale(1.02);
  box-shadow: 0 8px 35px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.95);
}

@keyframes exampleFade {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.example-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, background;
}

.example-card:nth-child(4n+1) .example-number {
  color: var(--accent-dark);
  background: rgba(15, 118, 110, 0.12);
}

.example-card:nth-child(4n+2) .example-number {
  color: var(--amber);
  background: rgba(183, 121, 31, 0.12);
}

.example-card:nth-child(4n+3) .example-number {
  color: var(--purple);
  background: rgba(124, 58, 237, 0.12);
}

.example-card:nth-child(4n+4) .example-number {
  color: var(--pink);
  background: rgba(219, 39, 119, 0.12);
}

.example-card:hover .example-number {
  transform: scale(1.15) rotate(-5deg);
}

.example-card:nth-child(4n+1):hover .example-number {
  background: rgba(15, 118, 110, 0.2);
}

.example-card:nth-child(4n+2):hover .example-number {
  background: rgba(183, 121, 31, 0.2);
}

.example-card:nth-child(4n+3):hover .example-number {
  background: rgba(124, 58, 237, 0.2);
}

.example-card:nth-child(4n+4):hover .example-number {
  background: rgba(219, 39, 119, 0.2);
}

.arabic-example {
  margin: 0 0 6px;
  color: #1f2937;
  font-size: clamp(26px, 6vw, 36px);
  line-height: 2.2;
  font-family: var(--arabic);
  direction: rtl;
  text-align: right;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, color;
}

.example-card:hover .arabic-example {
  color: var(--accent-dark);
  transform: scale(1.02);
}

.example-translation {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  padding-left: 12px;
  border-left: 2px solid rgba(15, 118, 110, 0.1);
}

.example-card:hover .example-translation {
  color: var(--text);
  border-left-color: var(--accent);
}

.empty-state,
.error-state {
  padding: 48px 20px;
  border-radius: 22px;
  text-align: center;
  border: 2px dashed var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  animation: fadeInUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.empty-state strong,
.error-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
  color: var(--accent-dark);
}

.empty-state span,
.error-state span {
  color: var(--muted);
  line-height: 1.6;
}

/* ===== KEYBOARD - ЖАКШЫРТЫЛДЫ ===== */
.keyboard-overlay {
  display: none;
  pointer-events: none;
}

.dictionary-keyboard {
  position: fixed;
  left: 50%;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 50;
  width: min(920px, calc(100% - 20px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(245, 248, 250, .98);
  box-shadow: 0 20px 60px rgba(25, 38, 62, .2), inset 0 1px 0 rgba(255, 255, 255, .8);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(-50%, 130%, 0) scale(0.92);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, opacity;
  backdrop-filter: blur(20px);
}

.dictionary-keyboard.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(-50%, 0, 0) scale(1);
}

.keyboard-handle {
  width: 50px;
  height: 5px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(100, 112, 132, .2), rgba(100, 112, 132, .4), rgba(100, 112, 132, .2));
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.keyboard-handle:hover {
  transform: scaleX(1.2);
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.keyboard-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(15, 118, 110, .06);
}

.keyboard-tab {
  height: 40px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.keyboard-tab::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(15, 118, 110, .1);
  transform: translate(-50%, -50%);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.keyboard-tab:hover::before {
  width: 300%;
  height: 300%;
}

.keyboard-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  box-shadow: 0 8px 25px rgba(15, 118, 110, .3);
  transform: scale(1.03);
}

.keyboard-tab:active {
  transform: scale(.95);
  transition-duration: 0.08s;
}

.keyboard-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.keyboard-actions {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr 1.2fr;
  gap: 6px;
  margin-top: 8px;
}

.key {
  min-width: 0;
  height: 48px;
  border: 2px solid rgba(15, 118, 110, .06);
  border-radius: 14px;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, .9);
  box-shadow: inset 0 1px 0 #fff, 0 4px 16px rgba(31, 42, 68, .06);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  font-weight: 600;
  will-change: transform, border-color, box-shadow;
}

.key::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(15, 118, 110, .08);
  transform: translate(-50%, -50%);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.key:hover::before {
  width: 300%;
  height: 300%;
}

.key:not(.action-key) {
  font-family: var(--arabic);
  font-size: 26px;
  line-height: 1;
}

.dictionary-keyboard[data-layout="kyrgyz"] .key:not(.action-key) {
  font-family: var(--latin);
  font-size: 20px;
  font-weight: 700;
}

.key:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 8px 25px rgba(15, 118, 110, .15);
  z-index: 1;
}

.key:active {
  transform: scale(.92) translateY(2px);
  background: rgba(229, 245, 242, .9);
  transition-duration: 0.05s;
}

.action-key {
  font-size: 14px;
  font-weight: 700;
  background: rgba(15, 118, 110, .04);
}

.action-key:hover {
  background: rgba(15, 118, 110, .1);
  border-color: var(--accent);
}

.key[data-action="close"] {
  background: linear-gradient(135deg, rgba(220, 38, 38, .05), rgba(220, 38, 38, .1));
  color: var(--danger);
}

.key[data-action="close"]:hover {
  background: linear-gradient(135deg, rgba(220, 38, 38, .1), rgba(220, 38, 38, .2));
  border-color: var(--danger);
}

.key[data-action="clear"] {
  background: linear-gradient(135deg, rgba(183, 121, 31, .05), rgba(183, 121, 31, .1));
  color: var(--amber);
}

.key[data-action="clear"]:hover {
  background: linear-gradient(135deg, rgba(183, 121, 31, .1), rgba(183, 121, 31, .2));
  border-color: var(--amber);
}

/* ===== Responsive - БАРДЫК ТҮЗМӨКТӨРГӨ ТУУРАЛАНГАН ===== */

/* --- СМАРТФОН (480px жана кичине) --- */
@media (max-width: 480px) {
  body {
    padding: 10px 6px 160px;
  }

  .hero {
    padding: 20px 16px;
    min-height: 150px;
    border-radius: 18px;
  }

  .hero-image {
    opacity: 0.12;
  }
  
  .hero:hover .hero-image {
    opacity: 0.2;
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .back-link {
    font-size: 12px;
    padding: 6px 12px;
  }

  h1 {
    font-size: clamp(24px, 6vw, 32px);
  }

  .search-panel {
    padding: 8px;
    border-radius: 18px;
    top: 6px;
  }

  .search-panel.shrink {
    padding: 6px 8px;
    border-radius: 14px;
    top: 4px;
  }

  .search-panel.shrink .search-input {
    height: 36px;
    font-size: 18px;
    padding: 0 10px;
  }

  .search-panel.shrink .icon-button {
    width: 32px;
    height: 32px;
  }

  .search-panel.shrink .icon-button svg {
    width: 16px;
    height: 16px;
  }

  .search-panel.shrink .search-line {
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    gap: 4px;
  }

  .search-panel.shrink .status-row {
    font-size: 10px;
    min-height: 14px;
    margin-top: 2px;
  }

  .search-panel.shrink .search-mode {
    margin-top: 4px;
    padding: 2px;
    gap: 3px;
  }

  .search-panel.shrink .mode-option {
    min-height: 24px;
    font-size: 10px;
  }

  .search-line {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 5px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .icon-button svg {
    width: 20px;
    height: 20px;
  }

  .search-input {
    height: 48px;
    font-size: 22px;
    padding: 0 12px;
    border-radius: 14px;
  }

  .status-row {
    font-size: 12px;
    flex-wrap: wrap;
  }

  .mode-option {
    min-height: 34px;
    font-size: 12px;
  }

  .result-top {
    padding: 14px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .entry-id {
    min-width: 30px;
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .arabic-word {
    font-size: clamp(24px, 8vw, 32px);
  }

  .action-btn {
    width: 32px;
    height: 32px;
  }

  .action-btn svg {
    width: 16px;
    height: 16px;
  }

  .translation-list {
    padding: 0 12px 12px;
    gap: 8px;
  }

  .translation-text {
    font-size: 15px;
  }

  .example-card {
    padding: 12px 14px;
    gap: 10px;
  }

  .arabic-example {
    font-size: clamp(22px, 7vw, 28px);
    line-height: 1.8;
  }

  .example-translation {
    font-size: 14px;
  }

  .keyboard-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
  }

  .keyboard-actions {
    grid-template-columns: .8fr 1.2fr .8fr .7fr 1fr;
    gap: 4px;
  }

  .key {
    height: 38px;
    border-radius: 10px;
    font-size: 12px;
  }

  .key:not(.action-key) {
    font-size: 20px;
  }

  .dictionary-keyboard {
    width: calc(100% - 10px);
    padding: 8px;
    border-radius: 18px;
  }
}

/* --- ПЛАНШЕТ (481px - 1024px) --- */
@media (min-width: 481px) and (max-width: 1024px) {
  body {
    padding: 18px 12px 160px;
  }

  .hero {
    padding: 32px 24px;
    min-height: 180px;
    border-radius: 24px;
  }

  .hero-image {
    opacity: 0.14;
  }
  
  .hero:hover .hero-image {
    opacity: 0.22;
  }

  h1 {
    font-size: clamp(30px, 5vw, 44px);
  }

  .search-panel {
    padding: 12px;
    border-radius: 24px;
  }

  .search-panel.shrink {
    padding: 8px 12px;
    border-radius: 18px;
  }

  .search-panel.shrink .search-input {
    height: 40px;
    font-size: 20px;
  }

  .search-panel.shrink .icon-button {
    width: 36px;
    height: 36px;
  }

  .search-panel.shrink .search-line {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 5px;
  }

  .search-input {
    font-size: 28px;
    height: 56px;
  }

  .keyboard-grid {
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 5px;
  }

  .key:not(.action-key) {
    font-size: 23px;
  }
}

/* --- НОУТБУК ЖАНА ЧОҢ ЭКРАНДАР (1025px жана чоң) --- */
@media (min-width: 1025px) {
  .hero {
    padding: 50px 40px;
    min-height: 220px;
    border-radius: 32px;
  }

  .hero-image {
    opacity: 0.18;
  }
  
  .hero:hover .hero-image {
    opacity: 0.28;
  }

  h1 {
    font-size: clamp(40px, 5vw, 56px);
  }

  .back-link {
    font-size: 15px;
    padding: 10px 20px;
    border-radius: 14px;
  }

  .search-panel {
    padding: 18px;
    border-radius: 32px;
  }

  .search-panel.shrink {
    padding: 10px 18px;
    border-radius: 24px;
  }

  .search-panel.shrink .search-input {
    height: 48px;
    font-size: 24px;
  }

  .search-panel.shrink .icon-button {
    width: 44px;
    height: 44px;
  }

  .search-panel.shrink .search-line {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .search-input {
    height: 68px;
    font-size: 34px;
    border-radius: 20px;
  }

  .icon-button {
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }

  .key {
    height: 50px;
    border-radius: 14px;
  }

  .key:not(.action-key) {
    font-size: 27px;
  }
}

/* --- ЛАНДШАФТ РЕЖИМИ (бийиктиги 500px жана кичине) --- */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding-bottom: 130px;
  }

  .hero {
    padding: 12px 16px;
    min-height: 80px;
    margin: 4px 0 12px;
    border-radius: 18px;
  }

  .hero-image {
    opacity: 0.1;
  }

  h1 {
    font-size: clamp(20px, 4vw, 28px);
  }

  .hero-content {
    flex-direction: row;
    align-items: center;
  }

  .back-link {
    font-size: 11px;
    padding: 4px 10px;
  }

  .search-panel {
    padding: 6px 10px;
    border-radius: 16px;
    top: 4px;
  }

  .search-panel.shrink {
    padding: 4px 8px;
    border-radius: 12px;
    top: 2px;
  }

  .search-panel.shrink .search-input {
    height: 28px;
    font-size: 14px;
    padding: 0 8px;
  }

  .search-panel.shrink .icon-button {
    width: 26px;
    height: 26px;
  }

  .search-panel.shrink .icon-button svg {
    width: 14px;
    height: 14px;
  }

  .search-panel.shrink .search-line {
    grid-template-columns: 26px minmax(0, 1fr) 26px;
    gap: 3px;
  }

  .search-panel.shrink .status-row {
    font-size: 9px;
    min-height: 12px;
    margin-top: 2px;
  }

  .search-panel.shrink .search-mode {
    margin-top: 3px;
    padding: 2px;
    gap: 2px;
  }

  .search-panel.shrink .mode-option {
    min-height: 20px;
    font-size: 9px;
  }

  .search-line {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 4px;
  }

  .search-input {
    height: 36px;
    font-size: 18px;
    padding: 0 10px;
    border-radius: 10px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .icon-button svg {
    width: 16px;
    height: 16px;
  }

  .status-row {
    font-size: 10px;
    min-height: 16px;
    margin-top: 4px;
  }

  .search-mode {
    margin-top: 6px;
    gap: 4px;
    padding: 3px;
  }

  .mode-option {
    min-height: 28px;
    font-size: 10px;
  }

  .dictionary-keyboard {
    padding: 6px;
    border-radius: 16px;
  }

  .keyboard-grid {
    gap: 4px;
  }

  .key {
    height: 30px;
    border-radius: 8px;
    font-size: 10px;
  }

  .key:not(.action-key) {
    font-size: 16px;
  }

  .keyboard-actions {
    margin-top: 4px;
    gap: 4px;
  }

  .keyboard-handle {
    display: none;
  }

  .result-top {
    padding: 10px 14px;
    grid-template-columns: auto 1fr auto;
  }

  .arabic-word {
    font-size: clamp(20px, 5vw, 28px);
  }

  .action-btn {
    width: 28px;
    height: 28px;
  }

  .action-btn svg {
    width: 14px;
    height: 14px;
  }

  .translation-list {
    padding: 0 12px 10px;
    gap: 6px;
  }

  .translation-toggle {
    min-height: 38px;
    padding: 6px 10px;
  }

  .translation-text {
    font-size: 13px;
  }

  .entry-id {
    min-width: 26px;
    height: 26px;
    font-size: 10px;
  }

  .example-card {
    padding: 8px 12px;
    gap: 8px;
  }

  .arabic-example {
    font-size: clamp(18px, 4vw, 24px);
    line-height: 1.6;
  }

  .example-translation {
    font-size: 12px;
  }
}