.vocab-dashboard-page {
  --vocab-blue: #3f7bf7;
  --vocab-blue-deep: #102a56;
  --vocab-text: #52709a;
  --vocab-line: rgba(90, 140, 205, 0.14);
  color: var(--vocab-blue-deep);
  background:
    radial-gradient(circle at 10% 8%, rgba(120, 190, 255, 0.2), transparent 28%),
    radial-gradient(circle at 90% 28%, rgba(124, 176, 255, 0.16), transparent 30%),
    linear-gradient(180deg, #edf7ff 0%, #f8fbff 52%, #eef7ff 100%);
}

.vocab-dashboard-page .vocab-dashboard-shell {
  width: min(1180px, calc(100% - 40px));
  padding: 34px 0 52px;
}

.vocab-dashboard-topbar {
  margin-bottom: 24px;
  padding: 14px 18px;
  border-color: rgba(112, 157, 215, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 32px rgba(69, 118, 183, 0.1);
}

.vocab-dashboard-topbar .topbar__home-icon {
  border-color: rgba(63, 123, 247, 0.18);
  background: linear-gradient(145deg, #f5faff, #e1efff);
  color: var(--vocab-blue);
}

.vocab-dashboard-topbar .topbar__brand-copy strong {
  color: var(--vocab-blue-deep);
  font-size: 1.02rem;
  font-weight: 700;
}

.vocab-dashboard-topbar .topbar__brand-copy span {
  color: #7288a9;
}

.vocab-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 18px;
  border-radius: 999px;
  color: #3479e8;
  background: #eaf3ff;
  box-shadow: 0 8px 18px rgba(68, 128, 220, 0.11);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 160ms ease, background 160ms ease;
}

.vocab-back-link:hover {
  transform: translateY(-1px);
  background: #dfedff;
}

.vocab-dashboard {
  display: grid;
  gap: 28px;
}

.vocab-hero {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 38px 40px;
  border: 1px solid rgba(98, 158, 227, 0.15);
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(237, 248, 255, 0.98) 0%, rgba(237, 248, 255, 0.89) 37%, rgba(237, 248, 255, 0.12) 64%),
    url("../../../assets/jlpt-vocab-hero-v2.webp") center / cover no-repeat;
  box-shadow: 0 18px 42px rgba(62, 114, 177, 0.13);
}

.vocab-hero__copy {
  position: relative;
  z-index: 2;
  max-width: 610px;
}

.vocab-kicker {
  margin: 0 0 14px;
  color: #4e79b5;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.vocab-hero h1 {
  margin: 0;
  max-width: 650px;
  color: var(--vocab-blue-deep);
  font-size: clamp(2.1rem, 4.2vw, 3.35rem);
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.vocab-hero h1 span {
  color: #3b73eb;
}

.vocab-hero__description {
  margin: 14px 0 20px;
  color: #37577d;
  font-size: 1rem;
  line-height: 1.65;
}

.vocab-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.vocab-hero__chips span {
  padding: 8px 15px;
  border: 1px solid rgba(87, 139, 210, 0.22);
  border-radius: 999px;
  color: #3971c1;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 5px 14px rgba(70, 119, 178, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
}

.vocab-hero__message {
  position: absolute;
  z-index: 2;
  top: 36px;
  right: 124px;
  padding: 13px 18px;
  border-radius: 18px;
  color: #3475e4;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(46, 98, 170, 0.12);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
  transform: rotate(-4deg);
}

.vocab-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 18px 8px;
  border: 1px solid var(--vocab-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 13px 32px rgba(64, 111, 174, 0.09);
}

.vocab-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 6px 20px;
}

.vocab-stat + .vocab-stat {
  border-left: 1px solid #e1ebf7;
}

.vocab-stat__icon,
.vocab-card-heading__icon,
.vocab-mode-card__icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
}

.vocab-stat__icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  font-size: 1.25rem;
  font-weight: 900;
}

