.arsr-reader {
  --arsr-ink: #132629;
  --arsr-soft: #5f7377;
  --arsr-card: rgba(255, 255, 255, 0.9);
  --arsr-line: rgba(19, 38, 41, 0.12);
  --arsr-accent: #0f766e;
  --arsr-accent-strong: #115e59;
  --arsr-sun: #f59e0b;
  --arsr-wash: #fff9ec;
  --arsr-shadow: 0 26px 60px rgba(19, 38, 41, 0.12);
  font-family: "Segoe UI Variable Display", "Noto Kufi Arabic", Tahoma, sans-serif;
  color: var(--arsr-ink);
  margin: 18px 0;
}

.arsr-shell {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.28), transparent 27%),
    radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.16), transparent 32%),
    linear-gradient(180deg, #fffdf8 0%, #f4fbfa 52%, #eef8f7 100%);
  border: 1px solid rgba(15, 118, 110, 0.16);
  box-shadow: var(--arsr-shadow);
}

.arsr-shell::before {
  content: "";
  position: absolute;
  inset: auto -70px -70px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2), transparent 68%);
  pointer-events: none;
}

.arsr-banner,
.arsr-sentence-grid {
  position: relative;
  z-index: 1;
  animation: arsr-fade-up 0.45s ease both;
}

.arsr-banner {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.arsr-copy {
  max-width: 720px;
}

.arsr-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.12);
  color: var(--arsr-accent-strong);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.arsr-title {
  margin-top: 14px;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.06;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.arsr-description {
  margin-top: 8px;
  color: var(--arsr-soft);
  font-size: 14px;
  line-height: 1.55;
}

.arsr-toolbar {
  min-width: min(100%, 290px);
  display: grid;
  gap: 10px;
}

.arsr-range {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--arsr-line);
  backdrop-filter: blur(10px);
}

.arsr-range span {
  font-size: 13px;
  font-weight: 800;
  color: var(--arsr-accent-strong);
}

.arsr-speed-value {
  justify-self: end;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.12);
  color: var(--arsr-accent-strong);
  font-size: 12px;
  line-height: 1;
}

.arsr-speed-range {
  width: 100%;
  accent-color: var(--arsr-accent);
}

.arsr-stat-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
}

.arsr-stat-pill {
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--arsr-line);
}

.arsr-stat-pill strong {
  display: block;
  margin-bottom: 6px;
  color: var(--arsr-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.arsr-stat-pill span {
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.arsr-sentence-grid {
  display: grid;
  gap: 14px;
}

.arsr-card-head {
  display: flex;
  justify-content: flex-end;
}

.arsr-panel-label {
  color: var(--arsr-soft);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.arsr-current-word {
  margin-top: 10px;
  min-height: 48px;
  font-size: clamp(26px, 3.8vw, 40px);
  font-weight: 900;
  line-height: 1.02;
  word-break: break-word;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.08em;
}

.arsr-letter {
  position: relative;
  display: inline-block;
  padding: 0.01em 0.03em 0.05em;
  border-radius: 16px;
  transform-origin: center bottom;
  transition:
    transform 0.18s ease,
    color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.arsr-letter.is-pending {
  opacity: 0.42;
}

.arsr-letter.is-complete {
  color: var(--arsr-accent-strong);
  background: rgba(15, 118, 110, 0.1);
}

.arsr-letter.is-active {
  color: #052e2b;
  background: rgba(245, 158, 11, 0.26);
  box-shadow: 0 18px 34px rgba(245, 158, 11, 0.22);
  animation: arsr-letter-pop 0.5s ease, arsr-letter-glow 0.95s ease-in-out infinite;
}

.arsr-status-message {
  min-height: 18px;
  margin-top: 2px;
  color: var(--arsr-soft);
  font-size: 12px;
  font-weight: 700;
}

.arsr-flow-label {
  margin-top: 2px;
}

.arsr-progress-bar {
  margin-top: 8px;
  height: 9px;
  border-radius: 999px;
  background: rgba(19, 38, 41, 0.08);
  overflow: hidden;
}

.arsr-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b 0%, #0f766e 100%);
  transition: width 0.22s ease;
}

.arsr-progress-meta {
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--arsr-soft);
  font-size: 12px;
  font-weight: 800;
}

.arsr-controls {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.arsr-btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.arsr-btn:hover {
  transform: translateY(-1px);
}

.arsr-btn:active {
  transform: translateY(0);
}

.arsr-btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fffaf0;
  box-shadow: 0 16px 30px rgba(245, 158, 11, 0.28);
}

.arsr-btn-secondary {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #effcf9;
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.24);
}

.arsr-btn-ghost {
  background: rgba(255, 255, 255, 0.8);
  color: var(--arsr-ink);
  border: 1px solid var(--arsr-line);
}

.arsr-live-sentence {
  margin-top: 8px;
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(19, 38, 41, 0.04), rgba(19, 38, 41, 0.02));
  font-size: clamp(19px, 2.4vw, 26px);
  line-height: 1.65;
  word-break: break-word;
}

.arsr-token {
  transition: color 0.22s ease, background-color 0.22s ease, transform 0.22s ease;
  border-radius: 10px;
  padding: 1px 5px;
}

.arsr-token.is-upcoming {
  color: rgba(19, 38, 41, 0.62);
}

.arsr-token.is-current {
  color: #052e2b;
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.16);
}

