/* C08B shared visual contract. Functional engines and identity stores stay separate. */
:root{--kq-paper:#faf9f3;--kq-ink:#254638;--kq-line:#d9ddcf;--kq-gold:#987750;--kq-muted:#5e6a5a}
.kqe-header,.kc .kc-header{background:var(--kq-paper);color:var(--kq-ink);border-bottom:1px solid var(--kq-line);min-height:90px;padding:0 max(24px,5.5vw);display:flex;align-items:center;gap:28px;font:15px/1.5 system-ui;position:relative;z-index:20;box-sizing:border-box}
.kqe-brand{display:flex;gap:12px;align-items:center;color:var(--kq-ink);text-decoration:none;flex-shrink:0}.kqe-brand>span:first-child{font:38px Georgia,serif;letter-spacing:-5px;margin-right:5px}.kqe-brand strong{display:block;letter-spacing:.15em;font-size:14px;font-weight:500}.kqe-brand small{display:block;font-size:10px;letter-spacing:.14em;margin-top:3px}.kqe-primary{display:flex;align-self:stretch;align-items:center;gap:28px;margin:auto}.kqe-primary>a{color:var(--kq-ink);text-decoration:none;display:flex;align-items:center;min-height:44px;height:100%;border-bottom:2px solid transparent}.kqe-primary>a[aria-current=page]{border-color:var(--kq-gold)}.kqe-account{position:relative;font-size:14px}.kqe-account summary{cursor:pointer;min-height:44px;display:flex;align-items:center}.kqe-account>div{position:absolute;right:0;top:100%;width:230px;max-width:80vw;background:var(--kq-paper);color:var(--kq-ink);border:1px solid var(--kq-line);border-radius:10px;padding:12px;box-shadow:0 12px 25px #183c2920;z-index:50}.kqe-account a,.kqe-account button{display:flex;width:100%;padding:10px;min-height:44px;text-decoration:none;color:inherit;box-sizing:border-box}.kqe-account small{display:block;padding:8px;color:var(--kq-muted);line-height:1.6}.kqe-mobile{display:none;background:none;border:1px solid var(--kq-line);border-radius:8px;min-width:44px;min-height:44px;font-size:20px;color:var(--kq-ink)}.kqe-breadcrumb,.kc-breadcrumb{max-width:1120px;margin:20px auto 0;padding:0 24px;display:flex;gap:12px;align-items:center;flex-wrap:wrap;font:14px/1.6 system-ui;color:var(--kq-muted)}.kqe-breadcrumb a,.kc-breadcrumb a{color:var(--kq-ink);text-decoration:none;min-height:36px;display:inline-flex;align-items:center}.kqe-footer{border-top:1px solid var(--kq-line);padding:24px max(24px,5.5vw);background:var(--kq-paper);color:var(--kq-muted);display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap;font:13px/1.7 system-ui}.kqe-footer a{color:var(--kq-ink);min-height:36px;display:inline-flex;align-items:center;margin-right:18px}.kqe-header a:focus-visible,.kqe-header summary:focus-visible,.kqe-header button:focus-visible,.kqe-breadcrumb a:focus-visible{outline:3px solid #977442;outline-offset:4px}
body.kq-shell{background:var(--kq-paper)!important;color:var(--kq-ink);margin:0!important;font-family:system-ui,sans-serif}.kq-shell .kb-shell{--kb-bg:#faf9f3;--kb-surface:#f0f2e7;--kb-text:#254638;--kb-muted:#58664f;--kb-line:#ccd5c2;--kb-accent:#315d45}.kq-shell .qp-shell{--qp-bg:#faf9f3;--qp-panel:#f0f2e7;--qp-ink:#254638;--qp-muted:#58664f;--qp-line:#ccd5c2;--qp-accent:#315d45}.kq-shell .br-shell{--br-text:#254638;--br-muted:#58664f;--br-border:#ccd5c2;--br-surface:#f0f2e7;background:#faf9f3}.kq-shell .qh-shell{color:var(--kq-ink)}.kq-shell .kb-shell,.kq-shell .qp-shell,.kq-shell .br-shell{min-height:65vh;font-family:system-ui,sans-serif}.kq-shell .kb-shell h1,.kq-shell .qp-shell h1,.kq-shell .br-shell h1{font-family:Georgia,serif;font-weight:400}.kq-shell .kb-header,.kq-shell .br-header,.kq-shell .kb-footer,.kq-shell .qp-footer,.kq-shell .br-shell>footer{display:none!important}.kq-shell .qp-nav>.qp-brand,.kq-shell .qp-nav nav>a,.kq-shell .qh-nav>.qh-brand,.kq-shell .qh-nav nav>a{display:none!important}.kq-shell .qp-nav,.kq-shell .qh-nav{border:0;min-height:0;justify-content:flex-end;padding:12px 24px;margin:0 auto;max-width:1180px}.kq-shell .qp-nav nav,.kq-shell .qh-nav nav{margin-left:auto}.kq-shell .qp-nav button,.kq-shell .qh-nav button{color:var(--kq-ink);background:var(--kq-paper);border:1px solid var(--kq-line)}
/* Keep source/reader tools and game dialogs; remove duplicate app-wide branding only. */
.kq-shell #homeButton,.kq-shell .ks-page-nav,.kq-shell #kqBreadcrumbs>a,.kq-shell #kqBreadcrumbs>span,.kq-shell #kqBreadcrumbs>b{display:none!important}.kq-shell #kqBreadcrumbs{position:static!important;inset:auto!important;max-width:1120px;margin:8px auto;padding:8px 24px;background:transparent;border:0;box-shadow:none;justify-content:flex-end}.kq-shell .app-shell{padding-top:0}.kq-shell .topbar{background:transparent;box-shadow:none;border-bottom:1px solid var(--kq-line);justify-content:flex-end;min-height:58px}.kq-shell .topbar:before{content:'Game controls';font:14px system-ui;color:var(--kq-muted);margin-right:auto}.kq-shell .ks-nav{display:none!important}.kq-shell .quest-support-footer{background:var(--kq-paper);color:var(--kq-ink);margin:0;padding:12px 24px}.kq-shell .quest-support-footer a{color:inherit}.kq-shell .kq-color-toggle{position:static!important;inset:auto!important;box-shadow:none!important;background:transparent!important;color:inherit!important;border:1px solid var(--kq-line)!important;font:14px system-ui}
/* Respect an explicit existing dark reading preference, using forest rather than navy. */
html[data-color-mode=dark] .kq-shell .kb-shell{--kb-bg:#173b30;--kb-surface:#224c3e;--kb-text:#f7f5e9;--kb-muted:#cedbc8;--kb-line:#56735e;--kb-accent:#e0c68d}html[data-color-mode=dark] .kq-shell .qp-shell{--qp-bg:#173b30;--qp-panel:#224c3e;--qp-ink:#f7f5e9;--qp-muted:#cedbc8;--qp-line:#56735e;--qp-accent:#e0c68d}html[data-color-mode=dark] .kq-shell .br-shell{--br-text:#f7f5e9;--br-muted:#cedbc8;--br-border:#56735e;--br-surface:#224c3e;background:#173b30}
@media(max-width:800px){.kqe-header,.kc .kc-header{padding:0 20px;min-height:82px;gap:16px}.kqe-brand strong{font-size:12px}.kqe-brand small{font-size:9px}.kqe-primary{display:none;position:absolute;top:100%;left:0;right:0;align-self:auto;background:var(--kq-paper);padding:14px 20px;border-bottom:1px solid var(--kq-line);z-index:35}.kqe-primary.open{display:grid;grid-template-columns:1fr 1fr}.kqe-primary>a{padding:12px}.kqe-mobile{display:block}.kqe-account{margin-left:auto}.kqe-account summary{font-size:12px}.kqe-breadcrumb{margin-top:12px;padding:0 20px}.kqe-footer{padding:22px 20px}}

.kq-shell .platform-tools>a,.kq-shell .qh-footer,.kq-shell .quest-support-footer{display:none!important}.kq-shell .platform-tools{border-bottom:1px solid var(--kq-line);padding:10px 0;gap:12px}.kq-shell .platform-tools:before{content:'Board tools';font-size:13px;color:var(--kq-muted);align-self:center;margin-right:8px}

.kq-shell #quest-account-gate{background:#faf9f3!important;color:#254638!important;font-family:system-ui!important}.kq-shell #quest-account-gate button{background:#254638!important;color:#faf9f3!important;border-color:#254638!important}
/* The legacy game sets !important body colors; override only its outer workspace. */
html body.quest-unified.kingdom-studio.kq-shell{--kq-workspace-ink:#254638;background:#faf9f3!important;color:var(--kq-workspace-ink)!important}html[data-color-mode=dark] body.quest-unified.kingdom-studio.kq-shell{--kq-workspace-ink:#f7f5e9;background:#173b30!important;color:var(--kq-workspace-ink)!important}.kq-shell .kqe-breadcrumb{background:var(--kq-paper);max-width:none;margin:0;padding:16px max(24px,5.5vw);border-bottom:1px solid var(--kq-line);box-sizing:border-box}.kq-shell .setup-copy,.kq-shell .setup-copy h1,.kq-shell .setup-copy p{color:var(--kq-workspace-ink,#254638)!important}.kq-shell .platform-tools button{color:var(--kq-workspace-ink,#254638)!important}.kq-shell .topbar button{color:var(--kq-ink)!important;background:var(--kq-paper)!important;border-color:var(--kq-line)!important}.kq-shell .learning-preview-grid button{background:#254638!important;color:#f5efd9!important}.kq-shell .topbar:before,.kq-shell .platform-tools:before{color:var(--kq-workspace-ink,#254638)}

@media(max-width:600px){.kqe-account-long{display:none}.kqe-header{gap:12px;padding-inline:16px}.kqe-brand{gap:9px;min-width:0}.kqe-brand>span:first-child{font-size:32px}.kqe-brand strong{font-size:11px;letter-spacing:.1em}.kqe-brand small{display:none}.kc .kc-header .kc-brand small{display:none}}
.kq-shell .qp-nav:before,.kq-shell .qh-nav:before{content:'Workspace account & tools';font:13px/1.6 system-ui;color:var(--kq-muted);margin-right:auto}.kq-shell .qh-ask{background:#254638!important;color:#faf9f3!important}
.kq-shell .kb-shell [role=combobox]{background:transparent;color:inherit;border-color:var(--kb-line)}.kq-shell .kb-select{background:#faf9f3;color:#254638;border-color:#ccd5c2}html[data-color-mode=dark] .kq-shell .kb-select{background:#224c3e;color:#f7f5e9;border-color:#56735e}

/* C08D: embedded Study/Lab already have the parent shell and accurate breadcrumb. */
body:is(.embedded-study,.embedded-lab) #kqBreadcrumbs>:is(a,span,b){display:none!important}

/* C09: one global header; separate workspace controls live under Account. */
.kqe-workspace-tools{border-top:1px solid var(--kq-line);margin-top:10px;padding-top:10px}.kqe-workspace-tools #siteControlsRoot{display:flex;flex-wrap:wrap;gap:8px}.kqe-workspace-tools button,.kqe-workspace-tools a{min-height:44px}.kqe-reader-return{margin-left:auto;min-height:44px;display:inline-flex;align-items:center}.kq-shell .kq-utility-header[hidden]{display:none!important}
/* C09: relocated workspace controls retain the shared palette. */
html:root body.kq-shell .kqe-workspace-tools .kq-site-controls button{background:#edf1e7!important;color:#254638!important;border:1px solid #a8b7a7!important;min-height:44px;min-width:44px}
html:root[data-color-mode] body.quest-unified.embedded-study:not([data-theme=contrast]) #studyDialog.study-organized :is(input,select,textarea){background:#edf1e7!important;color:#254638!important;border-color:#a8b7a7!important}
/* C11 shared interaction contract: no decorative motion or changed engine states. */
:is(.kq-shell,.kc-app) :is(a,button,input,select,textarea,summary):focus-visible{outline:3px solid #856324;outline-offset:3px}
.kq-scripture-reference{color:inherit;text-decoration:underline;text-decoration-color:#856324;text-underline-offset:3px;overflow-wrap:anywhere}
:is(.kq-shell,.kc-app) [aria-busy=true]{cursor:progress}
@media(prefers-reduced-motion:reduce){:is(.kq-shell,.kc-app) :is(a,button,details){transition:none!important;animation:none!important;scroll-behavior:auto!important}}

.kqe-brand>img{width:40px;height:40px;display:block;flex:none}

img.brand-mark{object-fit:contain;background:transparent!important;border:0!important;box-shadow:none!important}.kqe-footer{color:#52634f}

/* Brief optional guidance stays out of the way of the functional engines. */
.kqe-guide{box-sizing:border-box;max-width:1120px;margin:12px auto 20px;padding:0 24px;font:15px/1.65 system-ui;color:var(--kq-ink)}
.kqe-guide summary{display:list-item;cursor:pointer;min-height:44px;padding:9px 0;box-sizing:border-box;color:var(--kq-ink)}
.kqe-guide>div{border-left:2px solid var(--kq-gold);padding:8px 20px;max-width:78ch}
.kqe-guide strong{font:24px/1.3 Georgia,serif;color:inherit}.kqe-guide p{margin:12px 0;color:inherit;line-height:1.65}.kqe-guide a{color:inherit;display:inline-flex;align-items:center;min-height:44px;text-decoration:underline;text-underline-offset:4px}
.kqe-guide summary:hover,.kqe-guide a:hover{text-decoration:underline;text-underline-offset:4px}
.kqe-guide summary:focus-visible,.kqe-guide a:focus-visible{outline:3px solid #b69850;outline-offset:3px}
@media(max-width:600px){.kqe-guide{padding:0 18px;font-size:16px}.kqe-guide>div{padding:8px 14px}}
/* The Lab frame shares the viewport with navigation; never crop its bottom controls. */
html:root body.kq-utility-page.kq-shell{display:flex;flex-direction:column;height:100dvh;min-height:100vh;overflow:auto}
.kq-utility-page.kq-shell>.kqe-header,.kq-utility-page.kq-shell>.kqe-breadcrumb,.kq-utility-page.kq-shell>.kqe-guide,.kq-utility-page.kq-shell>.kqe-footer{flex-shrink:0}
html:root body.kq-utility-page.kq-shell>iframe{flex:1 0 360px;height:auto;min-height:360px;display:block;width:100%;border:0}
.kq-shell :is(.qp-nav,.qh-nav)[hidden]{display:none!important}
/* Long account tools remain reachable on shorter phones and landscape screens. */
.kqe-account>div{max-height:calc(100dvh - 110px);overflow-y:auto;overscroll-behavior:contain}

/* Native disclosure semantics, with a quiet theme-aware chevron. */
:is(.fj-device-study,.kqe-guide,.kc-security,.kc-main,.qp-root) summary{list-style:none;cursor:pointer;min-height:44px;position:relative;padding-inline-start:28px;align-content:center}
:is(.fj-device-study,.kqe-guide,.kc-security,.kc-main,.qp-root) summary::-webkit-details-marker{display:none}
:is(.fj-device-study,.kqe-guide,.kc-security,.kc-main,.qp-root) summary::marker{content:""}
:is(.fj-device-study,.kqe-guide,.kc-security,.kc-main,.qp-root) summary::before{content:"";position:absolute;inset-inline-start:5px;top:50%;width:8px;height:8px;border-inline-end:1.8px solid currentColor;border-block-end:1.8px solid currentColor;transform:translateY(-65%) rotate(-45deg);transition:transform .16s ease;opacity:.8}
:is(.fj-device-study,.kqe-guide,.kc-security,.kc-main,.qp-root) details[open]>summary::before{transform:translateY(-65%) rotate(45deg)}
:is(.fj-device-study,.kqe-guide,.kc-security,.kc-main,.qp-root) summary:hover{color:var(--kq-ink,inherit)}
:is(.fj-device-study,.kqe-guide,.kc-security,.kc-main,.qp-root) summary:focus-visible{outline:3px solid var(--kq-gold,#a28248);outline-offset:3px;border-radius:4px}
@media(prefers-reduced-motion:reduce){summary::before{transition:none!important}}
