:root {
  --navy: #13265b;
  --navy-dark: #0d1d49;
  --blue: #3156d8;
  --yellow: #f6c845;
  --cream: #f6f2e8;
  --paper: #fffdf8;
  --ink: #1c2541;
  --muted: #68718a;
  --line: #d8deeb;
  --soft-blue: #edf1ff;
  --shadow: 0 22px 54px rgba(24, 38, 83, 0.14), 0 3px 8px rgba(24, 38, 83, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 77% 31%, rgba(49, 86, 216, 0.07), transparent 26rem),
    linear-gradient(180deg, #fbfaf6 0%, var(--cream) 100%);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid #101a3d;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--yellow);
}

.answer-area:focus-visible {
  outline: 3px solid #101a3d;
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(100% - 48px, 1136px);
  margin: 0 auto;
}

.topbar {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-bottom: 1px solid rgba(19, 38, 91, 0.11);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  text-decoration: none;
}

.brand-mark {
  width: 31px;
  height: 31px;
  position: relative;
  display: inline-block;
}

.brand-mark span {
  position: absolute;
  inset: 0 auto auto 0;
  width: 25px;
  height: 20px;
  border-radius: 4px;
  background: var(--navy);
  box-shadow: 0 0 0 2px #fbfaf6;
}

.brand-mark span:nth-child(2) {
  top: 5px;
  left: 3px;
  background: #3156d8;
}

.brand-mark span:nth-child(3) {
  top: 10px;
  left: 6px;
  background: #7391f0;
}

.brand-word,
h1,
.prompt-area h2,
.panel strong {
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
}

.brand-word {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.7px;
}

.level-pill {
  min-width: 43px;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.profile-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid #e2e5ed;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
}

.profile {
  min-height: 44px;
  padding: 4px 14px 4px 5px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.profile.active {
  color: #fff;
  background: var(--navy);
  box-shadow: 0 4px 10px rgba(19, 38, 91, 0.2);
}

.profile:not(.active):hover {
  background: #f0f2f7;
}

.avatar,
.profile-avatar-large {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-weight: 800;
}

.avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.avatar-mostafa {
  background: linear-gradient(145deg, #d7a477, #7b3f25);
}

.avatar-negar {
  background: linear-gradient(145deg, #e28aa7, #7f365d);
}

.hero {
  padding: 48px 0 35px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(350px, 0.72fr);
  gap: 72px;
  align-items: end;
}

.eyebrow,
.meta-label,
.card-type,
.answer-label,
.panel-label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
}

.eyebrow {
  color: var(--blue);
}

h1 {
  max-width: 660px;
  margin: 14px 0 13px;
  color: var(--navy);
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.06;
  letter-spacing: -2px;
}

h1 em {
  color: var(--blue);
  font-style: italic;
}

.intro {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.session-meta {
  padding-bottom: 4px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 16px;
}

.today-block {
  display: grid;
  gap: 7px;
}

.meta-label {
  color: #626a7d;
}

.today-block strong {
  color: var(--navy);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: 18px;
}

.today-block strong span:last-child {
  color: #626a7d;
  font-size: 13px;
}

.progress-track,
.mini-progress {
  overflow: hidden;
  border-radius: 999px;
  background: #dfe3eb;
}

.progress-track {
  height: 4px;
  margin-bottom: 8px;
}

.progress-track span,
.mini-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 240ms ease-out;
}

.streak-pill {
  min-height: 32px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  color: #7c5b06;
  background: #ffedb6;
  font-size: 12px;
  white-space: nowrap;
}

.streak-pill svg {
  width: 15px;
  fill: #e69117;
}

.study-area {
  width: min(100%, 870px);
  margin: 0 auto;
}

.flashcard {
  overflow: hidden;
  border: 1px solid #dfe3ed;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.card-content {
  min-height: 390px;
  padding: 30px 52px 22px;
  display: flex;
  flex-direction: column;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-type {
  color: var(--blue);
}

.star-button,
.audio-button,
.reveal-button,
.nav-button,
.review-button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.star-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.star-button:hover {
  background: #fff5d4;
}

.star-button svg {
  width: 25px;
  fill: transparent;
  stroke: #737d94;
  stroke-width: 1.6;
}

.star-button.starred svg {
  fill: var(--yellow);
  stroke: #c39313;
}

.prompt-area {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.card-kicker {
  margin: 0 0 10px;
  color: #5f687e;
  font-size: 13px;
}

.prompt-area h2 {
  max-width: 720px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(29px, 4.6vw, 46px);
  line-height: 1.18;
  letter-spacing: -1.5px;
}

.audio-button {
  min-height: 44px;
  margin-top: 17px;
  padding: 7px 14px 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--blue);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.audio-button:hover {
  border-color: #dce3ff;
  background: var(--soft-blue);
}

.audio-button svg {
  width: 20px;
  fill: currentColor;
}

.answer-area {
  width: min(100%, 650px);
  margin: 7px auto 22px;
  padding: 18px 24px;
  border: 1px solid #dfe4f5;
  border-radius: 10px;
  background: #f4f6ff;
  text-align: center;
}

.answer-label {
  color: var(--blue);
}

.answer-area p {
  margin: 8px 0 0;
}

.answer-area #answer-text {
  color: var(--navy);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
  font-size: 21px;
  font-weight: 800;
}

.answer-note {
  color: var(--muted);
  font-size: 13px;
}

.reveal-area {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.reveal-button {
  min-width: 190px;
  min-height: 47px;
  padding: 10px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 8px 16px rgba(19, 38, 91, 0.18);
  font-weight: 800;
}

.reveal-button:hover,
.nav-button.next:hover {
  background: #1b3478;
}

.reveal-button svg,
.nav-button svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.reveal-area p {
  margin: 0;
  color: #626a7d;
  font-size: 12px;
}

.card-footer {
  min-height: 47px;
  padding: 10px 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 42px;
  border-top: 1px solid #e7e9ef;
  color: #626a7d;
  background: #fafafa;
  font-size: 12px;
}

kbd {
  min-width: 22px;
  min-height: 18px;
  padding: 2px 6px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #d1d5de;
  border-bottom-width: 2px;
  border-radius: 4px;
  color: #626a7d;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
}

.card-navigation {
  margin: 18px 0 50px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav-button {
  min-height: 44px;
  padding: 9px 17px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #ccd1dc;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 800;
}

#previous-button {
  grid-column: 1;
}

.nav-button:hover {
  border-color: #aeb5c5;
  background: #fff;
}

.nav-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.nav-button.next {
  grid-column: 3;
  justify-self: end;
  border-color: var(--navy);
  color: #fff;
  background: var(--navy);
}

.card-dots {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mobile-position {
  display: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.dot-button {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.dot-button::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8791a6;
}

.dot-button.active::before {
  width: 8px;
  height: 8px;
  background: var(--blue);
}

.dot-button.starred::before {
  content: "★";
  width: auto;
  height: auto;
  color: #956600;
  background: transparent;
  font-size: 13px;
  line-height: 1;
}

.dot-button.active.starred {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 28px;
}

.panel {
  min-height: 113px;
  padding: 25px 27px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  border: 1px solid #e0e3e9;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
}

.panel-icon,
.profile-avatar-large {
  width: 52px;
  height: 52px;
}

.panel-icon {
  display: grid;
  place-items: center;
  border-radius: 9px;
}

.panel-icon svg {
  width: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.book-icon {
  color: var(--blue);
  background: #edf0ff;
}

.star-icon {
  color: #8a6a12;
  background: #fff1c9;
}

.star-icon svg {
  fill: var(--yellow);
  stroke: #bd8e0e;
}

.panel > div {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.panel-label {
  color: #626a7d;
  font-size: 12px;
  letter-spacing: 1.4px;
}

.panel strong {
  color: var(--navy);
  font-size: 14px;
}

.mini-progress {
  width: 100%;
  height: 4px;
}

.review-button {
  width: fit-content;
  min-height: 32px;
  padding: 0;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.review-button:disabled {
  color: #a4a9b5;
  cursor: not-allowed;
}

.profile-avatar-large {
  font-size: 18px;
}

.profile-status {
  color: #626a7d;
  font-size: 12px;
}

.page-footer {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(19, 38, 91, 0.11);
  color: #626a7d;
  font-size: 12px;
}

.toast {
  width: min(100%, 870px);
  margin: 14px auto 0;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy-dark);
  font-size: 13px;
  text-align: center;
}

.toast.visible {
  display: block;
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

.profile,
.star-button,
.audio-button,
.reveal-button,
.nav-button,
.review-button,
.dot-button {
  transition: transform 120ms ease-out;
}

@media (hover: hover) and (pointer: fine) {
  .profile,
  .star-button,
  .audio-button,
  .reveal-button,
  .nav-button,
  .review-button,
  .dot-button {
    transition: color 150ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out, transform 120ms ease-out;
  }
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 32px, 780px);
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .dashboard {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 96px;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 24px, 540px);
  }

  .topbar {
    min-height: 128px;
    padding: 18px 0;
    flex-direction: column;
    justify-content: center;
  }

  .profile-switcher {
    width: 100%;
  }

  .profile {
    flex: 1;
    justify-content: center;
    padding-right: 8px;
  }

  .hero {
    padding-top: 34px;
  }

  h1 {
    letter-spacing: -1.4px;
  }

  .session-meta {
    grid-template-columns: auto 1fr;
  }

  .streak-pill {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .card-content {
    min-height: 440px;
    padding: 24px 22px 20px;
  }

  .prompt-area h2 {
    font-size: clamp(27px, 9vw, 39px);
  }

  .card-footer {
    display: none;
  }

  .card-navigation {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .card-dots {
    display: none;
  }

  .mobile-position {
    grid-column: 1 / -1;
    grid-row: 1;
    display: block;
    justify-self: center;
  }

  .review-button {
    min-height: 44px;
    padding-right: 12px;
  }


  .nav-button {
    grid-column: 1;
    grid-row: 2;
  }

  .nav-button.next {
    grid-column: 2;
    width: 100%;
    justify-content: center;
  }

  .dashboard {
    gap: 14px;
  }

  .panel {
    padding: 20px;
  }

  .page-footer {
    padding: 18px 0;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  button:active:not(:disabled) {
    transform: none;
  }
}
