/* Rust bindings retain the approved C layout. Gallery positioning is shared with the source motion geometry. */
.spread-category-tabs{display:flex;gap:8px;flex-wrap:wrap}.spread-learning-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.three-card-custom{display:flex;gap:8px}.three-card-custom label{min-width:0;flex:1}.three-card-custom input{width:100%;min-width:0}.deck-pool-picker{display:flex;flex-wrap:wrap;gap:8px}#tarot-status:empty{display:none}#tarot-status{color:var(--ink,#252c33);padding:12px;border-left:3px solid var(--accent,#173b61)}

.study-selection-list li>div>small{color:#62606b}

.quick-question-picker h1{font-size:1.25rem;line-height:1.4;margin:0 0 16px}
.vl-hint{color:#62606b}

.compare-summary>.compare-heading{font-size:1.17em;margin:1em 0}.compare-difference>.compare-field-heading{margin:0 0 .5rem;font-size:var(--type-16)}

/* The lesson zoom shares C tokens and keeps the original artwork proportions. */
dialog.card-study-zoom{max-width:min(94vw,620px);max-height:94dvh;padding:16px;border:1px solid var(--ryn-rule,#d9ddd3);border-radius:16px;background:var(--ryn-paper,#faf8f3);color:var(--ryn-ink,#24332d)}dialog.card-study-zoom::backdrop{background:rgba(8,24,18,.75)}dialog.card-study-zoom>button{display:block;margin:0 0 12px auto;min-height:44px;min-width:64px}dialog.card-study-zoom .card-study-art{display:flex;justify-content:center}dialog.card-study-zoom img{display:block;width:auto;height:auto;max-width:min(88vw,520px);max-height:76dvh;object-fit:contain}

/* Reserve the fixed controls when navigating by keyboard, without moving touch actions. */
@media(max-width:1023px){
 html:has(.setup-form){scroll-padding-block:100px calc(190px + env(safe-area-inset-bottom,0px))}
 .digital-tarot.atlas-theme:has(.setup-form) .site-footer{padding-bottom:calc(190px + env(safe-area-inset-bottom,0px))}
 .setup-form :is(button,input,select,summary,a),.digital-tarot.atlas-theme:has(.setup-form) .site-footer a{scroll-margin-block:12px}
}
.digital-result-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))}
.reading-guide-learn{min-height:44px}
.route-not-found{max-width:640px;margin-inline:auto;padding-block:clamp(48px,10vh,100px);min-height:50vh}
.route-not-found h1{font-size:clamp(1.65rem,4vw,2.25rem);line-height:1.35;text-wrap:balance}
.route-not-found p{margin:16px 0 32px;color:var(--ryn-ink,#24332d)}
.route-recovery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:480px;margin-bottom:24px}
.route-recovery a{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:12px 24px;text-decoration:none}
.route-home{display:inline-flex;align-items:center;min-height:44px;text-underline-offset:4px}

.digital-tarot.atlas-theme .route-recovery .secondary-action{border-color:var(--digital-line,#d8ddd4);color:var(--digital-ink,#252c33);background:transparent}

/* Preserve the original shell and illustration states after native route updates. */
.digital-tarot .site-bottomnav[hidden],.site-content>.site-breadcrumb[hidden],#rust-reading-resume:empty,.study-error:empty,.study-status:empty{display:none!important}
.record-more-tools>summary{display:flex;align-items:center;justify-content:space-between;gap:12px}
.deck-library__close,.circular-deck-controls>[data-action=gallery-prev],.circular-deck-controls>[data-action=gallery-next]{display:inline-flex;align-items:center;justify-content:center}

/* Hidden list panels must not consume the gallery's flex height. */
.deck-library [hidden]{display:none!important}
.deck-library .circular-deck-gallery{flex-shrink:0}

.digital-tarot.gallery-tarot .content-connected .spread-quick-choices .spread-choice-check svg{width:11px;height:11px}
/* R0134: existing setup controls retain their appearance with full touch targets. */
.setup-section-heading>a{display:inline-flex;align-items:center;min-height:44px;min-width:44px}.deck-curator__change{min-height:44px!important;min-width:44px}

/* R0149: source-bound reading path, preserving the navy/gold C system. */
.reading-engine{container-type:inline-size;margin-block:24px 32px;color:var(--ink,#243b59)}
.reading-engine>header{display:flex;gap:14px;align-items:center;margin-bottom:8px}.reading-engine h2{font-size:clamp(1.25rem,3vw,1.6rem);margin:0 0 8px}.reading-engine>header p{margin:0;line-height:1.6}.engine-scope{font-size:.85rem;color:var(--muted,#667180);margin:12px 0 20px}
.engine-flow{list-style:none;padding:0;display:grid;grid-template-columns:1fr;gap:8px}.engine-flow>li{min-width:0;display:grid;grid-template-columns:70px minmax(0,1fr);gap:14px;padding-block:20px;border-top:1px solid var(--line,#d9d5cb)}.engine-card-art img{width:100%;height:auto;object-fit:contain;border-radius:8px}.engine-slot{font-size:.85rem;color:var(--muted,#667180);margin:0 0 6px}.engine-flow h3{font-size:1.15rem;margin:0 0 6px}.engine-keywords{font-size:.85rem;color:var(--muted,#667180)}.engine-card-copy>p:not(.engine-slot):not(.engine-keywords){line-height:1.75;margin-block:12px}.engine-card-copy details p{line-height:1.7}.engine-basic{color:var(--muted,#667180)}.engine-card-copy summary,.engine-sources summary,.engine-saved summary,.engine-reference-details>summary{min-height:44px;padding-block:12px;cursor:pointer}.engine-flow .reading-guide-learn{display:inline-flex;gap:8px;align-items:center;min-height:44px;font-size:.9rem;flex-wrap:wrap}
.engine-step{display:flex;align-items:flex-start;gap:14px;padding:22px;background:var(--surface-soft,#edf1f6);border-radius:12px;margin:12px 0 20px}.engine-step>svg{flex-shrink:0;margin-top:3px}.engine-step h3{margin:0 0 10px;font-size:1.1rem}.engine-step p{line-height:1.7;margin:0 0 12px}.engine-step small,.engine-sources small{color:var(--muted,#667180);line-height:1.6}.engine-sources p,.engine-saved p{line-height:1.7}.engine-sources,.engine-reference-details,.engine-saved{border-top:1px solid var(--line,#d9d5cb);padding-block:8px}.engine-saved{margin-block:16px}.engine-saved li{padding-block:8px}.engine-common,.reading-engine-status{line-height:1.7;margin-block:18px}.engine-card-copy{overflow-wrap:anywhere;min-width:0}.engine-flow:has(>li:only-child){grid-template-columns:1fr;max-width:680px}
@media(max-width:1000px){.engine-flow{grid-template-columns:1fr;gap:4px}.engine-flow>li{grid-template-columns:80px minmax(0,1fr);gap:18px}.engine-step{padding:18px}}
@media(max-width:360px){.engine-flow>li{grid-template-columns:60px minmax(0,1fr);gap:12px}}

#reading-guide:has(.reading-engine)>.reading-guide-head{display:none}

.reading-engine>header>.ryn-pictogram{width:44px;height:44px;flex:0 0 44px}.reading-engine .engine-flow>li{grid-template-columns:80px minmax(0,1fr)}
@container(min-width:850px){.engine-flow{grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}}
@media(max-width:360px){.reading-engine .engine-flow>li{grid-template-columns:60px minmax(0,1fr)}}

/* R0158: bounded controls and a clear reading sequence, original visual tokens retained. */
.study-import-label,.record-file-actions>div{min-width:0;max-width:100%;box-sizing:border-box}
.study-import-label input[type=file]{display:block;min-width:0;width:100%;max-width:100%;box-sizing:border-box;min-height:44px}
.engine-flow.engine-sequence-list{grid-template-columns:minmax(0,1fr)}
.engine-flow>li.engine-sequence{display:block;padding-block:8px}
.engine-sequence>details>summary{min-height:44px;padding:12px 0;cursor:pointer;font-weight:600}
.engine-position-body{display:grid;grid-template-columns:80px minmax(0,1fr);gap:18px;padding:12px 0}
.learning-reading-back{display:flex;align-items:center;gap:8px;min-height:44px;width:fit-content;margin-bottom:8px}
.backup-legacy-options{margin-block:16px}.backup-legacy-options summary{min-height:44px;cursor:pointer}
@media(max-width:600px){.card-learning .ig-grid{grid-template-columns:minmax(0,1fr)!important}.card-learning .ig-decks{display:flex;flex-wrap:wrap}.card-learning .ig-decks>*{flex:1 1 12em;min-width:0}.card-learning .ig-art-panel{max-width:100%;position:static}.card-learning .ig-art-frame{max-width:300px;margin-inline:auto}}
@media(max-width:360px){.engine-position-body{grid-template-columns:60px minmax(0,1fr);gap:12px}}
@media(max-width:600px){.card-learning .ig-art-panel{display:grid;grid-template-columns:minmax(0,1fr)!important;gap:18px}.card-learning .ig-art-frame{width:min(100%,210px)!important;justify-self:center}.card-learning .ig-observation{min-width:0;width:100%}}

/* R0202 learning: one return, artwork and goal before secondary exploration. */
.card-learning .lesson-focus{font-size:20px;font-weight:600;line-height:1.5;margin:8px 0 20px;color:var(--digital-navy,#243b5a)}.card-learning .lesson-finish{padding:24px 0;margin-top:32px;border-top:1px solid var(--rule,#d9d6cc)}.lesson-finish h2{font-size:20px;margin:0 0 8px}.lesson-finish p{margin:0 0 16px}.lesson-finish button{min-height:44px}.card-learning.has-infographic>header{margin-bottom:16px}


.ryn-toast{position:fixed;z-index:1000;bottom:calc(100px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 32px);padding:14px 20px;background:#20344f;color:#fff;border-radius:12px;box-shadow:0 8px 24px rgba(15,30,50,.2);font-family:inherit;font-size:16px;font-weight:500;line-height:1.5;pointer-events:none}.ryn-toast[hidden]{display:none}
/* R0151: preserve artwork geometry and connect positions to compact reading details. */
.result-screen .cloth-board__card{padding:0;border:0;border-radius:3px;min-width:0;min-height:0;overflow:visible;background:transparent;box-shadow:0 3px 9px #14263c24}
.result-screen .cloth-board__card img{width:100%;height:100%;object-fit:contain;border-radius:2px}
.result-screen .cloth-board__number{pointer-events:none;z-index:3;font-size:12px;min-width:20px;min-height:20px;display:grid;place-items:center;line-height:1;background:var(--cloth-number-background,#f8f5ec);color:var(--cloth-number-ink,#233b59);border-radius:50%}
.reading-topic-control{margin:20px 0 24px;padding-bottom:20px;border-bottom:1px solid #d9d5cc}
.reading-topic-control>span{display:block;margin-bottom:12px;font-weight:600}
.reading-topic-control .luminous-topic-options{display:flex;flex-wrap:wrap;gap:8px}
.reading-topic-control button{min-height:44px;min-width:44px}
.luminous-question-lens>.luminous-topic-options:empty{display:none}
.result-screen .reading-guide-cards:has(.reading-card-detail){display:block}
.result-screen .reading-guide-cards>li:has(.reading-card-detail){margin:0;border:0;padding:0}
.result-screen .reading-card-detail{border:0;border-bottom:1px solid #d9d5cc;border-radius:0;padding:0;scroll-margin-top:100px}
.result-screen .reading-card-detail>summary{display:flex;gap:14px;align-items:center;min-height:72px;padding:14px 4px;cursor:pointer;list-style:none}
.result-screen .reading-card-detail>summary::after{content:'+';margin-left:auto;font-size:24px;color:#233b59}
.result-screen .reading-card-detail[open]>summary::after{content:'−'}
.result-screen .reading-card-detail>summary strong,.result-screen .reading-card-detail>summary small{display:block}
.result-screen .reading-card-detail>summary small{margin-top:5px;color:#687180}
.result-screen .reading-card-detail>article{padding:12px 4px 28px}
.result-screen .reading-card-detail .reading-guide-card-head{display:none}
.result-screen .repeat-reading-action,.result-screen .reading-guide-learn,.result-screen .digital-result-shortcuts a,.result-screen .record-save-feedback a,.setup-screen .setup-text-link{min-width:44px;min-height:44px;display:inline-flex;align-items:center}
.result-screen .d2-card-sheet>[data-action=guide-card]{margin:12px auto;min-height:44px;display:block}
@media(max-width:600px){.result-screen .cloth-board{min-width:0}.reading-topic-control .luminous-topic-options button{flex:1 0 28%;padding:8px}.result-screen .reading-guide-cards{gap:12px}}
.result-screen .d2-card-spread[data-count="1"]>button{width:min(100%,270px);margin-inline:auto}
.result-screen .d2-card-spread[data-count="1"]>button img{max-height:440px;width:auto;max-width:100%;object-fit:contain;margin-inline:auto}
@media(max-width:600px){.result-screen .d2-card-spread[data-count="1"]>button{width:min(100%,200px)}.result-screen .d2-card-spread[data-count="1"]>button img{max-height:330px}}
.result-screen .result-more>a{display:inline-flex;align-items:center;min-height:44px;min-width:44px}
.result-screen .reading-topic-control .luminous-topic-options button{min-width:44px;min-height:44px;padding:10px 12px;flex:1 1 72px}
.result-screen .reading-guide-cards>li{scroll-margin-top:100px}
@media(max-width:600px){.result-screen .reading-topic-control .luminous-topic-options button{flex:1 0 28%}}

.deck-reading-scope{padding-top:16px;margin-top:16px;border-top:1px solid var(--border,#d9d6cc)}.deck-reading-scope h3{font-size:16px;margin:0 0 8px}.deck-reading-scope p{margin:8px 0}
