.mp-palace.inner{background:var(--mp-inner,#f6eadf)}
.mp-palace.outer{background:var(--mp-outer,#edf1f2)}
.mp-board{width:calc(100% - 10px);aspect-ratio:1/1}
.mp-palace{height:auto;min-height:0}
.mp-palace.analysis-hit{box-shadow:inset 0 0 0 3px rgba(42,130,117,.72)}
.palace-modal{align-items:center;padding:16px}
.palace-modal .contact-mask{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.palace-modal>section{width:min(88vw,390px);max-height:74vh;margin:auto;padding:20px 15px;border:1px solid rgba(255,255,255,.72);border-radius:18px;background:rgba(255,253,249,.62);box-shadow:0 18px 55px rgba(47,38,30,.18);backdrop-filter:blur(18px) saturate(1.25);-webkit-backdrop-filter:blur(18px) saturate(1.25)}
.palace-modal h2{font-size:22px;margin:4px 0}
.palace-modal .palace-flags{margin:4px 0 10px;padding:5px 8px}
.palace-modal .detail-grid{grid-template-columns:1fr 1fr;border-color:rgba(166,150,137,.28);background:rgba(255,255,255,.2)}
.palace-modal .detail-grid div{padding:7px;border-color:rgba(166,150,137,.22)}
.palace-modal .detail-grid small{font-size:8px;margin-bottom:3px}
.palace-modal .detail-grid b{font-size:10px}
.palace-modal .patterns{margin-top:9px;padding:9px;background:rgba(237,245,241,.62)}
.palace-modal .patterns p{margin:3px 0 7px}
.compare-modal,.analysis-modal,.color-modal{position:fixed;inset:0;z-index:90;display:grid;align-items:end}
.compare-modal>section,.analysis-modal>section,.color-modal>section{position:relative;z-index:1;width:min(100%,520px);max-height:82vh;overflow:auto;margin:auto;padding:24px 18px;background:#fffdf9;border-radius:22px 22px 0 0}
.color-modal h2{font:700 22px serif}
.color-modal section>button:not(.modal-close){width:100%;display:flex;align-items:center;gap:8px;margin:8px 0;padding:11px;border:1px solid #e1dcd6;border-radius:9px;background:#fff}
.color-modal section>button i{width:26px;height:26px;border-radius:6px}
.site-shell:has(.result-shell){background:#f4f4f4;color:#171717}
.site-shell:has(.result-shell) .topbar{background:rgba(250,250,250,.94);border-color:#d8d8d8}
.site-shell:has(.result-shell) .seal{background:#202020}
.site-shell:has(.result-shell) .tabbar{background:rgba(250,250,250,.95);border-color:#d8d8d8}
.site-shell:has(.result-shell) .tabbar .active{color:#111}
.result-shell{--mono-ink:#171717;--mono-sub:#6f6f6f;--mono-line:#d8d8d8;--mono-paper:#fafafa}
.result-shell .mp-title b{color:#111}.result-shell .mp-title small{color:#777}
.result-shell .mp-info,.result-shell .year-tool{background:#fafafa;border-color:#d6d6d6;box-shadow:none}
.result-shell .mp-info>div{border-color:#dedede}.result-shell .mp-info span,.result-shell .mp-info em{color:#777}.result-shell .mp-info .accent{color:#111}
.pillar-row-exact,.void-row-exact{display:flex;border-bottom:1px solid #dedede}
.pillar-row-exact>span,.void-row-exact>span{width:64px;flex:0 0 64px;display:grid;place-items:center;color:#555;font-size:10px}
.pillar-row-exact .pillar-table{min-width:0;flex:1;margin:0;border-top:0;border-bottom:0;border-right:0}
.pillar-table>div{border-color:#d9d9d9}.pillar-table p button{color:#1d1d1d;font-weight:700}.pillar-table small{color:#666}
.void-row-exact>section{min-width:0;flex:1;display:grid;grid-template-columns:repeat(4,1fr);border-left:1px solid #d9d9d9}
.void-row-exact button{border:0;border-right:1px solid #d9d9d9;background:#f5f5f5;color:#777;padding:8px 2px;font-size:9px}
.result-shell .meta-row i{background:#f1f1f1;color:#777}.result-shell .meta-row b{color:#171717}
.year-tool summary{color:#171717}.year-entry-list{border-top:1px solid #ddd;margin-top:10px}
.year-entry{display:flex;align-items:center;gap:7px;padding-top:9px}.year-entry>span{flex:0 0 42px;color:#666;font-size:9px}.year-entry input{min-width:0;flex:1;border:1px solid #d7d7d7;border-radius:7px;background:#f7f7f7;padding:9px;color:#171717}.year-entry button{flex:0 0 104px;border:1px solid #777;border-radius:7px;background:#eee;color:#222;padding:9px 4px;font-size:8px}
.convert-years{width:100%;margin-top:10px;border:0;border-radius:7px;background:#222;color:#fff;padding:10px}.highlight-modes button{border-color:#cfcfcf;color:#555;background:#fafafa}.highlight-modes button:active{background:#222;color:#fff}
.result-shell .mp-board{background:#555;border-color:#555}.result-shell .mp-palace.inner{background:#f0f0f0}.result-shell .mp-palace.outer{background:#fafafa}.result-shell .center-palace{background:#e4e4e4}
.result-shell .mp-palace.selected{box-shadow:inset 0 0 0 3px #222}.result-shell .mp-palace.stem-highlight{background:#e5e5e5;box-shadow:inset 0 0 0 2px #444}.result-shell .mp-palace.branch-highlight{background:#f4f4f4;box-shadow:inset 0 0 0 2px #888}.result-shell .mp-palace.analysis-hit{box-shadow:inset 0 0 0 3px #333}
.result-shell .mp-row .chief,.result-shell .mp-markers .good,.result-shell .mp-markers .horse{color:#111}.result-shell .mp-row .tomb,.result-shell .mp-row .jixing,.result-shell .mp-row .broken,.result-shell .mp-markers .bad{color:#555}.result-shell .mp-markers .build,.result-shell .mp-markers .break{color:#333;background:#eee}
.result-shell .analysis-toolbar{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;width:calc(100% - 12px);margin:10px 6px;overflow:visible;padding:0}
.result-shell .analysis-toolbar button{min-width:0;width:100%;padding:8px 2px;border-color:#ccc;border-radius:7px;background:#fafafa;color:#444;font-size:8px;white-space:normal;line-height:1.25}
.result-shell .analysis-toolbar button.active{border-color:#222;background:#222;color:#fff}.result-shell .analysis-toolbar button.locked{opacity:1;border-style:solid}
.result-shell .mp-legend{color:#777}.result-shell .disclaimer{color:#888}
.longevity-in-palace{position:absolute;right:2px;bottom:2px;left:2px;z-index:2;padding:2px 3px;border-radius:4px;background:rgba(255,255,255,.88);font-size:6px;line-height:1.25}.longevity-in-palace span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mp-markers .analysis-source{right:3px;bottom:3px;color:#333}.mp-markers .peach-target{right:3px;bottom:3px;padding:2px 4px;border-radius:8px;color:#fff;background:#555;font-weight:700}
.mode-analysis{margin:10px 8px;padding:12px;border:1px solid #d4d4d4;border-radius:10px;background:#f7f7f7;color:#222}.mode-analysis header{display:flex;justify-content:space-between;gap:10px}.mode-analysis header b{font-size:13px}.mode-analysis header p{margin:5px 0 0;color:#666;font-size:9px;line-height:1.5}.mode-analysis header i{height:max-content;padding:3px 6px;border-radius:8px;background:#333;color:#fff;font-size:8px;font-style:normal}.analysis-summary-grid,.horse-result{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;margin-top:10px}.analysis-summary-grid div,.horse-result span{padding:8px;border-radius:7px;background:#e9e9e9}.analysis-summary-grid small,.horse-result span{color:#666;font-size:8px}.analysis-summary-grid b,.horse-result b{display:block;margin-top:4px;color:#222;font-size:11px}.analysis-notes p,.analysis-paths p{margin:7px 0 0;color:#555;font-size:9px}.horse-pillars{display:grid;grid-template-columns:repeat(4,1fr);gap:5px;margin-top:10px}.horse-pillars button{padding:7px 2px;border:1px solid #ccc;border-radius:7px;background:#fff;color:#555;font-size:9px}.horse-pillars button.active{background:#222;color:#fff}.horse-result{grid-template-columns:repeat(3,1fr)}.relation-list article{padding:8px 0;border-bottom:1px solid #ddd}.relation-list b,.relation-list em{display:inline-block;font-size:9px}.relation-list em{float:right;color:#555;font-style:normal}.relation-list p,.relation-list small{display:block;margin:5px 0 0;color:#666;font-size:8px;line-height:1.5}
.result-shell .palace-modal>section{color:#171717;background:rgba(245,245,245,.68);border-color:rgba(255,255,255,.8)}
.palace-modal>section{width:min(calc(100% - 28px),430px);max-height:68vh;padding:14px;border:1px solid rgba(255,255,255,.78);border-radius:16px;background:rgba(245,245,245,.68);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}.overlay-head{text-align:center;border-bottom:1px solid rgba(80,80,80,.14)}.overlay-head h2{margin:0;font:700 15px serif}.overlay-head p{margin:4px 0 9px;color:#666;font-size:8px}.overlay-section{padding:9px 1px;border-bottom:1px dashed rgba(80,80,80,.18);text-align:center}.overlay-section h3{display:flex;align-items:center;justify-content:center;gap:5px;margin:0 0 6px;font-size:10px}.overlay-section h3 i{padding:2px 5px;border-radius:5px;background:#ddd;color:#444;font-size:8px;font-style:normal}.overlay-section p,.overlay-section em{display:block;margin:5px 0;color:#555;font-size:9px;line-height:1.55;font-style:normal}.overlay-section h4{margin:9px 0 4px;font-size:10px}.overlay-name{display:block;font-size:10px}.overlay-status-grid{display:grid;gap:5px}.overlay-status-grid article{padding:6px;border-radius:6px;background:rgba(255,255,255,.42)}.overlay-status-grid small,.overlay-status-grid b{display:block;font-size:8px}.overlay-status-grid b{margin-top:3px;font-size:10px}.overlay-pattern{padding:5px 0}.overlay-pattern+article{border-top:1px dashed #ddd}.overlay-pattern b{font-size:10px}
.compare-modal{align-items:center}.compare-modal>section{width:min(calc(100% - 28px),430px);max-height:72vh;padding:14px;border:1px solid rgba(255,255,255,.8);border-radius:17px;background:rgba(245,245,245,.72);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}.compare-modal header{text-align:center;border-bottom:1px solid #ddd}.compare-modal header h2{margin:0;font:700 15px serif}.compare-modal header p{margin:4px 0 9px;color:#666;font-size:9px}.compare-modal article{padding:9px 1px}.compare-modal article div{display:flex;justify-content:space-between;align-items:center}.compare-modal article div b{font-size:10px}.compare-modal article div i{padding:2px 6px;border-radius:7px;background:#ddd;color:#444;font-size:8px;font-style:normal}.compare-modal article>p{display:grid;grid-template-columns:1fr auto 1fr;gap:5px;margin:7px 0;text-align:center}.compare-modal article>p span{font-size:9px}.compare-modal article>p em{color:#888;font-style:normal}.compare-modal article small{display:block;color:#666;font-size:8px;line-height:1.5}.compare-modal footer{padding-top:9px;border-top:1px solid #ddd;color:#777;font-size:8px;line-height:1.5;text-align:center}.result-toast{position:fixed;z-index:150;left:50%;top:45%;transform:translate(-50%,-50%);padding:9px 13px;border-radius:9px;background:rgba(25,25,25,.86);color:#fff;font-size:10px;pointer-events:none}

/* Match the mini-program's full-palace longevity presentation. */
.longevity-in-palace{position:absolute;inset:3px;z-index:8;display:flex;flex-direction:column;justify-content:center;gap:5px;padding:5px;border:1px solid rgba(70,70,70,.24);border-radius:6px;background:rgba(249,249,249,.95);color:#303030;font-size:8px;line-height:1.42;pointer-events:none}
.longevity-in-palace span{display:block;overflow:visible;text-overflow:clip;white-space:normal;text-align:left}
.longevity-in-palace span::first-letter{color:#111;font-weight:700}

/* The second triple-tap result uses exactly the same glass container as double-tap detail. */
.compare-modal{align-items:center;padding:16px}
.compare-modal .contact-mask{background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}
.compare-modal>section{width:min(calc(100% - 28px),430px);max-height:68vh;margin:auto;padding:14px;border:1px solid rgba(255,255,255,.78);border-radius:16px;background:rgba(245,245,245,.68);box-shadow:0 18px 55px rgba(47,38,30,.18);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}

/* Result summary table follows the compact mini-program layout. */
.result-shell .mp-info{margin:0 5px 10px;padding:0;overflow:hidden;border:1px solid #d8d8d8;border-radius:0;background:#fafafa}
.result-shell .mp-info>div{min-height:36px;box-sizing:border-box;display:grid;grid-template-columns:58px minmax(0,1fr) 52px;align-items:center;gap:0;padding:0;border-bottom:1px solid #dedede;font-size:10px}
.result-shell .mp-info>div>span{align-self:stretch;display:grid;place-items:center;border-right:1px solid #dedede;color:#666;text-align:center}
.result-shell .mp-info>div>b{min-width:0;padding:7px 8px;color:#2b2b2b;font-weight:500;text-align:center}
.result-shell .mp-info>div>em{align-self:stretch;display:grid;place-items:center;padding:0 3px;border-left:1px solid #ededed;color:#aaa;text-align:center}
.result-shell .mp-info>div:nth-of-type(2){grid-template-columns:58px minmax(0,1fr)}
.result-shell .mp-info>div:nth-of-type(2)>b{grid-column:2}
.result-shell .mp-info>div:nth-of-type(3) .accent{color:#555;font-weight:700}
.result-shell .mp-info>div:nth-of-type(4){grid-template-columns:58px minmax(0,1fr)}
.result-shell .mp-info>div:nth-of-type(4)>b{grid-column:2}
.pillar-row-exact,.void-row-exact{min-height:58px;border-bottom:1px solid #dedede;background:#fafafa}
.pillar-row-exact>span,.void-row-exact>span{width:58px;flex:0 0 58px;border-right:1px solid #dedede;color:#666}
.pillar-row-exact .pillar-table{border:0}
.pillar-table>div{display:flex;min-width:0;flex-direction:column;justify-content:center;border-right:1px solid #dedede}
.pillar-table>div:last-child{border-right:0}
.pillar-table small{padding:5px 2px 2px;font-size:9px}
.pillar-table p{display:flex;flex-direction:column;align-items:center;margin:0;padding:2px 0 5px}
.pillar-table p button{display:block;padding:1px 2px;border:0;background:transparent;font-size:17px;line-height:1.05}
.void-row-exact{min-height:36px}
.void-row-exact>section{border-left:0}
.void-row-exact button{padding:7px 2px;background:#fafafa;color:#777}
.void-row-exact button:last-child{border-right:0}
.result-shell .meta-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));margin:0;border-top:0}
.result-shell .meta-row i{min-width:0;min-height:47px;box-sizing:border-box;padding:6px 2px;border-right:1px solid #dedede;background:#fafafa;color:#777;font-size:10px}
.result-shell .meta-row i:last-child{border-right:0}
.result-shell .meta-row b{margin-top:5px;overflow:hidden;color:#222;font-size:10px;font-weight:500;text-overflow:ellipsis;white-space:nowrap}

@keyframes palace-highlight-feedback{0%{filter:brightness(1);transform:scale(1)}45%{filter:brightness(.88);transform:scale(.965)}100%{filter:brightness(1);transform:scale(1)}}
@keyframes pillar-part-feedback{0%{transform:scale(1)}45%{transform:scale(1.18)}100%{transform:scale(1)}}
.result-shell .mp-palace.stem-highlight,.result-shell .mp-palace.branch-highlight{animation:palace-highlight-feedback 450ms ease-out both}
.pillar-table p button.pillar-part-active{border-radius:5px;background:#222;color:#fff;animation:pillar-part-feedback 450ms ease-out both}

/* Black, white and warm-gray paper design tokens. */
.result-shell{--paper-page:#f2f2f0;--paper-card:#fafaf8;--paper-inner:#e9e9e6;--paper-ink:#191919;--paper-sub:#707070;--paper-line:#d8d8d4;color:var(--paper-ink);font-family:-apple-system,"Helvetica Neue","PingFang SC","Microsoft YaHei",sans-serif}
.site-shell:has(.result-shell){background:var(--paper-page)}
.result-shell .mp-title{padding:15px 14px 11px}
.result-shell .mp-title b{color:var(--paper-ink);font:650 17px/1.3 "Songti SC","STSong",serif;letter-spacing:1px}
.result-shell .mp-title small{margin-top:5px;color:var(--paper-sub);font-size:9px;letter-spacing:.5px}
.result-shell .mp-info{border-color:var(--paper-line);background:var(--paper-card);box-shadow:0 4px 16px rgba(20,20,20,.035)}
.result-shell .mp-info>div,.pillar-row-exact,.void-row-exact{border-color:var(--paper-line);background:var(--paper-card)}
.result-shell .mp-info>div>span,.pillar-row-exact>span,.void-row-exact>span{border-color:var(--paper-line);color:var(--paper-sub);font-size:10px}
.result-shell .mp-info>div>b{color:var(--paper-ink);font-size:11px}
.pillar-table small{color:var(--paper-sub);font-size:9px}
.pillar-table p button{color:var(--paper-ink);font-weight:650}
.void-row-exact button,.result-shell .meta-row i{border-color:var(--paper-line);background:var(--paper-card);color:var(--paper-sub)}
.result-shell .meta-row b{color:var(--paper-ink);font-size:10px}

.result-shell .mp-board-head{padding:10px 8px 7px;color:var(--paper-ink)}
.result-shell .mp-board-head b{font-size:12px;letter-spacing:.5px}.result-shell .mp-board-head span{color:var(--paper-sub);font-size:9px}
.result-shell .mp-board{gap:1px;border:1px solid #505050;background:#505050;box-shadow:0 7px 22px rgba(20,20,20,.08)}
.result-shell .mp-palace{padding:5px;color:var(--paper-ink);transition:transform 180ms ease,box-shadow 180ms ease,filter 180ms ease}
.result-shell .mp-palace.inner{background:var(--paper-inner)!important}.result-shell .mp-palace.outer{background:var(--paper-card)!important}.result-shell .center-palace{background:#dfdfdc!important}
.result-shell .mp-row span{color:var(--paper-sub);font-size:10px}.result-shell .mp-row b{color:#262626;font-size:12px;font-weight:500}.result-shell .mp-row strong{color:#111;font-size:17px;font-weight:600}.result-shell .mp-row em{color:#777;font-size:8px}
.result-shell .energy{border:1px solid rgba(80,80,80,.10);background:rgba(255,255,255,.58);color:#666}
.result-shell .mp-palace.selected{z-index:3;box-shadow:inset 0 0 0 3px #191919}
.result-shell .mp-palace.stem-highlight{background:#e2e2df!important;box-shadow:inset 0 0 0 2px #242424}.result-shell .mp-palace.branch-highlight{background:#f6f6f3!important;box-shadow:inset 0 0 0 2px #5d5d5d}.result-shell .mp-palace.stem-highlight.branch-highlight{background:#e8e8e4!important;box-shadow:inset 0 0 0 3px #1d1d1d}
.result-shell .mp-markers .month{border:1px solid #cfcfcb;background:rgba(250,250,248,.9);color:#333}.result-shell .mp-markers .horse{color:#111}.result-shell .mp-markers .good,.result-shell .mp-markers .bad{color:#444}
.result-shell .mp-legend{padding:7px 9px;color:var(--paper-sub);font-size:8px;line-height:1.5}

.result-shell .analysis-toolbar{gap:6px;margin:11px 6px 9px}
.result-shell .analysis-toolbar button{min-height:39px;padding:6px 2px;border:1px solid var(--paper-line);border-radius:8px;background:var(--paper-card);box-shadow:0 2px 7px rgba(20,20,20,.025);color:#555;font-size:8px;line-height:1.3;transition:transform 150ms ease,background 150ms ease,color 150ms ease}
.result-shell .analysis-toolbar button:active{transform:scale(.96)}
.result-shell .analysis-toolbar button.active{border-color:#202020;background:#202020;color:#fff;box-shadow:none}
.result-shell .year-tool{border-color:var(--paper-line);border-radius:9px;background:var(--paper-card);box-shadow:0 3px 12px rgba(20,20,20,.025)}
.result-shell .year-tool summary{color:var(--paper-ink)}
.result-shell .mode-analysis{border-color:var(--paper-line);border-radius:10px;background:rgba(250,250,248,.94);box-shadow:0 5px 16px rgba(20,20,20,.04)}
.result-shell .mode-analysis header i,.result-shell .horse-pillars button.active{background:#202020;color:#fff}
.result-shell .analysis-summary-grid div,.result-shell .horse-result span{background:#ececea}
.result-shell .longevity-in-palace{border-color:rgba(70,70,70,.25);background:rgba(248,248,246,.95);color:#292929;box-shadow:inset 0 0 0 1px rgba(255,255,255,.5)}
.palace-modal>section,.compare-modal>section{border:1px solid rgba(255,255,255,.82);border-radius:16px;background:rgba(246,246,244,.72);box-shadow:0 20px 60px rgba(25,25,25,.18);backdrop-filter:blur(20px) saturate(1.05);-webkit-backdrop-filter:blur(20px) saturate(1.05);color:#1d1d1d}
.palace-modal .modal-close,.compare-modal .modal-close{background:rgba(30,30,30,.08);color:#333}
.palace-modal .overlay-head,.compare-modal header{border-color:rgba(70,70,70,.16)}
.palace-modal .overlay-section,.compare-modal article{border-color:rgba(70,70,70,.15)}
.palace-modal .overlay-section h3 i,.compare-modal article div i{background:#dfdfdc;color:#404040}

/* Ink-jade rice-paper theme. */
.result-shell{--paper-page:#f3f1ec;--paper-card:#fcfbf7;--paper-inner:#e5ece8;--paper-outer:#f5f3ee;--paper-center:#e7e2da;--paper-ink:#252421;--paper-sub:#766f66;--paper-line:#d8d2c8;--paper-primary:#294e47;--paper-primary-soft:#e0ebe6;--paper-copper:#9a604a;--paper-copper-soft:#f1e4dc}
.site-shell:has(.result-shell){background:var(--paper-page)}
.site-shell:has(.result-shell) .topbar,.site-shell:has(.result-shell) .tabbar{border-color:var(--paper-line);background:rgba(252,251,247,.95)}
.site-shell:has(.result-shell) .seal{background:var(--paper-primary)}.site-shell:has(.result-shell) .tabbar .active{color:var(--paper-primary)}
.result-shell .mp-info,.result-shell .year-tool,.result-shell .analysis-toolbar button{border-color:var(--paper-line);background:var(--paper-card)}
.result-shell .mp-info>div,.pillar-row-exact,.void-row-exact,.void-row-exact button,.result-shell .meta-row i{border-color:var(--paper-line);background:var(--paper-card)}
.result-shell .mp-info>div>span,.pillar-row-exact>span,.void-row-exact>span{border-color:var(--paper-line);color:var(--paper-sub)}
.result-shell .mp-info>div:nth-of-type(3) .accent{color:var(--paper-copper)}
.pillar-table p button.pillar-part-active{background:var(--paper-primary);color:#fffdf8}
.result-shell .mp-board{border-color:#665f57;background:#665f57;box-shadow:0 8px 24px rgba(65,54,43,.10)}
.result-shell .mp-palace.inner{background:var(--paper-inner)!important}.result-shell .mp-palace.outer{background:var(--paper-outer)!important}.result-shell .center-palace{background:var(--paper-center)!important}
.result-shell .mp-row b,.result-shell .mp-row strong{color:var(--paper-ink)}.result-shell .mp-row span,.result-shell .mp-row em{color:var(--paper-sub)}
.result-shell .mp-row .chief{color:var(--paper-primary)}
.result-shell .mp-row .tomb,.result-shell .mp-row .broken,.result-shell .mp-row .jixing,.result-shell .mp-markers .bad{color:var(--paper-copper)}
.result-shell .mp-palace.selected{box-shadow:inset 0 0 0 3px var(--paper-primary)}
.result-shell .mp-palace.stem-highlight{background:var(--paper-copper-soft)!important;box-shadow:inset 0 0 0 2px var(--paper-copper)}
.result-shell .mp-palace.branch-highlight{background:var(--paper-primary-soft)!important;box-shadow:inset 0 0 0 2px var(--paper-primary)}
.result-shell .mp-palace.stem-highlight.branch-highlight{background:#e8e5dc!important;box-shadow:inset 0 0 0 3px #52645e}
.result-shell .mp-markers .horse,.result-shell .mp-markers .good{color:var(--paper-primary)}
.result-shell .mp-markers .month{border-color:var(--paper-line);background:rgba(252,251,247,.92);color:var(--paper-primary)}
.result-shell .analysis-toolbar button.active,.result-shell .mode-analysis header i,.result-shell .horse-pillars button.active{border-color:var(--paper-primary);background:var(--paper-primary);color:#fffdf8}
.result-shell .mode-analysis{border-color:var(--paper-line);background:rgba(252,251,247,.95);box-shadow:0 6px 18px rgba(41,78,71,.07)}
.result-shell .analysis-summary-grid div,.result-shell .horse-result span{background:#eeeae2}
.result-shell .longevity-in-palace{border-color:rgba(41,78,71,.28);background:rgba(237,244,240,.96);color:var(--paper-primary)}
.mp-markers .peach-target{background:var(--paper-copper);color:#fffaf5}.mp-markers .analysis-source{color:var(--paper-primary)}
.palace-modal>section,.compare-modal>section{border-color:rgba(255,255,255,.84);background:rgba(250,248,242,.76);box-shadow:0 20px 60px rgba(41,78,71,.16);color:var(--paper-ink)}
.palace-modal .overlay-head,.compare-modal header,.palace-modal .overlay-section,.compare-modal article{border-color:rgba(118,111,102,.18)}
.palace-modal .overlay-section h3 i,.compare-modal article div i{background:#e5e1d8;color:var(--paper-primary)}
.result-shell .mp-palace{touch-action:pan-y}
.result-shell .mp-board.gesture-locked,.result-shell .mp-board.gesture-locked *{touch-action:none}
.result-shell .mp-board.gesture-locked{box-shadow:0 0 0 2px rgba(41,78,71,.48),0 8px 24px rgba(65,54,43,.10)}

/* Refined highlight strokes. */
.result-shell .mp-palace.selected{box-shadow:inset 0 0 0 2px var(--paper-primary)}
.result-shell .mp-palace.stem-highlight{box-shadow:inset 0 0 0 1px var(--paper-copper)}
.result-shell .mp-palace.branch-highlight{box-shadow:inset 0 0 0 1px var(--paper-primary)}
.result-shell .mp-palace.stem-highlight.branch-highlight{box-shadow:inset 0 0 0 2px #52645e}
.result-shell .mp-palace.analysis-hit{box-shadow:inset 0 0 0 2px var(--paper-primary)}
.cancel-year-highlight,.cancel-all-highlight{width:100%;margin-top:7px;padding:8px;border:1px solid var(--paper-line);border-radius:7px;background:transparent;color:var(--paper-sub);font-size:9px}
.cancel-year-highlight:active,.cancel-all-highlight:active{background:var(--paper-primary-soft);color:var(--paper-primary)}
.result-shell .mp-board{position:relative}
.compare-connections{position:absolute;z-index:5;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.compare-connections line{fill:none;stroke:var(--mp-compare-line,var(--paper-primary));stroke-width:1.2;stroke-dasharray:5 5;opacity:.58;animation:compare-line-in 320ms ease-out both}
@keyframes compare-line-in{from{opacity:0;stroke-dashoffset:12}to{opacity:.48;stroke-dashoffset:0}}
.result-shell .mp-palace.compare-anchor{z-index:6;box-shadow:inset 0 0 0 2px var(--paper-primary);outline:1px dashed var(--paper-primary);outline-offset:-5px}
.exit-compare-mode{margin-left:auto;padding:5px 8px;border:1px dashed var(--paper-primary);border-radius:7px;background:var(--paper-primary-soft);color:var(--paper-primary);font-size:8px}
.year-entry button.active{border-color:var(--paper-primary);background:var(--paper-primary);color:#fffdf8}

@keyframes palace-select-light{from{filter:brightness(1);box-shadow:inset 0 0 0 1px rgba(41,78,71,.24),inset 0 0 0 rgba(41,78,71,0)}to{filter:brightness(1.025);box-shadow:inset 0 0 0 1px rgba(41,78,71,.68),inset 0 0 18px rgba(41,78,71,.10),0 0 0 1px rgba(255,255,255,.50)}}
.result-shell .mp-palace.selected{z-index:3;filter:brightness(1.025);box-shadow:inset 0 0 0 1px rgba(41,78,71,.68),inset 0 0 18px rgba(41,78,71,.10),0 0 0 1px rgba(255,255,255,.50);animation:palace-select-light 220ms ease-out both}

@keyframes floating-overlay-in{from{opacity:0}to{opacity:1}}
@keyframes floating-panel-in{from{opacity:0;transform:translateY(10px) scale(.975)}to{opacity:1;transform:translateY(0) scale(1)}}
.palace-modal,.compare-modal{animation:floating-overlay-in 180ms ease-out both}
.palace-modal>section,.compare-modal>section{transform-origin:center center;touch-action:pan-y;animation:floating-panel-in 260ms cubic-bezier(.2,.78,.28,1) both}
@media (prefers-reduced-motion:reduce){.result-shell .mp-palace.selected,.palace-modal,.compare-modal,.palace-modal>section,.compare-modal>section{animation:none!important}}

/* Palace status colors and compact legend. */
.result-shell .mp-row .broken{color:#b5473f}
.result-shell .mp-row .tomb{color:#98643d}
.result-shell .mp-row .jixing{color:#76538f}
.result-shell .mp-row .tomb.jixing{color:#2f6f94}
.result-shell .mp-row strong,.result-shell .stem-token{font-weight:400}
.result-shell .stem-token{display:inline;color:inherit}
.result-shell .stem-separator{padding:0;color:var(--paper-sub);font-size:.72em;font-style:normal;font-weight:400}
.result-shell [data-edit-topic]{cursor:text}
.result-shell [data-edit-time]{cursor:pointer}
.result-shell [data-edit-topic]:hover,.result-shell [data-edit-time]:hover{color:var(--paper-primary)}
.result-shell .mp-legend{gap:12px;padding-block:7px}
.result-shell .mp-legend span{display:inline-flex;align-items:center;gap:4px;font-size:0;color:var(--paper-sub)}
.result-shell .mp-legend span::before{content:"";width:7px;height:7px;border-radius:50%;box-shadow:0 0 0 1px rgba(44,39,34,.08)}
.result-shell .mp-legend span::after{font-size:9px;line-height:1;color:var(--paper-sub)}
.result-shell .mp-legend span:nth-child(1)::before{background:#b5473f}
.result-shell .mp-legend span:nth-child(1)::after{content:"门破"}
.result-shell .mp-legend span:nth-child(2)::before{background:#98643d}
.result-shell .mp-legend span:nth-child(2)::after{content:"入墓"}
.result-shell .mp-legend span:nth-child(3)::before{background:#76538f}
.result-shell .mp-legend span:nth-child(3)::after{content:"击刑"}
.result-shell .mp-legend span:nth-child(4)::before{background:#2f6f94}
.result-shell .mp-legend span:nth-child(4)::after{content:"入墓＋击刑"}

/* 九宫状态：值符、值使与旺相休囚死。 */
.result-shell .mp-row .chief{color:#168564!important}
.result-shell .energy{min-width:13px;justify-content:center;margin-left:3px;padding:1px 3px;border:0;border-radius:3px;font-size:8px;font-weight:500;line-height:1.3}
.result-shell .energy.state-旺{background:#dcefe4;color:#18734f}
.result-shell .energy.state-相{background:#dcefed;color:#176f69}
.result-shell .energy.state-休{background:#e8ecec;color:#5d6a6b}
.result-shell .energy.state-囚{background:#eee3d7;color:#8a5936}
.result-shell .energy.state-死,.result-shell .energy.state-废{background:#f3dfdd;color:#a5403b}

/* 九宫文字层级：按 iPhone 15 的阅读距离提高干、神、星、门的可读性。 */
.result-shell .mp-row{grid-template-columns:11% 56% 33%}
.result-shell .mp-row span{font-size:10px;line-height:1;transform:translateX(-2px)}
.result-shell .mp-row .void-mark{font-size:19px;line-height:.8;transform:translateX(-3px);color:var(--paper-primary)}
.result-shell .mp-row b{font-size:16px;line-height:1.12;letter-spacing:0;font-weight:500}
.result-shell .mp-row strong{font-size:17px;line-height:1;font-weight:400;letter-spacing:0}
.result-shell .mp-row strong .stem-token{font-size:inherit;line-height:inherit;transform:none}
.result-shell .mp-row em{font-size:7px;line-height:1;letter-spacing:0}
.result-shell .energy{font-size:7px;line-height:1.25;vertical-align:1px}
.result-shell .mp-markers .good,.result-shell .mp-markers .bad{font-size:8px;line-height:1;padding:3px 4px;border-radius:4px;font-weight:600}
.result-shell .mp-markers .good{left:3px;bottom:3px;background:#dcefe4;color:#18734f}
.result-shell .mp-markers .bad{left:auto;right:3px;bottom:3px;background:#f3dfdd;color:#a5403b}

/* 月建、月破以轻渐层铺入宫位；不会遮挡原有内外盘底色。 */
.result-shell .mp-palace.month-build{background-image:linear-gradient(135deg,rgba(36,126,92,.17),rgba(36,126,92,0) 52%)!important}
.result-shell .mp-palace.month-break{background-image:linear-gradient(135deg,rgba(177,72,62,.18),rgba(177,72,62,0) 52%)!important}
.result-shell .mp-markers .month{font-size:8px;font-weight:600;padding:3px 4px;border-radius:4px}
.result-shell .mp-markers .build{background:#dcefe4;color:#18734f;border-color:transparent}
.result-shell .mp-markers .break{background:#f3dfdd;color:#a5403b;border-color:transparent}

/* 宫位交互只保留一套描边语言：高亮不改变宫内底色，只在外沿出现动效线。 */
.result-shell .mp-palace.inner.stem-highlight,.result-shell .mp-palace.inner.branch-highlight{background-color:var(--paper-inner)!important}
.result-shell .mp-palace.outer.stem-highlight,.result-shell .mp-palace.outer.branch-highlight{background-color:var(--paper-outer)!important}
.result-shell .mp-palace.center-palace.stem-highlight,.result-shell .mp-palace.center-palace.branch-highlight{background-color:var(--paper-center)!important}
.result-shell .mp-palace.stem-highlight,.result-shell .mp-palace.branch-highlight,.result-shell .mp-palace.stem-highlight.branch-highlight{z-index:2;filter:none;box-shadow:none;outline:1px dashed var(--paper-primary);outline-offset:-3px;animation:none}
.result-shell .mp-palace.selected{z-index:3;filter:none;box-shadow:inset 0 0 0 1.5px var(--paper-primary),0 0 0 1px rgba(255,255,255,.52);animation:palace-select-light 220ms ease-out both}
.result-shell .mp-palace.analysis-hit{z-index:2;box-shadow:inset 0 0 0 1.5px var(--paper-primary)}
.result-shell .mp-palace.peach-focus{z-index:3;box-shadow:inset 0 0 0 1.5px #cf5f88,0 0 0 1px rgba(255,250,253,.8)}
.result-shell .mp-palace.compare-anchor{z-index:6;box-shadow:inset 0 0 0 1.5px var(--paper-primary);outline:1px dashed var(--paper-primary);outline-offset:-5px}

/* 桃花以粉色虚线连向落宫；马星模式只显示马星符号。 */
.peach-connections{position:absolute;z-index:5;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.peach-connections line{fill:none;stroke:#cf5f88;stroke-width:1.25;stroke-dasharray:5 5;opacity:.7;animation:compare-line-in 320ms ease-out both}

/* 十二长生模式以两行信息为主，单独提高宫内文字而不改变普通盘面层级。 */
.result-shell .longevity-in-palace{inset:3px;gap:6px;padding:7px 6px;font-size:11px;line-height:1.38;font-weight:500;letter-spacing:.01em}
.result-shell .longevity-in-palace span::first-letter{font-weight:700;color:var(--paper-primary)}

/* 起局时间：极简纸面输入样式。 */
.cast-section #cast-datetime{appearance:none;border:0;border-bottom:1px solid #c9c4bb;border-radius:0;background:transparent;padding:9px 2px 8px;color:#25231f;font-size:14px;font-variant-numeric:tabular-nums;letter-spacing:.2px;box-shadow:none}
.cast-section #cast-datetime:hover{border-bottom-color:#777168}
.cast-section #cast-datetime:focus{border-bottom-color:var(--paper-primary,#294e47);outline:0;box-shadow:0 1px 0 var(--paper-primary,#294e47)}
.cast-section #cast-datetime::-webkit-calendar-picker-indicator{margin-left:8px;cursor:pointer;opacity:.56;filter:grayscale(1)}
/* web-design-layout: Apple-style result page */
.result-shell.result-apple{--apple-bg:#f5f5f7;--apple-card:#fff;--apple-ink:#1d1d1f;--apple-sub:#6e6e73;--apple-line:rgba(0,0,0,.07);min-height:100%;padding:0 10px 24px;background:var(--apple-bg);color:var(--apple-ink);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Helvetica Neue",sans-serif}
.result-shell.result-apple .mp-title{padding:28px 8px 18px;text-align:left}.result-shell.result-apple .mp-title b{color:var(--apple-ink);font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","PingFang SC",sans-serif;font-size:25px;font-weight:720;line-height:1.2;letter-spacing:-.7px}.result-shell.result-apple .mp-title small{margin-top:6px;color:var(--apple-sub);font-size:10px;letter-spacing:.2px}
.result-shell.result-apple .mp-info,.result-shell.result-apple .year-tool{margin:0 0 12px;border:0;border-radius:20px;background:var(--apple-card);box-shadow:0 1px 0 rgba(0,0,0,.035);overflow:hidden}
.result-shell.result-apple .mp-info{padding:4px 14px 0}.result-shell.result-apple .mp-info>div{min-height:45px;grid-template-columns:66px minmax(0,1fr) 48px;border-bottom:1px solid var(--apple-line);background:transparent}.result-shell.result-apple .mp-info>div>span{place-items:center start;border:0;color:var(--apple-sub);font-size:10px}.result-shell.result-apple .mp-info>div>b{padding:10px 4px;color:var(--apple-ink);font-size:11px;font-weight:550;text-align:left}.result-shell.result-apple .mp-info>div>em{border:0;color:#a1a1a6;font-size:8px}
.result-shell.result-apple .pillar-row-exact,.result-shell.result-apple .void-row-exact{border-color:var(--apple-line);background:transparent}.result-shell.result-apple .pillar-row-exact>span,.result-shell.result-apple .void-row-exact>span{border-color:var(--apple-line);color:var(--apple-sub)}.result-shell.result-apple .pillar-table,.result-shell.result-apple .pillar-table>div,.result-shell.result-apple .void-row-exact button{border-color:var(--apple-line);background:transparent}
.result-shell.result-apple .meta-row{margin:0 -14px}.result-shell.result-apple .meta-row i{min-height:52px;border-color:var(--apple-line);background:#fafafa;color:var(--apple-sub)}.result-shell.result-apple .meta-row b{color:var(--apple-ink);font-weight:600}
.result-shell.result-apple .year-tool{padding:15px 16px}.result-shell.result-apple .year-tool summary{color:var(--apple-ink);font-size:12px;font-weight:650}.result-shell.result-apple .year-entry-list{border-color:var(--apple-line)}.result-shell.result-apple .year-tool button{border:0;border-radius:10px;background:#f2f2f7;color:var(--paper-primary);min-height:36px}
.result-shell.result-apple .mp-board-head{margin-top:4px;padding:13px 4px 9px}.result-shell.result-apple .mp-board-head b{font-size:15px;font-weight:650;letter-spacing:-.2px}.result-shell.result-apple .mp-board-head span{color:var(--apple-sub);font-size:9px}
.result-shell.result-apple .mp-board{margin:0;border:1px solid rgba(0,0,0,.14);border-radius:18px;gap:1px;background:rgba(0,0,0,.14);box-shadow:0 8px 30px rgba(0,0,0,.08);overflow:hidden}.result-shell.result-apple .mp-palace{border-radius:0;transition:transform .18s ease,box-shadow .18s ease,filter .18s ease}.result-shell.result-apple .mp-palace:active{transform:scale(.985)}
.result-shell.result-apple .analysis-toolbar{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;width:100%;margin:14px 0 10px}.result-shell.result-apple .analysis-toolbar button{min-height:42px;border:0;border-radius:11px;background:var(--apple-card);box-shadow:0 1px 0 rgba(0,0,0,.04);color:#515154;font-size:8px;font-weight:550}.result-shell.result-apple .analysis-toolbar button.active{background:var(--paper-primary);color:#fff}.result-shell.result-apple .analysis-toolbar button:active{transform:scale(.96)}
.result-shell.result-apple .mp-legend{gap:13px;padding:8px 4px}.result-shell.result-apple .disclaimer{margin:10px 4px;color:var(--apple-sub);font-size:9px;line-height:1.65}
.result-shell.result-apple .palace-modal>section,.result-shell.result-apple .compare-modal>section,.result-shell.result-apple .analysis-modal>section{border:1px solid rgba(255,255,255,.7);background:rgba(255,255,255,.82);box-shadow:0 24px 70px rgba(0,0,0,.18);backdrop-filter:blur(26px);-webkit-backdrop-filter:blur(26px)}
@media(min-width:700px){.result-shell.result-apple{max-width:620px;margin:0 auto;padding-left:16px;padding-right:16px}}
@media(max-width:370px){.result-shell.result-apple{padding-left:7px;padding-right:7px}.result-shell.result-apple .analysis-toolbar{gap:5px}.result-shell.result-apple .analysis-toolbar button{min-height:39px}}
/* Apple hierarchy for inner / outer palaces; keep user palette variables live. */
.result-shell.result-apple .mp-palace.outer{background:var(--mp-outer,#fbfbfd)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.78)}
.result-shell.result-apple .mp-palace.inner{background:var(--mp-inner,#eef1f4)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.6)}
.result-shell.result-apple .mp-palace.center-palace{background:color-mix(in srgb,var(--mp-inner,#eef1f4) 78%,#cfd3d8)!important;box-shadow:inset 0 0 0 1px rgba(0,0,0,.045),inset 0 1px 0 rgba(255,255,255,.48)}
.result-shell.result-apple .mp-palace.outer.stem-highlight,.result-shell.result-apple .mp-palace.outer.branch-highlight{background-color:var(--mp-outer,#fbfbfd)!important}
.result-shell.result-apple .mp-palace.inner.stem-highlight,.result-shell.result-apple .mp-palace.inner.branch-highlight{background-color:var(--mp-inner,#eef1f4)!important}
.result-shell.result-apple .mp-palace.center-palace.stem-highlight,.result-shell.result-apple .mp-palace.center-palace.branch-highlight{background-color:color-mix(in srgb,var(--mp-inner,#eef1f4) 78%,#cfd3d8)!important}
.result-shell.result-apple .mp-board{border-color:var(--mp-line,#b8bdc3);background:var(--mp-line,#b8bdc3)}
.result-shell.result-apple .mp-row span,.result-shell.result-apple .mp-row em{color:#74747a}.result-shell.result-apple .mp-row b,.result-shell.result-apple .mp-row strong{color:#202124}
.color-modal>section{border:1px solid rgba(255,255,255,.72);background:rgba(250,250,252,.88);box-shadow:0 24px 70px rgba(0,0,0,.2);backdrop-filter:blur(26px);-webkit-backdrop-filter:blur(26px)}
.color-modal h2{margin:7px 0 17px;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","PingFang SC",sans-serif;font-size:23px;font-weight:700;letter-spacing:-.5px}
.color-modal section>button:not(.modal-close){min-height:54px;margin:7px 0;padding:9px 12px;border:0;border-radius:13px;background:#fff;box-shadow:0 1px 0 rgba(0,0,0,.04);color:#1d1d1f;font-family:inherit;font-size:12px;font-weight:600}
.color-modal section>button i{width:31px;height:31px;border:1px solid rgba(0,0,0,.06);border-radius:9px;box-shadow:inset 0 1px 0 rgba(255,255,255,.55)}
/* Balanced palace typography and symbols for phone readability. */
.result-shell.result-apple .mp-palace{padding:16px 6px 15px}
.result-shell.result-apple .mp-row{height:34%;grid-template-columns:13% 53% 34%;align-items:center;column-gap:0}
.result-shell.result-apple .mp-row:first-of-type{height:30%}
.result-shell.result-apple .mp-row span{font-size:clamp(11px,3vw,12px);font-weight:520;line-height:1;transform:none}
.result-shell.result-apple .mp-row b{min-width:0;font-size:clamp(14px,3.75vw,16px);font-weight:600;line-height:1.08;letter-spacing:-.2px;white-space:nowrap}
.result-shell.result-apple .mp-row:first-of-type b{font-size:clamp(13px,3.45vw,15px);font-weight:650;letter-spacing:.1px}
.result-shell.result-apple .mp-row strong{justify-self:end;font-size:clamp(18px,4.9vw,20px);font-weight:480;line-height:1;letter-spacing:.15px;white-space:nowrap}
.result-shell.result-apple .mp-row strong .stem-token{font-size:inherit;font-weight:inherit;line-height:inherit}
.result-shell.result-apple .stem-separator{padding:0 1px;font-size:9px;opacity:.58;vertical-align:2px}
.result-shell.result-apple .mp-row em{justify-self:end;max-width:100%;font-size:clamp(8.5px,2.45vw,10px);font-weight:620;line-height:1.12;letter-spacing:-.1px;text-align:right;white-space:normal;overflow-wrap:normal}
.result-shell.result-apple .mp-row .void-mark{align-self:center;justify-self:start;font-size:16px;font-weight:450;line-height:1;transform:none;color:var(--paper-primary);opacity:.82}
.result-shell.result-apple .energy{min-width:15px;margin-left:3px;padding:2px 4px;border-radius:999px;font-size:clamp(7px,1.9vw,8px);font-weight:680;line-height:1;vertical-align:2px}
.result-shell.result-apple .mp-markers .horse{right:5px;top:4px;font-size:21px;line-height:1;filter:drop-shadow(0 1px 0 rgba(255,255,255,.65))}
.result-shell.result-apple .mp-markers .month,.result-shell.result-apple .mp-markers .good,.result-shell.result-apple .mp-markers .bad{padding:3px 5px;border-radius:999px;font-size:clamp(8px,2.25vw,9.5px);font-weight:700;line-height:1}
.result-shell.result-apple .mp-markers .month{top:3px;left:4px}.result-shell.result-apple .mp-markers .good{left:4px;bottom:3px}.result-shell.result-apple .mp-markers .bad{right:4px;bottom:3px}
.result-shell.result-apple .center-hidden,.result-shell.result-apple .center-earth{font-family:"Songti SC","STSong",serif;font-size:25px;font-weight:500;line-height:1;opacity:.34}.result-shell.result-apple .center-hidden{left:12px;top:12px}.result-shell.result-apple .center-earth{right:12px;bottom:12px}
@media(max-width:390px){.result-shell.result-apple .mp-palace{padding:15px 4px 14px}.result-shell.result-apple .mp-row{grid-template-columns:12% 53% 35%}.result-shell.result-apple .mp-row .void-mark{font-size:15px}.result-shell.result-apple .energy{margin-left:2px;padding-inline:3px}}
/* Result theme follows the homepage preset. */
.result-shell.result-apple{--result-bg:#f2f3f4;--result-card:#fff;--result-accent:#222;--result-line:#d8dadd;background:var(--result-bg)}
.result-shell.result-theme-bright{--result-bg:#f7f9fb;--result-card:#fff;--result-accent:#2e6f68;--result-line:#d8e1e0}.result-shell.result-theme-wuxia{--result-bg:#f3eee7;--result-card:#fffdf9;--result-accent:#8e553f;--result-line:#e4d9cd}.result-shell.result-theme-ink{--result-bg:#e9eeeb;--result-card:#fbfdfb;--result-accent:#456f65;--result-line:#cfdbd6}.result-shell.result-theme-mist{--result-bg:#eef2f5;--result-card:#fcfdff;--result-accent:#506f88;--result-line:#d4dce4}.result-shell.result-theme-walnut{--result-bg:#efeae4;--result-card:#fffdf9;--result-accent:#7d5e49;--result-line:#ded3c8}
.palace-modal.result-theme-bright{--result-bg:#f7f9fb;--result-card:#fff;--result-accent:#2e6f68;--result-line:#d8e1e0}.palace-modal.result-theme-wuxia{--result-bg:#f3eee7;--result-card:#fffdf9;--result-accent:#8e553f;--result-line:#e4d9cd}.palace-modal.result-theme-ink{--result-bg:#e9eeeb;--result-card:#fbfdfb;--result-accent:#456f65;--result-line:#cfdbd6}.palace-modal.result-theme-mist{--result-bg:#eef2f5;--result-card:#fcfdff;--result-accent:#506f88;--result-line:#d4dce4}.palace-modal.result-theme-walnut{--result-bg:#efeae4;--result-card:#fffdf9;--result-accent:#7d5e49;--result-line:#ded3c8}
.palace-modal.palace-theme-linked>section{border-color:color-mix(in srgb,var(--result-accent) 16%,rgba(255,255,255,.82));background:color-mix(in srgb,var(--result-card) 84%,transparent);box-shadow:0 22px 64px color-mix(in srgb,var(--result-accent) 18%,transparent);color:#202124}
.palace-modal.palace-theme-linked .modal-close{background:color-mix(in srgb,var(--result-accent) 12%,transparent);color:var(--result-accent)}
.palace-modal.palace-theme-linked .overlay-head{border-color:color-mix(in srgb,var(--result-accent) 22%,transparent)}
.palace-modal.palace-theme-linked .overlay-head h2{color:var(--result-accent)}
.palace-modal.palace-theme-linked .overlay-head p{color:color-mix(in srgb,var(--result-accent) 42%,#777)}
.palace-modal.palace-theme-linked .overlay-section{border-color:color-mix(in srgb,var(--result-accent) 24%,transparent)}
.palace-modal.palace-theme-linked .overlay-section h3 i{background:color-mix(in srgb,var(--result-accent) 14%,var(--result-card));color:var(--result-accent)}
.palace-modal.palace-theme-linked .overlay-status-grid article{border:1px solid color-mix(in srgb,var(--result-line) 78%,transparent);background:color-mix(in srgb,var(--result-bg) 64%,var(--result-card))}
.palace-modal.palace-theme-linked .overlay-status-grid b,.palace-modal.palace-theme-linked .overlay-name{color:var(--result-accent)}
.result-shell.result-apple .mp-info,.result-shell.result-apple .year-tool,.result-shell.result-apple .analysis-toolbar button{background:var(--result-card)}
.result-shell.result-apple .analysis-toolbar button.active,.result-shell.result-apple .longevity-switch button.active{background:var(--result-accent);color:#fff}
.site-shell:has(.result-shell.result-theme-bright),.site-shell:has(.result-shell.result-theme-bright)>.topbar,.site-shell:has(.result-shell.result-theme-bright)>.tabbar{background:#f7f9fb}.site-shell:has(.result-shell.result-theme-wuxia),.site-shell:has(.result-shell.result-theme-wuxia)>.topbar,.site-shell:has(.result-shell.result-theme-wuxia)>.tabbar{background:#f3eee7}.site-shell:has(.result-shell.result-theme-ink),.site-shell:has(.result-shell.result-theme-ink)>.topbar,.site-shell:has(.result-shell.result-theme-ink)>.tabbar{background:#e9eeeb}.site-shell:has(.result-shell.result-theme-mist),.site-shell:has(.result-shell.result-theme-mist)>.topbar,.site-shell:has(.result-shell.result-theme-mist)>.tabbar{background:#eef2f5}.site-shell:has(.result-shell.result-theme-walnut),.site-shell:has(.result-shell.result-theme-walnut)>.topbar,.site-shell:has(.result-shell.result-theme-walnut)>.tabbar{background:#efeae4}
.site-shell:has(.result-shell)>.topbar{height:56px;backdrop-filter:blur(22px) saturate(1.12);-webkit-backdrop-filter:blur(22px) saturate(1.12)}
.site-shell:has(.result-shell)>.topbar .brand{color:inherit}.site-shell:has(.result-shell)>.topbar .seal{border-radius:9px}.site-shell:has(.result-shell)>.topbar .top-note{color:inherit;opacity:.68}
.site-shell:has(.result-shell.result-theme-bright)>.topbar{border-color:#cbdedb;background:rgba(232,243,241,.94);color:#245f59}.site-shell:has(.result-shell.result-theme-bright)>.topbar .seal{background:#2e6f68}
.site-shell:has(.result-shell.result-theme-wuxia)>.topbar{border-color:#dbcabc;background:rgba(239,226,213,.94);color:#744331}.site-shell:has(.result-shell.result-theme-wuxia)>.topbar .seal{background:#8e553f}
.site-shell:has(.result-shell.result-theme-ink)>.topbar{border-color:#bfd0c9;background:rgba(218,230,225,.94);color:#315b52}.site-shell:has(.result-shell.result-theme-ink)>.topbar .seal{background:#456f65}
.site-shell:has(.result-shell.result-theme-mist)>.topbar{border-color:#c4d1dc;background:rgba(224,232,239,.94);color:#405f78}.site-shell:has(.result-shell.result-theme-mist)>.topbar .seal{background:#506f88}
.site-shell:has(.result-shell.result-theme-walnut)>.topbar{border-color:#d2c4b7;background:rgba(231,222,213,.94);color:#624b3b}.site-shell:has(.result-shell.result-theme-walnut)>.topbar .seal{background:#7d5e49}
.site-shell:has(.result-shell)>.tabbar{height:68px;backdrop-filter:blur(22px) saturate(1.12);-webkit-backdrop-filter:blur(22px) saturate(1.12)}
.site-shell:has(.result-shell)>.tabbar button{color:#777b7a;transition:color .16s ease,background .16s ease}.site-shell:has(.result-shell)>.tabbar button.active{font-weight:700}
.site-shell:has(.result-shell.result-theme-bright)>.tabbar{border-color:#cbdedb;background:rgba(232,243,241,.94)}.site-shell:has(.result-shell.result-theme-bright)>.tabbar button.active{color:#2e6f68;background:rgba(46,111,104,.06)}
.site-shell:has(.result-shell.result-theme-wuxia)>.tabbar{border-color:#dbcabc;background:rgba(239,226,213,.94)}.site-shell:has(.result-shell.result-theme-wuxia)>.tabbar button.active{color:#8e553f;background:rgba(142,85,63,.06)}
.site-shell:has(.result-shell.result-theme-ink)>.tabbar{border-color:#bfd0c9;background:rgba(218,230,225,.94)}.site-shell:has(.result-shell.result-theme-ink)>.tabbar button.active{color:#456f65;background:rgba(69,111,101,.07)}
.site-shell:has(.result-shell.result-theme-mist)>.tabbar{border-color:#c4d1dc;background:rgba(224,232,239,.94)}.site-shell:has(.result-shell.result-theme-mist)>.tabbar button.active{color:#506f88;background:rgba(80,111,136,.07)}
.site-shell:has(.result-shell.result-theme-walnut)>.tabbar{border-color:#d2c4b7;background:rgba(231,222,213,.94)}.site-shell:has(.result-shell.result-theme-walnut)>.tabbar button.active{color:#7d5e49;background:rgba(125,94,73,.07)}

.board-control-strip{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:4px 0 10px;padding:6px;border:1px solid var(--result-line);border-radius:14px;background:color-mix(in srgb,var(--result-card) 88%,transparent);box-shadow:0 5px 18px rgba(0,0,0,.04);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.interaction-switch{display:grid;grid-template-columns:1fr 1fr;gap:3px;flex:1;padding:3px;border-radius:10px;background:color-mix(in srgb,var(--result-line) 55%,transparent)}.interaction-switch button,.board-memory-button{min-height:34px;border:0;border-radius:8px;background:transparent;color:#6e6e73;font-size:10px;font-weight:650}.interaction-switch button.active{background:var(--result-card);color:var(--result-accent);box-shadow:0 1px 5px rgba(0,0,0,.08)}.board-memory-button{flex:0 0 auto;padding:0 13px;background:var(--result-accent);color:#fff}
.longevity-switch{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin:0 0 10px;padding:4px;border-radius:11px;background:#eceeed}.longevity-switch button{min-height:34px;border:0;border-radius:8px;background:transparent;color:#666;font-size:9px;font-weight:650}.result-shell .longevity-in-palace{font-size:clamp(11px,3.2vw,13px);line-height:1.45}

.board-memory-modal{position:fixed;inset:0;z-index:110;display:grid;place-items:center;padding:18px}.board-memory-modal .contact-mask{background:transparent;backdrop-filter:none}.board-memory-modal>section{position:relative;z-index:1;width:min(92vw,430px);padding:21px 17px 16px;border:1px solid rgba(255,255,255,.75);border-radius:20px;background:rgba(255,255,255,.86);box-shadow:0 24px 70px rgba(0,0,0,.18);backdrop-filter:blur(26px);-webkit-backdrop-filter:blur(26px)}.board-memory-modal h2{margin:5px 0 5px;font-size:22px;letter-spacing:-.5px}.board-memory-modal p{margin:0 0 13px;color:#777;font-size:9px}.board-memory-modal textarea{box-sizing:border-box;width:100%;height:180px;padding:13px;border:1px solid #dde0e2;border-radius:13px;background:#f7f7f9;color:#222;font:12px/1.7 inherit;resize:vertical;outline:none}.board-memory-modal textarea:focus{border-color:var(--result-accent,#456f65);box-shadow:0 0 0 3px rgba(69,111,101,.1)}.board-memory-modal footer{display:grid;grid-template-columns:1fr 1.45fr;gap:8px;margin-top:12px}.board-memory-modal footer button{min-height:42px;border:0;border-radius:11px;background:#eeeef0;color:#444;font-weight:650}.board-memory-modal footer button:last-child{background:#294e47;color:#fff}

.board-color-diy{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px;padding-top:14px;border-top:1px solid rgba(0,0,0,.08)}.board-color-diy h3{grid-column:1/-1;margin:0 0 3px;font-size:13px}.board-color-diy label{display:flex;align-items:center;justify-content:space-between;min-height:42px;padding:0 9px;border-radius:10px;background:#fff;color:#555;font-size:9px}.board-color-diy input[type=color]{width:31px;height:31px;padding:2px;border:0;border-radius:8px;background:transparent}.board-color-diy>button{grid-column:1/-1;min-height:43px;border:0;border-radius:11px;background:#294e47;color:#fff;font-size:11px;font-weight:700}

/* Keep the longevity analysis panel inside the active result palette. */
.result-shell.result-apple .mode-analysis{margin:12px 0;padding:14px;border:1px solid var(--result-line);border-radius:16px;background:color-mix(in srgb,var(--result-card) 94%,var(--result-bg));color:var(--apple-ink);box-shadow:0 6px 20px color-mix(in srgb,var(--result-accent) 8%,transparent)}
.result-shell.result-apple .mode-analysis header{align-items:flex-start}.result-shell.result-apple .mode-analysis header b{color:var(--apple-ink);font-size:14px}.result-shell.result-apple .mode-analysis header p{color:color-mix(in srgb,var(--result-accent) 24%,#74747a);font-size:9px}.result-shell.result-apple .mode-analysis header i{border:0;background:var(--result-accent);color:#fff}
.result-shell.result-apple .longevity-switch{background:color-mix(in srgb,var(--result-line) 58%,transparent)}.result-shell.result-apple .longevity-switch button{color:color-mix(in srgb,var(--result-accent) 38%,#666);background:transparent}.result-shell.result-apple .longevity-switch button.active{background:var(--result-accent);color:#fff;box-shadow:0 2px 7px color-mix(in srgb,var(--result-accent) 20%,transparent)}
.result-shell.result-apple .analysis-summary-grid div{border:1px solid color-mix(in srgb,var(--result-line) 78%,transparent);background:color-mix(in srgb,var(--result-bg) 62%,var(--result-card))}.result-shell.result-apple .analysis-summary-grid small{color:color-mix(in srgb,var(--result-accent) 28%,#777)}.result-shell.result-apple .analysis-summary-grid b{color:var(--result-accent);font-size:13px}
.result-shell.result-apple .analysis-notes p{color:color-mix(in srgb,var(--result-accent) 18%,#555);font-size:10px;line-height:1.65}
.site-shell.app-theme-mono{--app-shell:#f6f6f6;--app-bar:rgba(255,255,255,.95);--app-accent:#171717;--app-border:#d8d8d8}
.site-shell.app-theme-bright{--app-shell:#f7f9fb;--app-bar:rgba(239,247,245,.95);--app-accent:#2e6f68;--app-border:#cbdedb}
.site-shell.app-theme-wuxia{--app-shell:#f3eee7;--app-bar:rgba(239,226,213,.95);--app-accent:#8e553f;--app-border:#dbcabc}
.site-shell.app-theme-ink{--app-shell:#e9eeeb;--app-bar:rgba(218,230,225,.95);--app-accent:#456f65;--app-border:#bfd0c9}
.site-shell.app-theme-mist{--app-shell:#eef2f5;--app-bar:rgba(224,232,239,.95);--app-accent:#506f88;--app-border:#c4d1dc}
.site-shell.app-theme-walnut{--app-shell:#efeae4;--app-bar:rgba(231,222,213,.95);--app-accent:#7d5e49;--app-border:#d2c4b7}
.site-shell[class*="app-theme-"]{background:var(--app-shell)}
.site-shell[class*="app-theme-"]>.topbar{border-color:var(--app-border)!important;background:var(--app-bar)!important;color:var(--app-accent)}
.site-shell[class*="app-theme-"]>.topbar .seal{background:var(--app-accent)!important}
.site-shell[class*="app-theme-"]>.tabbar{grid-template-columns:repeat(4,1fr);border-color:var(--app-border)!important;background:var(--app-bar)!important;box-shadow:0 -8px 28px rgba(30,38,34,.06);backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px)}
.site-shell[class*="app-theme-"]>.tabbar button{position:relative;color:#777b78;background:transparent!important;transition:color .16s ease,background .16s ease}
.site-shell[class*="app-theme-"]>.tabbar button.active{color:var(--app-accent)!important;background:color-mix(in srgb,var(--app-accent) 7%,transparent)!important;font-weight:700}
.site-shell[class*="app-theme-"]>.tabbar button.active::before{content:"";position:absolute;top:0;left:34%;right:34%;height:2px;border-radius:0 0 3px 3px;background:var(--app-accent)}
