/* Arabic Keyboard Tool */
.ak-tool {
  --ak-bg: #ffffff;
  --ak-soft: #f8fafc;
  --ak-border: #e5e7eb;
  --ak-text: #111827;
  --ak-muted: #64748b;
  --ak-accent: var(--color-accent, #111827);
  color: var(--ak-text);
  margin: 0 auto 3rem;
}

.ak-tool * {
  box-sizing: border-box;
}

.ak-ad {
  display: grid;
  gap: .25rem;
  place-items: center;
  min-height: 72px;
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 1px dashed var(--ak-border);
  border-radius: 14px;
  background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 10px, #f1f5f9 10px, #f1f5f9 20px);
  text-align: center;
}

.ak-ad__label {
  font-weight: 800;
  color: var(--ak-text);
}

.ak-ad__note {
  color: var(--ak-muted);
  font-size: .875rem;
}

.ak-hero {
  padding: clamp(1.25rem, 4vw, 3rem);
  border-radius: 24px;
  background: radial-gradient(circle at top right, #eef2ff, transparent 32%), linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid var(--ak-border);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .08);
  margin-bottom: 1.25rem;
}

.ak-eyebrow {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 .75rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
}

.ak-hero h1 {
  margin: 0 0 .75rem;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.ak-hero p,
.ak-panel p,
.ak-seo-content p,
.ak-seo-content li {
  color: var(--ak-muted);
  font-size: clamp(1rem, 2vw, 1.1rem);
  line-height: 1.85;
}

.ak-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.ak-panel,
.ak-keyboard,
.ak-seo-content {
  border: 1px solid var(--ak-border);
  border-radius: 20px;
  background: var(--ak-bg);
  box-shadow: 0 12px 35px rgba(15, 23, 42, .06);
}

.ak-panel {
  padding: 1rem;
}

.ak-panel h2,
.ak-seo-content h2 {
  margin: 0 0 .5rem;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.ak-label {
  display: block;
  margin-bottom: .5rem;
  font-weight: 800;
  color: var(--ak-text);
}

.ak-textarea {
  width: 100%;
  min-height: 260px;
  padding: 1rem;
  resize: vertical;
  border: 1px solid var(--ak-border);
  border-radius: 16px;
  background: var(--ak-soft);
  color: var(--ak-text);
  font-family: Tahoma, Arial, sans-serif;
  font-size: 1.15rem;
  line-height: 1.9;
  direction: rtl;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.ak-textarea--small {
  min-height: 110px;
  direction: ltr;
  text-align: left;
  font-size: 1rem;
}

.ak-textarea:focus {
  outline: none;
  border-color: var(--ak-accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, .09);
}

.ak-toolbar,
.ak-smart-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .8rem;
}

.ak-smart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1rem 0;
}

.ak-btn,
.ak-key {
  appearance: none;
  border: 1px solid var(--ak-border);
  background: #fff;
  color: var(--ak-text);
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}

.ak-btn {
  padding: .72rem 1rem;
  font-size: .92rem;
}

.ak-btn--primary {
  background: var(--ak-accent);
  border-color: var(--ak-accent);
  color: #fff;
}

.ak-btn:hover,
.ak-key:hover,
.ak-btn:focus-visible,
.ak-key:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}

.ak-btn:focus-visible,
.ak-key:focus-visible {
  outline: 3px solid rgba(17, 24, 39, .25);
  outline-offset: 2px;
}

.ak-status {
  min-height: 1.5rem;
  margin: .75rem 0 0;
  color: #047857;
  font-weight: 800;
}

.ak-result {
  min-height: 52px;
  margin-top: .8rem;
  padding: .85rem 1rem;
  border: 1px solid var(--ak-border);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--ak-text);
  line-height: 1.8;
}

.ak-keyboard {
  padding: 1rem;
  margin-bottom: 1rem;
}

.ak-keyboard__row {
  display: grid;
  grid-template-columns: repeat(12, minmax(44px, 1fr));
  gap: .45rem;
  margin-bottom: .45rem;
}

.ak-keyboard__row--1 {
  grid-template-columns: repeat(11, minmax(44px, 1fr));
}

.ak-keyboard__row--2,
.ak-keyboard__row--3 {
  grid-template-columns: repeat(10, minmax(44px, 1fr));
}

.ak-keyboard__row--4 {
  grid-template-columns: repeat(9, minmax(44px, 1fr));
}

.ak-keyboard__row--actions {
  grid-template-columns: 2fr 1fr 1fr;
  margin-bottom: 0;
}

.ak-key {
  min-height: 52px;
  padding: .55rem;
  background: #f8fafc;
  font-size: 1.25rem;
}

.ak-key--wide {
  font-size: 1rem;
}

.ak-seo-content {
  padding: clamp(1rem, 3vw, 2rem);
}

.ak-seo-content ul {
  margin: 1rem 1.25rem 0 0;
}

@media (max-width: 900px) {
  .ak-layout {
    grid-template-columns: 1fr;
  }

  .ak-keyboard__row,
  .ak-keyboard__row--1,
  .ak-keyboard__row--2,
  .ak-keyboard__row--3,
  .ak-keyboard__row--4 {
    grid-template-columns: repeat(6, minmax(42px, 1fr));
  }
}

@media (max-width: 520px) {
  .ak-hero,
  .ak-panel,
  .ak-keyboard,
  .ak-seo-content {
    border-radius: 16px;
  }

  .ak-smart-grid,
  .ak-keyboard__row--actions {
    grid-template-columns: 1fr;
  }

  .ak-keyboard__row,
  .ak-keyboard__row--1,
  .ak-keyboard__row--2,
  .ak-keyboard__row--3,
  .ak-keyboard__row--4 {
    grid-template-columns: repeat(4, minmax(42px, 1fr));
  }

  .ak-key {
    min-height: 48px;
    font-size: 1.1rem;
  }
}