.vocab-stat--library .vocab-stat__icon { color: #3f7bf7; background: #edf5ff; }
.vocab-stat--pending .vocab-stat__icon { color: #ff6878; background: #fff0f2; }
.vocab-stat--known .vocab-stat__icon { color: #17b98c; background: #eafaf5; }
.vocab-stat--favorite .vocab-stat__icon { color: #f4a91f; background: #fff7e8; }

.vocab-stat div {
  display: grid;
  min-width: 0;
}

.vocab-stat span:not(.vocab-stat__icon) {
  color: #637b9d;
  font-size: 0.83rem;
}

.vocab-stat strong {
  margin: 1px 0;
  color: #142e5c;
  font-size: 1.55rem;
  line-height: 1.25;
}

.vocab-stat small {
  overflow: hidden;
  color: #8396b2;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vocab-control-grid,
.vocab-support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.vocab-control-card,
.vocab-support-card {
  padding: 24px;
  border: 1px solid var(--vocab-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(65, 111, 173, 0.08);
}

.vocab-card-heading,
.vocab-support-card__heading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.vocab-card-heading__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #6da6ff, #397cf0);
  box-shadow: 0 8px 16px rgba(55, 122, 235, 0.2);
  font-size: 1rem;
  font-weight: 900;
}

.vocab-card-heading h2,
.vocab-section-heading h2,
.vocab-support-card__heading h2 {
  margin: 0;
  color: var(--vocab-blue-deep);
  font-size: 1.08rem;
  line-height: 1.35;
}

.vocab-card-heading p,
.vocab-section-heading p,
.vocab-support-card__heading p {
  margin: 3px 0 0;
  color: #7188a8;
  font-size: 0.75rem;
  line-height: 1.45;
}

.vocab-card-heading--progress a,
.vocab-support-card__heading a {
  margin-left: auto;
  color: #3f7bf7;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
}

.vocab-level-picker {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.vocab-level-picker button {
  min-height: 46px;
  border: 1px solid #d6e4f4;
  border-radius: 999px;
  color: #35547e;
  background: #f9fcff;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.vocab-level-picker button:hover {
  transform: translateY(-1px);
  border-color: #9cbff5;
}

.vocab-level-picker button.is-active {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, #5a91ff, #356fe9);
  box-shadow: 0 8px 18px rgba(52, 113, 234, 0.28);
  font-weight: 800;
}

.vocab-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.vocab-progress__track {
  flex: 1;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #eaf1fb;
}

.vocab-progress__track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #528cff, #71a7ff);
  transition: width 320ms ease;
}

.vocab-progress > strong {
  min-width: 50px;
  color: #153161;
  font-size: 1rem;
}

.vocab-progress__label {
  margin: 10px 0 0;
  color: #5f789c;
  font-size: 0.82rem;
}

.vocab-learning-section {
  scroll-margin-top: 20px;
}

.vocab-section-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 2px 0 16px;
}

.vocab-section-heading > span {
  color: #4a82ee;
  font-size: 1.55rem;
}

.vocab-section-heading h2 {
  font-size: 1.4rem;
}

.vocab-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.vocab-mode-card {
  --mode-color: #3f7bf7;
  --mode-soft: #edf5ff;
  position: relative;
  min-height: 210px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 62px 1fr;
  grid-template-rows: auto auto auto 1fr;
  column-gap: 18px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--mode-color) 13%, white);
  border-radius: 20px;
  color: inherit;
  background: linear-gradient(135deg, white 35%, var(--mode-soft));
  box-shadow: 0 12px 30px rgba(66, 111, 169, 0.08);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.vocab-mode-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 36px rgba(65, 111, 173, 0.13);
}

.vocab-mode-card--coral { --mode-color: #ff6878; --mode-soft: #fff0f3; }
.vocab-mode-card--purple { --mode-color: #805cf2; --mode-soft: #f3efff; }
.vocab-mode-card--mint { --mode-color: #16bd91; --mode-soft: #eafaf5; }

.vocab-mode-card__icon {
  grid-row: 1 / span 4;
  width: 62px;
  height: 62px;
  border-radius: 16px;
  color: var(--mode-color);
  background: color-mix(in srgb, var(--mode-color) 11%, white);
  font-size: 1.65rem;
  font-weight: 900;
}

.vocab-mode-card__eyebrow {
  color: #6a7e99;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.vocab-mode-card > strong {
  margin: 10px 0 6px;
  color: #102a56;
  font-size: 1.45rem;
}

.vocab-mode-card p {
  max-width: 430px;
  margin: 0;
  color: #617a9d;
  font-size: 0.86rem;
  line-height: 1.6;
}

.vocab-mode-card__arrow {
  position: absolute;
  right: 26px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--mode-color);
  background: color-mix(in srgb, var(--mode-color) 10%, white);
  font-size: 1.2rem;
}

.vocab-mode-card .portal-module-card__badge--counter {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 6px 11px;
  border-radius: 999px;
  color: var(--mode-color);
  background: color-mix(in srgb, var(--mode-color) 9%, white);
  font-size: 0.68rem;
  font-weight: 800;
}

.vocab-support-card__heading > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: white;
  background: #5c95f8;
  font-weight: 900;
}

.vocab-task-list {
  display: grid;
  margin-top: 16px;
}

.vocab-task-list a {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-bottom: 1px solid #e7eef7;
  color: #536d92;
  text-decoration: none;
  font-size: 0.82rem;
}

.vocab-task-list a:last-child { border-bottom: 0; }
.vocab-task-list a > span { color: #4c85ee; font-weight: 900; text-align: center; }
.vocab-task-list a:nth-child(2) > span { color: #ff7180; }
.vocab-task-list a:nth-child(3) > span { color: #805cf2; }
.vocab-task-list a:nth-child(4) > span { color: #16bd91; }
.vocab-task-list strong { color: #587197; font-weight: 600; }
.vocab-task-list small { color: #7489a8; font-size: 0.78rem; }

.vocab-tips-card .vocab-support-card__heading > span {
  color: #f4a91f;
  background: #fff6dc;
}

.vocab-tips-card ol {
  display: grid;
  gap: 7px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.vocab-tips-card li {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 10px;
  border-radius: 10px;
  color: #62799b;
  background: #f4f8fd;
  font-size: 0.76rem;
}

.vocab-tips-card li span {
  margin-right: 10px;
  color: #4780e9;
  font-weight: 800;
}

.vocab-tips-card blockquote {
  display: grid;
  place-items: center;
  gap: 2px;
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  color: #3e78df;
  background: linear-gradient(135deg, #eef6ff, #e5f1ff);
}

.vocab-tips-card blockquote strong { font-size: 0.98rem; }
.vocab-tips-card blockquote span { color: #7890b2; font-size: 0.68rem; }

@media (max-width: 900px) {
  .vocab-stats { grid-template-columns: repeat(2, 1fr); }
  .vocab-stat:nth-child(3) { border-left: 0; }
  .vocab-stat:nth-child(n + 3) { border-top: 1px solid #e1ebf7; padding-top: 14px; }
  .vocab-control-grid,
  .vocab-support-grid { grid-template-columns: 1fr; }
  .vocab-hero { min-height: 300px; background-position: 58% center; }
  .vocab-hero__message { right: 50px; }
}

@media (max-width: 680px) {
  .vocab-dashboard-page .vocab-dashboard-shell {
    width: min(100% - 20px, 560px);
    padding: 14px 0 32px;
  }

  .vocab-dashboard-topbar { margin-bottom: 14px; padding: 10px 12px; }
  .vocab-dashboard-topbar .topbar__home-icon { width: 34px; height: 34px; }
  .vocab-dashboard-topbar .topbar__brand-copy strong { font-size: 0.88rem; }
  .vocab-dashboard-topbar .topbar__brand-copy span { font-size: 0.66rem; }
  .vocab-back-link { padding: 9px 11px; font-size: 0.72rem; }
  .vocab-back-link span { display: none; }
  .vocab-dashboard { gap: 18px; }

  .vocab-hero {
    min-height: 430px;
    align-items: flex-start;
    padding: 26px 20px;
    background:
      linear-gradient(180deg, rgba(239, 249, 255, 0.99) 0%, rgba(239, 249, 255, 0.93) 46%, rgba(239, 249, 255, 0.08) 76%),
      url("../../../assets/jlpt-vocab-hero-v2.webp") 65% bottom / auto 60% no-repeat,
      #edf7ff;
  }

  .vocab-kicker { margin-bottom: 10px; font-size: 0.62rem; }
  .vocab-hero h1 { max-width: 430px; font-size: clamp(1.8rem, 8.4vw, 2.35rem); }
  .vocab-hero__description { margin: 10px 0 14px; font-size: 0.83rem; }
  .vocab-hero__chips { gap: 7px; }
  .vocab-hero__chips span { padding: 6px 10px; font-size: 0.67rem; }
  .vocab-hero__message { display: none; }

  .vocab-stats { padding: 8px; }
  .vocab-stat { gap: 9px; padding: 12px 8px; }
  .vocab-stat__icon { width: 38px; height: 38px; font-size: 0.9rem; }
  .vocab-stat strong { font-size: 1.2rem; }
  .vocab-stat small { display: none; }

  .vocab-control-card,
  .vocab-support-card { padding: 18px; }
  .vocab-card-heading__icon { width: 38px; height: 38px; }
  .vocab-card-heading p { font-size: 0.69rem; }
  .vocab-level-picker { gap: 6px; margin-top: 16px; }
  .vocab-level-picker button { min-height: 40px; }

  .vocab-mode-grid { grid-template-columns: 1fr; gap: 13px; }
  .vocab-mode-card { min-height: 180px; grid-template-columns: 50px 1fr; column-gap: 14px; padding: 19px; }
  .vocab-mode-card__icon { width: 50px; height: 50px; border-radius: 14px; font-size: 1.3rem; }
  .vocab-mode-card > strong { margin-top: 8px; font-size: 1.2rem; }
  .vocab-mode-card p { padding-right: 26px; font-size: 0.78rem; }
  .vocab-mode-card__arrow { right: 18px; bottom: 18px; width: 38px; height: 38px; }
  .vocab-mode-card .portal-module-card__badge--counter { top: 14px; right: 14px; }

  .vocab-support-card__heading a { font-size: 0.68rem; }
  .vocab-tips-card li { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .vocab-dashboard-page *,
  .vocab-dashboard-page *::before,
  .vocab-dashboard-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
