/* Complex Quest · the Argand plane IS the finished artwork.
   Shares the familiar Inequality Ink studio language without taking over the
   Graph Art four-mode workspace. */
.complex-quest-page{background:#f7f4ed}
.complex-quest-page .app{max-width:1320px}
.complex-quest-page .complex-home-link{white-space:nowrap;text-decoration:none;color:#397a6a;font-weight:800;font-size:.76rem;background:#e9f5ed;border:1px solid #afd0be;border-radius:10px;padding:11px 14px;min-height:39px}
.complex-quest-page .complex-home-link:hover{background:#dcf0e5}
.complex-main{max-width:1190px;margin:0 auto;padding:9px 0 42px}
.complex-heading{display:flex;justify-content:space-between;align-items:end;gap:22px;padding:15px 0 18px}
.complex-heading h1{font-size:clamp(2.4rem,5vw,4.15rem);letter-spacing:-.075em;line-height:1.07;margin:9px 0 8px;color:#30425b}
.complex-heading h1 em{font-style:normal;color:#438c79}
.complex-heading p{color:#6d8190;font-size:.9rem;line-height:1.58;max-width:660px;margin:0}
.complex-discovery{min-width:208px;border-radius:16px;background:#fffdfa;border:1px solid #dce7dc;padding:16px;box-shadow:0 8px 21px #315f4d0c;display:grid;gap:4px}
.complex-discovery>span{font-size:.67rem;font-weight:900;letter-spacing:.1em;color:#8b7c76}
.complex-discovery strong{font-size:2.05rem;color:#358872;line-height:1.2}
.complex-discovery strong small{font-size:.85rem;color:#8a9794}
.complex-discovery>small{font-size:.68rem;color:#879591;font-weight:700}
.complex-meter,.complex-progress-track{height:8px;background:#e8ece6;border-radius:999px;overflow:hidden}
.complex-meter>span,.complex-progress-track>div{display:block;height:100%;background:linear-gradient(90deg,#7db6a0,#54a290);width:0;transition:width .24s ease}
.complex-journey{background:#fffcf8;border:1px solid #e5e2d8;border-radius:20px;box-shadow:0 9px 30px #3649500c;padding:19px 22px}
.complex-section-head{display:flex;justify-content:space-between;gap:15px;align-items:end;margin-bottom:12px}
.complex-section-head h2{font-size:1.38rem;letter-spacing:-.04em;margin:6px 0 0;color:#35475c}
.complex-unlock-note{font-size:.71rem;color:#578b7b;font-weight:800;white-space:nowrap}
.complex-levels{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.complex-level-card{display:flex;align-items:center;gap:13px;padding:14px;background:#fbfaf7;border:1.5px solid #e1e4dd;border-radius:12px;cursor:pointer;text-align:left;font:inherit;color:#34475d;min-width:0}
.complex-level-card:nth-child(5){grid-column:1/-1}
.complex-level-card:hover,.complex-level-card:focus-visible{background:#edf7f0;border-color:#6db39e}
.complex-level-card[aria-pressed=true]{background:#e9f7ef;border:2px solid #65ac94;padding:13.5px;box-shadow:0 3px 0 #6aa48b1a}
.complex-level-number{display:grid;place-items:center;flex:0 0 43px;width:43px;height:43px;border-radius:10px;background:#f2eae5;color:#ba7e70;font-size:1.2rem;font-weight:900}
.complex-level-card[aria-pressed=true] .complex-level-number{background:#cdebdc;color:#367867}
.complex-level-description{display:grid;gap:3px;flex:1;min-width:0}
.complex-level-description strong{font-size:.95rem}
.complex-level-description small{font-size:.73rem;color:#738697;line-height:1.3}
.complex-level-description em{font-size:.68rem;color:#4b8b77;font-weight:800;font-style:normal}
.complex-level-symbol{font-weight:900;color:#4b9b85;font-size:1.1rem}
.complex-decision{margin-top:13px;padding:17px 19px;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#edf8f0;border:1px solid #c6dfce;border-radius:17px}
.complex-decision strong{display:block;font-size:1.14rem;color:#335d54;margin:7px 0 4px}
.complex-decision p{margin:0;color:#678379;font-size:.8rem;line-height:1.5}
.complex-decision>.button{min-width:195px;min-height:47px}
.complex-understated{font-size:.72rem;color:#8a999a;margin:12px 3px}
.complex-play-head{display:flex;align-items:center;gap:20px;margin:7px 0 12px}
.complex-play-head>div:nth-child(2){flex:1}
.complex-play-head h1{font-size:clamp(1.65rem,2.6vw,2.45rem);letter-spacing:-.055em;margin:5px 0 2px;color:#344b61}
.complex-play-head p{color:#6b8290;font-size:.78rem;margin:0;line-height:1.45}
.complex-back{font:inherit;white-space:nowrap;border:1px solid #dce5db;background:#fffdf8;border-radius:10px;color:#41796e;padding:11px;font-size:.76rem;font-weight:800;cursor:pointer}
.complex-back:hover{background:#e9f5ef}
.complex-progress-pill{text-align:center;background:#f0f8f2;border:1px solid #cce5d6;padding:9px 13px;border-radius:11px;min-width:87px;display:grid;gap:1px;color:#427c6d}
.complex-progress-pill strong{font-size:1rem}
.complex-progress-pill span{font-size:.65rem}
.complex-progress-track{margin-bottom:12px;height:7px}
.complex-workspace{display:grid;grid-template-columns:minmax(0,1.02fr) minmax(0,.98fr);gap:17px;align-items:start}
.complex-graph-panel,.complex-task-panel{min-width:0;padding:17px!important;border-radius:17px}
.complex-panel-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:13px}
.complex-panel-heading h2{margin:5px 0 0;font-size:1.2rem;letter-spacing:-.035em;color:#324b5f}
.complex-panel-heading .eyebrow{font-size:.64rem}
.complex-graph-key{font-size:.68rem;white-space:nowrap;background:#edf7f1;color:#4f8b79;border-radius:8px;padding:6px 9px;font-weight:800}
.complex-graph-frame{background:#faf8f2;border:1px solid #dde9e3;border-radius:12px;padding:8px;display:grid;place-items:center}
#complexGraph{display:block;width:100%;max-width:min(100%,530px);height:auto;aspect-ratio:1;touch-action:manipulation;cursor:crosshair}
.complex-canvas-caption{display:flex;align-items:start;gap:7px;font-size:.7rem;color:#758a8b;line-height:1.5;margin:10px 4px 2px}
.complex-key-dot{flex:none;margin-top:4px;width:9px;height:9px;border-radius:50%;background:#de8a7f;border:2px solid #fff;box-shadow:0 0 0 1px #cd847a}
.complex-task-maths{background:#f3f7f3;border:1px solid #e0e9e0;border-radius:12px;padding:16px;text-align:center}
.complex-task-maths>span{font-size:.64rem;letter-spacing:.12em;font-weight:850;color:#658c7f}
.complex-task-maths>p{margin:9px 0 0;line-height:1.4;font-size:clamp(1rem,2vw,1.3rem);color:#29465d;font-weight:840;overflow-wrap:anywhere}
.complex-task-hint{font-size:.78rem;color:#667e89;line-height:1.55;margin:12px 0}
.complex-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.complex-field{min-width:0;border:1px solid #e3e5dd;border-radius:11px;background:#fffdf9;padding:10px;display:grid;gap:7px}
.complex-field[hidden],.complex-angles[hidden]{display:none!important}
.complex-field label{font-size:.74rem;font-weight:850;color:#405c69}
.complex-field input,.complex-field select{font:inherit;width:100%;height:40px;min-width:0;background:#fbfbf7;border:1px solid #cdded5;border-radius:9px;text-align:center;font-size:.93rem;font-weight:850;color:#374d60}
.complex-field input:focus-visible,.complex-field select:focus-visible{outline:2px solid #77b69c;outline-offset:2px}
.complex-field>small{font-size:.65rem;color:#829399}
.complex-angles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:9px}
.complex-angles>p{grid-column:1/-1;font-size:.69rem;color:#7f8e95;margin:0;line-height:1.45}
.complex-candidate{margin:12px 0 7px;color:#508b7e;font-size:.76rem;font-weight:800}
.complex-feedback{min-height:35px;color:#587b7e;font-size:.75rem;line-height:1.5}
.complex-feedback.is-correct{color:#218269;font-weight:800}
.complex-feedback.is-incorrect{color:#aa655c}
.complex-actions{display:flex;gap:8px;flex-wrap:wrap}
.complex-actions .button{flex:1;min-height:43px;white-space:nowrap;font-size:.77rem}
.complex-hint-text{background:#f8f2e9;border:1px solid #eaddc9;color:#6b6d62;border-radius:9px;padding:10px 12px;font-size:.76rem;line-height:1.5;margin:10px 0 0}
.complex-help{margin-top:13px;border-top:1px solid #e8e9e4;padding-top:12px;font-size:.75rem;color:#6e8590}
.complex-help summary{cursor:pointer;font-weight:800;color:#537f75}
.complex-help p{line-height:1.62}
.complex-finished{text-align:center;padding:28px 12px}
.complex-finished h1{font-size:clamp(2rem,4vw,3.35rem);margin:8px 0;color:#33526a;letter-spacing:-.055em}
.complex-finished>p{font-size:.87rem;color:#768994;margin:5px auto;max-width:570px;line-height:1.55}
.complex-finished-frame{background:#fffdf8;border:1px solid #e5e6df;border-radius:18px;max-width:490px;margin:22px auto 14px;padding:12px;box-shadow:0 12px 28px #2d483310}
.complex-finished-frame svg{display:block;width:100%;height:auto;aspect-ratio:1}
.complex-finished-stats{font-weight:800;color:#477b6e!important}
.complex-finished-actions{display:flex;gap:9px;justify-content:center;flex-wrap:wrap;margin-top:20px}
.complex-finished-actions .button{min-height:42px}
.complex-reveal{width:min(94vw,740px);max-height:95dvh;padding:0;border:0;border-radius:22px;background:#fffdfa;color:#31495b;box-shadow:0 25px 100px #15283c64}
.complex-reveal::backdrop{background:#182b43d9;backdrop-filter:blur(5px)}
.complex-reveal-inner{display:grid;justify-items:center;text-align:center;padding:24px 24px 28px;gap:6px}
.complex-reveal h2{font-size:clamp(1.9rem,4vw,3.1rem);letter-spacing:-.055em;margin:7px 0 0}
.complex-reveal p{margin:0 0 6px;color:#718390;font-size:.85rem}
.complex-reveal svg{display:block;width:min(100%,500px);height:auto;background:#f9f7f0;border:10px solid #efefe8;border-radius:16px;margin:6px 0 12px;animation:complex-appear .7s ease both}
.complex-reveal .button{min-height:45px}
@keyframes complex-appear{from{opacity:.25;transform:scale(.93)}to{opacity:1;transform:scale(1)}}
@media(max-width:850px){
 .complex-workspace{grid-template-columns:minmax(0,1fr)}
 .complex-graph-panel{display:grid;justify-items:stretch}
 #complexGraph{max-width:min(100%,48dvh,475px);margin:auto}
 .complex-play-head{gap:9px}
}
@media(max-width:690px){
 .complex-main{padding:4px 0 22px}
 .complex-heading{align-items:start;gap:10px;padding:10px 0 14px}
 .complex-heading h1{font-size:clamp(2.25rem,9vw,3rem)}
 .complex-heading p{font-size:.75rem}
 .complex-discovery{min-width:100px;padding:11px}
 .complex-discovery strong{font-size:1.35rem}
 .complex-discovery>small{font-size:.6rem}
 .complex-section-head{display:block}
 .complex-section-head h2{font-size:1.18rem}
 .complex-unlock-note{display:block;margin-top:6px}
 .complex-journey{padding:14px}
 .complex-levels{grid-template-columns:minmax(0,1fr);gap:7px}
 .complex-level-card:nth-child(5){grid-column:auto}
 .complex-level-card{min-height:65px;padding:10px}
 .complex-level-card[aria-pressed=true]{padding:9.5px}
 .complex-level-number{width:37px;height:37px;flex-basis:37px;font-size:1rem}
 .complex-level-description strong{font-size:.86rem}
 .complex-level-description small{font-size:.68rem}
 .complex-decision{display:grid;padding:14px;gap:12px}
 .complex-decision>.button{width:100%;min-height:44px}
 .complex-play-head{flex-wrap:wrap}
 .complex-play-head>div:nth-child(2){order:-1;flex-basis:100%}
 .complex-play-head h1{font-size:1.75rem}
 .complex-progress-pill{min-width:65px;padding:7px}
 .complex-graph-panel,.complex-task-panel{padding:12px!important}
 .complex-panel-heading h2{font-size:1.07rem}
 .complex-graph-frame{padding:3px}
 #complexGraph{max-width:min(100%,50dvh)}
 .complex-fields,.complex-angles{gap:7px}
 .complex-field{padding:8px}
 .complex-actions{display:grid;grid-template-columns:1fr 1fr}
 .complex-actions #complexCheck,.complex-actions #complexNext{grid-column:1/-1}
 .complex-reveal-inner{padding:16px}
 .complex-quest-page .complex-home-link{font-size:.68rem;padding:9px}
}
@media(max-width:400px){
 .complex-quest-page .studio-switch .studio-tab{padding:7px}
 .complex-graph-key{font-size:.6rem}
 .complex-task-maths>p{font-size:1rem}
 .complex-field label{font-size:.69rem}
 .complex-heading p{font-size:.7rem}
}
@media(prefers-reduced-motion:reduce){
 .complex-meter>span,.complex-progress-track>div{transition:none}
 .complex-reveal svg{animation:none}
}
