:root {
    --paper: #FFF8F2;
    --deep: #FFFFFF;
    --surface: #FFFFFF;
    --soft: #F3EBE3;
    --ink: #1A1230;
    --text: #2C2440;
    --muted: #5A5270;
    --quiet: #8A8298;
    --magenta: #E11D8F;
    --indigo: #6366F1;
    --cyan: #0891B2;
    --amber: #D97706;
    --mint: #059669;
    --line: rgba(26,18,48,0.10);
    --shadow: 0 14px 34px rgba(26,18,48,0.08);
    --radius: 20px;
    --max: 1160px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--paper);
}

body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 10% 0%, rgba(225,29,143,0.045), transparent 26rem),
        radial-gradient(circle at 100% 20%, rgba(99,102,241,0.055), transparent 30rem),
        var(--paper);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.8;
    padding-top: 118px;
}

body.modal-open {
    overflow: hidden;
}

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

a, button, input {
    -webkit-tap-highlight-color: transparent;
}

button, input {
    font: inherit;
}

button {
    color: inherit;
}

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

.skip-link {
    position: fixed;
    left: 12px;
    top: -80px;
    z-index: 1300;
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    border-radius: 12px;
    transition: top .2s ease;
}

.skip-link:focus {
    top: 8px;
}

.masthead {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 800;
    height: 72px;
    background: rgba(255,248,242,.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}

.masthead-inner,
.chapter-strip-inner,
.site-main > *,
.footer-inner {
    width: min(calc(100% - 32px), var(--max));
    margin-left: auto;
    margin-right: auto;
}

.masthead-inner {
    height: 72px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
}

.square-action,
.close-action {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    box-shadow: 0 7px 18px rgba(26,18,48,.05);
}

.square-action {
    justify-self: start;
    font-size: 21px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    color: var(--ink);
    font-weight: 900;
    letter-spacing: .08em;
}

.brand-logo {
    max-height: 38px;
    width: auto;
}

.brand-text {
    font-size: 22px;
}

.masthead-actions {
    justify-self: end;
    display: flex;
    gap: 10px;
    align-items: center;
}

.app-link,
.primary-link,
.secondary-link,
.inline-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0 18px;
    font-weight: 750;
}

.app-link,
.primary-link {
    color: #fff;
    background: linear-gradient(135deg,#6366F1 0%,#E11D8F 55%,#D97706 100%);
    box-shadow: 0 10px 24px rgba(99,102,241,.18);
}

.secondary-link {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
}

.inline-link {
    padding: 0;
    min-height: 32px;
    color: var(--indigo);
}

.app-link:hover,
.primary-link:hover,
.secondary-link:hover,
.square-action:hover,
.close-action:hover,
.chapter-strip a:hover,
.mobile-bottom-nav a:hover {
    transform: translateY(-1px);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(225,29,143,.28);
    outline-offset: 3px;
}

.chapter-strip {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    z-index: 760;
    height: 46px;
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid var(--line);
}

.chapter-strip-inner {
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: clamp(22px, 4.5vw, 58px);
}

.chapter-strip a {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    transition: color .2s ease, transform .2s ease;
}

.chapter-strip a::after {
    content: "";
    position: absolute;
    left: 16%;
    right: 16%;
    bottom: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: transparent;
}

.chapter-strip a.is-active {
    color: var(--ink);
}

.chapter-strip a.is-active::after {
    background: var(--magenta);
}

.site-main {
    min-height: 70vh;
}

.page-shell,
.hero,
.home-section {
    padding-top: 46px;
    padding-bottom: 46px;
}

.page-shell {
    padding-top: 52px;
}

.page-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 36px;
    align-items: end;
    margin-bottom: 30px;
}

