:root{--ink:#173638;--muted:#697771;--paper:#f7f4ec;--gold:#ad8750;--line:#dddcd1;--green:#244c47;--serif:Georgia,"Noto Serif SC","Songti SC",SimSun,serif;--sans:Inter,"Microsoft YaHei",system-ui,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:var(--sans);line-height:1.65}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.4}button,a,input{ -webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,input:focus-visible,summary:focus-visible{outline:3px solid #c8953e;outline-offset:4px}button{border:0}a{color:inherit}.skip{position:absolute;top:-60px;left:16px;z-index:20;background:white;padding:10px}.skip:focus{top:8px}.site-header{max-width:1240px;margin:auto;display:flex;align-items:center;justify-content:space-between;padding:25px 40px;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:13px;background:none;text-align:left;color:var(--ink);font-weight:600;font-size:18px;letter-spacing:1px}.brand small{display:block;font-size:9px;letter-spacing:2.8px;color:var(--muted);font-weight:400}.brand-icon{font-family:var(--serif);font-size:42px;color:var(--gold);line-height:1}.text-button{background:none;color:var(--muted);font-size:12px;padding:10px 0}.text-button span{margin-left:12px}main{min-height:75vh}main:focus{outline:none}.wrap{max-width:1160px;margin:auto}.eyebrow{font-size:11px;letter-spacing:3px;text-transform:uppercase;color:var(--gold);font-weight:600}.hero{display:grid;grid-template-columns:1.05fr 1fr;gap:60px;padding:62px 40px 48px;align-items:center}.hero h1{font:400 clamp(36px,4.1vw,58px)/1.3 var(--serif);letter-spacing:2px;margin:20px 0 22px}.hero h1 em{font-style:normal;color:#668577}.hero-copy>p{color:var(--muted);max-width:400px;font-size:14px;line-height:1.95}.hero-meta{display:flex;gap:25px;margin:27px 0 30px;color:var(--muted);font-size:11px}.hero-meta b{font-size:19px;font-family:var(--serif);color:var(--ink);margin-right:5px}.primary{background:var(--green);color:#fff;padding:15px 24px;border-radius:5px;display:inline-flex;align-items:center;justify-content:space-between;gap:35px;font-size:14px;transition:background .2s,transform .2s}.primary:hover{background:#35645b;transform:translateY(-1px)}.secondary{background:transparent;border:1px solid #bfc9bc;border-radius:5px;color:var(--ink);padding:13px 20px;font-size:13px}.secondary:hover{background:#eaece2}.button-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center}.micro{font-size:11px!important;color:var(--muted);margin-top:14px}.hero-art{position:relative;border-radius:160px 160px 5px 5px;background:#142f32;overflow:hidden;min-height:440px;box-shadow:12px 14px 0 #e9e5d9;border:1px solid #3f5651}.hero-art svg{width:100%;height:440px;display:block}.art-caption{position:absolute;bottom:24px;left:0;width:100%;text-align:center;color:#d6c9a9;font:italic 14px var(--serif);letter-spacing:1px}.art-tag{position:absolute;top:25px;left:0;width:100%;text-align:center;color:#aeb8a4;font-size:9px;letter-spacing:4px}.section-head{display:flex;justify-content:space-between;align-items:end;margin-bottom:20px}.section-head h2{font:400 26px var(--serif);margin:5px 0}.section-head p{font-size:12px;color:var(--muted)}.gallery-section{padding:30px 40px 45px;border-top:1px solid var(--line)}.character-strip{display:grid;grid-template-columns:repeat(8,1fr);gap:12px}.character-small{background:#eeeee4;border:1px solid #e3e3d7;border-radius:5px;padding:18px 8px 14px;text-align:center;color:var(--ink);transition:transform .2s,background .2s}.character-small:hover{transform:translateY(-3px);background:#e2e8dc}.sigil{font:26px var(--serif);color:var(--gold);height:42px;display:flex;justify-content:center;align-items:center}.character-small strong{display:block;font-size:12px;font-weight:500;margin:5px 0}.character-small small{display:block;font-size:9px;color:var(--muted)}.three-notes{display:grid;grid-template-columns:repeat(3,1fr);gap:35px;padding:32px 40px;border-top:1px solid var(--line)}.note-num{font:italic 21px var(--serif);color:var(--gold)}.three-notes h3{font-size:13px;font-weight:500;margin:9px 0}.three-notes p{font-size:12px;color:var(--muted);line-height:1.8;margin:0}.disclosure{padding:20px 40px 35px;color:var(--muted);font-size:10px;line-height:1.8}.site-footer{max-width:1160px;margin:auto;padding:22px 40px;display:flex;justify-content:space-between;border-top:1px solid var(--line);font-size:10px;color:var(--muted)}.quiz-wrap{max-width:800px;padding:38px 28px 60px;margin:auto}.quiz-top{display:flex;justify-content:space-between;color:var(--muted);font-size:11px;letter-spacing:1px}.progress-track{height:3px;background:#dedfd2;margin-top:13px}.progress-fill{height:100%;background:var(--gold);transition:width .3s}.question-page{margin-top:38px}.question-number{font:italic 16px var(--serif);color:var(--gold)}.question-page h1{font:400 clamp(23px,3vw,30px)/1.6 var(--serif);margin:13px 0 23px}.choice-title{font-size:12px;color:var(--muted);margin-bottom:14px}.options{border:0;padding:0;margin:0;display:grid;gap:11px}.option{display:flex;gap:14px;align-items:center;border:1px solid #dddcd1;background:#fbfaf5;border-radius:6px;padding:16px 19px;cursor:pointer;transition:border .2s,background .2s}.option:has(input:checked){border-color:var(--green);background:#e7eee3;box-shadow:inset 3px 0 var(--green)}.option input{accent-color:var(--green);width:17px;height:17px;flex:none}.option .strength{font-size:10px;color:var(--muted);display:block;margin-bottom:3px;letter-spacing:1px}.option .answer-text{font-size:14px;display:block}.quiz-actions{display:flex;justify-content:space-between;gap:20px;margin-top:25px}.quiz-help{text-align:center;font-size:10px;color:var(--muted);margin-top:20px}.result-wrap{max-width:900px;margin:auto;padding:40px 30px 60px}.result-hero{position:relative;text-align:center;border:1px solid #cfc9b6;padding:38px 30px 30px;background:#eeeee3;border-radius:150px 150px 5px 5px;max-width:600px;margin:auto}.result-hero .sigil{font-size:48px;height:68px}.result-hero h1{font:400 36px var(--serif);margin:13px 0}.result-hero .period{font-size:10px;color:var(--muted)}.tags{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;margin:18px 0}.tag{font-size:10px;border:1px solid #c5cebd;padding:3px 10px;border-radius:30px;color:#546451}.result-hero .personal-line{font:400 15px/1.8 var(--serif);max-width:420px;margin:22px auto 5px}.result-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:26px}.report-card{padding:24px;border:1px solid var(--line);background:#fbfaf5;border-radius:6px}.report-card h2{font:400 20px var(--serif);margin:0 0 17px}.report-card h3{font-size:13px;margin:17px 0 6px}.report-card p{font-size:12px;color:var(--muted);line-height:1.9}.span-two{grid-column:1/-1}.axis-row{margin:14px 0}.axis-head{display:flex;justify-content:space-between;align-items:center;font-size:12px}.axis-head b{font-weight:500;font-size:11px}.axis-bar{position:relative;height:5px;background:linear-gradient(to right,#c8cebd,#e7e6da,#809b87);margin:9px 4px}.axis-marker{position:absolute;width:10px;height:10px;border-radius:50%;background:var(--green);top:-2.5px;transform:translateX(-50%);border:2px solid #faf9f3}.axis-ends{display:flex;justify-content:space-between;font-size:9px;color:var(--muted)}.similarity{border-left:2px solid #b49b67;padding-left:13px;margin:16px 0}.similarity p{margin:4px 0}.alternate{display:flex;align-items:center;gap:17px;border-top:1px solid var(--line);padding-top:16px;margin-top:15px}.alternate .sigil{width:45px;flex:none}.alternate strong{font:18px var(--serif)}.alternate p{margin:4px 0;font-size:10px}.evidence{padding:15px;background:#eeeee5;border-radius:4px;margin-bottom:10px}.evidence small{font-size:10px;color:var(--gold)}.evidence p{margin:5px 0}.actions-center{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin:28px 0 16px}.result-note{text-align:center;font-size:10px;line-height:1.9;color:var(--muted)}details summary{cursor:pointer;font-size:12px}details p{font-size:11px}.character-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}.character-grid button{padding:12px 8px;border:1px solid var(--line);background:#f6f5ee;border-radius:4px;color:var(--ink);text-align:left}.character-grid strong{display:block;font-size:12px;font-weight:500}.character-grid small{font-size:9px;color:var(--muted)}dialog{width:min(600px,calc(100% - 32px));border:1px solid #c9cabb;border-radius:10px;background:var(--paper);color:var(--ink);padding:35px;max-height:85vh}dialog::backdrop{background:#102c30aa;backdrop-filter:blur(3px)}.dialog-close{position:absolute;right:14px;top:10px;background:none;color:var(--muted);font-size:25px}.dialog-title{font:28px var(--serif);margin:10px 0 20px}dialog p{font-size:12px;color:var(--muted);line-height:1.9}dialog h3{font-size:14px}#toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:var(--ink);color:white;font-size:12px;border-radius:5px;padding:12px 20px;opacity:0;pointer-events:none;transition:opacity .2s;z-index:10}#toast.visible{opacity:1}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.return-banner{border:1px solid #c5ccba;padding:12px 17px;margin:0 40px 25px;display:flex;align-items:center;justify-content:space-between;gap:15px;font-size:12px;background:#e8eddf}.return-banner button{font-size:12px;background:none;color:var(--green);text-decoration:underline}
@media(max-width:800px){.hero{gap:30px;padding-top:40px}.hero-art,.hero-art svg{min-height:360px;height:360px}.character-strip{grid-template-columns:repeat(4,1fr)}.hero-meta{gap:14px}.hero h1{font-size:37px}.three-notes{gap:20px}}
@media(max-width:600px){.site-header{padding:17px 20px}.brand{font-size:15px}.brand small{font-size:8px;letter-spacing:2px}.brand-icon{font-size:34px}.text-button{font-size:10px}.hero{grid-template-columns:1fr;padding:34px 24px 38px;gap:32px}.hero h1{font-size:40px;margin:15px 0}.hero-copy>p{font-size:13px}.hero-meta{margin:20px 0}.hero-art{max-width:360px;width:100%;margin:auto;border-radius:140px 140px 4px 4px}.hero-art,.hero-art svg{height:320px;min-height:320px}.art-caption{bottom:20px;font-size:12px}.gallery-section{padding:25px 22px}.section-head h2{font-size:23px}.section-head p{display:none}.character-strip{gap:8px}.character-small{padding:12px 5px}.three-notes{grid-template-columns:1fr;padding:25px 24px;gap:20px}.three-notes article{display:grid;grid-template-columns:30px 1fr;column-gap:13px}.three-notes h3{margin:0}.three-notes p{grid-column:2}.disclosure{padding:10px 24px 28px}.site-footer{padding:20px 24px;display:block}.site-footer span{display:block;margin:4px 0}.return-banner{margin:0 24px 20px;font-size:11px}.quiz-wrap{padding:28px 20px 40px}.question-page{margin-top:28px}.question-page h1{font-size:24px}.option{padding:14px}.option .answer-text{font-size:13px}.quiz-actions .primary{gap:18px}.result-wrap{padding:28px 20px 40px}.result-hero{padding:30px 23px 25px;border-radius:100px 100px 5px 5px}.result-hero h1{font-size:30px}.result-grid{grid-template-columns:1fr}.span-two{grid-column:auto}.report-card{padding:21px}.character-grid{grid-template-columns:repeat(2,1fr)}dialog{padding:28px 23px}.actions-center{gap:9px}.actions-center button{font-size:12px;padding:13px 17px}.hero .primary{width:100%;max-width:360px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;scroll-behavior:auto!important}}
@media print{.site-header,.site-footer,.actions-center,#toast,dialog{display:none!important}.result-wrap{max-width:none;padding:0}.report-card,.result-hero{break-inside:avoid}.result-grid{display:block}.report-card{margin:15px 0}body{background:white}}

/* Phone-first refinements: comfortable reading and thumb reach. */
.share-preview{display:block;max-width:100%;max-height:55dvh;width:auto;margin:15px auto;border-radius:6px}
.share-download{display:flex;text-decoration:none;min-height:48px}
@media screen and (max-width:767px){
body{overflow-wrap:break-word}
.site-header{padding:12px max(18px,env(safe-area-inset-right)) 12px max(18px,env(safe-area-inset-left))}
.brand{min-height:44px;font-size:15px;gap:8px;letter-spacing:.5px}
.brand small{font-size:8px}
#about-button{min-height:44px;min-width:44px;font-size:12px}
.hero{grid-template-columns:1fr;padding:22px 20px 28px;gap:22px}
.hero-art{order:-1;width:100%;max-width:none;height:156px;min-height:156px;border-radius:14px;box-shadow:none}
.hero-art svg{width:100%;height:220px;min-height:0;position:absolute;bottom:-22px;left:0}
.art-tag{top:13px;font-size:8px;letter-spacing:2px}
.art-caption{display:none}
.hero h1{font-size:clamp(30px,8.5vw,38px);line-height:1.35;letter-spacing:1px;margin:12px 0 15px}
.hero .eyebrow{font-size:10px;letter-spacing:2px}
.hero-copy>p{font-size:14px;line-height:1.8;max-width:none}
.hero-meta{gap:0;justify-content:space-between;margin:20px 0;font-size:12px}
.hero-meta b{font-size:22px}
.primary,.secondary{min-height:50px;border-radius:9px;font-size:15px}
.hero .primary{width:100%;max-width:none}
.micro{font-size:12px!important;line-height:1.8}
.gallery-section{padding:24px 20px}
.section-head{align-items:center;gap:10px}
.section-head h2{font-size:22px}
.section-head .eyebrow{font-size:9px;letter-spacing:1px}
#all-characters{min-height:44px;font-size:12px;max-width:92px;text-align:right}
.character-strip{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.character-small{min-height:100px;padding:12px 4px;border-radius:9px}
.character-small strong{font-size:13px}
.character-small small{font-size:10px;line-height:1.5}
.three-notes{grid-template-columns:1fr;padding:24px 20px;gap:20px}
.three-notes article{display:grid;grid-template-columns:30px 1fr;gap:2px 12px}
.three-notes h3{font-size:15px;margin:0}
.three-notes p{grid-column:2;font-size:13px;line-height:1.85}
.disclosure{font-size:12px;padding:12px 20px 26px}
.return-banner{margin:0 20px 20px;padding:12px;font-size:13px;border-radius:9px}
.return-banner button{min-height:44px;flex:none;font-size:13px}
.site-footer{display:block;padding:18px 20px calc(18px + env(safe-area-inset-bottom));font-size:11px}
.site-footer span{display:block;margin:4px 0}
.quiz-wrap{padding:24px 18px calc(130px + env(safe-area-inset-bottom));max-width:600px}
.quiz-top{font-size:12px;letter-spacing:0;gap:8px}
.progress-track{height:5px;margin-top:12px;border-radius:5px;overflow:hidden}
.question-page{margin-top:24px}
.question-number{font-size:14px}
.question-page h1{font-size:22px;line-height:1.55;margin:12px 0 19px}
.choice-title{font-size:13px}
.options{gap:10px}
.option{padding:14px 13px;gap:12px;min-height:82px;border-radius:10px}
.option input{height:20px;width:20px}
.option .strength{font-size:12px;letter-spacing:0;margin-bottom:4px}
.option .answer-text{font-size:15px;line-height:1.65}
.quiz-actions{position:fixed;z-index:5;left:0;right:0;bottom:0;gap:12px;margin:0;padding:12px max(18px,env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));border-top:1px solid var(--line);background:var(--paper);box-shadow:0 -5px 20px #17363808}
.quiz-actions #prev{flex:0 0 108px}
.quiz-actions #next{flex:1;justify-content:space-between;min-width:0;padding:14px 18px;gap:8px}
.quiz-help{font-size:12px;text-align:left;line-height:1.8}
body[data-view="quiz"] .site-footer{display:none}
.result-wrap{padding:24px 16px 35px;max-width:600px}
.result-hero{border-radius:70px 70px 12px 12px;padding:27px 20px}
.result-hero h1{font-size:30px;line-height:1.4}
.result-hero .period{font-size:12px;line-height:1.7}
.result-hero .personal-line{font-size:16px}
.tag{font-size:12px;padding:4px 10px}
.result-grid{grid-template-columns:minmax(0,1fr);gap:14px;margin-top:20px}
.span-two{grid-column:auto}
.report-card{padding:22px 19px;border-radius:12px}
.report-card h2{font-size:23px}
.report-card h3{font-size:15px}
.report-card p{font-size:14px;line-height:1.9}
.axis-row{margin:18px 0}
.axis-head{font-size:14px}
.axis-head b{font-size:13px}
.axis-ends{font-size:12px;gap:10px}
.axis-bar{height:6px;margin:10px 5px}
.alternate p{font-size:12px}
.evidence{padding:14px}
.evidence small{font-size:12px;line-height:1.8;display:block}
details summary{font-size:14px;min-height:44px;display:flex;align-items:center}
.actions-center{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.actions-center #save-card{grid-column:1/-1}
.actions-center button{width:100%;font-size:14px}
.result-note{font-size:12px;line-height:1.85}
dialog{padding:28px 20px;width:calc(100% - 24px);max-height:calc(90dvh - env(safe-area-inset-bottom))}
dialog p{font-size:14px}
.dialog-close{min-height:44px;min-width:44px;right:5px;top:5px}
.character-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.character-grid button{min-height:75px}
.character-grid strong{font-size:14px}
.character-grid small{font-size:11px}
#toast{max-width:calc(100% - 36px);width:max-content;font-size:13px;bottom:calc(24px + env(safe-area-inset-bottom))}
body[data-view="quiz"] #toast{bottom:calc(90px + env(safe-area-inset-bottom))}
}
@media screen and (max-width:359px){
.brand{font-size:13px}.brand small{letter-spacing:1px}
.hero{padding-left:16px;padding-right:16px}
.hero-meta{font-size:11px}.hero-meta b{font-size:19px}
.quiz-actions #prev{flex-basis:90px;padding-left:10px;padding-right:10px}
.question-page h1{font-size:21px}.option .answer-text{font-size:14px}
}


/* Result colours follow the main matched character; other screens reset to defaults. */
.result-house{font-size:12px;letter-spacing:1px;color:var(--green);margin:8px 0 12px}
body[data-view="result"] .result-hero{background:var(--result-soft);border-color:var(--line)}
body[data-view="result"] .report-card{background:var(--paper)}
body[data-view="result"] .tag{color:var(--green);border-color:var(--line)}
body[data-view="result"] .axis-bar{background:linear-gradient(to right,var(--line),var(--paper),var(--green))}
body[data-view="result"] .similarity{border-color:var(--gold)}
body[data-view="result"] .evidence{background:var(--result-soft)}
body[data-view="result"] .secondary{border-color:var(--line)}
body[data-view="result"] .secondary:hover{background:var(--result-soft)}
body[data-view="result"] .primary:hover{background:var(--ink)}
@media print{body[data-view="result"]{print-color-adjust:exact;-webkit-print-color-adjust:exact}}

@media screen and (max-width:767px){.actions-center #save-card{grid-column:auto;justify-content:center;gap:12px}}

/* Approved v3 character badges. */
.character-badge{display:block;width:100%;height:100%;object-fit:contain;flex:none}
.character-small .sigil{height:64px;margin:0 auto 8px;width:64px}
.result-hero .sigil{height:120px;width:120px;margin:12px auto 0}
.alternate .sigil{height:64px;width:64px}
#dialog-content>.sigil{height:120px;width:120px;margin:0 auto 15px}
@media screen and (max-width:767px){.character-small .sigil{width:58px;height:58px}.result-hero .sigil{width:112px;height:112px}.alternate .sigil{width:60px;height:60px}}

.axis-head .axis-value{font-variant-numeric:tabular-nums;font-size:15px;font-weight:600;color:var(--green);white-space:nowrap}.axis-value small{font-size:11px;font-weight:400;color:var(--muted)}

@media screen and (max-width:767px){.site-header{gap:8px;flex-wrap:wrap}.brand{margin-right:auto}.site-header #lock-button{font-size:12px;min-height:44px}.site-header #about-button span{display:none}}