.arsr-reader.is-reading .arsr-token.is-current {
  animation: arsr-token-breathe 0.9s ease-in-out infinite;
}

.arsr-token-letter {
  display: inline-block;
  padding: 0.02em 0.01em;
  border-radius: 10px;
  transition:
    transform 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease,
    opacity 0.16s ease,
    box-shadow 0.16s ease;
}

.arsr-token-letter.is-pending {
  opacity: 0.62;
}

.arsr-token-letter.is-complete {
  color: var(--arsr-accent-strong);
}

.arsr-token-letter.is-active {
  color: #052e2b;
  background: rgba(245, 158, 11, 0.26);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.18);
  animation: arsr-letter-pop 0.45s ease, arsr-letter-glow 0.95s ease-in-out infinite;
}

.arsr-token.is-complete {
  color: var(--arsr-accent-strong);
}

.arsr-token.is-punctuation {
  padding-inline: 2px;
}

.arsr-sentence-card {
  text-align: right;
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 22px;
  background: var(--arsr-card);
  border: 1px solid var(--arsr-line);
  backdrop-filter: blur(14px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.arsr-sentence-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(19, 38, 41, 0.08);
}

.arsr-sentence-card.is-playing {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 18px 34px rgba(15, 118, 110, 0.12);
}

.arsr-card-index {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 118, 110, 0.08);
  color: var(--arsr-accent-strong);
  font-weight: 900;
}

.arsr-reader.is-reading .arsr-shell {
  box-shadow: 0 30px 70px rgba(15, 118, 110, 0.16);
}

@keyframes arsr-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes arsr-letter-pop {
  0% {
    transform: translateY(0) scale(1);
  }

  40% {
    transform: translateY(-0.18em) scale(1.18);
  }

  100% {
    transform: translateY(-0.04em) scale(1.04);
  }
}

@keyframes arsr-letter-glow {
  0%,
  100% {
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.14);
  }

  50% {
    box-shadow: 0 16px 28px rgba(245, 158, 11, 0.26);
  }
}

@keyframes arsr-token-breathe {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 10px 22px rgba(245, 158, 11, 0.16);
  }

  50% {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 16px 28px rgba(245, 158, 11, 0.22);
  }
}

@media (max-width: 860px) {
  .arsr-shell {
    padding: 16px;
    border-radius: 24px;
  }

  .arsr-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .arsr-stat-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 580px) {
  .arsr-title {
    font-size: 22px;
  }

  .arsr-live-sentence {
    font-size: 18px;
    min-height: 72px;
  }

  .arsr-current-word {
    font-size: 28px;
    min-height: 42px;
  }

  .arsr-stat-row,
  .arsr-controls {
    grid-template-columns: 1fr;
  }
}
