.dictionary-word-shell {
  max-width: 1020px;
}

.dictionary-word-hero {
  display: flex;
  justify-content: flex-end;
}

.dictionary-headword-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  padding: 1rem 1.2rem;
  border: 1px solid #dbe4f3;
  border-radius: 1rem;
  background: linear-gradient(165deg, #f6f8fc 0%, #eef3fb 100%);
  box-shadow: 0 0.35rem 1rem rgba(23, 43, 77, 0.08);
  text-align: right;
}

.dictionary-headword-card__body {
  position: relative;
  z-index: 2;
}

.dictionary-headword-card.has-headword-background::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(246, 248, 252, 0.14) 0%,
    rgba(246, 248, 252, 0.56) 20%,
    rgba(246, 248, 252, 0.9) 40%,
    rgba(238, 243, 251, 0.98) 62%,
    rgba(238, 243, 251, 1) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.dictionary-headword-card__fade-image {
  position: absolute;
  inset: 0 auto 0 0;
  width: min(42%, 320px);
  background-size: auto 100%;
  background-position: left center;
  background-repeat: no-repeat;
  opacity: 0.94;
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.92) 46%, rgba(0, 0, 0, 0.42) 78%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.92) 46%, rgba(0, 0, 0, 0.42) 78%, rgba(0, 0, 0, 0) 100%);
}

.dictionary-headword-card h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3.2vw, 2.4rem);
  line-height: 1.15;
  direction: rtl;
  unicode-bidi: isolate;
  text-align: right;
}

.dictionary-word-translation {
  font-size: 1.1rem;
  color: #1f2d3d;
  font-weight: 500;
}

.dictionary-word-transliteration {
  margin-top: 0.4rem;
  color: #5b6b7f;
  font-size: 1rem;
  direction: ltr;
}

.dictionary-word-overview {
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  padding: 1rem 1.15rem;
  background: #ffffff;
  box-shadow: 0 0.3rem 0.95rem rgba(15, 23, 42, 0.04);
}

.dictionary-word-explanation {
  font-size: 1.02rem;
  line-height: 1.6;
}

.dictionary-cognates {
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  padding: 1rem;
  background: #ffffff;
  box-shadow: 0 0.3rem 0.95rem rgba(15, 23, 42, 0.04);
}

.dictionary-cognate-map-shell {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.85rem;
  background: #f8f9fb;
  overflow: hidden;
}

.dictionary-cognate-map {
  width: 100%;
  min-height: 320px;
  max-height: 540px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dictionary-cognate-map svg {
  width: 100%;
  height: auto;
  display: block;
}

.dictionary-cognate-map .region-shape {
  transition: fill 0.2s ease, stroke 0.2s ease, opacity 0.2s ease;
  stroke-width: 1.2;
}

.dictionary-cognate-map .map-region.state .region-shape {
  fill: #d8e5fb;
  stroke: #4f6f9f;
}

.dictionary-cognate-map .map-region.russian_subject .region-shape {
  fill: #dfead7;
  stroke: #5f7e4b;
}

.dictionary-cognate-map .map-region.iran_unit .region-shape {
  fill: #e6efdc;
  stroke: #5c7b46;
}

.dictionary-cognate-map .map-region.regional_unit .region-shape {
  fill: #e5e9d7;
  stroke: #5f7241;
}

.dictionary-cognate-map .map-region.has-cognate.state .region-shape {
  fill: #6c95d8;
  stroke: #2f4f7f;
}

.dictionary-cognate-map .map-region.has-cognate.russian_subject .region-shape {
  fill: #7ea85f;
  stroke: #496634;
}

.dictionary-cognate-map .map-region.has-cognate.iran_unit .region-shape {
  fill: #6ea24f;
  stroke: #3e5f2a;
}

.dictionary-cognate-map .map-region.has-cognate.regional_unit .region-shape {
  fill: #7e9f4d;
  stroke: #4d622f;
}

.dictionary-cognate-map .map-region.is-disappeared .region-shape {
  fill: #d6d8dc;
  stroke: #8c949f;
}

.dictionary-cognate-map .map-region.has-cognate.is-disappeared .region-shape {
  fill: #d6d8dc;
  stroke: #8c949f;
}

.dictionary-cognate-map .map-region.is-empty .region-shape {
  opacity: 0.5;
}

.dictionary-cognate-map .map-region.is-active .region-shape,
.dictionary-cognate-map .map-region:hover .region-shape,
.dictionary-cognate-map .map-region:focus-visible .region-shape {
  stroke: #111827;
  stroke-width: 2.2;
  opacity: 1;
}

.dictionary-cognate-map .map-region {
  cursor: pointer;
  outline: none;
}

.dictionary-cognate-map .map-region.is-unavailable,
.dictionary-cognate-map .region-label.is-unavailable {
  display: none;
}

.dictionary-cognate-map .region-label {
  font-size: 14px;
  font-weight: 600;
  fill: #223249;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 3;
  stroke-linejoin: round;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.dictionary-cognate-map .region-label.is-cognate {
  font-size: 13px;
  font-weight: 700;
  fill: #0f172a;
}

.dictionary-cognate-map .region-label.is-cognate.is-disappeared {
  fill: #6b7280;
}

.dictionary-cognate-map .region-label.is-active {
  fill: #0f172a;
}

.dictionary-cognate-details {
  border-top: 1px solid var(--bs-border-color);
  padding: 0.65rem 0.85rem;
  min-height: 2.65rem;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
}

.dictionary-cognate-row {
  cursor: pointer;
}

.dictionary-cognate-row.is-active {
  --bs-table-bg: #ebf3ff;
}

.dictionary-cognate-row.is-disappeared {
  color: #6b7280;
}

@media (max-width: 767.98px) {
  .dictionary-headword-card {
    width: 100%;
  }

  .dictionary-headword-card h1 {
    font-size: 1.65rem;
  }

  .dictionary-cognates {
    padding: 0.75rem;
  }

  .dictionary-cognate-map {
    min-height: 250px;
  }

  .dictionary-cognate-map .region-label {
    font-size: 12px;
  }
}
