:root {
  --blue: #0758d8;
  --deep-blue: #073b9a;
  --sky: #e8f7ff;
  --green: #58b62b;
  --orange: #ff6b13;
  --yellow: #ffc928;
  --teal: #0aa8a7;
  --purple: #7651c9;
  --red: #ef343e;
  --ink: #122042;
  --muted: #61708f;
  --line: #dbe7f6;
  --white: #ffffff;
  --shadow: 0 14px 34px rgba(21, 76, 148, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: #9cc7f2 #edf6ff;
  scrollbar-width: thin;
}

* {
  scrollbar-color: #9cc7f2 #edf6ff;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: #edf6ff;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7fb4f1, #0d6bed);
  border: 2px solid #edf6ff;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0d6bed, #0758d8);
}

body {
  margin: 0;
  color: var(--ink);
  background: #ffffff;
  font-family: "Mitr", "Noto Sans Thai", "Tahoma", sans-serif;
  letter-spacing: 0;
}

body.reader-open,
body.modal-open {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 252, 255, 0.92)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(7, 88, 216, 0.035) 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(7, 88, 216, 0.035) 32px);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(7, 88, 216, 0.12);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 82px;
}

.brand img {
  width: 146px;
  height: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.5vw, 28px);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
}

.main-nav a {
  position: relative;
  padding: 28px 0 22px;
  color: #14264c;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  height: 3px;
  border-radius: 999px;
  background: transparent;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--blue);
}