.eyebrow,
.kicker,
.card-number,
.timeline-status {
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.eyebrow,
.kicker {
    color: var(--magenta);
}

.page-head h1,
.hero h1 {
    margin: 8px 0 14px;
    color: var(--ink);
    line-height: 1.18;
    letter-spacing: -.035em;
    font-size: clamp(28px, 4vw, 34px);
}

.page-head p,
.hero p {
    margin: 0;
    color: var(--muted);
}

.page-head-note {
    border-left: 4px solid var(--amber);
    background: rgba(217,119,6,.07);
    border-radius: 0 16px 16px 0;
    padding: 18px 20px;
    color: var(--text);
}

.hero {
    min-height: 520px;
    display: grid;
    grid-template-columns: 1.02fr .98fr;
    gap: 46px;
    align-items: center;
}

.hero-copy {
    position: relative;
    padding-left: 48px;
}

.hero-vertical {
    position: absolute;
    left: 0;
    top: 6px;
    writing-mode: vertical-rl;
    color: var(--magenta);
    font-weight: 850;
    letter-spacing: .2em;
    font-size: 13px;
}

.hero h1 {
    font-size: clamp(31px, 4.6vw, 50px);
    max-width: 9.5em;
}

.hero-copy > p {
    max-width: 42em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.hero-visual {
    min-height: 260px;
    border-radius: 22px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(99,102,241,.16), rgba(225,29,143,.12) 50%, rgba(217,119,6,.16)),
        #fff;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    display: grid;
    place-items: center;
}

.hero-visual img {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
}

.image-slot {
    min-height: 220px;
    width: 100%;
    background:
        linear-gradient(135deg, rgba(99,102,241,.08), rgba(225,29,143,.06) 55%, rgba(8,145,178,.08)),
        repeating-linear-gradient(90deg, transparent 0 23px, rgba(26,18,48,.025) 23px 24px),
        #fff;
    border: 1px dashed rgba(26,18,48,.12);
}

.section-image {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 18px;
}

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

.section-heading h2 {
    margin: 4px 0 0;
    color: var(--ink);
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.25;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    max-width: 42em;
}

.paper-panel,
.content-card,
.step-card,
.index-row,
.faq-item,
.note-panel,
.policy-block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.paper-panel {
    padding: clamp(22px, 4vw, 38px);
}

.topic-tags {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.topic-tag {
    min-height: 148px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topic-tag .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tag-color, var(--magenta));
}

.topic-tag strong {
    color: var(--ink);
    font-size: 18px;
}

.topic-tag span {
    color: var(--muted);
    font-size: 14px;
}

.topic-tag a {
    margin-top: auto;
    color: var(--indigo);
    font-weight: 750;
}

.editorial-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(260px, .95fr);
    gap: 28px;
    align-items: stretch;
}

