
:root {
  --an-green-950: #103b2d;
  --an-green-900: #15513d;
  --an-green-800: #1a654b;
  --an-green-100: #e8f3ed;
  --an-green-50: #f5faf7;
  --an-gold: #d9a936;
  --an-cream: #fffaf0;
  --an-ink: #17352c;
  --an-muted: #62766f;
  --an-line: #d5e4dc;
  --an-white: #ffffff;
  --an-shadow: 0 18px 48px rgba(16, 65, 47, .11);
}

* {
  box-sizing: border-box;
}

body.arabic-number-page {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(217, 169, 54, .12), transparent 30rem),
    linear-gradient(180deg, #f8fbf9 0%, #eef6f2 100%);
  color: var(--an-ink);
}

.an-main {
  width: min(1120px, calc(100% - 28px));
  margin: 22px auto 60px;
}

.an-hero,
.an-tool,
.an-suggestion,
.an-case,
.an-guide {
  border: 1px solid var(--an-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--an-shadow);
}

.an-hero {
  padding: clamp(25px, 5vw, 48px);
  background:
    linear-gradient(135deg, rgba(255,255,255,.99), rgba(241,249,245,.98));
}

.an-eyebrow {
  color: var(--an-green-800);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.an-hero h1 {
  margin: 9px 0 12px;
  color: var(--an-green-950);
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.03;
  letter-spacing: -.035em;
}

.an-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--an-muted);
  font-size: clamp(1rem, 2vw, 1.17rem);
  line-height: 1.75;
}

.an-limit {
  width: max-content;
  max-width: 100%;
  margin-top: 18px;
  padding: 10px 14px;
  border: 1px solid #e8d39a;
  border-radius: 999px;
  background: var(--an-cream);
  color: #6c5417;
  font-size: 14px;
}

.an-tool {
  margin-top: 22px;
  padding: clamp(20px, 4vw, 34px);
}

.an-tool__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 23px;
}

.an-tool__heading h2,
.an-results-heading h2,
.an-guide h2 {
  margin: 5px 0 0;
  color: var(--an-green-950);
}

.an-tool__heading h2 {
  font-size: clamp(1.65rem, 4vw, 2.35rem);
}

.an-tool__arabic {
  color: var(--an-gold);
  font-family: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 700;
}

.an-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.an-field {
  display: grid;
  gap: 8px;
}

.an-field > span {
  color: var(--an-green-950);
  font-weight: 850;
}