.main-nav a.active::after {
  background: var(--blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  width: min(245px, 20vw);
  height: 44px;
  padding: 0 8px 0 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(20, 54, 111, 0.06);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.search-box button,
.cart-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.cart-button {
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
}

.cart-button b {
  position: absolute;
  top: -7px;
  right: -4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #ffffff;
  background: var(--orange);
  border-radius: 999px;
  font-family: "Baloo 2", sans-serif;
  font-size: 13px;
}

.login-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  color: #ffffff;
  background: linear-gradient(180deg, #0d6bed, #064fc5);
  border-radius: 999px;
  box-shadow: 0 12px 22px rgba(7, 88, 216, 0.25);
  font-weight: 600;
  white-space: nowrap;
}

.nav-toggle,
.menu-button {
  display: none;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  background:
    linear-gradient(180deg, #ffffff 0%, #ffffff 66%, #dff5ff 66%, #dff5ff 100%);
  border-bottom: 1px solid #cceeff;
}

.hero::before {
  content: "";
  position: absolute;
  left: -6vw;
  right: -6vw;
  bottom: 38px;
  height: 170px;
  background: #cdeeff;
  border-radius: 48% 52% 0 0 / 60% 58% 0 0;
  transform: rotate(-1deg);
}

.hero::after {
  content: "";
  position: absolute;
  left: -4vw;
  right: -4vw;
  bottom: -70px;
  height: 190px;
  background: #b7e4ff;
  border-radius: 45% 55% 0 0 / 72% 58% 0 0;
  transform: rotate(1deg);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(420px, 0.82fr) minmax(520px, 1.18fr);
  align-items: end;
  gap: 24px;
  width: min(1460px, calc(100% - 48px));
  min-height: 560px;
  margin: 0 auto;
}

.hero-copy {
  align-self: center;
  padding: 52px 0 64px;
}

.eyebrow {
  width: max-content;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 8px 14px;
  color: var(--blue);
  background: #eff7ff;
  border: 1px solid #cce6ff;
  border-radius: 999px;
  font-weight: 600;
}

.hero h1 {
  margin: 0;
  color: var(--deep-blue);
  font-family: "Baloo 2", "Mitr", sans-serif;
  font-size: clamp(54px, 5.8vw, 92px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0;
}

.hero h1 span,
.hero h1 strong {
  display: inline-block;
}

.hero h1 span {
  color: var(--green);
}

.hero h1 strong {
  color: var(--orange);
}

.hero-lead {
  max-width: 720px;
  margin: 18px 0 18px;
  color: #24395f;
  font-size: clamp(16px, 1.25vw, 20px);
  line-height: 1.72;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}

.hero-tags span {
  display: inline-flex;
  flex-direction: column;
  min-width: 142px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dfeaf8;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(25, 76, 146, 0.08);
  color: #53627d;
  font-size: 13px;
}

.hero-tags b {
  color: var(--blue);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.primary-button {
  min-width: 290px;
  min-height: 58px;
  padding: 0 30px;
  font-size: 18px;
}

.start-price {
  margin: 0;
  color: #28395d;
  font-weight: 500;
}

.start-price strong {
  color: var(--orange);
  font-family: "Baloo 2", sans-serif;
  font-size: 36px;
  line-height: 1;
}

.hero-visual {
  align-self: end;
  margin-right: -44px;
}

.hero-visual img {
  width: min(930px, 64vw);
  margin-left: auto;
}

.grade-badge {
  position: absolute;
  right: 16px;
  bottom: 76px;
  display: grid;
  place-items: center;
  width: 190px;
  min-height: 128px;
  padding: 18px;
  color: #ffffff;
  background: linear-gradient(180deg, #0871ee, #064fc4);
  border: 5px solid #ffffff;
  border-radius: 38% 62% 45% 55% / 58% 44% 56% 42%;
  box-shadow: 0 16px 24px rgba(7, 88, 216, 0.24);
  text-align: center;
  transform: rotate(-4deg);
}

.grade-badge span {
  font-weight: 600;
}

.grade-badge strong {
  color: var(--yellow);
  font-family: "Baloo 2", "Mitr", sans-serif;
  font-size: 40px;
  line-height: 1;
}

.star {
  position: absolute;
  z-index: 2;
  font-size: 36px;
  line-height: 1;
}

.star-a {
  top: 98px;
  left: 46px;
  color: var(--yellow);
  transform: rotate(-14deg);
}

.star-b {
  top: 150px;
  right: 138px;
  color: var(--purple);
}

.star-c {
  top: 245px;
  left: 5vw;
  color: var(--orange);
  font-size: 24px;
}

.section {
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-heading h2 {
  position: relative;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 28px);
  line-height: 1.25;
}

.section-heading h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 5px;
  height: 1em;
  background: var(--blue);
  border-radius: 999px;
}

.section-heading a {
  color: var(--blue);
  font-weight: 600;
}

.subject-grid,
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.subject-card,
.level-card,
.product-card {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 24px rgba(25, 76, 146, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.subject-card:hover,
.level-card:hover,
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 30px rgba(25, 76, 146, 0.13);
}

.subject-card {
  display: grid;
  align-content: center;
  min-height: 166px;
  padding: 16px;
  border: 2px solid var(--card-color);
  text-align: center;
}

.subject-card.math { --card-color: #79b9f6; --card-soft: #eef8ff; --card-main: var(--blue); }
.subject-card.thai { --card-color: #8bd071; --card-soft: #f3fff0; --card-main: var(--green); }
.subject-card.english { --card-color: #ffb37d; --card-soft: #fff5ed; --card-main: var(--orange); }
.subject-card.science { --card-color: #a991e0; --card-soft: #f7f3ff; --card-main: var(--purple); }
.subject-card.art { --card-color: #ff9aa4; --card-soft: #fff2f4; --card-main: var(--red); }

.subject-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  margin: 0 auto 10px;
  background: var(--card-soft);
  border-radius: 8px;
  overflow: hidden;
}

.subject-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subject-card b {
  color: var(--card-main);
  font-size: 18px;
}

.subject-card small {
  color: #53627c;
  line-height: 1.35;
}

.levels {
  padding-top: 20px;
}

.level-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.level-card {
  min-height: 158px;
  padding: 16px 12px;
  border: 2px solid var(--level-color);
  text-align: center;
}

.level-icon {
  display: block;
  width: 68px;
  height: 68px;
  margin: 0 auto 8px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(25, 76, 146, 0.12);
}

.level-card.blue { --level-color: var(--blue); }
.level-card.green { --level-color: var(--green); }
.level-card.orange { --level-color: var(--orange); }
.level-card.purple { --level-color: var(--purple); }
.level-card.red { --level-color: var(--red); }
.level-card.teal { --level-color: var(--teal); }

.level-card b {
  display: block;
  color: var(--level-color);
  font-family: "Baloo 2", "Mitr", sans-serif;
  font-size: 30px;
  line-height: 1;
}

.level-card span {
  display: block;
  margin-top: 5px;
  color: #42526f;
  font-size: 13px;
  line-height: 1.35;
}

.products {
  padding-top: 22px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  min-height: 140px;
  padding: 10px;
  border: 1px solid var(--line);
}

.product-card img {
  width: 86px;
  height: 120px;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
  box-shadow: 0 8px 14px rgba(20, 50, 90, 0.13);
}

.product-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-info h3 {
  margin: 0 0 4px;
  color: #14264c;
  font-size: 16px;
  line-height: 1.25;
}

.product-info p {
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 3px 8px;
  color: var(--blue);
  background: #edf6ff;
  border: 1px solid #cce4ff;
  border-radius: 999px;
  font-size: 12px;
}

.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.product-foot strong {
  color: var(--orange);
  font-family: "Baloo 2", "Mitr", sans-serif;
  font-size: 28px;
  line-height: 1;
}

.product-foot button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  color: #ffffff;
  background: var(--blue);
  border-radius: 8px;
  cursor: pointer;
  font-family: "Baloo 2", sans-serif;
  font-size: 24px;
  font-weight: 800;
}

.benefits {
  margin-top: 28px;
  background: linear-gradient(180deg, #e8f7ff, #d9f0ff);
  border-top: 1px solid #bde4ff;
  border-bottom: 1px solid #bde4ff;
}

.benefit-inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 0 18px;
  border-right: 1px dashed #78b8ea;
}

.benefit-item:last-child {
  border-right: 0;
}

.benefit-item > span {
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  color: var(--blue);
  background: #ffffff;
  border: 2px solid #a8dcff;
  border-radius: 8px;
  font-family: "Baloo 2", sans-serif;
  font-size: 32px;
  font-weight: 800;
}

.benefit-item b,
.benefit-item small {
  display: block;
}

.benefit-item b {
  color: var(--deep-blue);
  font-size: 17px;
}

.benefit-item small {
  color: #53627c;
  line-height: 1.35;
}

.site-footer {
  color: #ffffff;
  background:
    linear-gradient(135deg, #0757d4 0%, #0147b6 48%, #00358f 100%);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.25fr 0.7fr 0.8fr 1fr 1.2fr;
  gap: 36px;
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 20px;
}

.footer-brand img {
  width: 160px;
  padding: 8px;
  background: #ffffff;
  border-radius: 8px;
}

.footer-brand p,
.footer-column p,
.newsletter p {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.footer-column h2,
.newsletter h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.footer-column a {
  display: block;
  width: max-content;
  max-width: 100%;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.86);
}

.newsletter div {
  display: flex;
  margin-top: 14px;
  padding: 5px;
  background: #ffffff;
  border-radius: 999px;
}

.newsletter input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
}

.newsletter button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  color: #ffffff;
  background: var(--green);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.copyright {
  width: min(1460px, calc(100% - 48px));
  margin: 0 auto;
  padding: 10px 0 18px;
  color: rgba(255, 255, 255, 0.78);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  text-align: center;
  font-size: 13px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(1460px, calc(100% - 48px));
  margin: 18px auto 0;
  color: #60708f;
  font-size: 14px;
}

.breadcrumbs a {
  color: var(--blue);
  font-weight: 600;
}

.page-hero {
  width: min(1460px, calc(100% - 48px));
  margin: 18px auto 0;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #eef9ff);
  border: 1px solid #d3eafa;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.page-hero-inner {
  display: grid;
  grid-template-columns: minmax(360px, 0.88fr) minmax(520px, 1.12fr);
  align-items: center;
  gap: 20px;
  min-height: 360px;
}

.page-hero-copy {
  padding: 42px;
}

.page-hero-copy h1 {
  margin: 0;
  color: var(--deep-blue);
  font-family: "Baloo 2", "Mitr", sans-serif;
  font-size: clamp(42px, 4vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}

.page-hero-copy p:not(.eyebrow) {
  margin: 16px 0 0;
  color: #33486b;
  font-size: 17px;
  line-height: 1.72;
}

.page-hero-media {
  align-self: stretch;
  min-height: 320px;
}

.page-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.topic-nav a,
.inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  color: var(--blue);
  background: #eff7ff;
  border: 1px solid #cfe6ff;
  border-radius: 999px;
  font-weight: 600;
}

.seo-text {
  padding-bottom: 28px;
}

.seo-text h2,
.content-block h2,
.info-card h2,
.article-card h2 {
  margin: 0 0 10px;
  color: var(--deep-blue);
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1.25;
}

.seo-text p,
.content-block p,
.content-block li,
.info-card p,
.article-card p {
  color: #42526f;
  line-height: 1.75;
}

.feature-grid,
.article-grid,
.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.info-card,
.article-card,
.content-block {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(25, 76, 146, 0.08);
}

.info-card,
.article-card {
  padding: 22px;
}

.article-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 14px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  width: min(1460px, calc(100% - 48px));
  margin: 24px auto 36px;
}

.content-block {
  padding: 28px;
}

.content-block h1 {
  margin: 0 0 14px;
  color: var(--deep-blue);
  font-family: "Baloo 2", "Mitr", sans-serif;
  font-size: clamp(38px, 4vw, 60px);
  line-height: 1.05;
}

.content-block h2 {
  margin-top: 24px;
}

.content-block ul,
.content-block ol {
  padding-left: 24px;
}

.side-nav {
  position: sticky;
  top: 106px;
  align-self: start;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(25, 76, 146, 0.08);
}

.side-nav b,
.side-nav a {
  display: block;
}

.side-nav b {
  color: var(--deep-blue);
  margin-bottom: 10px;
}

.side-nav a {
  padding: 8px 0;
  color: #42526f;
}

.contact-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.contact-item {
  padding: 18px;
  background: #eff7ff;
  border: 1px solid #cfe6ff;
  border-radius: 8px;
}

.contact-item b,
.contact-item span {
  display: block;
}

.contact-item b {
  color: var(--deep-blue);
  margin-bottom: 4px;
}

.faq-list details {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.faq-list summary {
  color: var(--deep-blue);
  cursor: pointer;
  font-weight: 600;
}

.faq-list p {
  margin-bottom: 0;
}

.policy-note {
  padding: 14px 16px;
  background: #fff8e6;
  border: 1px solid #ffe0a3;
  border-radius: 8px;
  color: #5e4a13;
}

.subject-grid-large,
.level-grid-large {
  align-items: stretch;
}

.subject-grid-large .subject-card,
.level-grid-large .level-card {
  min-height: 220px;
  padding: 20px;
}

.level-grid-large {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-body,
.app-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(235, 247, 255, 0.96)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(7, 88, 216, 0.035) 32px),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(7, 88, 216, 0.035) 32px);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(520px, 1fr);
  gap: 28px;
  width: min(1180px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 38px 0;
  align-items: center;
}

.auth-panel,
.auth-showcase,
.showcase-card,
.metric-card,
.workspace-section,
.online-viewer,
.progress-panel,
.smart-tools,
.purchase-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 34px;
}

.auth-logo img {
  width: 150px;
  padding: 8px;
  background: #ffffff;
  border-radius: 8px;
}

.auth-copy h1,
.app-topbar h1 {
  margin: 10px 0 0;
  color: var(--deep-blue);
  font-family: "Baloo 2", "Mitr", sans-serif;
  font-size: clamp(40px, 4vw, 62px);
  line-height: 1.02;
}

.auth-copy p:not(.eyebrow) {
  color: #42526f;
  line-height: 1.72;
}

.login-form {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.login-form label,
.check-row {
  color: #24395f;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #cfe0f4;
  border-radius: 8px;
  outline: 0;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.password-field button,
.auth-submit,
.icon-action,
.avatar-link {
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

.password-field button {
  padding: 0 16px;
  color: var(--blue);
  background: #eff7ff;
  border-radius: 8px;
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 8px;
  font-size: 14px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 16px;
  min-height: 16px;
}

.form-row a {
  color: var(--blue);
  font-weight: 600;
}

.auth-submit {
  min-height: 54px;
  color: #ffffff;
  background: linear-gradient(180deg, #0d6bed, #064fc5);
  border-radius: 999px;
  box-shadow: 0 12px 22px rgba(7, 88, 216, 0.25);
}

.auth-hint {
  margin: 8px 0 0;
  color: #61708f;
  font-size: 13px;
}

.auth-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.auth-benefits span {
  padding: 10px 12px;
  color: var(--deep-blue);
  background: #eff7ff;
  border: 1px solid #cfe6ff;
  border-radius: 8px;
  font-weight: 600;
}

.auth-showcase {
  padding: 18px;
}

.showcase-top {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--deep-blue);
  font-weight: 700;
  margin-bottom: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(88, 182, 43, 0.15);
}

.showcase-card {
  position: relative;
  overflow: hidden;
}

.showcase-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.showcase-overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  padding: 14px;
  color: #ffffff;
  background: rgba(7, 58, 150, 0.86);
  border-radius: 8px;
}

.showcase-overlay b,
.showcase-overlay span {
  display: block;
}

.showcase-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.showcase-stats div {
  padding: 14px;
  background: #eff7ff;
  border: 1px solid #cfe6ff;
  border-radius: 8px;
}

.showcase-stats b {
  display: block;
  color: var(--blue);
  font-family: "Baloo 2", sans-serif;
  font-size: 34px;
  line-height: 1;
}

.showcase-stats span {
  color: #42526f;
  font-size: 13px;
}

.app-body {
  display: grid;
  grid-template-columns: 268px 1fr;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.app-brand img {
  width: 148px;
  margin-bottom: 24px;
}

.app-nav {
  display: grid;
  gap: 10px;
}

.app-nav::-webkit-scrollbar {
  height: 7px;
}

.app-nav::-webkit-scrollbar-track {
  background: transparent;
}

.app-nav::-webkit-scrollbar-thumb {
  background: #b6d9fb;
  border: 0;
  border-radius: 999px;
}

.app-nav::-webkit-scrollbar-thumb:hover {
  background: #6eadf2;
}

.app-nav a,
.app-nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  color: #42526f;
  background: #ffffff;
  border: 1px solid #d9e9fb;
  border-radius: 8px;
  appearance: none;
  cursor: pointer;
  text-align: left;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(20, 78, 148, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.app-nav a::before,
.app-nav button::before {
  content: "";
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  background: #b7d8f8;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.app-nav a.active,
.app-nav a:hover,
.app-nav button.active,
.app-nav button:hover {
  color: var(--blue);
  background: #eff7ff;
  border-color: #b8d8ff;
  box-shadow: 0 10px 24px rgba(7, 88, 216, 0.12);
  transform: translateY(-1px);
}

.app-nav button.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0758d8, #0b72ff);
  border-color: #0758d8;
  box-shadow: 0 14px 26px rgba(7, 88, 216, 0.24);
}

.app-nav button.active::before {
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.app-nav a:last-child {
  margin-top: 6px;
  color: var(--deep-blue);
  background: #f7fbff;
}

.app-nav a:focus-visible,
.app-nav button:focus-visible,
.tile-actions button:focus-visible,
.tile-actions a:focus-visible,
.store-actions button:focus-visible,
.viewer-toolbar a:focus-visible {
  outline: 3px solid rgba(255, 201, 40, 0.85);
  outline-offset: 2px;
}

.dashboard-view[hidden] {
  display: none;
}

.purchase-card {
  margin-top: 24px;
  padding: 16px;
}

.purchase-card span,
.purchase-card small,
.metric-card span,
.metric-card small {
  display: block;
  color: #61708f;
}

.purchase-card b {
  display: block;
  color: var(--deep-blue);
  font-size: 22px;
}

.app-main {
  min-width: 0;
  padding: 24px;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.app-topbar .eyebrow {
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-search input {
  width: min(330px, 28vw);
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #cfe0f4;
  border-radius: 999px;
  outline: 0;
}

.icon-action,
.avatar-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--blue);
  background: #eff7ff;
  border-radius: 999px;
}

.icon-action {
  position: relative;
  border: 0;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.icon-action:hover {
  background: #e3f1ff;
  transform: translateY(-1px);
}

.icon-action::after {
  content: "";
  position: absolute;
  top: 9px;
  right: 11px;
  width: 8px;
  height: 8px;
  background: var(--orange);
  border: 2px solid #ffffff;
  border-radius: 999px;
}

.avatar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 0 16px;
  font-weight: 700;
  transition: background 0.18s ease, transform 0.18s ease;
}

.avatar-link:hover {
  background: #e3f1ff;
  transform: translateY(-1px);
}

.empty-state {
  margin: 12px 0 0;
  padding: 22px 18px;
  text-align: center;
  color: #61708f;
  font-weight: 600;
  background: #f4f8ff;
  border: 1px dashed #cfe0f4;
  border-radius: 8px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  padding: 18px;
}

.metric-card b {
  display: block;
  color: var(--blue);
  font-family: "Baloo 2", sans-serif;
  font-size: 44px;
  line-height: 1;
}

.metric-card.green b { color: var(--green); }
.metric-card.orange b { color: var(--orange); }
.metric-card.purple b { color: var(--purple); }

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
}

.workspace-layout.single-column {
  grid-template-columns: minmax(0, 1fr);
}

.workspace-layout.single-column .store-section {
  margin-top: 0;
}

.workspace-main[hidden],
.workspace-side[hidden] {
  display: none;
}

.workspace-section,
.online-viewer,
.progress-panel,
.smart-tools {
  padding: 18px;
}

.workspace-heading,
.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.workspace-heading h2,
.progress-panel h2,
.smart-tools h2 {
  margin: 0;
  color: var(--deep-blue);
  font-size: 24px;
}

.workspace-heading p {
  margin: 4px 0 0;
  color: #61708f;
}

.segmented-control {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: #eff7ff;
  border-radius: 999px;
}

.segmented-control button {
  min-height: 34px;
  padding: 0 12px;
  color: #42526f;
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.segmented-control button.active {
  color: #ffffff;
  background: var(--blue);
}

.worksheet-library {
  display: grid;
  gap: 12px;
}

.worksheet-tile {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.worksheet-tile img {
  width: 82px;
  height: 106px;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
  box-shadow: 0 8px 14px rgba(20, 50, 90, 0.13);
}

.worksheet-tile span {
  color: var(--blue);
  font-weight: 700;
}

.worksheet-tile h3 {
  margin: 4px 0;
  color: var(--ink);
  font-size: 20px;
}

.worksheet-tile p {
  margin: 0;
  color: #61708f;
}

.tile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tile-actions button,
.tile-actions a,
.viewer-toolbar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  color: var(--blue);
  background: #eff7ff;
  border: 1px solid #cfe6ff;
  border-radius: 8px;
  appearance: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(7, 88, 216, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.tile-actions button:hover,
.tile-actions a:hover,
.viewer-toolbar a:hover {
  background: #e3f1ff;
  border-color: #a8d2ff;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(7, 88, 216, 0.14);
}

.tile-actions button[data-preview],
.viewer-toolbar a {
  color: #ffffff;
  background: linear-gradient(135deg, #0758d8, #0b72ff);
  border-color: #0758d8;
}

.tile-actions button[data-favorite] {
  width: 38px;
  padding: 0;
}

.tile-actions button.active {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.store-section {
  margin-top: 18px;
}

.store-link {
  color: var(--blue);
  font-weight: 700;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

.store-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
  padding: 14px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.store-card.purchased {
  border-color: rgba(88, 182, 43, 0.62);
  box-shadow: 0 12px 26px rgba(88, 182, 43, 0.14);
}

.store-card img {
  width: 120px;
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  background: #eff7ff;
  box-shadow: 0 10px 18px rgba(20, 50, 90, 0.16);
}

.store-card > div {
  display: grid;
  gap: 8px;
  padding: 0;
  align-content: start;
}

.store-card span {
  color: var(--blue);
  font-weight: 700;
}

.store-card h3,
.store-card p {
  margin: 0;
}

.store-card h3 {
  color: var(--ink);
  font-size: 20px;
}

.store-card p {
  color: #61708f;
  line-height: 1.55;
}

.store-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.store-actions b {
  color: var(--orange);
  font-family: "Baloo 2", sans-serif;
  font-size: 28px;
}

.store-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  color: var(--blue);
  background: #eff7ff;
  border: 1px solid #cfe6ff;
  border-radius: 8px;
  appearance: none;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(7, 88, 216, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.store-actions button:hover {
  background: #e3f1ff;
  border-color: #a8d2ff;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(7, 88, 216, 0.14);
}

.store-actions button:first-of-type {
  color: #ffffff;
  background: linear-gradient(135deg, #0758d8, #0b72ff);
  border-color: var(--blue);
}

.store-actions button.active {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.viewer-toolbar span,
.viewer-toolbar b {
  display: block;
}

.viewer-toolbar span {
  color: #61708f;
  font-size: 13px;
}

.viewer-toolbar b {
  color: var(--deep-blue);
}

.viewer-frame {
  overflow: hidden;
  min-height: 460px;
  background: #f5f9ff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.viewer-frame iframe,
.preview-dialog iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #ffffff;
}

.viewer-frame iframe {
  display: block;
  min-height: 460px;
}

.viewer-note {
  margin: 10px 0 0;
  color: #61708f;
  font-size: 13px;
  line-height: 1.55;
}

.worksheet-page {
  min-height: 164px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.worksheet-page b {
  color: var(--deep-blue);
}

.mock-lines {
  height: 28px;
  margin: 12px 0;
  background: repeating-linear-gradient(180deg, transparent 0 8px, #d9e8f8 9px 10px);
}

.mock-exercise {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  color: #42526f;
  border-top: 1px dashed #cfe0f4;
}

.mock-exercise i {
  width: 44px;
  height: 24px;
  border: 2px solid #b8d5ef;
  border-radius: 6px;
}

.progress-panel,
.smart-tools {
  margin-top: 14px;
}

.progress-ring {
  display: grid;
  place-items: center;
  width: 130px;
  height: 130px;
  margin: 16px auto;
  background:
    radial-gradient(circle, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--green) 0 76%, #dbe7f6 76% 100%);
  border-radius: 50%;
}

.progress-ring span {
  color: var(--deep-blue);
  font-family: "Baloo 2", sans-serif;
  font-size: 34px;
  font-weight: 800;
}

.progress-panel p,
.smart-tools li {
  color: #42526f;
  line-height: 1.6;
}

.smart-tools ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.preview-modal[hidden] {
  display: none;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: block;
  padding: 0;
  background: #eef5ff;
}

.preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

.preview-dialog-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(18, 32, 66, 0.08);
  backdrop-filter: blur(14px);
}

.preview-dialog-bar span,
.preview-dialog-bar b {
  display: block;
}

.preview-dialog-bar span {
  color: #61708f;
  font-size: 13px;
}

.preview-dialog-bar b {
  color: var(--deep-blue);
  font-size: 20px;
}

.reader-heading {
  min-width: 0;
}

.reader-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  color: #ffffff;
  background: var(--blue);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.preview-dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-dialog-actions a,
.preview-dialog-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  color: var(--blue);
  background: #eff7ff;
  border: 1px solid #cfe6ff;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.preview-dialog-actions a:last-child {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.reader-mobile-note {
  display: none;
}

.preview-dialog iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #f7fbff;
}

@media (max-width: 1180px) {
  .auth-shell {
    grid-template-columns: 1fr;
    width: min(760px, calc(100% - 40px));
  }

  .app-body {
    display: block;
  }

  .app-sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .app-brand img {
    width: 124px;
    margin-bottom: 0;
  }

  .app-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px;
    background: #f2f8ff;
    border: 1px solid #d7e9fb;
    border-radius: 8px;
    scroll-snap-type: x mandatory;
  }

  .app-nav a,
  .app-nav button {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
    scroll-snap-align: start;
    padding: 10px 14px;
    text-align: center;
  }

  .purchase-card {
    margin-top: 0;
  }

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

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .workspace-side {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 14px;
  }

  .app-body[data-dashboard-view="viewer"] .workspace-side,
  .app-body[data-dashboard-view="downloads"] .workspace-side {
    display: block;
  }

  .workspace-side .online-viewer {
    grid-row: span 2;
  }

  .store-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .progress-panel,
  .smart-tools {
    margin-top: 0;
  }
}

@media (max-width: 860px) {
  .auth-shell {
    padding: 24px 0;
  }

  .auth-panel,
  .auth-showcase {
    padding: 22px;
  }

  .auth-copy h1,
  .app-topbar h1 {
    font-size: 42px;
  }

  .app-sidebar {
    grid-template-columns: 1fr;
    align-items: start;
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
  }

  .app-nav {
    width: 100%;
  }

  .app-nav button.active {
    box-shadow: none;
  }

  .purchase-card {
    display: none;
  }

  .app-topbar {
    display: grid;
    align-items: start;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .app-search {
    flex: 1 1 100%;
  }

  .app-search input {
    width: 100%;
  }

  .workspace-heading,
  .viewer-toolbar {
    display: grid;
    align-items: start;
  }

  .segmented-control {
    overflow-x: auto;
    border-radius: 8px;
  }

  .segmented-control button {
    white-space: nowrap;
  }

  .worksheet-tile {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .worksheet-tile img {
    width: 76px;
    height: 98px;
  }

  .tile-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .workspace-side {
    grid-template-columns: 1fr;
  }

  .workspace-side .online-viewer {
    grid-row: auto;
  }

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

  .preview-dialog-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .preview-dialog-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .preview-dialog-actions a,
  .preview-dialog-actions button {
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {
  .auth-shell {
    width: min(100% - 24px, 420px);
  }

  .auth-panel,
  .auth-showcase,
  .workspace-section,
  .online-viewer,
  .progress-panel,
  .smart-tools {
    padding: 16px;
  }

  .auth-copy h1,
  .app-topbar h1 {
    font-size: 36px;
  }

  .password-field,
  .form-row,
  .showcase-stats,
  .auth-benefits,
  .app-grid,
  .store-actions {
    grid-template-columns: 1fr;
  }

  .password-field button {
    min-height: 42px;
  }

  .form-row {
    display: grid;
  }

  .app-main {
    padding: 14px;
  }

  .metric-card b {
    font-size: 36px;
  }

  .worksheet-tile {
    grid-template-columns: 70px minmax(0, 1fr);
    gap: 10px;
  }

  .worksheet-tile img {
    width: 70px;
    height: 92px;
  }

  .worksheet-tile h3 {
    font-size: 18px;
  }

  .tile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tile-actions button,
  .tile-actions a,
  .viewer-toolbar a {
    width: 100%;
  }

  .viewer-frame {
    min-height: 360px;
  }

  .viewer-frame iframe {
    min-height: 360px;
  }

  .preview-dialog-actions {
    display: none;
  }

  .preview-dialog-bar {
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 58px;
    padding: 8px 10px;
  }

  .reader-back {
    min-height: 40px;
    padding: 0 12px;
  }

  .reader-mobile-note {
    display: block;
    padding: 10px 14px;
    color: #42526f;
    background: #fff8e6;
    border-bottom: 1px solid #ffe0a3;
    font-size: 13px;
    line-height: 1.5;
  }

  .preview-dialog iframe {
    min-height: calc(100vh - 118px);
  }

  .progress-ring {
    width: 112px;
    height: 112px;
  }
}

@media (max-width: 1280px) {
  .header-inner {
    grid-template-columns: auto auto 1fr;
  }

  .brand img {
    width: 122px;
  }

  .main-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .main-nav a {
    padding: 2px 0 10px;
  }

  .main-nav a::after {
    bottom: 3px;
  }

  .header-actions {
    justify-self: end;
  }

  .hero-inner {
    grid-template-columns: minmax(360px, 0.95fr) minmax(440px, 1.05fr);
  }

  .hero-visual {
    margin-right: -120px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-inner {
    grid-template-columns: 1.3fr 1fr 1fr;
  }

  .newsletter {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  .header-inner,
  .hero-inner,
  .section,
  .breadcrumbs,
  .page-hero,
  .content-layout,
  .benefit-inner,
  .footer-inner,
  .copyright {
    width: min(100% - 32px, 760px);
  }

  .header-inner {
    grid-template-columns: auto 1fr auto;
    min-height: 74px;
  }

  .brand img {
    width: 118px;
  }

  .menu-button {
    display: grid;
    justify-self: end;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
  }

  .menu-button span {
    display: block;
    height: 3px;
    background: var(--blue);
    border-radius: 999px;
  }

  .main-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 74px;
    display: none;
    grid-column: auto;
    order: initial;
    max-height: calc(100vh - 90px);
    padding: 10px;
    overflow: auto;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }

  .main-nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
  }

  .main-nav a::after {
    display: none;
  }

  .main-nav a.active {
    background: #eef7ff;
  }

  .nav-toggle:checked ~ .main-nav {
    display: grid;
  }

  .header-actions {
    display: none;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-copy {
    padding: 38px 0 0;
  }

  .hero h1 {
    font-size: clamp(44px, 13vw, 68px);
  }

  .hero-lead {
    font-size: 16px;
  }

  .hero-tags {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-tags span {
    min-width: 0;
  }

  .hero-visual {
    margin: 0 -90px 0 -180px;
  }

  .hero-visual img {
    width: 1080px;
    max-width: none;
  }

  .grade-badge {
    right: 2px;
    bottom: 28px;
    width: 150px;
    min-height: 104px;
    padding: 12px;
  }

  .grade-badge strong {
    font-size: 32px;
  }

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

  .subject-grid .subject-card:last-child {
    grid-column: 1 / -1;
  }

  .level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .benefit-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .benefit-item {
    padding: 12px;
    border: 1px dashed #9ed3f5;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.56);
  }

  .page-hero-inner,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .page-hero-copy {
    padding: 30px;
  }

  .page-hero-media {
    min-height: 260px;
  }

  .feature-grid,
  .article-grid,
  .policy-grid,
  .contact-panel,
  .level-grid-large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-nav {
    position: static;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .hero-inner,
  .section,
  .breadcrumbs,
  .page-hero,
  .content-layout,
  .benefit-inner,
  .footer-inner,
  .copyright {
    width: min(100% - 24px, 560px);
  }

  .hero-copy {
    padding-top: 28px;
  }

  .eyebrow {
    font-size: 13px;
  }

  .hero h1 {
    font-size: clamp(38px, 15vw, 58px);
  }

  .hero-tags {
    grid-template-columns: 1fr;
  }

  .hero-tags span {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .primary-button {
    width: 100%;
    min-width: 0;
  }

  .start-price {
    width: 100%;
    text-align: center;
  }

  .hero-visual {
    margin: 0 -105px 0 -260px;
  }

  .hero-visual img {
    width: 960px;
  }

  .grade-badge {
    right: 0;
    bottom: 18px;
    width: 132px;
    min-height: 92px;
    border-width: 4px;
  }

  .grade-badge span {
    font-size: 13px;
  }

  .grade-badge strong {
    font-size: 28px;
  }

  .star-a,
  .star-b,
  .star-c {
    display: none;
  }

  .section {
    padding-top: 20px;
  }

  .section-heading {
    align-items: flex-end;
  }

  .section-heading h2 {
    font-size: 22px;
  }

  .subject-grid,
  .level-grid,
  .product-grid,
  .feature-grid,
  .article-grid,
  .policy-grid,
  .contact-panel,
  .level-grid-large,
  .benefit-inner,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .subject-grid .subject-card:last-child {
    grid-column: auto;
  }

  .level-card {
    min-height: 148px;
  }

  .product-card {
    grid-template-columns: 96px 1fr;
  }

  .product-card img {
    width: 96px;
    height: 128px;
  }

  .benefits {
    margin-top: 22px;
  }

  .newsletter {
    grid-column: auto;
  }

  .page-hero-copy,
  .content-block,
  .info-card,
  .article-card {
    padding: 20px;
  }

  .page-hero-copy h1,
  .content-block h1 {
    font-size: 38px;
  }
}

@media (max-width: 430px) {
  .brand img {
    width: 104px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero-lead {
    line-height: 1.6;
  }

  .hero-visual {
    margin-left: -310px;
    margin-right: -120px;
  }

  .grade-badge {
    bottom: 10px;
  }

  .product-info h3 {
    font-size: 15px;
  }

  .footer-inner {
    gap: 24px;
  }

  .newsletter div {
    display: grid;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
  }

  .newsletter input {
    min-height: 42px;
  }
}
