/* Layout implementation for the editorial interior design concepts. */
body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-main,.life-main,.network-main,.history-main,.relations-main,.tarot-main){width:min(1400px,calc(100% - 80px));max-width:none!important;margin:0 auto;padding:40px 0 90px!important}
body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-header,.life-header,.network-header,.history-heading,.relations-heading,.tarot-header){position:relative;min-height:0!important;margin:0!important;padding:0 0 28px!important;border:0!important;border-bottom:1px solid #d9d6d0!important;overflow:hidden}
body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-header,.life-header,.network-header,.history-heading,.relations-heading,.tarot-header) h1{font-size:40px;line-height:1.15;margin:12px 0;color:#171717!important}
body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-header,.life-header,.network-header,.history-heading,.relations-heading,.tarot-header)>p:last-child{max-width:580px;line-height:1.65;color:#625f5a!important}
body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-form,.qimen-result,.qimen-placeholder,.life-form,.life-result,.network-panel,.history-list-panel,.history-detail,.relations-form,.relations-result){border:1px solid #dcd9d3!important;border-radius:10px!important;background:#f4f3f0!important;box-shadow:none!important}
body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-form-head h2,.qimen-result-head h2,.life-form-head h2,.life-result-head h2,.network-panel h2,.history-list-heading h2,.history-detail h2,.relations-form-title h2,.relations-result-heading h2){font-size:22px!important;line-height:1.3}
body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-fields input,.qimen-fields select,.life-fields input,.life-fields select,.network-panel input,.network-panel select,.relations-fields input,.relations-fields select){min-height:46px}