.an-field em {
  color: var(--an-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.an-field input {
  width: 100%;
  min-height: 58px;
  padding: 13px 15px;
  border: 2px solid var(--an-line);
  border-radius: 13px;
  outline: none;
  background: #fff;
  color: var(--an-ink);
  font: inherit;
  font-size: 17px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.an-field input:focus {
  border-color: var(--an-green-800);
  box-shadow: 0 0 0 4px rgba(26,101,75,.12);
}

.an-field small {
  color: var(--an-muted);
  line-height: 1.45;
}

.an-examples {
  margin-top: 17px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--an-muted);
  font-size: 13px;
}

.an-examples button {
  min-height: 34px;
  padding: 6px 11px;
  border: 1px solid var(--an-line);
  border-radius: 999px;
  background: var(--an-green-50);
  color: var(--an-green-900);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.an-message,
.an-suggestion {
  margin-top: 18px;
  padding: 15px 17px;
  line-height: 1.55;
}

.an-message {
  border: 1px solid #e0b860;
  border-radius: 12px;
  background: #fff7df;
  color: #6d5114;
}

.an-suggestion {
  border-color: #e6c35b;
  background: #fff8df;
}

.an-suggestion p {
  margin: 8px 0;
}

.an-suggestion button {
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid #cda83d;
  border-radius: 999px;
  background: #fff;
  color: #644d0e;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.an-generate {
  width: 100%;
  min-height: 56px;
  margin-top: 20px;
  padding: 13px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--an-green-800);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(26,101,75,.22);
}

.an-generate:hover,
.an-generate:focus-visible {
  background: var(--an-green-950);
  transform: translateY(-1px);
}

.an-results {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.an-results-heading {
  padding: 5px 3px 2px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.an-results-heading p {
  max-width: 430px;
  margin: 0;
  color: var(--an-muted);
  line-height: 1.55;
}

.an-case {
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 4vw, 30px);
}

.an-case::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
}

.an-case--nom {
  background: linear-gradient(135deg, #effaf2 0%, #fbfffc 100%);
  border-color: #bfe0c8;
}

.an-case--nom::before {
  background: #3b9660;
}

.an-case--acc {
  background: linear-gradient(135deg, #fff3ec 0%, #fffdfb 100%);
  border-color: #eccdbb;
}

.an-case--acc::before {
  background: #d77c4a;
}

.an-case--gen {
  background: linear-gradient(135deg, #eef6ff 0%, #fcfeff 100%);
  border-color: #bfd6eb;
}

.an-case--gen::before {
  background: #4a82b6;
}

.an-case__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.an-case__header h3 {
  margin: 3px 0 0;
  color: var(--an-green-950);
  font-size: clamp(1.2rem, 3vw, 1.55rem);
}

.an-case__arabic {
  display: block;
  font-family: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 700;
}

.an-case--nom .an-case__arabic {
  color: #277a49;
}

.an-case--acc .an-case__arabic {
  color: #b65c2c;
}

.an-case--gen .an-case__arabic {
  color: #306d9f;
}

.an-case__number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  font-weight: 900;
}

.an-digits {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.an-digits > div {
  padding: 12px 14px;
  border: 1px solid rgba(21,81,61,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
}

.an-digits span {
  display: block;
  color: var(--an-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.an-digits strong {
  display: block;
  margin-top: 4px;
  color: var(--an-green-950);
  font-size: clamp(1.15rem, 3vw, 1.45rem);
}

.an-phrase {
  margin-top: 18px;
  color: #102f25;
  font-family: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  font-size: clamp(2rem, 6vw, 3.6rem);
  font-weight: 700;
  line-height: 1.65;
  text-align: right;
}

.an-transliteration {
  margin-top: 7px;
  color: var(--an-ink);
  font-size: clamp(1.06rem, 2.4vw, 1.35rem);
  font-weight: 650;
  line-height: 1.7;
}

.an-rule,
.an-audio-status,
.an-note {
  color: var(--an-muted);
  font-size: 13px;
  line-height: 1.6;
}

.an-rule {
  margin: 12px 0 0;
}

.an-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.an-actions button {
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid var(--an-line);
  border-radius: 999px;
  background: #fff;
  color: var(--an-green-900);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.an-actions button[data-play-case] {
  border-color: var(--an-green-800);
  background: var(--an-green-800);
  color: #fff;
}

.an-audio-status {
  margin: 10px 0 0;
}

.an-guide {
  margin-top: 24px;
  padding: clamp(22px, 4vw, 34px);
}

.an-guide-grid {
  margin-top: 17px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.an-guide-grid article {
  padding: 17px;
  border: 1px solid var(--an-line);
  border-radius: 14px;
  background: var(--an-green-50);
}

.an-guide-grid strong {
  color: var(--an-green-900);
}

.an-guide-grid p {
  margin-bottom: 0;
  color: var(--an-muted);
  line-height: 1.55;
}

.an-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  padding: 22px 14px 35px;
}

.an-footer p {
  margin: 0;
}

@media (max-width: 780px) {
  .an-main {
    width: calc(100% - 16px);
    margin-top: 10px;
  }

  .an-form-grid,
  .an-guide-grid {
    grid-template-columns: 1fr;
  }

  .an-tool__heading,
  .an-results-heading {
    align-items: start;
    flex-direction: column;
  }

  .an-digits {
    grid-template-columns: 1fr;
  }

  .an-phrase {
    font-size: clamp(1.9rem, 10vw, 3rem);
  }
}

@media (max-width: 480px) {
  .an-limit {
    width: 100%;
    border-radius: 12px;
  }

  .an-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .an-actions button {
    width: 100%;
    min-height: 50px;
  }
}