.editorial-copy {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chapter-list {
    display: grid;
    gap: 10px;
}

.chapter-list a {
    min-height: 58px;
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.chapter-list b {
    color: var(--magenta);
    font-size: 18px;
}

.chapter-list strong {
    color: var(--ink);
}

.chapter-list span {
    color: var(--quiet);
}

.masonry-three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.content-card {
    overflow: hidden;
    padding: 0;
}

.content-card:nth-child(2) {
    margin-top: 28px;
}

.card-copy {
    padding: 22px;
}

.card-copy h3,
.step-card h3,
.policy-block h2,
.note-panel h2,
.index-row h2,
.index-row h3 {
    margin: 0 0 10px;
    color: var(--ink);
}

.card-copy p,
.step-card p,
.policy-block p,
.note-panel p,
.index-row p {
    margin: 0;
    color: var(--muted);
}

.card-copy a {
    display: inline-flex;
    margin-top: 16px;
    color: var(--indigo);
    font-weight: 750;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.step-card {
    padding: 20px;
    box-shadow: none;
}

.step-card .card-number {
    color: var(--indigo);
    display: block;
    margin-bottom: 14px;
}

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

.theme-card {
    min-height: 170px;
    border-radius: 18px;
    padding: 18px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.theme-card:nth-child(1),
.theme-card:nth-child(4) {
    grid-column: span 2;
    min-height: 220px;
}

.theme-card:nth-child(2),
.theme-card:nth-child(3),
.theme-card:nth-child(5),
.theme-card:nth-child(6) {
    grid-column: span 2;
}

.theme-card strong {
    font-size: 20px;
}

.theme-card p {
    margin: 10px 0 0;
    color: rgba(255,255,255,.9);
}

.theme-card a {
    margin-top: 18px;
    font-weight: 800;
}

.bg-magenta { background: linear-gradient(145deg, #E11D8F, #A91875); }
.bg-indigo { background: linear-gradient(145deg, #6366F1, #4F46E5); }
.bg-cyan { background: linear-gradient(145deg, #0891B2, #0E7490); }
.bg-amber { background: linear-gradient(145deg, #D97706, #B45309); }
.bg-mint { background: linear-gradient(145deg, #059669, #047857); }
.bg-ink { background: linear-gradient(145deg, #2C2440, #1A1230); }

.shelf-list {
    display: grid;
    gap: 14px;
}

.shelf-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.shelf-row .shelf-mark {
    width: 56px;
    height: 70px;
    border-radius: 12px 5px 5px 12px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(160deg, var(--indigo), var(--magenta));
}

.shelf-row h3,
.rank-row h3 {
    margin: 0 0 6px;
    color: var(--ink);
}

.shelf-row p,
.rank-row p {
    margin: 0;
    color: var(--muted);
}

.shelf-row > a {
    color: var(--indigo);
    font-weight: 800;
}

.rank-list {
    display: grid;
    gap: 16px;
}

.rank-row {
    display: grid;
    grid-template-columns: 104px 1fr auto;
    gap: 20px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.rank-row:last-child {
    border-bottom: 0;
}

.rank-number {
    font-size: clamp(40px, 7vw, 72px);
    line-height: .9;
    font-weight: 950;
    letter-spacing: -.06em;
    color: var(--rank-color, var(--magenta));
}

.timeline {
    position: relative;
    margin-left: 14px;
    padding-left: 36px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(var(--magenta), var(--indigo), var(--cyan), var(--mint));
}

.timeline-item {
    position: relative;
    padding: 0 0 30px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -36px;
    top: 9px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--indigo);
}

.timeline-item h3 {
    margin: 4px 0 8px;
    color: var(--ink);
}

.timeline-item p {
    margin: 0;
    color: var(--muted);
}

.timeline-status {
    color: var(--magenta);
}

.app-panel {
    display: grid;
    grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr);
    gap: 30px;
    align-items: center;
}

.app-copy h2 {
    margin-top: 0;
    color: var(--ink);
    font-size: clamp(26px, 3vw, 34px);
}

.app-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.app-badges span {
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--ink);
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 750;
}

.split-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.note-panel {
    padding: 24px;
    box-shadow: none;
}

.note-panel a {
    display: inline-flex;
    margin-top: 14px;
    color: var(--indigo);
    font-weight: 800;
}

.content-stack {
    display: grid;
    gap: 18px;
}

.index-row,
.policy-block {
    padding: clamp(20px, 3vw, 28px);
    box-shadow: none;
}

.index-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 24px;
    align-items: start;
}

.index-row .index-label {
    color: var(--magenta);
    font-weight: 900;
    letter-spacing: .08em;
}

.index-row ul,
.policy-block ul {
    margin: 10px 0 0;
    padding-left: 1.2em;
}

.index-row li,
.policy-block li {
    margin: 5px 0;
}

.cards-2,
.cards-3,
.cards-4 {
    display: grid;
    gap: 18px;
}

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

.editor-note {
    padding: 16px 18px;
    border-left: 4px solid var(--magenta);
    background: rgba(225,29,143,.055);
    border-radius: 0 15px 15px 0;
    color: var(--ink);
    font-weight: 700;
}

.faq-list {
    display: grid;
    gap: 14px;
}

.faq-item {
    padding: 22px 24px;
    box-shadow: none;
}

.faq-item h2 {
    margin: 0 0 10px;
    font-size: 19px;
    color: var(--ink);
}

.faq-item p {
    margin: 0;
    color: var(--muted);
}

.cta-band {
    margin-top: 26px;
    padding: 24px;
    border-radius: 20px;
    background: linear-gradient(135deg,#6366F1 0%,#E11D8F 55%,#D97706 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.cta-band h2,
.cta-band p {
    color: #fff;
    margin: 0;
}

.cta-band .secondary-link {
    flex: 0 0 auto;
}

.site-footer {
    margin-top: 56px;
    background: var(--ink);
    color: #F7EFE6;
}

.footer-inner {
    padding-top: 48px;
    padding-bottom: 30px;
}

.footer-brand {
    max-width: 760px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(247,239,230,.14);
}

.footer-logo-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: #fff;
}

.footer-logo {
    max-height: 38px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-brand p {
    color: rgba(247,239,230,.76);
}

.footer-brand-en {
    margin: 5px 0 12px;
    color: #fff !important;
    font-weight: 850;
    letter-spacing: .15em;
    font-size: 12px;
}

.footer-groups {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 26px;
    padding: 30px 0;
}

.footer-groups h2 {
    color: #fff;
    font-size: 15px;
    margin: 0 0 12px;
}

.footer-groups a {
    display: block;
    min-height: 34px;
    color: rgba(247,239,230,.78);
    font-size: 14px;
}

.footer-groups a:hover,
.footer-bottom a:hover {
    color: #fff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid rgba(247,239,230,.14);
    color: rgba(247,239,230,.66);
    font-size: 13px;
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom div {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 980;
    background: rgba(26,18,48,.52);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.book-menu,
.search-layer {
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -48%) scale(.98);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: var(--paper);
    border: 1px solid rgba(26,18,48,.14);
    box-shadow: 0 32px 90px rgba(26,18,48,.28);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.book-menu.is-open,
.search-layer.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.book-menu {
    width: min(calc(100% - 32px), 840px);
    max-height: min(88vh, 760px);
    overflow: auto;
    border-radius: 24px;
}

.book-menu-top,
.search-top {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
}

.book-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.book-brand span {
    display: grid;
    line-height: 1.3;
}

.book-brand strong {
    color: var(--ink);
}

.book-brand small {
    color: var(--muted);
    letter-spacing: .12em;
}

.book-logo {
    max-height: 34px;
    max-width: 132px;
    width: auto;
}

.close-action {
    flex: 0 0 44px;
    font-size: 25px;
}

.book-pages {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.book-page {
    padding: 20px 22px 26px;
    background: #fff;
}

.book-page:first-child {
    border-right: 1px solid var(--line);
    box-shadow: inset -18px 0 32px -32px rgba(26,18,48,.35);
}

.book-page:last-child {
    box-shadow: inset 18px 0 32px -32px rgba(26,18,48,.35);
}

.menu-group + .menu-group {
    margin-top: 20px;
}

.menu-group h2 {
    margin: 0 0 8px;
    font-size: 13px;
    letter-spacing: .12em;
    color: var(--magenta);
}

.menu-group a {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
}

.menu-group a:last-child {
    border-bottom: 0;
}

.menu-group strong {
    color: var(--ink);
    font-size: 14px;
}

.menu-group span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.search-layer {
    width: min(calc(100% - 32px), 620px);
    border-radius: 24px;
    padding-bottom: 24px;
}

.search-top h2 {
    margin: 2px 0 0;
    color: var(--ink);
    font-size: 22px;
}

.search-top small {
    color: var(--magenta);
    font-weight: 800;
}

.search-box {
    display: block;
    margin: 20px 20px 12px;
}

.search-box input {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--ink);
    padding: 0 16px;
}

.search-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px;
}

.search-presets a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--ink);
    font-weight: 700;
}

.search-note {
    margin: 14px 20px 0;
    color: var(--quiet);
    font-size: 12px;
}

.mobile-bottom-nav {
    display: none;
}

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

@media (max-width: 900px) {
    .topic-tags {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .masonry-three,
    .cards-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .masonry-three .content-card:last-child,
    .cards-3 > :last-child {
        grid-column: 1 / -1;
    }

    .content-card:nth-child(2) {
        margin-top: 0;
    }

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

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

    .theme-card,
    .theme-card:nth-child(n) {
        grid-column: span 1;
        min-height: 190px;
    }

    .page-head {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .page-head-note {
        max-width: 700px;
    }
}

@media (max-width: 760px) {
    body {
        padding-top: 72px;
        padding-bottom: calc(60px + env(safe-area-inset-bottom));
    }

    .chapter-strip {
        display: none;
    }

    .masthead-inner,
    .site-main > *,
    .footer-inner {
        width: min(calc(100% - 32px), var(--max));
    }

    .masthead-inner {
        grid-template-columns: 48px minmax(0,1fr) auto;
        gap: 8px;
    }

    .desktop-search {
        display: none;
    }

    .app-link {
        min-width: 74px;
        padding: 0 12px;
        font-size: 13px;
    }

    .brand-mark {
        min-width: 0;
        overflow: hidden;
    }

    .brand-logo {
        max-width: 150px;
    }

    .brand-text {
        font-size: 20px;
        white-space: nowrap;
    }

    .hero {
        min-height: 0;
        grid-template-columns: 1fr;
        gap: 26px;
        padding-top: 34px;
        padding-bottom: 34px;
    }

    .hero-copy {
        padding-left: 0;
    }

    .hero-vertical {
        position: static;
        writing-mode: horizontal-tb;
        margin-bottom: 8px;
    }

    .hero h1 {
        max-width: none;
        font-size: 34px;
    }

    .hero-visual {
        min-height: 220px;
    }

    .page-shell,
    .home-section {
        padding-top: 34px;
        padding-bottom: 34px;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
        gap: 8px;
    }

    .editorial-layout,
    .app-panel {
        grid-template-columns: 1fr;
    }

    .masonry-three,
    .cards-2,
    .cards-3 {
        grid-template-columns: 1fr;
    }

    .masonry-three .content-card:last-child,
    .cards-3 > :last-child {
        grid-column: auto;
    }

    .shelf-row {
        grid-template-columns: 56px 1fr;
    }

    .shelf-row > a {
        grid-column: 2;
    }

    .rank-row {
        grid-template-columns: 72px 1fr;
    }

    .rank-row > a {
        grid-column: 2;
    }

    .rank-number {
        font-size: 48px;
    }

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

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .book-menu {
        max-height: calc(100vh - 28px);
    }

    .book-pages {
        grid-template-columns: 1fr;
    }

    .book-page:first-child {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        box-shadow: none;
    }

    .book-page:last-child {
        box-shadow: none;
    }

    .menu-group a {
        grid-template-columns: 92px 1fr;
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 720;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: calc(50px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        background: rgba(255,255,255,.97);
        border-top: 1px solid var(--line);
        box-shadow: 0 -10px 30px rgba(26,18,48,.08);
    }

    .mobile-bottom-nav a {
        min-width: 0;
        min-height: 50px;
        display: flex;
        flex-direction: column;
        gap: 0;
        align-items: center;
        justify-content: center;
        color: var(--muted);
        font-size: 11px;
    }

    .mobile-bottom-nav a span {
        font-size: 16px;
        line-height: 1.1;
    }

    .mobile-bottom-nav a strong {
        font-weight: 750;
    }

    .mobile-bottom-nav a.is-active {
        color: var(--magenta);
    }

    .site-footer {
        margin-bottom: 0;
    }
}

@media (max-width: 520px) {
    .topic-tags,
    .steps-grid,
    .cards-4,
    .theme-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .hero-actions a {
        width: 100%;
    }

    .chapter-list a {
        grid-template-columns: 40px 1fr;
    }

    .chapter-list span {
        grid-column: 2;
    }

    .index-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .footer-groups {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    .cta-band {
        align-items: flex-start;
        flex-direction: column;
    }

    .search-layer {
        width: calc(100% - 20px);
    }
}

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