/* Shared layout for both themes; Classic overrides only the quieter visual treatment. */
.design-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 2px; padding: 3px; border: 1px solid #d7dfeb; border-radius: 12px; background: #edf1f6; }
.design-toggle[hidden] { display: none; }
.design-toggle button { display: grid; place-items: center; width: 36px; min-height: 36px; padding: 7px; border: 0; border-radius: 8px; background: transparent; color: #68778c; cursor: pointer; }
.design-toggle button[aria-pressed="true"] { background: #fff; color: #244e91; box-shadow: 0 1px 4px #14294615; }
.design-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.design-toggle button:focus-visible { outline: 3px solid #4279d2; outline-offset: 3px; }
html[data-design] { --ink: #202b40; --muted: #58677d; --navy-800: #243b59; --blue-700: #245dc1; --line: #dde5ef; scroll-padding-top: 130px; }
[data-design] body { background: #f4f6fa; font-family: "Inter", "Segoe UI", system-ui, sans-serif; line-height: 1.65; }
[data-design] .container { width: min(1360px, calc(100% - 64px)); }
[data-design] .design-toolbar { background: #f4f6fa; }
[data-design] .design-toggle { border-color: #d8e0eb; background: #e7ecf3; }
[data-design] .design-toggle button { color: #58677d; }
[data-design] .design-toggle button[aria-pressed="true"] { color: #174998; }
[data-design] .site-header { background: #fffffffa; color: var(--ink); border-bottom: 1px solid #e1e7f0; box-shadow: 0 4px 24px #182d4e08; }
[data-design] .site-header__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 28px; padding: 16px 0; min-height: 84px; }
[data-design] .site-header .brand { flex: 1 1 280px; max-width: 460px; }
[data-design] .brand__title { color: inherit; font-family: inherit; font-weight: 750; font-size: 1.1rem; letter-spacing: -.03em; line-height: 1.35; }
[data-design] .brand__tagline { color: var(--muted); font-size: .8rem; }
[data-design] .brand__mark { border: 1px solid #cbd9eb; border-radius: 14px; background: #edf3fc; color: #245dc1; }
[data-design] .category-tabs { flex-wrap: wrap; gap: 6px; width: auto; padding: 0; }
[data-design] .category-tab { padding: 9px 13px; border-radius: 10px; color: #31435f; background: #f3f6fa; font-size: .875rem; }
[data-design] .main-nav { gap: 20px; width: auto; padding: 0; flex-wrap: wrap; }
[data-design] .main-nav a { color: #364965; font-size: .875rem; }
[data-design] .hero { background: radial-gradient(ellipse at 85% 30%, #dbe8ff 0, transparent 55%), linear-gradient(120deg, #f9fafc, #ecf1f9); color: var(--ink); border-bottom: 1px solid #dfe7f1; }
[data-design] .hero::before { background: radial-gradient(ellipse at 15% 100%, #f4e6cd55, transparent 50%); }
[data-design] .hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(32px, 5vw, 76px); padding: 64px 0 72px; min-height: 570px; }
[data-design] .hero__intro { min-width: 0; }
[data-design] .eyebrow { display: inline-block; padding: 6px 12px; border: 1px solid #cbd9ee; border-radius: 7px; color: #355b89; background: #ffffff90; font-size: .78rem; letter-spacing: .06em; margin-bottom: 24px; }
[data-design] h1 { font-family: inherit; font-size: clamp(2.5rem, 4.4vw, 4.4rem); line-height: 1.1; font-weight: 780; letter-spacing: -.045em; margin-bottom: 26px; text-wrap: balance; }
[data-design] .hero__description { font-family: inherit; font-size: 1.08rem; line-height: 1.8; color: #53627a; }
[data-design] .hero-features { gap: 16px; padding-top: 30px; }
[data-design] .hero-features li { color: #445570; font-size: .85rem; font-weight: 600; }
[data-design] .hero-features__icon { width: 36px; height: 36px; border: 1px solid #d0dded; border-radius: 10px; background: #fff9; color: #315b93; }
[data-design] .book-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: stretch; }
[data-design] .book-card { min-width: 0; padding: 20px 16px 16px; gap: 22px; grid-template-rows: auto 1fr; border: 1px solid #fff; border-radius: 20px; background: linear-gradient(150deg, #ffffffeb, #ffffff88); box-shadow: 0 24px 45px -24px #355b8960, 0 2px 5px #355b8908; transform: none; transition: transform 200ms ease, box-shadow 200ms ease; }
[data-design] .book-card__visual { min-height: 0; padding: 8px 12px 0; perspective: 1000px; align-items: center; }
[data-design] .book-card__image, [data-design] .book-card__placeholder { width: min(100%, 220px); height: auto; aspect-ratio: auto; object-fit: contain; border-radius: 3px 6px 6px 3px; box-shadow: 9px 12px 16px #1e365c30, 2px 2px 2px #1e365c20; transform: rotateY(-8deg) rotateZ(-2deg); }
[data-design] .book-card__placeholder { min-height: 240px; }
[data-design] .book-card:nth-child(even) .book-card__image { transform: rotateY(8deg) rotateZ(2deg); }
[data-design] .book-card__caption { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; text-align: left; justify-items: stretch; align-content: start; }
[data-design] .book-card__caption h2 { font-size: 1rem; line-height: 1.45; font-weight: 750; }
[data-design] .book-card__caption .rich-text { color: #58677d; font-size: .85rem; }
[data-design] .button { border-radius: 10px; min-height: 48px; font-weight: 650; background: linear-gradient(120deg, #275fc0, #224d99); border-color: #2457ad; box-shadow: 0 4px 10px #2457ad15; transition: background 150ms ease, box-shadow 150ms ease; }
[data-design] .button--secondary, [data-design] .button--ghost { background: #fff; color: #2455a0; border-color: #cbd8ec; box-shadow: none; }
[data-design] .button--ghost { width: 100%; font-size: .85rem; }
[data-design] .quiz { padding: 36px 0 24px; background: #f4f6fa; }
[data-design] .quiz-panel { grid-template-columns: minmax(220px, .35fr) minmax(0, 1fr); gap: 24px 36px; padding: 32px; border: 1px solid #dee5ef; border-radius: 20px; box-shadow: 0 12px 40px -20px #294c8038; }
[data-design] .quiz-panel__controls { grid-row: 1 / 3; min-width: 0; padding-right: 28px; padding-bottom: 0; border-bottom: 0; }
[data-design] .quiz-panel__question { min-width: 0; }
[data-design] .quiz-panel__controls h2 { font-size: 1.3rem; letter-spacing: -.025em; }
[data-design] .quiz-panel__question h3 { font-size: 1.125rem; line-height: 1.65; margin-bottom: 20px; }
[data-design] .quiz-panel__actions { grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
[data-design] .form-select { min-height: 48px; border-radius: 10px; font-size: 16px; }
[data-design] .quiz-stats { padding: 16px; border-radius: 12px; background: #f6f8fc; }
[data-design] .quiz-stats__reset { min-height: 44px; }
[data-design] .choices { gap: 10px; }
[data-design] .choice { padding: 13px 16px; border-radius: 12px; min-height: 56px; }
[data-design] .choice__marker { width: 32px; height: 32px; border-radius: 9px; }
[data-design] .quiz-explanation { padding: 18px; border-radius: 12px; }
[data-design] .quiz-recommendation { border-color: #cfdbeb; border-radius: 18px; max-height: calc(100dvh - 48px); overflow-y: auto; }
[data-design] .quiz-recommendation__close, [data-design] .report-modal__close { width: 44px; height: 44px; flex-shrink: 0; }
[data-design] .quiz-recommendation h2, [data-design] .quiz-recommendation__top { padding-right: 40px; }
[data-design] .report-modal, [data-design] .report-modal__panel { border-radius: 18px; }
[data-design] .report-modal__textarea { font-size: 16px; }
[data-design] .info { background: #f4f6fa; padding: 0 0 32px; }
[data-design] .info-grid { gap: 18px; }
[data-design] .info-card { border-radius: 16px; border-color: #dfe6f0; box-shadow: 0 8px 22px -16px #294c8040; }
[data-design] .info-card__body { padding: 24px; }
[data-design] .info-card__icon, [data-design] .faq__icon { background: #edf2fb; color: #315b93; border-radius: 10px; }
[data-design] .faq { background: #f4f6fa; padding: 0 0 48px; }
[data-design] .faq__inner { grid-template-columns: minmax(160px, .3fr) minmax(0, 1fr); padding: 28px; gap: 28px; border-radius: 18px; box-shadow: none; }
[data-design] .faq__title { align-self: start; }
[data-design] .faq__items { grid-template-columns: 1fr; gap: 0; }
[data-design] .faq-item { border-left: 0; border-bottom: 1px solid var(--line); }
[data-design] .faq-item:last-child { border-bottom: 0; }
[data-design] .faq-item summary { padding: 16px 0; }
[data-design] .faq-item .rich-text { padding: 0 0 18px; }
[data-design] .site-footer { background: #18273e; border-top: 0; }
[data-design] .site-footer__inner { padding: 30px 0; }
[data-design] .site-footer .brand__tagline { color: #b5c2d5; }
[data-design] :focus-visible { outline: 3px solid #4279d2; outline-offset: 4px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  [data-design] .book-card:hover { transform: translateY(-5px); box-shadow: 0 28px 48px -24px #355b8980; }
  [data-design] .button:hover:not(:disabled) { box-shadow: 0 5px 18px #2457ad30; }
  [data-design] .main-nav a:hover { color: #245dc1; }
  [data-design] .category-tab:hover { background: #e6eefb; }
}
@media (max-width: 1100px) {
  [data-design] .hero__grid { gap: 28px; padding: 44px 0; }
  [data-design] .book-stage { gap: 12px; }
  [data-design] .book-card { padding: 16px 12px; }
  [data-design] .quiz-panel__controls { border-right: 1px solid var(--line); }
  [data-design] .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  html[data-design] { scroll-padding-top: 20px; }
  [data-design] .container { width: calc(100% - 32px); }
  [data-design] .site-header { position: relative; }
  [data-design] .site-header__inner { gap: 16px; }
  [data-design] .category-tabs { width: 100%; }
  [data-design] .hero__grid { grid-template-columns: 1fr; gap: 36px; }
  [data-design] .hero__intro { max-width: 650px; }
  [data-design] h1 { font-size: clamp(2.35rem, 7vw, 3.75rem); }
  [data-design] .hero-features { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-design] .book-stage { gap: 16px; }
  [data-design] .quiz-panel { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
  [data-design] .quiz-panel__controls { grid-row: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 0 0 24px; }
  [data-design] .quiz-panel__actions { grid-column: auto; }
  [data-design] .faq__inner { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 480px) {
  [data-design] .category-tab { padding: 8px 10px; font-size: .8rem; white-space: normal; }
  [data-design] .main-nav { gap: 12px 20px; }
  [data-design] .hero__grid { padding: 32px 0; }
  [data-design] .hero__description { font-size: 1rem; }
  [data-design] .hero-features { gap: 12px; }
  [data-design] .hero-features li { font-size: .78rem; }
  [data-design] .book-stage { grid-template-columns: 1fr; }
  [data-design] .book-card { grid-template-columns: minmax(80px, .65fr) minmax(0, 1fr); grid-template-rows: auto; gap: 18px; padding: 18px; align-items: center; }
  [data-design] .book-card__visual { padding: 0; }
  [data-design] .book-card__caption h2 { font-size: .9rem; }
  [data-design] .book-card__caption .rich-text { font-size: .8rem; }
  [data-design] .book-card .book-card__image { transform: none; }
  [data-design] .quiz { padding-top: 20px; }
  [data-design] .quiz-panel { padding: 18px; border-radius: 16px; }
  [data-design] .choice { padding: 12px; gap: 8px; }
  [data-design] .quiz-panel__actions, [data-design] .info-grid { grid-template-columns: 1fr; }
  [data-design] .info-card { min-height: auto; }
  [data-design] .faq__inner { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-design] { scroll-behavior: auto; }
  [data-design] *, [data-design] *::before, [data-design] *::after { animation: none !important; transition: none !important; }
}

/* Small header control replaces the separate theme toolbar. */
[data-design] .site-header .brand { margin-right: auto; }
[data-design] .site-header .design-toggle { margin: 0; }
[data-design] .site-header .design-toggle button { padding: 7px; }
[data-design] .quiz-panel__question h3:empty,
[data-design] .quiz-subject:empty { display: none; }
.quiz-initial-extra { display: none; }
[data-design] .quiz-panel:has([data-subject-select] option[value=""]:checked) .quiz-panel__question {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 260px; padding: 32px; background: #f5f8fd; border: 1px solid #e5ebf4; border-radius: 14px;
}
[data-design] .quiz-panel:has([data-subject-select] option[value=""]:checked) .empty-state { color: var(--ink); font-weight: 650; font-size: 1.12rem; }
[data-design] .quiz-panel:has([data-subject-select] option[value=""]:checked) .quiz-initial-extra { display: block; margin-top: 22px; max-width: 100%; }
.quiz-initial-extra p { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.quiz-telegram { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; padding: 12px 16px; border: 1px solid #cbdff2; border-radius: 12px; background: #fff; color: #226191; font-weight: 650; font-size: .95rem; text-decoration: none; }
.quiz-telegram svg { width: 30px; height: 30px; flex: 0 0 30px; fill: #278fc2; }
[data-design="classic"] body { background: #f5f6f8; }
[data-design="classic"] .hero { background: #eef1f5; color: #26354c; border-bottom-color: #dce2ea; }
[data-design="classic"] .hero::before { display: none; }
[data-design="classic"] h1 { font-weight: 700; letter-spacing: -.035em; }
[data-design="classic"] .site-header { background: #fff; box-shadow: none; }
[data-design="classic"] .eyebrow { background: #f8f9fb; border-color: #d7dfe9; color: #56677e; letter-spacing: .035em; }
[data-design="classic"] .book-stage { perspective: none; }
[data-design="classic"] .book-card { background: #fff; border-color: #dbe1e9; border-radius: 14px; box-shadow: 0 3px 12px #26354c08; transform: none; transition: none; }
[data-design="classic"] .book-card:hover { transform: none; box-shadow: 0 3px 12px #26354c08; }
[data-design="classic"] .book-card .book-card__image { transform: none; box-shadow: 0 5px 12px #25374f15; }
[data-design="classic"] .button { background: #34567e; border-color: #34567e; box-shadow: none; }
[data-design="classic"] .button--secondary,
[data-design="classic"] .button--ghost { background: #fff; color: #34567e; border-color: #cbd5e2; }
[data-design="classic"] .quiz,
[data-design="classic"] .info,
[data-design="classic"] .faq { background: #f5f6f8; }
[data-design="classic"] .quiz-panel,
[data-design="classic"] .info-card,
[data-design="classic"] .faq__inner { box-shadow: none; border-color: #dbe1e9; }
[data-design="classic"] .quiz-panel:has([data-subject-select] option[value=""]:checked) .quiz-panel__question { background: #f7f8fa; }
[data-design="classic"] .quiz-stats { background: #f7f8fa; }
[data-design="classic"] .site-footer { background: #28394f; }
@media (max-width: 900px) {
  [data-design] .site-header__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; }
  [data-design] .site-header .brand { max-width: none; margin: 0; }
  [data-design] .site-header .design-toggle { grid-column: 2; grid-row: 1; }
  [data-design] .site-header .main-nav,
  [data-design] .site-header .category-tabs { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  [data-design] .site-header .brand { gap: 10px; }
  [data-design] .site-header .brand__logo,
  [data-design] .site-header .brand__mark { width: 40px; height: 40px; flex-basis: 40px; }
  [data-design] .site-header .brand__title { font-size: .87rem; }
  [data-design] .site-header .brand__tagline { font-size: .72rem; }
  [data-design] .quiz-panel:has([data-subject-select] option[value=""]:checked) .quiz-panel__question { padding: 22px 18px; min-height: 260px; }
  .quiz-telegram { padding: 12px; font-size: .87rem; }
}
@media (pointer: coarse) { .design-toggle button { min-height: 40px; width: 40px; } }
