/* Stage three: reference pages and Support use the shared study surfaces. */
body[data-cx-secondary]{--secondary-theme:var(--codex-track,var(--theme,#0b4a3d));color:#183b33;background-color:#f8f6f0;background-image:linear-gradient(#f8f6f0b8,#f8f6f0b8),url('/assets/codex-hex.svg');background-size:auto,36.95px 64px;font-family:Manrope,Arial,sans-serif}
body[data-cx-secondary] :focus-visible{outline:3px solid var(--secondary-theme);outline-offset:3px}
body[data-cx-secondary=reference] main>header,body[data-cx-secondary=reference] main>section{background:#fffdf8;border:1px solid #d5dfd9;border-left:3px solid var(--secondary-theme);border-radius:16px;padding:24px;box-shadow:-4px 6px 16px #0b4a3d14;margin-bottom:24px}
body[data-cx-secondary=reference] main{max-width:1080px;padding:32px clamp(16px,4vw,40px)}
body[data-cx-secondary=reference] h1{font-family:'Instrument Serif',Georgia,serif;color:var(--secondary-theme);font-weight:400;font-size:clamp(30px,4vw,44px);line-height:1.13}
body[data-cx-secondary=reference] input#search{border:1px solid #bdcbbf;border-radius:10px;min-height:48px;background:#fffdf8;color:#183b33;font:16px/1.5 Manrope,Arial,sans-serif;padding:12px 15px;margin-bottom:12px}
body[data-cx-secondary=reference] .codex-table-scroll{border:1px solid #d5dfd9;border-radius:14px;background:#fffdf8;box-shadow:-4px 6px 16px #0b4a3d12;overflow-x:auto}
body[data-cx-secondary=reference] table{background:#fffdf8;font-size:14px;line-height:1.65}
body[data-cx-secondary=reference] th,body[data-cx-secondary=reference] td{padding:13px 16px}
body[data-cx-secondary=reference] thead th{background:#edf3ee;color:var(--secondary-theme);font-size:12px;letter-spacing:.04em}
.cx-reference-state{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-bottom:16px;font-size:12px;color:#53685e}.cx-reference-state button{min-height:44px;border:1px solid #bdcbbf;border-radius:10px;padding:8px 14px;background:#fffdf8;color:var(--secondary-theme);font:650 13px Manrope,Arial,sans-serif;cursor:pointer}
html:not(.embedded) body[data-cx-secondary=guide]{padding-top:var(--secondary-head,70px);padding-bottom:var(--secondary-foot,0px)}
html:not(.embedded) body[data-cx-secondary=guide]>.shell{position:fixed;inset:0 0 auto;z-index:60;background:#fffdf8;border-bottom:1px solid #d5dfd9;padding-top:max(10px,env(safe-area-inset-top));padding-bottom:10px}
html:not(.embedded) body[data-cx-secondary=guide] .guide{height:calc(100dvh - var(--secondary-head,70px) - 36px);border-radius:16px;box-shadow:-4px 6px 16px #0b4a3d1f;border-left-width:3px}
body[data-cx-secondary=guide] :is(.guide-card,.connected-intro,.reader-howto){background:#fffdf8;border-radius:16px;box-shadow:-4px 6px 16px #0b4a3d14;border:1px solid #d5dfd9;border-left:3px solid var(--theme,#0b4a3d)}
body[data-cx-secondary=guide] .guide-grid{gap:24px}body[data-cx-secondary=guide] .library-hero h1{line-height:1.1}body[data-cx-secondary=guide] .library-foot{position:fixed;inset:auto 0 0;z-index:55;margin:0;padding:12px 20px max(12px,env(safe-area-inset-bottom));background:#fffdf8;border-top:1px solid #d5dfd9;font-size:12px;text-align:center}
.reader-howto{padding:16px 20px;margin:16px auto;max-width:1126px}.reader-howto summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:700;color:var(--theme,#0b4a3d)}.reader-howto ul{font-size:14px;line-height:1.8;padding-left:22px}.reader-howto li{margin:10px 0}.reader-howto a{color:var(--theme,#0b4a3d);font-weight:700}.embedded .reader-howto{display:none}
body[data-cx-secondary=diagram] .layout{border-radius:16px;box-shadow:-4px 6px 16px #0b4a3d1f;border-left:3px solid #0b4a3d}body[data-cx-secondary=diagram] :is(.pane,.canvashead,.factbox,.tip){background-color:#fffdf8}body[data-cx-secondary=diagram] :is(.controls button,.links a){border-radius:10px;min-height:44px;display:inline-flex;align-items:center}body[data-cx-secondary=diagram] h1{font-family:'Instrument Serif',Georgia,serif;color:#0b4a3d}
@media(max-width:600px){body[data-cx-secondary=reference] main>header,body[data-cx-secondary=reference] main>section{padding:20px 16px}body[data-cx-secondary=reference] th,body[data-cx-secondary=reference] td{padding:12px}body[data-cx-secondary=guide] .guide-grid{gap:18px}.reader-howto{margin:12px 10px;padding:12px 16px}}
@media print{body[data-cx-secondary]{background:#fff;padding:0!important}html:not(.embedded) body[data-cx-secondary=guide]>.shell,body[data-cx-secondary=guide] .library-foot{position:static}}
