:root{font-family:-apple-system,BlinkMacSystemFont,'Noto Sans TC','PingFang TC','Microsoft JhengHei',sans-serif;color:#302e32;background:#f5f2eb;font-synthesis:none;--ink:#783b47;--line:#ded8cc;--muted:#7e7774}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid var(--line);border-radius:8px;background:#fffdf9;padding:10px 16px;color:inherit;min-height:44px;transition:background .15s}button:hover{background:#eee7df}button:focus-visible,a:focus-visible{outline:3px solid #bb8f58;outline-offset:2px}button.primary{background:var(--ink);border-color:var(--ink);color:white}button.primary:hover{background:#632e39}button.danger{background:#943945;color:white}a{color:var(--ink)}h1,h2,h3,p{margin:0}h1{font-size:30px;letter-spacing:.04em}h2{font-size:22px}h3{font-size:14px;font-weight:600;margin-bottom:12px}p{line-height:1.75}small{font-size:12px;line-height:1.6}.header{height:84px;padding:0 max(28px,calc((100vw - 1320px)/2));display:flex;align-items:center;gap:48px;border-bottom:1px solid var(--line);background:#fcfaf5}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;white-space:nowrap}.brand img{width:42px;height:42px}.brand span{font-size:19px;font-weight:700;letter-spacing:.15em}.brand small{display:block;font-size:10px;color:var(--muted);font-weight:400;letter-spacing:.28em;margin-top:3px}.header nav{display:flex;gap:10px;flex:1}.header nav button{border:0;background:none;color:var(--muted)}.header nav button.active{color:var(--ink);font-weight:700;background:#f1e6e5}main{max-width:1320px;margin:auto;padding:32px 28px}.pagehead{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:28px}.eyebrow{font-size:10px;letter-spacing:.22em;color:#9a8276;margin-bottom:10px;font-weight:600}.pagehead h1{display:flex;align-items:center;gap:12px}.pagehead p:not(.eyebrow){font-size:14px;color:var(--muted);margin-top:8px}.pill{display:inline-block;vertical-align:middle;font-size:11px;font-weight:500;letter-spacing:0;padding:4px 8px;background:#ece5dc;border-radius:5px;color:#776657}.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 318px;gap:24px;align-items:start}.chart-panel{min-width:0}.scope-tabs{display:flex;border:1px solid var(--line);padding:5px;background:#fcfaf5;border-radius:10px;margin-bottom:16px;gap:4px}.scope-tabs button{flex:1;padding:10px 4px;border:0;min-width:0;background:none;font-size:14px}.scope-tabs button.active{background:var(--ink);color:white;box-shadow:0 2px 4px #783b4720}.board{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,166px);background:#fffdf8;border:1px solid #c6bbaa;border-radius:10px;overflow:hidden}.palace{border:0;border-radius:0;border-right:1px solid #d8cebe;border-bottom:1px solid #d8cebe;text-align:left;padding:10px;position:relative;background:transparent;display:flex;flex-direction:column;overflow:hidden;min-width:0}.palace:hover{background:#f8eee4}.palace.related{background:#f5eee1}.palace.selected{background:#f1dfde;box-shadow:inset 0 0 0 2px var(--ink);z-index:1}.p-top{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:#9b8b77;margin-bottom:8px}.p-top b{font-size:10px;font-weight:500;background:var(--ink);color:white;border-radius:3px;padding:1px 4px}.major{display:flex;flex-wrap:wrap;gap:5px;font-weight:600;color:var(--ink);font-size:16px}.star{display:inline-flex;align-items:center;gap:2px;white-space:nowrap;line-height:1.65}.star small{font-size:10px;font-weight:400;color:#8f8272}.minor{display:flex;flex-wrap:wrap;gap:2px 7px;margin-top:4px;font-size:12px;color:#637d7b;max-height:54px;overflow:hidden}.tough{color:#9a6245}.badge{font-size:9px;line-height:15px;border-radius:3px;display:inline-block;padding:0 3px;color:white;background:#688b78;font-weight:500}.b權{background:#b1803e}.b科{background:#548e9a}.b忌{background:#a64b56}.badge.cycle{background:transparent;color:#688b78;border:1px solid currentColor;line-height:13px}.badge.cycle.b權{color:#a87836}.badge.cycle.b科{color:#548e9a}.badge.cycle.b忌{color:#a64b56}.p-bottom{margin-top:auto;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:2px}.p-bottom strong{font-size:14px;color:#383234;font-weight:600}.p-bottom>span:not(.overlay-name){font-size:10px;color:#8e806f}.overlay-name{flex-basis:100%;font-size:10px;color:var(--ink)}.empty-star{color:#a19486;font-size:13px;font-weight:400}.chart-center{grid-column:2/4;grid-row:2/4;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;border-right:1px solid #d8cebe;border-bottom:1px solid #d8cebe;background:radial-gradient(ellipse,#fcf9f1,#f7f2e7);padding:16px;min-width:0}.center-mark{font-size:32px;color:#b39560;margin-bottom:6px}.chart-center h2{font-size:24px;letter-spacing:.12em;margin-bottom:8px}.chart-center>span:not(.center-mark){font-size:13px;color:var(--ink)}.chart-center dl{display:grid;grid-template-columns:32px 1fr;gap:8px 12px;text-align:left;font-size:12px;margin:18px 0;max-width:100%;line-height:1.6}.chart-center dt{color:#9b8b77}.chart-center dd{margin:0;overflow-wrap:anywhere}.chart-center>small{font-size:10px;color:#9b8b77}.cycle-summary{font-size:12px;color:var(--ink);margin-bottom:8px}.legend{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:14px 0;font-size:10px;color:#85786b}.legend>span{display:flex;align-items:center;gap:4px}.dot{width:9px;height:9px;border-radius:2px;display:inline-block}.selected-dot{background:#bd8a8f}.related-dot{background:#e0d2b5}.switch{margin-left:auto;display:flex;align-items:center;gap:4px}.switch input{accent-color:var(--ink);width:16px;height:16px;margin:0}.decadal-list{display:flex;overflow-x:auto;gap:6px;padding:4px 0 12px;scrollbar-width:thin}.decadal-list button{flex:0 0 67px;padding:7px 4px;font-size:12px}.decadal-list button small{display:block;font-size:10px;color:var(--muted)}.decadal-list button.active{background:#f1dfde;border-color:var(--ink);color:var(--ink)}.detail-panel{border:1px solid var(--line);border-radius:12px;background:#fcfaf5;padding:24px}.detail-panel h2{display:flex;gap:8px;align-items:center;margin-bottom:8px}.subtle{font-size:12px;color:var(--muted)}.detail-panel section{margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}.detail-stars{display:flex;flex-wrap:wrap;gap:6px 12px;color:var(--ink);font-size:15px}.muted-stars{font-size:13px;color:#82766a}.relations{display:grid;grid-template-columns:1fr 1fr;gap:8px}.relations button{padding:9px;text-align:left;background:#f8f4ec}.relations small{color:#998975;font-size:10px}.relations strong{display:block;font-size:14px;margin:3px 0}.relations span{font-size:11px;color:#887c70}.detail-panel details{margin-top:20px}details summary{font-size:12px;cursor:pointer;color:#8a7561;padding:6px 0}details p{font-size:12px;color:var(--muted);margin-top:8px}textarea{resize:vertical;min-height:90px}.text-button{padding:6px 0;border:0;background:none;color:var(--ink);font-size:12px}.timebar{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}.timebar label{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted)}.timebar input{width:auto;padding:7px;min-height:44px}.timebar button{padding:8px 14px}.mutagens{display:flex;gap:16px;padding:8px 0;font-size:12px}.mutagens>span{display:flex;gap:5px;align-items:center}input,select,textarea{width:100%;min-width:0;border:1px solid var(--line);border-radius:7px;background:#fffdf9;color:#302e32;padding:11px 12px;min-height:44px;outline-color:var(--ink);font-size:16px}label{display:block;font-size:13px;line-height:1.6}label input,label select{margin-top:6px}.library-toolbar{display:flex;gap:12px;max-width:650px}.library-toolbar input{flex:1}.library-toolbar button{white-space:nowrap}.category-tabs{display:flex;gap:8px;overflow-x:auto;padding:24px 0}.category-tabs button{white-space:nowrap}.category-tabs button small{margin-left:10px;color:#a59483}.category-tabs .active{color:var(--ink);border-color:var(--ink);background:#f1dfde}.record-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.record{padding:24px;border:1px solid var(--line);background:#fffdf8;border-radius:12px}.record h2{margin:16px 0 8px}.record p{font-size:13px;color:#827669}.record>div{display:flex;gap:8px;margin-top:20px}.record .snippet{margin-top:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.empty{text-align:center;padding:80px 20px;color:#9b8b77}.empty>span{font-size:48px;color:#b89a68}.empty h2{color:#5c5149;margin:16px 0}.empty button{margin-top:24px}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;max-width:1000px}.setting-card{border:1px solid var(--line);border-radius:12px;padding:28px;background:#fcfaf5}.setting-card h2{margin-bottom:14px;font-size:20px}.setting-card p{font-size:14px;color:#7d7065;margin-bottom:18px}.setting-card>small{display:block;color:#9b8b77;margin-top:14px}.setting-card a{font-size:13px}footer{display:flex;justify-content:space-between;gap:12px;margin-top:32px;padding:22px 0;border-top:1px solid var(--line);font-size:11px;color:#a39383}.bottom-nav{display:none}.toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#453b39;color:white;border-radius:10px;padding:12px 22px;z-index:100;max-width:90vw;font-size:14px;box-shadow:0 8px 30px #302e3220}.scrim{position:fixed;inset:0;background:#27232666;backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:50;padding:20px}.dialog{background:#fcfaf5;max-width:460px;width:100%;max-height:90dvh;overflow:auto;padding:28px;border-radius:16px;box-shadow:0 20px 80px #221a2740}.dialog-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}.dialog-head button{border:0;background:none;font-size:26px;min-width:44px;padding:4px}.dialog label{margin-bottom:14px}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}.dialog form>small{display:block;color:#9b8b77;margin:-6px 0 16px}.check{display:flex;gap:8px;align-items:center}.check input{width:18px;min-height:18px;height:18px;margin:0;accent-color:var(--ink)}.full{width:100%;margin-top:18px}.error{background:#f7e8e5;color:#a24949;font-size:13px;padding:10px;border-radius:6px;margin-top:12px}.category-manage{margin-top:20px}.category-manage>div{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px solid var(--line);align-items:center}.category-manage button{border:0;font-size:12px;color:var(--ink)}.dialog>small{display:block;margin-top:18px;color:var(--muted)}.dialog>h3{margin-top:20px}.dialog>p{font-size:14px;margin-bottom:14px}
@media(min-width:1500px){.board{grid-template-rows:repeat(4,180px)}}@media(max-width:1050px){.workspace{grid-template-columns:minmax(0,1fr) 280px;gap:16px}.detail-panel{padding:18px}.board{grid-template-rows:repeat(4,150px)}.palace{padding:8px}.major{font-size:14px}.minor{font-size:11px}.chart-center dl{font-size:11px;gap:6px}.header{gap:20px}.record-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:800px){.workspace{grid-template-columns:1fr}.detail-panel{padding:24px}.board{grid-template-rows:repeat(4,170px)}main{padding:24px 20px}.header{padding:0 20px;height:72px}.header nav{justify-content:flex-end}.new-top{display:none}.major{font-size:16px}.minor{font-size:12px}.chart-center dl{font-size:12px}.chart-center h2{font-size:24px}}
@media(max-width:560px){body{padding-bottom:calc(76px + env(safe-area-inset-bottom))}.header{height:68px;padding:0 16px}.brand img{width:36px;height:36px}.brand span{font-size:17px}.header nav{display:none}.new-top{display:block;margin-left:auto;font-size:12px;padding:8px 12px}main{padding:22px 12px}.pagehead{align-items:flex-start;gap:10px;margin-bottom:20px}.pagehead h1{font-size:23px;gap:8px}.pagehead .eyebrow{font-size:9px;margin-bottom:6px}.pagehead p:not(.eyebrow){font-size:12px}.pagehead .actions{gap:5px;flex-direction:column;align-items:stretch}.pagehead .actions button{font-size:11px;padding:7px 10px}.pagehead>button{font-size:12px;padding:8px 10px}.scope-tabs{gap:0;padding:4px;margin-bottom:12px}.scope-tabs button{font-size:12px;min-height:42px;padding:8px 0}.board{grid-template-rows:repeat(4,144px);border-radius:8px}.palace{padding:7px 5px}.p-top{font-size:10px;margin-bottom:6px}.major{font-size:13px;gap:1px;flex-direction:column;align-items:flex-start;line-height:1.5}.major .star{line-height:1.5}.star small{font-size:9px}.badge{font-size:8px;line-height:13px;padding:0 2px}.badge.cycle{line-height:11px}.minor{font-size:10px;gap:1px 4px;max-height:34px;margin-top:5px}.p-bottom{gap:2px;align-items:baseline}.p-bottom strong{font-size:12px}.p-bottom>span:not(.overlay-name){font-size:9px}.overlay-name{font-size:9px}.chart-center{padding:10px 7px}.center-mark{font-size:25px;margin-bottom:4px}.chart-center h2{font-size:19px;margin-bottom:8px;letter-spacing:.04em;overflow-wrap:anywhere}.chart-center>span:not(.center-mark){font-size:11px}.chart-center dl{display:block;font-size:10px;margin:10px 0;text-align:center;line-height:1.6}.chart-center dt{display:none}.chart-center dd{margin-bottom:4px}.chart-center>small{font-size:9px}.cycle-summary{font-size:10px}.legend{gap:8px;font-size:9px;line-height:1.6}.switch{margin-left:0;font-size:11px}.detail-panel{margin-top:6px;padding:20px}.detail-panel h2{font-size:23px}.detail-panel .detail-stars{font-size:16px}.detail-panel .star small{font-size:11px}.detail-panel .badge{font-size:10px;line-height:16px}.detail-panel .badge.cycle{line-height:14px}.timebar{gap:4px}.timebar label{font-size:10px}.timebar input{font-size:13px;padding:5px;width:130px}.timebar button{padding:7px 10px}.timebar label:has(input[type=time]) input{width:90px}.record-grid,.settings-grid{grid-template-columns:1fr}.record{padding:20px}.setting-card{padding:22px}.category-tabs{padding:18px 0;gap:6px}.category-tabs button{font-size:12px;padding:8px 12px}.library-toolbar{gap:8px}.library-toolbar button{font-size:12px;padding:8px 12px}.empty{padding:50px 10px}.empty h2{font-size:20px}.bottom-nav{display:flex;position:fixed;bottom:0;left:0;right:0;background:#fcfaf5f5;border-top:1px solid var(--line);padding:6px 8px calc(6px + env(safe-area-inset-bottom));z-index:20;backdrop-filter:blur(14px)}.bottom-nav button{flex:1;border:0;background:none;font-size:10px;color:#958576;min-height:56px;padding:4px}.bottom-nav button span{display:block;font-size:23px;height:30px;font-weight:300}.bottom-nav button.active{color:var(--ink);font-weight:600}.toast{bottom:calc(85px + env(safe-area-inset-bottom));font-size:12px;padding:12px 16px}.scrim{padding:12px;align-items:flex-end}.dialog{max-height:92dvh;border-radius:16px;padding:22px;margin-bottom:env(safe-area-inset-bottom)}footer{font-size:10px;flex-direction:column;gap:5px;margin-top:20px}.mutagens{font-size:11px;gap:12px}}
@media(max-width:360px){.board{grid-template-rows:repeat(4,140px)}.major{font-size:12px}.palace{padding:6px 4px}.p-bottom>span:not(.overlay-name){font-size:8px}.p-bottom strong{font-size:11px}.chart-center h2{font-size:17px}.pagehead h1{font-size:21px}.chart-center dl{font-size:9px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;scroll-behavior:auto!important}}@media print{.header,.scope-tabs,.actions,.bottom-nav,.decadal-list,.detail-panel textarea,.text-button{display:none}body{background:white;padding:0}main{padding:0}.workspace{display:block}.detail-panel{margin-top:20px}.board{break-inside:avoid}.palace{print-color-adjust:exact;-webkit-print-color-adjust:exact}}
@media(max-width:560px){.pagehead .actions{flex:0 0 82px}.pagehead .actions button{white-space:nowrap}.pagehead>div:first-child{min-width:0}.pagehead h1{flex-wrap:wrap}}
@media(min-width:561px) and (max-width:800px){.new-top{display:block;font-size:12px;padding:8px 10px}.header{gap:12px}.header nav{gap:4px}.header nav button{font-size:12px;padding:8px}}
/* 傳統排盤架構：直列星曜，盤下運限，中央出生資料 */
.eyebrow{display:none}.palace-stars{display:flex;gap:8px;min-height:0;overflow:hidden;margin-bottom:6px}.palace-stars .major,.palace-stars .minor{display:flex;flex-direction:row;align-items:flex-start;flex-wrap:nowrap;gap:5px;margin:0;overflow:visible;max-height:none}.palace-stars .star{writing-mode:vertical-rl;display:inline-flex;align-items:center;gap:3px;line-height:1.05;letter-spacing:2px}.palace-stars .star small{writing-mode:horizontal-tb;letter-spacing:0}.palace-stars .badge{writing-mode:horizontal-tb;letter-spacing:0}.center-mark{font-size:13px;letter-spacing:.2em;color:#8d6c4f}.strip-label{font-size:12px;color:#7f6a56;display:flex;gap:14px;align-items:center;margin-top:10px}.strip-label small{font-size:10px;color:#a39383}.year-list{display:flex;gap:6px;overflow-x:auto;padding:5px 0 10px;scrollbar-width:thin}.year-list button{flex:0 0 68px;font-size:12px;padding:6px 4px}.year-list small{display:block;font-size:10px;color:var(--muted)}.year-list .active{background:#f1dfde;border-color:var(--ink);color:var(--ink)}button:disabled{opacity:.4;cursor:default}.header{height:66px}.pagehead{margin-bottom:18px}.pagehead h1{font-size:25px}.brand small{display:none}
@media(max-width:560px){.header{height:48px;padding:0 12px}.brand img{width:28px;height:28px}.brand span{font-size:16px}.header .new-top{min-height:34px;padding:6px 10px}main{padding:10px 8px}.pagehead{align-items:center;gap:6px;margin-bottom:9px}.pagehead h1{font-size:16px;gap:5px}.pagehead p:not(.eyebrow){display:none}.pagehead .pill{font-size:9px;padding:3px 5px}.pagehead .actions{flex:none;flex-direction:row;gap:5px}.pagehead .actions button{min-height:34px;font-size:11px;padding:5px 8px}.scope-tabs{margin-bottom:7px;border-radius:5px;padding:2px}.scope-tabs button{min-height:35px;font-size:12px}.board{grid-template-rows:repeat(4,126px);border-radius:4px}.palace{padding:5px 4px}.p-top{margin-bottom:5px}.palace-stars{gap:5px;margin-bottom:4px;max-height:78px}.palace-stars .major{font-size:14px;gap:4px}.palace-stars .minor{font-size:11px;gap:4px}.palace-stars .star{letter-spacing:1px;gap:3px}.palace-stars .star small{font-size:9px}.p-bottom strong{font-size:12px}.p-bottom>span:not(.overlay-name){font-size:8px}.p-bottom{gap:1px}.chart-center{padding:7px}.chart-center h2{font-size:18px}.center-mark{font-size:11px;letter-spacing:.15em;margin:0 0 7px}.chart-center dl{font-size:10px;margin:8px 0}.chart-center dd{margin-bottom:4px}.chart-center>small{font-size:9px}.legend{padding:7px 0;font-size:9px;gap:7px}.decadal-list,.year-list{gap:3px;padding-bottom:5px}.decadal-list button,.year-list button{flex-basis:53px;font-size:11px;padding:5px 2px;min-height:39px;border-radius:4px}.strip-label{margin-top:6px;font-size:11px}.strip-label small{font-size:9px}.detail-panel{margin-top:12px}.bottom-nav button{min-height:50px}.bottom-nav button span{font-size:21px;height:26px}.record-grid{gap:10px}.record{padding:16px}.record h2{margin:8px 0;font-size:19px}.record>div{margin-top:12px}.category-tabs{padding:12px 0}.library-toolbar{margin-top:16px}.record .snippet{font-size:12px}}
@media(max-width:360px){.palace-stars .major{font-size:12px}.palace-stars .minor{font-size:10px;gap:3px}.palace-stars{gap:4px}.board{grid-template-rows:repeat(4,126px)}.p-bottom strong{font-size:11px}.chart-center dl{font-size:9px}.pagehead h1{font-size:15px}.pagehead .actions button{font-size:10px;padding:5px 6px}}
/* 本命＋大限＋流年分層疊盤 */
.board{position:relative}.relations-diagram{position:absolute;inset:0;width:100%;height:100%;z-index:2;pointer-events:none}.relations-diagram line{stroke:#a097a3;stroke-width:1.2;stroke-dasharray:4 4;opacity:.55}.chart-center>*{position:relative;z-index:3}.chart-center dl,.chart-center h2,.chart-center .cycle-summary{background:#fbf7efa6;border-radius:4px}.palace-labels{display:flex;flex-direction:column;gap:1px;align-items:flex-start;line-height:1.15}.p-bottom{flex-wrap:nowrap;align-items:flex-end}.natal-name{color:#783b47!important}.decadal-name,.decadal-text{color:#8b6c9b}.yearly-name,.yearly-text{color:#4596a6}.decadal-name,.yearly-name{font-size:12px;font-weight:500}.real-range{color:#a59684;font-size:10px}.layer-status{display:flex;gap:7px;flex-wrap:wrap;align-items:center;font-size:12px;margin:8px 0 12px}.layer-status>b{font-weight:400;color:#b9a998}.layer-status>span:first-child{color:var(--ink)}.layer-badge.decadal{color:#8b6c9b;background:#f2eaf6;border:1px solid #cab5d5}.layer-badge.yearly{color:#338a9c;background:#e7f4f5;border:1px solid #9ccdd5}.mutagens{flex-wrap:wrap;font-size:11px;gap:10px}.mutagens strong{font-size:11px;color:#887765}.decadal-list button,.year-list button{display:flex;flex-direction:column;gap:2px;align-items:center;flex-basis:70px}.decadal-list button strong,.year-list button strong{font-size:12px;font-weight:500}.decadal-list button>span,.year-list button>span{font-size:11px}.scope-tabs button.active{background:#59445f}.scope-tabs button{min-height:40px}.palace.selected{background:#f5e7d1;box-shadow:inset 0 0 0 2px #ba985f}.palace.related{background:#f3f1f8}.decadal-list button.active{background:#eae0ef;border-color:#8b6c9b;color:#755582}.year-list button.active{background:#deeff2;border-color:#4596a6;color:#338a9c}.selected-dot{background:#d1af79}.related-dot{background:#c5b7d5}
@media(max-width:560px){.board{grid-template-rows:repeat(4,146px)}.palace-stars{max-height:87px}.palace-labels{gap:2px}.p-bottom strong{font-size:12px}.decadal-name,.yearly-name{font-size:11px}.real-range{font-size:8px!important;max-width:30px;line-height:1.2;text-align:right}.layer-status{font-size:10px;gap:5px;margin:6px 0 8px}.decadal-list,.year-list{gap:0;border:1px solid #d8cebe;border-radius:3px;padding:0}.decadal-list button,.year-list button{flex-basis:55px;border:0;border-right:1px solid #d8cebe;border-radius:0;min-height:53px;font-size:10px;gap:2px}.decadal-list button>strong,.year-list button>strong{font-size:11px}.decadal-list button>span,.year-list button>span{font-size:10px}.decadal-list button small,.year-list button small{font-size:9px}.strip-label{margin-bottom:5px}.mutagens{font-size:10px;gap:8px;padding:4px 0}.mutagens strong{font-size:10px}.palace-stars .layer-badge{letter-spacing:0;font-size:8px;line-height:11px}.cycle-summary{font-size:10px}.chart-center h2{font-size:17px}.chart-center dl{font-size:10px}.relations-diagram line{stroke-width:1;stroke-dasharray:3 3}.scope-tabs{gap:4px}.scope-tabs button{font-size:13px;min-height:35px}}
@media(max-width:360px){.palace-stars .major{font-size:12px}.palace-stars .minor{font-size:10px}.decadal-name,.yearly-name{font-size:10px}.natal-name{font-size:11px!important}.real-range{font-size:7px!important}.board{grid-template-rows:repeat(4,145px)}}

/* Fixed transformation rows, ordered natal / decade / annual. */
.palace-stars{gap:3px;align-items:flex-start;overflow:hidden}
.palace-stars .major{flex:none;gap:2px}
.palace-stars .minor{min-width:0;flex:1;overflow:hidden;gap:2px}
.palace-stars .star,.detail-stars .star{writing-mode:horizontal-tb;display:inline-flex;flex-direction:column;align-items:center;gap:0;letter-spacing:0;line-height:1}
.star-name{writing-mode:vertical-rl;height:32px;letter-spacing:1px;line-height:1.05}
.star-brightness{height:11px;min-height:11px;line-height:11px;font-size:9px}
.mutagen-stack{display:flex;flex-direction:column;gap:1px}
.mutagen-slot{display:flex;align-items:center;justify-content:center;width:13px;height:13px;min-height:13px}
.fixed-mutagen{display:flex!important;align-items:center;justify-content:center;width:12px;height:12px;padding:0!important;font-size:10px!important;border:0!important;line-height:1!important;border-radius:2px}
.fixed-mutagen.origin{background:#b74750!important;color:white!important}
.fixed-mutagen.decadal{background:#765787!important;color:white!important}
.fixed-mutagen.yearly{background:#258596!important;color:white!important}
.flow-stars{display:flex;flex:none;gap:1px;font-size:10px}
.flow-stars.decadal{color:#765787}.flow-stars.yearly{color:#258596}
.flow-stars .star-name{height:32px;font-size:10px;letter-spacing:0}
.flow-stars .mutagen-stack,.flow-stars .star-brightness{display:none}
.detail-stars{align-items:flex-start}.detail-stars .star{margin-right:8px}
@media(max-width:440px){.palace-stars .star{font-size:11px}.palace-stars .major .star{font-size:12px}.palace-stars{gap:2px}.mutagen-slot{width:11px}.fixed-mutagen{width:11px}}

/* Chart-only layout and center-bound relation lines. */
.workspace{display:block;max-width:900px;margin:0 auto}
.chart-center{position:relative;overflow:hidden}
.chart-center>.relations-diagram{position:absolute;inset:0;z-index:1;border-radius:0;background:none}
.chart-center>*:not(.relations-diagram){z-index:3}
.relations-diagram{overflow:hidden}
.p-top{position:absolute;top:4px;right:4px;margin:0;min-height:0}
.palace-stars{margin-top:2px}
.palace-corner{display:flex;flex-direction:column;align-items:flex-end;gap:3px;align-self:flex-end}
.palace-stem{font-size:12px;line-height:1.1;color:#6e6256;white-space:nowrap;letter-spacing:1px}
.return-origin{float:right;min-height:32px;padding:4px 10px;font-size:11px}
.strip-label{min-height:32px;display:flex;justify-content:space-between;align-items:center}
@media(max-width:560px){.palace-stem{font-size:11px}.p-bottom .palace-corner{flex:none}.p-bottom{gap:1px}.board{grid-template-rows:repeat(4,146px)}}

/* The chart is a dedicated screen; management lives one level above. */
.header-actions{display:flex;align-items:center;gap:6px;margin-left:auto;flex:none}
.header .install-top{font-size:12px;padding:7px 10px}
.chart-header{height:56px;padding:6px 12px;gap:8px}
.chart-header h1{font-size:18px;white-space:nowrap;margin:0}
.back-page{border:0;background:transparent;padding:6px 0;font-size:13px;white-space:nowrap;min-height:36px}
.chart-header .new-top,.chart-header .install-top{font-size:11px;min-height:34px;padding:6px 8px}
body:has(.chart-page){padding-bottom:0}
main.chart-page{padding:0 8px 4px;max-width:916px}
.chart-page .workspace{width:100%}
.chart-page .chart-panel{display:flex;flex-direction:column;height:calc(100dvh - 60px - env(safe-area-inset-bottom));min-height:662px}
.chart-page .board{flex:1;min-height:512px;grid-template-rows:repeat(4,minmax(128px,1fr))}
.chart-page .strip-label{min-height:23px;flex:none;margin:3px 0 2px;font-size:11px}
.chart-page .return-origin{min-height:23px;padding:2px 8px;font-size:10px}
.chart-page .decadal-list,.chart-page .year-list{flex:none;margin:0;padding:0;border:1px solid #d8cebe;border-radius:3px;gap:0}
.chart-page .decadal-list button,.chart-page .year-list button{border:0;border-right:1px solid #d8cebe;border-radius:0;min-height:48px;padding:4px 2px;flex-basis:65px}
.current-record{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px;margin-bottom:16px;border:1px solid var(--line);border-radius:10px;background:#fffdf8}
.current-record p{font-size:12px;color:var(--muted)}
button:disabled{opacity:.5;cursor:default}
@media(max-width:560px){.header{gap:8px}.header-actions{gap:4px}.header .install-top{min-height:34px;padding:5px 7px;font-size:11px}.header .brand span{font-size:14px;letter-spacing:0}.chart-header{height:48px;padding:4px 8px}.chart-header h1{font-size:16px}.back-page{font-size:12px}.chart-page .chart-panel{height:calc(100dvh - 52px - env(safe-area-inset-bottom))}.chart-page .decadal-list button,.chart-page .year-list button{flex-basis:55px}.current-record{display:block}.current-record .actions{margin-top:10px}.management-page .header-actions{gap:4px}}
@media(max-width:360px){.header .new-top{font-size:10px;padding:5px 6px}.header .install-top{font-size:10px;padding:5px 6px}.chart-header{gap:6px}.chart-header h1{font-size:15px}.chart-page .chart-panel{min-height:662px}}

.feedback-link{display:inline-flex;align-items:center;min-height:44px;margin-top:14px;padding:10px 16px;border-radius:8px;background:var(--ink);color:white;text-decoration:none;font-size:14px}

.install-steps{padding-left:22px;margin:12px 0 20px;line-height:1.9;font-size:14px}.install-steps li{padding:2px 0}