/* Qimen: title and art, input, and real chart form three independent columns. */
@media(min-width:1150px){
 body.fatemate-shell-ready .qimen-main{display:grid;grid-template-columns:minmax(220px,.75fr) minmax(250px,.72fr) minmax(0,1.5fr);gap:24px;align-items:start}
 body.fatemate-shell-ready .qimen-header{grid-column:1;grid-row:1;border:0!important;padding:0!important;min-height:590px!important}
 body.fatemate-shell-ready .qimen-header>p:last-child{max-width:290px}
 body.fatemate-shell-ready .qimen-header::after{content:'';display:block;width:100%;height:300px;margin:38px 0 0;background:url('/_design/home-4k-orbit.png') center/contain no-repeat;mix-blend-mode:multiply}
 body.fatemate-shell-ready .qimen-workspace{display:contents}
 body.fatemate-shell-ready .qimen-sidebar{grid-column:2;grid-row:1}
 body.fatemate-shell-ready .qimen-display{grid-column:3;grid-row:1;min-width:0}
 body.fatemate-shell-ready .qimen-attribution{grid-column:1/-1;margin:8px 0 0}
}
body.fatemate-shell-ready .qimen-workspace .qimen-form{padding:24px;margin:0}
body.fatemate-shell-ready .qimen-fields{gap:14px}
body.fatemate-shell-ready .qimen-quick{background:transparent;border-color:#dcd9d3}
body.fatemate-shell-ready .qimen-placeholder,body.fatemate-shell-ready .qimen-result{margin:0;padding:26px}
body.fatemate-shell-ready .qimen-placeholder-grid{margin-top:24px}
body.fatemate-shell-ready .qimen-cell{background:#f8f7f4;border-color:#dedbd6}
body.fatemate-shell-ready .qimen-cell:nth-child(5){background:#ebe9e5}
body.fatemate-shell-ready .qimen-cell :is(h3,dd){color:#36332f}

/* Life K-line: no values are shown until the user generates a result. */
body.fatemate-shell-ready .life-placeholder{position:relative;min-width:0;min-height:430px;margin:0;padding:26px;border:1px solid #dcd9d3;border-radius:10px;background:#f4f3f0;overflow:hidden}
body.fatemate-shell-ready .life-placeholder span{font-size:11px;letter-spacing:.08em;color:#77716a}
body.fatemate-shell-ready .life-placeholder h3{margin:12px 0;font:500 22px/1.35 Georgia,'Songti SC',serif;color:#252321}
body.fatemate-shell-ready .life-placeholder p{max-width:30em;color:#77716a;font-size:13px;line-height:1.7}
body.fatemate-shell-ready .life-placeholder-art{height:230px;margin:25px auto 0;background:url('/_design/home-4k-fan.png') center/contain no-repeat;mix-blend-mode:multiply;opacity:.75}
body.fatemate-shell-ready .life-main:has(#life-result:not([hidden])) .life-placeholder{display:none}
@media(min-width:1150px){
 body.fatemate-shell-ready .life-main{display:grid;grid-template-columns:minmax(200px,.75fr) minmax(280px,.9fr) minmax(0,1.35fr);gap:24px;align-items:start}
 body.fatemate-shell-ready .life-header{grid-column:1;grid-row:1;border:0!important;padding:0!important;min-height:570px!important}
 body.fatemate-shell-ready .life-header::after{content:'';display:block;height:240px;margin-top:34px;background:url('/_design/home-4k-fan.png') left center/contain no-repeat;mix-blend-mode:multiply}
 body.fatemate-shell-ready .life-form,body.fatemate-shell-ready .life-collapsed-info{grid-column:2;grid-row:1;margin:0}
 body.fatemate-shell-ready .life-placeholder,body.fatemate-shell-ready .life-result{grid-column:3;grid-row:1;margin:0}
 body.fatemate-shell-ready .life-form .life-fields{grid-template-columns:1fr}
 body.fatemate-shell-ready .life-result{min-width:0}
}
@media(max-width:1149px){body.fatemate-shell-ready .life-placeholder{margin-top:20px;min-height:260px}body.fatemate-shell-ready .life-placeholder-art{height:150px}}

/* Relationship pages use the actual two-person fields; no example charts are inserted. */
body.fatemate-shell-ready .relations-heading{min-height:175px!important;padding-right:34%!important}
body.fatemate-shell-ready .relations-heading::after{content:'';position:absolute;right:0;top:-15px;width:30%;height:185px;background:url('/_design/home-4k-pair.png') center/contain no-repeat;mix-blend-mode:multiply;pointer-events:none}
body.fatemate-shell-ready .relations-categories{margin:24px 0 16px}
body.fatemate-shell-ready .relations-form{padding:28px}
body.fatemate-shell-ready .relations-people{gap:18px}
body.fatemate-shell-ready .relations-people fieldset{border-radius:8px!important}
body.fatemate-shell-ready .relations-submit{max-width:none!important;width:100%!important;border-radius:6px!important}
body.fatemate-shell-ready .relations-result{margin-top:20px;padding:28px}

/* Map and records reuse the same quiet rail and results surface. */
body.fatemate-shell-ready .network-header,body.fatemate-shell-ready .history-heading{min-height:170px!important;padding-right:32%!important}
body.fatemate-shell-ready :is(.network-header,.history-heading)::after{content:'';position:absolute;right:0;top:-12px;width:28%;height:170px;background:url('/_design/home-4k-pair.png') center/contain no-repeat;mix-blend-mode:multiply;pointer-events:none}
body.fatemate-shell-ready .network-grid{grid-template-columns:minmax(280px,.85fr) minmax(0,1.6fr);gap:18px;margin-top:24px}
body.fatemate-shell-ready .network-panel{padding:24px}
body.fatemate-shell-ready .network-graph-panel{min-height:420px}
body.fatemate-shell-ready .history-layout{grid-template-columns:180px minmax(260px,.9fr) minmax(0,1.5fr);gap:16px;margin-top:24px}
body.fatemate-shell-ready .history-side{padding:8px;border:1px solid #dcd9d3;border-radius:10px;background:#f4f3f0}
body.fatemate-shell-ready .history-list-panel,body.fatemate-shell-ready .history-detail{min-height:390px;padding:24px}
body.fatemate-shell-ready .history-placeholder{background:transparent!important}
body.fatemate-shell-ready .history-item[aria-pressed=true],body.fatemate-shell-ready .history-item:hover{background:#e8e6e2;color:#211f1d}
body.fatemate-shell-ready :is(.history-facts,.history-message,.history-message.user){background:#ebe9e5;color:#4e4a45}

/* Account and pricing: editorial page header, useful account fields, real plan states. */
body.fatemate-shell-ready .account-hero{position:relative;padding-right:32%!important;background:transparent!important}
body.fatemate-shell-ready .account-hero::after{content:'';display:block!important;position:absolute;right:0;top:0;width:30%;height:100%;border:0!important;border-radius:0;background:url('/_design/home-4k-fan.png') right center/contain no-repeat;mix-blend-mode:multiply;pointer-events:none}
body.fatemate-shell-ready .account-layout{gap:24px}
body.fatemate-shell-ready .account-membership-grid{grid-template-columns:minmax(0,1fr);max-width:700px}
body.fatemate-shell-ready .account-membership-grid .account-panel:last-child{display:block;min-height:200px;padding:24px}
body.fatemate-shell-ready .account-membership-grid .account-panel:last-child h2{margin:9px 0;font-size:20px}
body.fatemate-shell-ready .account-membership-grid .account-panel:last-child p{width:auto;margin:0;font-size:13px}
.account-access-required{padding:24px;border:1px solid #dedbd6;border-radius:10px;background:#f3f2ef;color:#555;line-height:1.7}
.account-access-required[hidden]{display:none}
body.fatemate-shell-ready .account-sidebar{padding:10px;border:1px solid #dcd9d3;border-radius:10px;background:#f4f3f0}
body.fatemate-shell-ready .account-layout{align-items:start}
body.fatemate-shell-ready .account-sidebar{position:sticky;top:88px;align-self:start;max-height:calc(100vh - 104px);overflow-y:auto;z-index:10}
body.fatemate-shell-ready .history-account-content .history-layout{grid-template-columns:minmax(240px,.9fr) minmax(0,1.5fr);gap:16px;margin:0}
@media(max-width:900px){body.fatemate-shell-ready .history-account-content .history-layout{grid-template-columns:1fr}}
@media(max-width:800px){body.fatemate-shell-ready .account-sidebar{top:64px;max-height:none;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;white-space:nowrap}body.fatemate-shell-ready .account-sidebar>a,body.fatemate-shell-ready .account-sidebar-admin a{flex:0 0 auto}body.fatemate-shell-ready .account-sidebar-admin:not([hidden]){flex:0 0 auto}}
body.fatemate-shell-ready .account-panel{border-radius:10px!important}
body.fate-commerce.fatemate-shell-ready .commerce-main:not(.account-main){position:relative}
body.fate-commerce.fatemate-shell-ready .commerce-main:not(.account-main)::before{content:'';position:absolute;right:0;top:15px;width:28%;height:185px;background:url('/_design/home-4k-intake-noise.png') center/contain no-repeat;mix-blend-mode:multiply;pointer-events:none;opacity:.75}
body.fate-commerce.fatemate-shell-ready .commerce-main:not(.account-main)>:is(h1,.commerce-kicker,.commerce-lead){position:relative;z-index:1;max-width:68%}
body.fatemate-shell-ready .pricing-grid{margin-top:42px;gap:18px}
body.fatemate-shell-ready .pricing-card{position:relative;padding:28px;border-radius:10px!important}
body.fatemate-shell-ready .pricing-card .pricing-button{border-radius:6px!important}

/* Assistant: one shared header above the navigation rail and conversation. */
@media(min-width:901px){
 body.agent-page.fatemate-shell-ready .agent-main{display:grid;grid-template-columns:230px minmax(0,1fr);grid-template-rows:auto minmax(270px,1fr) auto auto auto;gap:0 20px;width:min(1400px,calc(100% - 80px));padding:35px 0 55px;min-height:calc(100dvh - 72px)}
 body.agent-page.fatemate-shell-ready .agent-content{display:contents}
 body.agent-page.fatemate-shell-ready .agent-intro{grid-column:1/-1;grid-row:1;padding:0 30% 28px 0;min-height:135px;position:relative}
 body.agent-page.fatemate-shell-ready .agent-intro::after{content:'';position:absolute;right:0;top:-14px;width:28%;height:140px;background:url('/_design/home-4k-bottom-assistant.png') center/contain no-repeat;mix-blend-mode:multiply;pointer-events:none}
 body.agent-page.fatemate-shell-ready .agent-sidebar{grid-column:1;grid-row:2/6;margin-top:22px;padding:18px!important;border:1px solid #dcd9d3!important;border-radius:10px}
 body.agent-page.fatemate-shell-ready .agent-feed{grid-column:2;grid-row:2;margin-top:22px;padding:28px 24px 28px 55px;border:1px solid #dcd9d3;border-bottom:0;border-radius:10px 10px 0 0;background:#f4f3f0;max-height:50dvh}
 body.agent-page.fatemate-shell-ready .agent-prompts{grid-column:2;grid-row:3;padding:12px 20px;border-left:1px solid #dcd9d3;border-right:1px solid #dcd9d3;background:#f4f3f0}
 body.agent-page.fatemate-shell-ready .agent-form{grid-column:2;grid-row:4;margin:0;border:1px solid #dcd9d3;border-radius:0 0 10px 10px!important}
 body.agent-page.fatemate-shell-ready .agent-note{grid-column:2;grid-row:5}
}

/* AI assistant: keep navigation, conversation and composer in one clear workspace. */
body.agent-page.fatemate-shell-ready .agent-main{display:grid;grid-template-columns:200px minmax(0,1fr);grid-template-rows:auto;align-items:start;gap:32px;width:min(1240px,calc(100% - 80px));min-height:calc(100dvh - 72px);padding:38px 0 56px}
body.agent-page.fatemate-shell-ready .agent-content{display:flex;flex-direction:column;grid-column:2;grid-row:1;max-width:none;min-width:0}
body.agent-page.fatemate-shell-ready .agent-intro{grid-column:auto;grid-row:auto;min-height:0;padding:0 0 24px;border-bottom:1px solid #dcd9d3}
body.agent-page.fatemate-shell-ready .agent-intro::after{display:none}
body.agent-page.fatemate-shell-ready .agent-intro>span{color:#847d73;font-size:11px;letter-spacing:.08em}
body.agent-page.fatemate-shell-ready .agent-intro h1{margin:9px 0 7px;font-size:32px;line-height:1.2}
body.agent-page.fatemate-shell-ready .agent-intro p{font-size:14px;line-height:1.6}
body.agent-page.fatemate-shell-ready .agent-sidebar{grid-column:1;grid-row:1;margin:0;padding:5px 20px 20px 0!important;border:0!important;border-right:1px solid #dcd9d3!important;border-radius:0;background:transparent!important;min-height:210px}
body.agent-page.fatemate-shell-ready .agent-sidebar>p:first-child{color:#81786c;font-size:10px;letter-spacing:.06em}
body.agent-page.fatemate-shell-ready .agent-history-links{gap:8px;margin-top:20px}
body.agent-page.fatemate-shell-ready .agent-history-links a{min-height:42px;font-size:14px}
body.agent-page.fatemate-shell-ready .agent-history-links a:not(.agent-new-chat):hover{background:#ebe9e4}
body.agent-page.fatemate-shell-ready .agent-sidebar-note{margin-top:22px;font-size:12px;line-height:1.7}
body.agent-page.fatemate-shell-ready .agent-feed{grid-column:auto;grid-row:auto;flex:1;min-height:300px;max-height:50dvh;margin:24px 0 0;padding:32px 64px;border:1px solid #dedbd6;border-bottom:0;border-radius:10px 10px 0 0;background:#faf9f6;gap:28px}
body.agent-page.fatemate-shell-ready .agent-welcome{flex:1;min-height:245px;align-content:center}
body.agent-page.fatemate-shell-ready .agent-welcome>span{width:52px;height:52px;font-size:24px}
body.agent-page.fatemate-shell-ready .agent-welcome h2{margin:18px 0 8px;font-size:24px}
body.agent-page.fatemate-shell-ready .agent-welcome p{font-size:14px;line-height:1.6}
body.agent-page.fatemate-shell-ready .agent-prompts{grid-column:auto;grid-row:auto;display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:14px 24px;border:1px solid #dedbd6;border-top:1px solid #eeece7;border-bottom:0;background:#faf9f6}
body.agent-page.fatemate-shell-ready .agent-prompts>span{flex-basis:auto;margin-right:5px;font-size:12px}
body.agent-page.fatemate-shell-ready .agent-prompts button{min-height:34px;padding:6px 12px;border:1px solid #dcd8d1;border-radius:5px;font-size:13px;cursor:pointer}
body.agent-page.fatemate-shell-ready .agent-prompts button:hover{background:#ebe9e4!important;border-color:#aaa49b!important}
body.agent-page.fatemate-shell-ready .agent-form{grid-column:auto;grid-row:auto;display:flex;align-items:stretch;gap:12px;margin:0;padding:4px 24px 24px;border:1px solid #dedbd6;border-top:0;border-radius:0 0 10px 10px!important;background:#faf9f6!important;box-shadow:none}
body.agent-page.fatemate-shell-ready .agent-form:focus-within{border-color:#dedbd6!important;box-shadow:none}
body.agent-page.fatemate-shell-ready .agent-form textarea{flex:1;min-width:0;height:52px;min-height:52px;max-height:180px;padding:14px 15px 10px;border:1px solid #d4d0ca!important;border-radius:8px;background:#fff!important;color:#252321;font-size:14px;line-height:1.5;resize:vertical}
body.agent-page.fatemate-shell-ready:not(.fate-home-v2) .agent-form textarea:focus-visible{outline:2px solid #a7a098!important;outline-offset:2px;border-color:#77716a!important}
body.agent-page.fatemate-shell-ready .agent-form>div{flex:none;align-items:stretch;gap:10px}
body.agent-page.fatemate-shell-ready .agent-form button{display:inline-flex;align-items:center;justify-content:center;min-width:82px;min-height:44px;padding:10px 18px;font-size:14px;line-height:1.3}
body.agent-page.fatemate-shell-ready .agent-error:not(:empty){max-width:220px;line-height:1.5}
body.agent-page.fatemate-shell-ready .agent-form:has(.agent-error:not(:empty)){flex-wrap:wrap}
body.agent-page.fatemate-shell-ready .agent-form:has(.agent-error:not(:empty)) textarea{flex-basis:100%}
body.agent-page.fatemate-shell-ready .agent-form>div:has(.agent-error:not(:empty)){flex:1 0 100%;align-items:center;justify-content:space-between}
body.agent-page.fatemate-shell-ready .agent-form .agent-error{overflow-wrap:anywhere}
body.agent-page.fatemate-shell-ready .agent-save-status,body.agent-page.fatemate-shell-ready .agent-note{grid-column:auto;grid-row:auto;margin:10px 0 0;color:#706c66;font-size:12px;line-height:1.6}
body.agent-page.fatemate-shell-ready .agent-note{margin-top:3px}
body.agent-page.fatemate-shell-ready .agent-save-retry{align-self:flex-start}
body.agent-page.fatemate-shell-ready .agent-message{box-sizing:border-box;max-width:min(85%,720px);font-size:15px;line-height:1.8}
body.agent-page.fatemate-shell-ready .agent-message.user{align-self:flex-end;padding:12px 16px;border-radius:12px 12px 3px 12px}
body.agent-page.fatemate-shell-ready .agent-message.user:before{left:auto;right:-42px}
body.agent-page.fatemate-shell-ready .agent-message.assistant{align-self:flex-start;width:min(100%,720px);max-width:100%;padding:2px 0;border:0;border-radius:0;background:transparent!important}
@media(max-width:760px){
 body.agent-page.fatemate-shell-ready .agent-main{display:flex;flex-direction:column;gap:20px;width:calc(100% - 32px);min-height:0;padding:22px 0 42px}
 body.agent-page.fatemate-shell-ready .agent-sidebar{display:block;order:0;width:100%;min-height:0;padding:0!important;border:0!important}
 body.agent-page.fatemate-shell-ready .agent-sidebar>p:first-child,body.agent-page.fatemate-shell-ready .agent-sidebar-note{display:none}
 body.agent-page.fatemate-shell-ready .agent-history-links{flex-direction:row;margin:0;gap:8px}
 body.agent-page.fatemate-shell-ready .agent-history-links a{min-height:38px;font-size:13px}
 body.agent-page.fatemate-shell-ready .agent-content{order:1;width:100%}
 body.agent-page.fatemate-shell-ready .agent-intro{padding-bottom:18px}
 body.agent-page.fatemate-shell-ready .agent-intro h1{font-size:28px}
 body.agent-page.fatemate-shell-ready .agent-feed{min-height:250px;margin-top:18px;padding:24px 52px;max-height:55dvh;gap:24px}
 body.agent-page.fatemate-shell-ready .agent-welcome{min-height:210px}
 body.agent-page.fatemate-shell-ready .agent-welcome h2{font-size:22px}
 body.agent-page.fatemate-shell-ready .agent-prompts{padding:12px 14px}
 body.agent-page.fatemate-shell-ready .agent-prompts>span{flex-basis:100%}
 body.agent-page.fatemate-shell-ready .agent-form{gap:8px;padding:10px 14px 14px}
 body.agent-page.fatemate-shell-ready .agent-form textarea{font-size:16px}
 body.agent-page.fatemate-shell-ready .agent-form button{min-width:62px;padding:8px}
 body.agent-page.fatemate-shell-ready .agent-message{max-width:100%;font-size:14px}
}
/* Date detail: calendar and the selected day's actual facts sit side by side. */
@media(min-width:950px){
 html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar]){max-width:1400px!important;width:min(1400px,calc(100% - 80px))!important}
 html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>div.mb-12>.grid{display:grid;grid-template-columns:minmax(330px,.9fr) minmax(0,1.1fr);gap:18px}
 html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>div.mb-12>.grid>div:first-child{grid-column:1}
 html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>div.mb-12>.grid>article{grid-column:2;grid-row:1}
 html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>div.mb-12>.grid>:nth-child(n+3){grid-column:1/-1}
}

/* Article templates: navigation is generated from actual H2 headings. */
html.fm-content body.fatemate-shell-ready div.max-w-2xl:has(>article.fm-article-with-contents){max-width:1100px!important}
html.fm-content body.fatemate-shell-ready article.fm-article-with-contents{display:grid;grid-template-columns:210px minmax(0,1fr);grid-template-areas:'contents header' 'contents reading';gap:0 44px;align-items:start}
html.fm-content body.fatemate-shell-ready article.fm-article-with-contents>header{grid-area:header;min-width:0}
html.fm-content body.fatemate-shell-ready article.fm-article-with-contents>.fm-reading{grid-area:reading;min-width:0;max-width:760px}
html.fm-content body.fatemate-shell-ready .fm-article-contents{grid-area:contents;position:sticky;top:95px;padding:18px;border:1px solid #dcd9d3;border-radius:8px;background:#f3f2ef;font-size:13px;line-height:1.55}
html.fm-content body.fatemate-shell-ready .fm-article-contents strong{display:block;font:600 16px Georgia,'Songti SC',serif;color:#242321}
html.fm-content body.fatemate-shell-ready .fm-article-contents ol{margin:14px 0 0;padding-left:18px}
html.fm-content body.fatemate-shell-ready .fm-article-contents li+li{margin-top:10px}
html.fm-content body.fatemate-shell-ready .fm-article-contents a{color:#67625c;text-decoration:none}
html.fm-content body.fatemate-shell-ready .fm-article-contents a:hover{text-decoration:underline;color:#191817}
html.fm-content body.fatemate-shell-ready .fm-reading h2{scroll-margin-top:95px}

@media(max-width:1149px){body.fatemate-shell-ready .qimen-workspace{margin-top:24px}body.fatemate-shell-ready .life-form{margin-top:24px}}
@media(max-width:900px){body.fatemate-shell-ready .history-layout{grid-template-columns:1fr;gap:12px}body.fatemate-shell-ready .history-side{display:flex;overflow-x:auto}body.fatemate-shell-ready .history-side a{white-space:nowrap}body.fatemate-shell-ready .history-list-panel,body.fatemate-shell-ready .history-detail{min-height:0}html.fm-content body.fatemate-shell-ready article.fm-article-with-contents{display:flex;flex-direction:column;gap:0}html.fm-content body.fatemate-shell-ready article.fm-article-with-contents>header{order:0}html.fm-content body.fatemate-shell-ready article.fm-article-with-contents>.fm-article-contents{order:1;position:static;width:100%;margin:20px 0 0}html.fm-content body.fatemate-shell-ready article.fm-article-with-contents>.fm-reading{order:2}}
@media(max-width:760px){body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-main,.life-main,.network-main,.history-main,.relations-main,.tarot-main){width:calc(100% - 32px);padding:24px 0 64px!important}body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-header,.life-header,.network-header,.history-heading,.relations-heading,.tarot-header){padding:0 0 20px!important}body.fatemate-shell-ready:not(.fate-home-v2) :is(.qimen-header,.life-header,.network-header,.history-heading,.relations-heading,.tarot-header) h1{font-size:30px}body.fatemate-shell-ready :is(.relations-heading,.network-header,.history-heading){padding-right:0!important}body.fatemate-shell-ready :is(.relations-heading,.network-header,.history-heading)::after{display:none}body.fatemate-shell-ready .network-grid{grid-template-columns:1fr}body.fatemate-shell-ready .network-graph-panel{min-height:260px}body.fatemate-shell-ready .account-hero{padding-right:12px!important}body.fatemate-shell-ready .account-hero::after,body.fate-commerce.fatemate-shell-ready .commerce-main:not(.account-main)::before{display:none!important}body.fate-commerce.fatemate-shell-ready .commerce-main:not(.account-main)>:is(h1,.commerce-kicker,.commerce-lead){max-width:none}body.fatemate-shell-ready .relations-form,body.fatemate-shell-ready .relations-result,body.fatemate-shell-ready .network-panel{padding:18px}body.fatemate-shell-ready .qimen-placeholder,body.fatemate-shell-ready .qimen-result{padding:18px}body.fatemate-shell-ready .life-placeholder{min-height:220px}}
@media(min-width:1150px){body.fatemate-shell-ready .life-header::after{width:100%}body.fatemate-shell-ready :is(.qimen-header,.life-header){border-bottom:0!important}}
body.fatemate-shell-ready .life-placeholder-art{background:repeating-linear-gradient(to bottom,transparent 0 49px,#dfdcd6 50px,#dfdcd6 51px),repeating-linear-gradient(to right,transparent 0 69px,#ebe8e2 70px,#ebe8e2 71px);border-bottom:1px solid #d5d1cb;opacity:1}
@media(min-width:950px){html.fm-workspace body.fatemate-shell-ready .container:has(>.fm-tool-page [data-huangli-calendar]){max-width:1480px!important;width:100%!important}html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>.fm-page-heading{grid-template-columns:minmax(0,1.2fr) minmax(260px,1fr)!important}html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>.fm-page-heading>h1{max-width:none!important}}
html.fm-content body.fatemate-shell-ready .fm-article-contents ol{list-style:decimal!important}
@media(min-width:800px){html.fm-bazi-match-tool body.fatemate-shell-ready .fm-tool-page>.fm-page-heading,html.fm-local-birth-tool body.fatemate-shell-ready .fm-tool-page>.fm-page-heading{background:#f6f5f2 url('/_design/home-4k-pair.png') right center/auto 150px no-repeat!important}html.fm-bazi-match-tool body.fatemate-shell-ready .fm-tool-page>.fm-page-heading p,html.fm-local-birth-tool body.fatemate-shell-ready .fm-tool-page>.fm-page-heading p{max-width:65%!important}}
@media(min-width:901px){html.fm-content body.fatemate-shell-ready .fm-guide-with-contents{display:grid;grid-template-columns:210px minmax(0,1fr);column-gap:44px;row-gap:45px;align-items:start}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>:first-child{grid-column:1/-1;grid-row:1}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>section{grid-column:2;margin:0!important;min-width:0}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>.fm-article-contents{grid-column:1;grid-row:2 / span 50}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>script{display:none}}
@media(max-width:900px){html.fm-content body.fatemate-shell-ready .fm-guide-with-contents{display:flex;flex-direction:column}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>:first-child{order:0}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>.fm-article-contents{order:1;position:static;width:100%;margin:24px 0 0}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>section{order:2;width:100%}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>script{display:none}}
@media(min-width:1150px){body.fatemate-shell-ready .life-main:has(#life-result:not([hidden])){grid-template-columns:minmax(220px,.75fr) minmax(0,2.25fr);grid-template-rows:auto auto}body.fatemate-shell-ready .life-main:has(#life-result:not([hidden])) .life-header{grid-column:1;grid-row:1/3}body.fatemate-shell-ready .life-main:has(#life-result:not([hidden])) :is(.life-form,.life-collapsed-info){grid-column:2;grid-row:1}body.fatemate-shell-ready .life-main:has(#life-result:not([hidden])) .life-result{grid-column:2;grid-row:2}}
body.fatemate-shell-ready :is(.qimen-quick h2,.qimen-quick a){color:#504c47!important;border-color:#dedbd6!important}
@media(min-width:800px){body.tarot-page.fatemate-shell-ready .tarot-header{padding-right:32%!important}body.tarot-page.fatemate-shell-ready .tarot-header::after{content:'';position:absolute;right:0;top:0;width:30%;height:180px;background:url('/_design/home-4k-bottom-tarot.png') center/contain no-repeat;mix-blend-mode:multiply;pointer-events:none}}
@media(min-width:901px){html.fm-content body.fatemate-shell-ready .fm-guide-with-contents> :not(.fm-article-contents):not(script){grid-column:2;margin-top:0!important;min-width:0}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>:first-child,html.fm-content body.fatemate-shell-ready .fm-guide-with-contents.fm-guide-leading-link>:nth-child(2){grid-column:1/-1}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>.fm-article-contents{grid-column:1;grid-row:2 / span 50;margin:0!important}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents.fm-guide-leading-link>.fm-article-contents{grid-row:3 / span 50}}
@media(max-width:900px){html.fm-content body.fatemate-shell-ready .fm-guide-with-contents.fm-guide-leading-link>:nth-child(2){order:0}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>div:not(.fm-article-contents){order:2}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>:first-child{order:0}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>.fm-article-contents{order:1;margin:24px 0 0!important}}
@media(max-width:900px){html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>:first-child,html.fm-content body.fatemate-shell-ready .fm-guide-with-contents.fm-guide-leading-link>:nth-child(2){order:0!important}html.fm-content body.fatemate-shell-ready .fm-guide-with-contents>.fm-article-contents{order:1!important}}
@media(max-width:760px){html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>.fm-page-heading>h1{max-width:none!important;font-size:26px!important;line-height:1.3!important}}
/* Daily outlook uses a genuine empty state until a reading or error exists. */
html.fm-daily-tool body.fatemate-shell-ready .aiboys-daily-placeholder{min-height:430px;padding:26px;border:1px solid #dcd9d3;border-radius:10px;background:#f4f3f0}
html.fm-daily-tool body.fatemate-shell-ready .aiboys-daily-placeholder h2{font:500 22px/1.35 Georgia,'Songti SC',serif;color:#252321;margin:0 0 12px}
html.fm-daily-tool body.fatemate-shell-ready .aiboys-daily-placeholder p{font-size:13px;line-height:1.7;color:#77716a}
html.fm-daily-tool body.fatemate-shell-ready .aiboys-daily-placeholder-art{height:220px;margin-top:25px;background:url('/_design/home-4k-daily.png') center/contain no-repeat;mix-blend-mode:multiply}
html.fm-daily-tool body.fatemate-shell-ready .fm-tool-page:has([data-aiboys-daily-result]) .aiboys-daily-placeholder{display:none}
@media(min-width:1000px){
 html.fm-daily-tool body.fatemate-shell-ready .container:has(>.fm-tool-page){max-width:1480px!important;width:100%!important}
 html.fm-daily-tool body.fatemate-shell-ready .fm-tool-page{display:grid!important;grid-template-columns:minmax(300px,.88fr) minmax(0,1.12fr);grid-template-rows:auto 1fr;gap:18px 24px;align-items:start;padding:42px 24px 70px!important}
 html.fm-daily-tool body.fatemate-shell-ready .fm-tool-page>.fm-page-heading{grid-column:1;grid-row:1;margin:0!important;padding:0!important;min-height:0!important;border:0!important;background:transparent!important}
 html.fm-daily-tool body.fatemate-shell-ready .fm-tool-page>.aiboys-panel{grid-column:1;grid-row:2;margin:0!important}
 html.fm-daily-tool body.fatemate-shell-ready .fm-tool-page>.aiboys-daily-placeholder,html.fm-daily-tool body.fatemate-shell-ready .fm-tool-page>[data-aiboys-daily-result]{grid-column:2;grid-row:1 / span 2;margin:0!important;min-width:0}
 html.fm-daily-tool body.fatemate-shell-ready .aiboys-panel-person{grid-template-columns:1fr 1fr}
 html.fm-daily-tool body.fatemate-shell-ready .fm-tool-page>.fm-reading:not(.aiboys-daily-placeholder){grid-column:1/-1}
}
/* Six Lines and Plum Blossom: the real controls and real result stay side by side. */
@media(min-width:1000px){
 html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has(.aiboys-divination-panel[data-divination-kind=liuyao]),
 html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has(.aiboys-divination-panel[data-divination-kind=meihua]){max-width:1400px!important;width:min(1400px,calc(100% - 80px))!important;padding:40px 0 80px!important}
 html.fm-workspace body.fatemate-shell-ready .container:has(>.fm-tool-page .aiboys-divination-panel[data-divination-kind=liuyao]),
 html.fm-workspace body.fatemate-shell-ready .container:has(>.fm-tool-page .aiboys-divination-panel[data-divination-kind=meihua]){max-width:1480px!important;width:100%!important}
 html.fm-workspace body.fatemate-shell-ready .fm-page-heading:has(>.aiboys-divination-panel[data-divination-kind=liuyao]),
 html.fm-workspace body.fatemate-shell-ready .fm-page-heading:has(>.aiboys-divination-panel[data-divination-kind=meihua]){display:grid!important;grid-template-columns:minmax(300px,.88fr) minmax(0,1.12fr)!important;grid-template-rows:auto auto auto auto!important;gap:0 24px!important;align-items:start!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important}
 html.fm-workspace body.fatemate-shell-ready .fm-page-heading:has(>.aiboys-divination-panel[data-divination-kind=liuyao])>h1,
 html.fm-workspace body.fatemate-shell-ready .fm-page-heading:has(>.aiboys-divination-panel[data-divination-kind=meihua])>h1{grid-column:1;grid-row:1;margin:0!important}
 html.fm-workspace body.fatemate-shell-ready .fm-page-heading:has(>.aiboys-divination-panel[data-divination-kind=liuyao])>p,
 html.fm-workspace body.fatemate-shell-ready .fm-page-heading:has(>.aiboys-divination-panel[data-divination-kind=meihua])>p{grid-column:1;grid-row:2;max-width:none!important;margin:14px 0 24px!important}
 html.fm-workspace body.fatemate-shell-ready .fm-page-heading>.aiboys-divination-panel[data-divination-kind=liuyao],
 html.fm-workspace body.fatemate-shell-ready .fm-page-heading>.aiboys-divination-panel[data-divination-kind=meihua]{display:contents!important}
 html.fm-workspace body.fatemate-shell-ready .aiboys-divination-panel:is([data-divination-kind=liuyao],[data-divination-kind=meihua]) .aiboys-divination-form{grid-column:1;grid-row:3;border:1px solid #dcd9d3!important;border-bottom:0!important;border-radius:10px 10px 0 0!important;padding:24px!important}
 html.fm-workspace body.fatemate-shell-ready .aiboys-divination-panel:is([data-divination-kind=liuyao],[data-divination-kind=meihua]) .aiboys-divination-submit{grid-column:1;grid-row:4;width:calc(100% - 48px)!important;margin:0 24px 24px!important;z-index:1}
 html.fm-workspace body.fatemate-shell-ready .aiboys-divination-panel:is([data-divination-kind=liuyao],[data-divination-kind=meihua])::after{content:''!important;display:block!important;grid-column:1;grid-row:4;min-height:70px;border:1px solid #dcd9d3!important;border-top:0!important;border-radius:0 0 10px 10px;background:#f4f3f0!important}
 html.fm-workspace body.fatemate-shell-ready .aiboys-divination-panel:is([data-divination-kind=liuyao],[data-divination-kind=meihua]) .aiboys-divination-report{grid-column:2;grid-row:1 / span 4;min-height:480px;margin:0!important;padding:26px!important;border:1px solid #dcd9d3!important;border-radius:10px!important}
}
html.fm-daily-tool.fate-help-available body.fatemate-shell-ready .fm-tool-page>.aiboys-daily-placeholder{display:block!important}
html.fm-daily-tool.fate-help-available body.fatemate-shell-ready .fm-tool-page:has([data-aiboys-daily-result])>.aiboys-daily-placeholder{display:none!important}
html.fm-daily-tool body.fatemate-shell-ready .aiboys-panel-person{border:0!important;background:transparent!important;padding:0!important}
@media(min-width:1000px){html.fm-daily-tool body.fatemate-shell-ready .fm-tool-page>section.text-center{grid-column:1/-1}}
html.fm-daily-tool body.fatemate-shell-ready [data-aiboys-daily-result]{border:1px solid #dcd9d3!important;border-radius:10px!important;background:#f4f3f0!important;box-shadow:none!important}
html.fm-daily-tool body.fatemate-shell-ready [data-aiboys-daily-result] .aiboys-report-badge{background:transparent!important;color:#252321!important;border-bottom:1px solid #dcd9d3;font:500 21px/1.4 Georgia,'Songti SC',serif;padding:22px 24px}
/* Keep semantic star colors inside the chart, but make the surrounding controls neutral. */
html body.fatemate-shell-ready .ziwei-result-workspace.is-open :is(.ziwei-edit-birth,.fate-save-chart,.ziwei-time-tabs button){color:#4e4a45!important;border-color:#c9c5be!important}
@media(max-width:420px){body.fatemate-shell-ready:not(.fate-home-v2) .fate-login-link{padding-left:10px;padding-right:10px}}
body.fatemate-shell-ready .history-item[aria-pressed=true]{border-color:#bdb8b0!important;color:#252321!important}
body.fatemate-shell-ready .extra-content>h2{font:500 25px/1.3 Georgia,'Songti SC',serif;color:#252321;margin:30px 0 18px}
body.fatemate-shell-ready .extra-grid a{min-height:88px;padding:16px 18px!important;align-items:center;border-radius:10px!important}
body.fatemate-shell-ready .extra-grid .extra-copy strong{color:#252321!important;font:500 17px/1.3 Georgia,'Songti SC',serif}
body.fatemate-shell-ready .extra-grid .extra-copy span{color:#6a6660!important;line-height:1.45}
body.fatemate-shell-ready .extra-grid .extra-copy{overflow-wrap:anywhere}
@media(max-width:480px){body.fatemate-shell-ready .extra-grid{grid-template-columns:1fr}}
body.fatemate-shell-ready .extra-grid a::after{content:'→';margin-left:auto;padding-left:12px;color:#3d3a36}
@media(max-width:360px){body.fatemate-shell-ready:not(.fate-home-v2) .fate-login-link{padding-left:6px;padding-right:6px;font-size:12px}}
/* Account access: the former password-reset route now explains the active sign-in method. */
body.account-access-page{margin:0;background:#f7f6f3;font-family:Arial,"PingFang SC","Microsoft YaHei",sans-serif}
body.account-access-page *,body.account-access-page *::before,body.account-access-page *::after{box-sizing:border-box}
.account-access-main{box-sizing:border-box;max-width:1400px;min-height:calc(100vh - 73px);margin:0 auto;padding:96px 7%;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(220px,.85fr);align-items:center;gap:48px;border-bottom:1px solid #d7d5d1;color:#181818}
.account-access-copy{max-width:650px}.account-access-kicker{margin:0 0 26px;color:#77736e;font:500 11px/1.4 sans-serif;letter-spacing:.1em}.account-access-main h1{margin:0 0 24px;font-family:Georgia,"Noto Serif SC","Songti SC",serif;font-size:48px;line-height:1.2;font-weight:500}.account-access-lead,.account-access-note{max-width:560px;color:#55514d;font-size:16px;line-height:1.8}.account-access-note{margin:8px 0 0}.account-access-actions{display:flex;flex-wrap:wrap;align-items:center;gap:24px;margin-top:36px}.account-access-actions a{display:inline-flex;align-items:center;justify-content:center;gap:16px;min-height:48px;text-decoration:none}.account-access-primary{padding:0 24px;border:1px solid #171717;border-radius:5px;background:#171717;color:#fff}.account-access-primary:hover{background:#3a3937}.account-access-secondary{color:#242321;border-bottom:1px solid #777}.account-access-actions a:focus-visible{outline:2px solid #555;outline-offset:4px}.account-access-art{height:320px;background:url('/_design/home-4k-orbit.png') center/contain no-repeat}
@media(max-width:700px){.account-access-main{min-height:calc(100vh - 68px);padding:64px 24px;grid-template-columns:1fr;gap:24px;align-content:center}.account-access-main h1{font-size:32px}.account-access-art{height:180px;grid-row:1}.account-access-actions{gap:18px}.account-access-kicker{margin-bottom:18px}}

/* The current almanac form replaces the captured AI box. The captured landing
   document also contains a fixed historical day, which is not today's result. */
html.fm-workspace body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>div.mb-12>.grid>div:nth-child(n+3){display:none!important}
html:is(.fm-huangli-root,.fm-huangli-fallback,.fm-huangli-out-of-sync) body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>div.mb-12>.grid>article{display:none!important}
html:is(.fm-huangli-fallback,.fm-huangli-out-of-sync) body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>div.mb-12>.grid>div:first-child{display:none!important}
@media(min-width:950px){html.fm-huangli-root body.fatemate-shell-ready .fm-tool-page:has([data-huangli-calendar])>div.mb-12>.grid{grid-template-columns:minmax(0,1fr)!important;max-width:680px;margin-inline:auto}}
/* Shared paper-and-ink controls for the captured workspace forms. */
body:not(.fate-home-v2) [role="listbox"] {
  border: 1px solid #d0cbc3 !important;
  border-radius: 8px !important;
  background: #f8f7f3 !important;
  color: #3c3934 !important;
  box-shadow: 0 12px 28px rgba(42,35,26,.17), 0 2px 7px rgba(42,35,26,.08) !important;
  font-family: Georgia,"Songti SC","Noto Serif CJK SC",serif;
}
body:not(.fate-home-v2) [role="listbox"] [data-radix-select-viewport] { padding: 5px !important; }
body:not(.fate-home-v2) [role="listbox"] [role="option"] {
  min-height: 37px; padding: 7px 30px 7px 10px !important; border-radius: 5px !important;
  color: #3c3934; font: 14px/1.35 Georgia,"Songti SC","Noto Serif CJK SC",serif; cursor: pointer;
}
body:not(.fate-home-v2) [role="listbox"] [role="option"]:is(:hover,[data-highlighted]) { background: #ebe9e3 !important; }
body:not(.fate-home-v2) [role="listbox"] [role="option"][data-state="checked"] { color: #171615; font-weight: 600; }
body:not(.fate-home-v2) :is(form, [role="dialog"]) button[role="combobox"] {
  border-color: #c9c5be; background: #f9f8f5; color: #292724;
  font-family: Georgia,"Songti SC","Noto Serif CJK SC",serif;
}
body:not(.fate-home-v2) :is(form, [role="dialog"]) button[role="combobox"]:is(:hover,[aria-expanded="true"]) { border-color: #89837a; background: #fffefa; }

/* The original Radix dialog keeps its focus management and date handling. */
body:has(> [role="dialog"] .rdp) > [data-state="open"][aria-hidden="true"].fixed { background: transparent !important; }
body > [role="dialog"]:has(.rdp) {
  position: fixed; display: block !important; width: min(350px, calc(100vw - 24px)) !important;
  max-width: 350px !important; max-height: min(520px, calc(100dvh - 24px)); overflow: visible;
  padding: 15px !important; border: 1px solid #c7c1b8 !important; border-radius: 9px !important;
  background: #f8f7f3 !important; color: #24221f !important;
  box-shadow: 0 14px 30px rgba(42,35,26,.16), 0 3px 8px rgba(42,35,26,.08) !important;
  font-family: Georgia,"Songti SC","Noto Serif CJK SC",serif;
  animation: none !important;
}
body > [role="dialog"]:has(.rdp) > div:first-child,
body > [role="dialog"]:has(.rdp) > button:last-child {
  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;
}
body > [role="dialog"]:has(.rdp) > div:has(> button[role="combobox"]) {
  display: grid !important; grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr); gap: 3px !important;
  margin: 0 31px !important; padding: 0 !important; border: 0 !important;
}
body > [role="dialog"]:has(.rdp) > div > button[role="combobox"] {
  width: 100% !important; height: 34px !important; padding: 0 8px !important; border: 0 !important;
  border-radius: 4px !important; background: #efede8 !important; box-shadow: none !important; font-size: 13px !important;
}
body > [role="dialog"]:has(.rdp) .rdp { width: 100% !important; margin: 14px 0 0 !important; padding: 0 !important; border: 0 !important; }
body > [role="dialog"]:has(.rdp) .rdp :is(.rdp-caption_start,.rdp-caption_end) { width: 100%; }
body > [role="dialog"]:has(.rdp) .rdp .rdp-caption_start > div:first-child { position: static !important; padding: 0 !important; }
body > [role="dialog"]:has(.rdp) .rdp [role="presentation"][aria-live] {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}
body > [role="dialog"]:has(.rdp) .rdp button[name$="-month"] {
  position: absolute !important; top: 15px !important; width: 28px !important; min-height: 34px !important; height: 34px !important;
  border: 0 !important; background: transparent !important; box-shadow: none !important; opacity: 1 !important;
}
body > [role="dialog"]:has(.rdp) .rdp button[name="previous-month"] { left: 15px !important; }
body > [role="dialog"]:has(.rdp) .rdp button[name="next-month"] { right: 15px !important; }
body > [role="dialog"]:has(.rdp) .rdp table { width: 100%; margin-top: 0 !important; }
body > [role="dialog"]:has(.rdp) .rdp :is(th,td) { width: calc(100% / 7) !important; text-align: center; }
body > [role="dialog"]:has(.rdp) .rdp th { color: #8a847b; font-size: 12px; }
body > [role="dialog"]:has(.rdp) .rdp td { display: grid; place-items: center; background: transparent !important; }
body > [role="dialog"]:has(.rdp) .rdp button[name="day"] { width: 34px !important; min-height: 34px !important; height: 34px !important; border-radius: 50% !important; font-size: 14px; }
body > [role="dialog"]:has(.rdp) .rdp button[name="day"]:hover { background: #e8e5de; }
body > [role="dialog"]:has(.rdp) .rdp button[name="day"][aria-selected="true"] { background: #22211f !important; color: #fff !important; }
body > [role="dialog"]:has(.rdp) .fm-shared-calendar-footer { display: flex; justify-content: space-between; margin-top: 13px; padding-top: 11px; border-top: 1px solid #dedad3; }
body > [role="dialog"]:has(.rdp) .fm-shared-calendar-footer button { min-height: 32px !important; padding: 6px 9px !important; border: 0 !important; border-radius: 4px !important; background: transparent !important; color: #514c45 !important; box-shadow: none !important; font: 13px/1.2 Georgia,"Songti SC",serif !important; }
body > [role="dialog"]:has(.rdp) .fm-shared-calendar-footer button:hover { background: #eae7e0 !important; }
/* Lunar dates retain their year/month/day selectors to support leap months. */
body:has(> [role="dialog"] .grid-cols-3 button[role="combobox"]) > [data-state="open"][aria-hidden="true"].fixed { background: transparent !important; }
body > [role="dialog"]:has(.grid-cols-3 button[role="combobox"]):not(:has(.rdp)) {
  width: min(400px, calc(100vw - 24px)) !important; max-width: 400px !important;
  padding: 20px !important; border: 1px solid #c7c1b8 !important; border-radius: 9px !important;
  background: #f8f7f3 !important; color: #24221f !important;
  box-shadow: 0 14px 30px rgba(42,35,26,.16), 0 3px 8px rgba(42,35,26,.08) !important;
  font-family: Georgia,"Songti SC","Noto Serif CJK SC",serif; animation: none !important;
}
body > [role="dialog"]:has(.grid-cols-3 button[role="combobox"]):not(:has(.rdp)) .grid-cols-3 { gap: 8px !important; }
@supports (top: anchor(bottom)) {
  @position-try --fm-calendar-above { top: auto; bottom: calc(anchor(top) + 9px); }
  @media (min-width: 601px) {
    body:has(> [role="dialog"] .rdp) button[aria-haspopup="dialog"][data-state="open"]:has(svg.lucide-calendar) { anchor-name: --fm-open-calendar; }
    body > [role="dialog"]:has(.rdp) {
      position-anchor: --fm-open-calendar; top: calc(anchor(bottom) + 9px);
      left: anchor(left) !important; right: auto !important; bottom: auto;
      transform: none !important; position-try-fallbacks: --fm-calendar-above, flip-inline;
    }
  }
}
@media (max-width: 600px) {
  body > [role="dialog"]:has(.rdp) { overflow-y: auto; }
  body:not(.fate-home-v2) [role="listbox"] [role="option"] { min-height: 40px; font-size: 15px; }
}

/* The same controls also wrap native selects and dates in standalone tools. */
body:not(.fate-home-v2) .fm-custom-select { position: relative; min-width: 0; }
body:not(.fate-home-v2) .fm-custom-select.is-open { z-index: 30; }
body:not(.fate-home-v2) .fm-custom-select .fm-select-native { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; border: 0 !important; opacity: 0; clip-path: inset(50%); overflow: hidden; pointer-events: none; }
body:not(.fate-home-v2) .fm-select-trigger { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 43px; padding: 0 13px; border: 1px solid #c9c5be; border-radius: 6px; background: #f9f8f5; color: #292724; text-align: left; font: 14px/1.2 Georgia,"Songti SC",serif; }
/* The Ziwei mirror's legacy selector wins the generic rule with an unset
   variable. Give its five custom date/time controls the intended height. */
body.fate-ziwei-reference .ref-birth-form .fm-select-trigger{min-height:46px;height:46px}
body:not(.fate-home-v2) .fm-select-trigger:is(:hover,[aria-expanded="true"]) { border-color: #89837a; background: #fffefa; }
body:not(.fate-home-v2) .fm-select-trigger:disabled { opacity: .52; cursor: not-allowed; }
body:not(.fate-home-v2) .fm-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body:not(.fate-home-v2) .fm-select-chevron { flex: none; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
body:not(.fate-home-v2) .fm-select-trigger[aria-expanded="true"] .fm-select-chevron { transform: rotate(225deg); }
body:not(.fate-home-v2) .fm-select-menu { position: absolute; z-index: 35; top: calc(100% + 6px); left: 0; width: 100%; min-width: 100%; padding: 5px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid #d0cbc3; border-radius: 8px; background: #f8f7f3; box-shadow: 0 12px 28px rgba(42,35,26,.17),0 2px 7px rgba(42,35,26,.08); }
body:not(.fate-home-v2) .fm-custom-select.opens-above .fm-select-menu { top: auto; bottom: calc(100% + 6px); }
body:not(.fate-home-v2) .fm-select-menu[hidden] { display: none !important; }
body:not(.fate-home-v2) .fm-select-option { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 37px; padding: 7px 10px; border-radius: 5px; color: #3c3934; font: 14px/1.35 Georgia,"Songti SC",serif; cursor: pointer; }
body:not(.fate-home-v2) .fm-select-option:is(:hover,.is-active) { background: #ebe9e3; }
body:not(.fate-home-v2) .fm-select-option[aria-selected="true"] { color: #171615; font-weight: 600; }
body:not(.fate-home-v2) .fm-select-check { visibility: hidden; }
body:not(.fate-home-v2) .fm-select-option[aria-selected="true"] .fm-select-check { visibility: visible; }
body:not(.fate-home-v2) .fm-select-error { display: block; margin-top: 6px; color: #9a554d; font-size: 12px; }
body:not(.fate-home-v2) .fm-select-error[hidden] { display: none; }
body:not(.fate-home-v2) .fm-global-date { position: relative; display: block; min-width: 0; }
body:not(.fate-home-v2) .fm-global-date .home-date-control { position: relative; display: block; }
body:not(.fate-home-v2) .fm-global-date input { width: 100%; padding-right: 48px !important; }
body:not(.fate-home-v2) .fm-global-date input[hidden] { display: none !important; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-trigger { position: absolute; top: 3px; right: 3px; display: grid; place-items: center; width: 38px; min-height: 37px; padding: 9px; border: 0; border-radius: 4px; background: transparent; color: #45413c; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-trigger svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.5; }
body:not(.fate-home-v2) .fm-global-date .home-date-popover { position: absolute; top: 100%; left: 0; z-index: 40; display: block; width: min(350px, calc(100vw - 32px)); margin-top: 9px; padding: 15px; border: 1px solid #c7c1b8; border-radius: 9px; background: #f8f7f3; color: #24221f; box-shadow: 0 14px 30px rgba(42,35,26,.16),0 3px 8px rgba(42,35,26,.08); }
body:not(.fate-home-v2) .fm-global-date .home-date-popover[hidden] { display: none !important; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-header { display: grid; grid-template-columns: 28px minmax(0,1.1fr) minmax(0,.9fr) 28px; gap: 3px; align-items: center; }
body:not(.fate-home-v2) .fm-global-date .is-calendar-select .fm-select-trigger { min-height: 34px; height: 34px; padding: 0 8px; border-color: transparent; background: #efede8; font-size: 13px; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-nav { width: 28px; min-height: 34px; height: 34px; padding: 0; border: 0; background: transparent; color: #48443e; font: 25px/1 Georgia,serif; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; margin-top: 14px; text-align: center; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-weekday { display: grid; place-items: center; min-height: 29px; color: #8a847b; font-size: 12px; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-day { display: grid; place-items: center; justify-self: center; width: 34px; min-height: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #393631; font: 14px/1 Georgia,"Songti SC",serif; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-day:hover { background: #e8e5de; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-day[aria-pressed="true"] { background: #22211f; color: #fff; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-footer { display: flex; justify-content: space-between; margin-top: 13px; padding-top: 11px; border-top: 1px solid #dedad3; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-action { min-height: 32px; padding: 6px 9px; border: 0; border-radius: 4px; background: transparent; color: #514c45; font: 13px/1.2 Georgia,"Songti SC",serif; }
body:not(.fate-home-v2) .fm-global-date :is(.home-calendar-trigger,.home-calendar-nav,.home-calendar-day,.home-calendar-action) { border: 0 !important; background: transparent !important; color: #393631 !important; box-shadow: none !important; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-day[aria-pressed="true"] { background: #22211f !important; color: #fff !important; }
body:not(.fate-home-v2) .fm-global-date :is(.home-calendar-nav,.home-calendar-action) { border-radius: 4px !important; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-day:hover { background: #e8e5de !important; }
body:not(.fate-home-v2) .fm-global-date .home-calendar-day[aria-pressed="true"]:hover { background: #22211f !important; }
body:not(.fate-home-v2) .fm-custom-select .fm-select-trigger { border-radius: 6px !important; color: #292724 !important; background: #f9f8f5 !important; box-shadow: none !important; }
body:not(.fate-home-v2) .fm-global-date .is-calendar-select .fm-select-trigger { border-radius: 4px !important; background: #efede8 !important; }
body:not(.fate-home-v2) .fm-global-time { display: block; min-width: 0; }
body:not(.fate-home-v2) .fm-global-time input[hidden], body:not(.fate-home-v2) .fm-global-time .home-time-controls[hidden] { display: none !important; }
body:not(.fate-home-v2) .fm-global-time .home-time-controls { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 10px; align-items: center; }
@media(max-width:600px){
  body.fatemate-shell-ready .life-fields>label:nth-child(-n+2){grid-column:1/-1}
  body.fatemate-shell-ready #person-form .network-fields{grid-template-columns:1fr}
  body.fatemate-shell-ready .qimen-fields>label:last-child{grid-column:1/-1}
}
body:not(.fate-home-v2) .fm-global-time .fm-select-menu { min-width: 140px; }
body:not(.fate-home-v2) .fm-global-time .home-select-wrap:last-child .fm-select-menu { left: auto; right: 0; }
/* Birthplace suggestions use the same paper surface as the shared selects. */
.fm-birthplace .fm-birthplace-list, .fm-birthplace .fm-birthplace-empty {
  z-index: 30; border: 1px solid #d0cbc3; border-radius: 8px; background: #f8f7f3;
  color: #3c3934; box-shadow: 0 12px 28px rgba(42,35,26,.17), 0 2px 7px rgba(42,35,26,.08);
}
.fm-birthplace .fm-birthplace-list { max-height: 240px; padding: 5px; overscroll-behavior: contain; }
.fm-birthplace .fm-birthplace-list [data-fm-place-option] {
  min-height: 37px; height: auto; padding: 8px 10px; border: 0; border-radius: 5px;
  background: transparent; color: #3c3934; white-space: normal; text-align: left;
  font: 14px/1.35 Georgia,"Songti SC","Noto Serif CJK SC",serif; cursor: pointer;
}
.fm-birthplace .fm-birthplace-list [data-fm-place-option]:is(:hover,:focus-visible) { background: #ebe9e3; outline: none; }
.fm-birthplace .fm-birthplace-empty { position: absolute; top: calc(100% + 4px); left: 0; width: 100%; padding: 12px; font-size: 13px; }
@media (max-width: 600px) {
  body:not(.fate-home-v2) .fm-global-date .home-date-popover { position: fixed; top: 50%; left: 50%; width: min(350px, calc(100vw - 32px)); margin: 0; transform: translate(-50%, -50%); max-height: calc(100dvh - 24px); overflow-y: auto; }
  body:not(.fate-home-v2) .fm-select-trigger { font-size: 16px; }
}
