/* Local app rebrand. Existing state, routes, forms and study handlers are retained. */
body.cortex-product.cortex-rebrand{--bg:#16171c;--bg-color:#16171c;--surface:#1e2026;--surface2:#24262e;--surface3:#2d303a;--border:#343640;--border-color:#343640;--text:#f3f1f8;--text-muted:#aaaab8;--text-secondary:#aaaab8;--accent:#c6b4fb;--accent2:#ace0d8;--cx-shadow:none;--cx-radius:16px;font-size:15px}
.cortex-rebrand .cx-workspace{max-width:1200px;margin:0 auto;padding:38px 42px 64px}
.cortex-rebrand .cx-page-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:32px}
.cortex-rebrand .cx-page-heading h1{font-size:clamp(28px,3.3vw,42px);margin:8px 0 10px;letter-spacing:-.05em}
.cortex-rebrand .cx-eyebrow{font-size:10px;letter-spacing:.16em;font-weight:700;color:var(--text-muted);margin:0}
.cortex-rebrand .cx-page-heading p:not(.cx-eyebrow),.cortex-rebrand .cx-section-heading p{margin:0;color:var(--text-muted);font-size:14px}
.cortex-rebrand :is(.cx-primary,.cx-secondary,.cx-text-button){display:inline-flex;align-items:center;justify-content:space-between;gap:20px;border:1px solid var(--border);border-radius:10px;padding:11px 17px;font-weight:600;font-size:14px;cursor:pointer;line-height:1.4;box-shadow:none}
.cortex-rebrand .cx-primary{background:var(--accent);border-color:var(--accent);color:#201a30}
.cortex-rebrand .cx-primary:hover{background:#d9ccff}
.cortex-rebrand .cx-secondary{background:var(--surface2);color:var(--text)}
.cortex-rebrand .cx-secondary:hover{border-color:var(--accent)}
.cortex-rebrand .cx-text-button{background:none;border-color:transparent;color:var(--accent);padding-right:0}
.cortex-rebrand .cx-start-grid{display:grid;grid-template-columns:1.5fr 1fr;gap:20px;margin-bottom:38px}
.cortex-rebrand .cx-create{position:relative;isolation:isolate;overflow:hidden;min-height:318px;border:1px solid #4b425c;border-radius:20px;background:#292432;padding:32px}
.cortex-rebrand .cx-create h2{font-size:32px;max-width:310px;margin:24px 0 12px;letter-spacing:-.04em}
.cortex-rebrand .cx-create p{color:#c0b9cd;font-size:14px;line-height:1.65;margin:0 0 26px;position:relative;z-index:2}
.cortex-rebrand .cx-create .cx-primary{position:relative;z-index:2}
.cortex-rebrand .cx-paper-art{position:absolute;right:-15px;bottom:22px;width:170px;height:205px;z-index:-1;opacity:.7}
.cortex-rebrand .cx-paper-art>div{position:absolute;inset:0;background:#514760;border:1px solid #8b7c9f;border-radius:12px;padding:20px;transform:rotate(-12deg)}
.cortex-rebrand .cx-paper-art>div+div{transform:rotate(9deg) translate(20px,33px);background:#c8bcdf;color:#352945}
.cortex-rebrand .cx-paper-art span{font-size:9px;letter-spacing:.15em}.cortex-rebrand .cx-paper-art b{display:block;font-size:19px;font-weight:500;line-height:1.4;margin:18px 0}
.cortex-rebrand .cx-paper-art i{display:block;height:3px;border-radius:2px;background:currentColor;opacity:.2;margin:12px 0;width:80%}
.cortex-rebrand .cx-next{display:flex;flex-direction:column;align-items:flex-start;padding:28px;border:1px solid var(--border);border-radius:20px;background:var(--surface)}
.cortex-rebrand .cx-orbit{width:68px;height:68px;margin:20px 0 12px;border:1px solid #536660;border-radius:50%;display:grid;place-items:center;color:#b0ded1;box-shadow:inset 0 0 0 8px #283632;font-size:26px}
.cortex-rebrand .cx-next h2{font-size:21px;margin:0 0 10px}.cortex-rebrand .cx-next p{font-size:14px;color:var(--text-muted);margin:0 0 22px;max-width:34ch}.cortex-rebrand .cx-next button{margin-top:auto}
.cortex-rebrand .cx-section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0 0 18px}.cortex-rebrand .cx-section-heading h2{font-size:21px;margin:0 0 6px}
.cortex-rebrand .cx-materials{margin-bottom:36px}.cortex-rebrand .cx-empty{display:flex;align-items:center;gap:22px;padding:28px;border:1px dashed #454650;border-radius:16px}.cortex-rebrand .cx-empty h3{font-size:17px;margin:0 0 7px}.cortex-rebrand .cx-empty p{max-width:47ch;margin:0;color:var(--text-muted);font-size:14px}.cortex-rebrand .cx-empty-symbol{font-size:28px;color:var(--accent);background:#302b3c;border-radius:12px;padding:10px 18px}.cortex-rebrand .cx-empty button{margin-left:auto;flex-shrink:0}
.cortex-rebrand .cx-deck-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.cortex-rebrand .cx-deck{overflow:hidden;border:1px solid var(--border);border-radius:16px;background:var(--surface)}.cortex-rebrand .cx-deck-cover{height:130px;padding:16px 22px;display:flex;align-items:flex-end;justify-content:space-between;background:#363047;color:#c9bbed}.cortex-rebrand .cx-cover-1{background:#253e3c;color:#b0d6c8}.cortex-rebrand .cx-cover-2{background:#443a2d;color:#e7c795}.cortex-rebrand .cx-deck-cover>span{font-family:var(--cx-title);font-size:64px;line-height:1}.cortex-rebrand .cx-deck-cover small{font-size:10px;letter-spacing:.08em;max-width:50%;overflow-wrap:anywhere}.cortex-rebrand .cx-deck-body{padding:20px}.cortex-rebrand .cx-deck-body h3{font-size:18px;margin:0 0 8px;overflow-wrap:anywhere}.cortex-rebrand .cx-deck-body p{font-size:12px;color:var(--text-muted);margin:0 0 18px}.cortex-rebrand .cx-deck-body button{width:100%}
.cortex-rebrand .cx-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.cortex-rebrand .cx-tool{display:flex;align-items:center;gap:16px;border:1px solid var(--border);border-radius:13px;background:var(--surface);color:var(--text);padding:18px;text-align:left;cursor:pointer}.cortex-rebrand .cx-tool:hover{border-color:#7e728f;background:#24232d}.cortex-rebrand .cx-tool>span:last-child{margin-left:auto;color:var(--text-muted)}.cortex-rebrand .cx-tool-mark{width:40px;height:40px;display:grid;place-items:center;border-radius:10px;background:#302d3b;color:var(--accent);font-size:22px;flex-shrink:0}.cortex-rebrand .cx-tool strong{font-size:14px;font-weight:600;display:block}.cortex-rebrand .cx-tool small{display:block;font-size:12px;color:var(--text-muted);margin-top:4px}
.cortex-rebrand .cx-progress{border-block:1px solid var(--border);margin:30px 0 20px}.cortex-rebrand .cx-progress>summary{display:flex;justify-content:space-between;cursor:pointer;padding:20px 0;font-size:14px}.cortex-rebrand .cx-progress-content{padding-bottom:20px}.cortex-rebrand .cx-extra-tools{display:grid;grid-template-columns:1fr 1fr;gap:12px}.cortex-rebrand .cx-feedback{margin-top:28px;color:var(--text-muted);font-size:13px}.cortex-rebrand .cx-feedback summary{cursor:pointer;padding:10px 0}.cortex-rebrand .cx-feedback-form{display:grid;grid-template-columns:160px 1fr auto;gap:12px;margin:12px 0}.cortex-rebrand #feedback-list{max-height:360px;overflow:auto}
.cortex-rebrand .cx-brand-name{font-family:var(--cx-title);font-size:24px;font-weight:600;letter-spacing:-1px}.cortex-rebrand .cx-brand-name small{font-family:var(--cx-body);font-size:9px;color:var(--text-muted);letter-spacing:.12em;display:block;margin-top:-6px}.cortex-rebrand .nav-tab svg,.cortex-rebrand .nav-action-btn svg{width:20px;height:20px;display:block;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.cortex-rebrand .nav-caption{font-size:10px;color:var(--text-muted);letter-spacing:.13em;margin:28px 12px 12px}
body.cortex-product.cortex-rebrand :is(.nebula-card,.upload-card,.glass,.settings-card,.plan-phase){box-shadow:none!important}
body.cortex-product.cortex-rebrand :is(.study-card,.flip-front,.flip-back,.input-area,.cortex-editor){border-color:var(--border)!important;box-shadow:none!important}
body.cortex-product.cortex-rebrand :is(#tolc-sim-overlay,#study-overlay,#quiz-overlay,#oral-overlay,#boss-overlay){background:#16171c!important}
body.cortex-product.cortex-rebrand :is(.tolc-pick,.settings-nav-btn){border-radius:12px!important;box-shadow:none!important}
body.cortex-product.cortex-rebrand #tolc-start{background:var(--accent)!important;color:#21182e!important;box-shadow:none!important}
body.cortex-product.cortex-rebrand :is(.cortex-editor,.cortex-tech-view){max-width:1080px;margin-inline:auto}
body.cortex-product.cortex-rebrand .upload-card{padding:24px!important}.cortex-rebrand .upload-card .icon{filter:grayscale(1);font-size:26px!important}
body.cortex-product.cortex-rebrand .card-title-nebula{font-size:21px}.cortex-rebrand .nebula-card{transition:border-color .15s ease!important}
@media(min-width:1001px){
 body.cortex-product.cortex-rebrand{padding-left:232px!important}
 body.cortex-product.cortex-rebrand>nav{position:fixed!important;inset:0 auto 0 0!important;width:232px!important;height:100dvh!important;max-width:none!important;margin:0!important;transform:none!important;border:0!important;border-right:1px solid #2c2e36!important;border-radius:0!important;background:#111216!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;padding:30px 18px 22px!important;box-shadow:none!important;backdrop-filter:none!important;gap:0!important;overflow-y:auto}
 body.cortex-product.cortex-rebrand .nav-logo{display:flex!important;align-items:center;gap:10px;padding:0 12px;margin:0}.cortex-rebrand .nav-logo img{width:38px!important;height:38px!important;object-fit:contain}
 body.cortex-product.cortex-rebrand .nav-tabs{display:flex!important;flex-direction:column!important;gap:7px!important;width:100%;background:none!important;border:0!important;padding:0!important}
 body.cortex-product.cortex-rebrand .nav-tab{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:12px!important;min-height:46px!important;width:100%!important;padding:12px!important;border-radius:9px!important;border:1px solid transparent!important;background:none!important;color:#b4b3c0!important;transform:none!important;box-shadow:none!important}
 body.cortex-product.cortex-rebrand .nav-tab .label{display:block!important;font-size:13px!important;font-weight:500!important;white-space:normal!important;text-align:left}.cortex-rebrand .nav-tab .icon{display:block!important;line-height:1}
 body.cortex-product.cortex-rebrand .nav-tab.active{background:#292335!important;color:#d6c6ff!important;border-color:#493b60!important}
 body.cortex-product.cortex-rebrand .nav-tab:hover{background:#22212a!important}
 body.cortex-product.cortex-rebrand .nav-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important;margin-top:auto!important;padding-top:32px!important;width:100%!important;border:0!important}
 body.cortex-product.cortex-rebrand .nav-action-btn{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:12px!important;width:100%!important;height:44px!important;border:0!important;border-radius:9px!important;padding:12px!important;background:transparent!important;color:#b4b3c0!important;box-shadow:none!important}
 body.cortex-product.cortex-rebrand .nav-action-btn .label{display:block!important;font-size:13px!important}.cortex-rebrand .lang-selector-wrap{margin:6px 8px}.cortex-rebrand #app-root{min-height:100dvh!important}.cortex-rebrand #home-root{padding-top:0!important}
 body.cortex-product.cortex-rebrand #app-root>div{padding-top:32px!important}body.cortex-product.cortex-rebrand #app-root>#home-root{padding-top:0!important}
}
@media(max-width:1000px){.cortex-rebrand .cx-brand-name,.cortex-rebrand .nav-caption{display:none}.cortex-rebrand .cx-workspace{padding:26px 24px 100px}.cortex-rebrand .cx-paper-art{opacity:.35}.cortex-rebrand .cx-create h2{font-size:29px}.cortex-rebrand .cx-empty{flex-wrap:wrap}.cortex-rebrand .cx-empty button{margin-left:0}.cortex-rebrand .cx-feedback-form{grid-template-columns:1fr}.cortex-rebrand .cx-deck-grid{gap:12px}}
@media(max-width:600px){
 .cortex-rebrand .cx-workspace{padding:22px 18px 110px}.cortex-rebrand .cx-page-heading{align-items:flex-start;margin-bottom:22px}.cortex-rebrand .cx-page-heading>.cx-secondary{display:none}.cortex-rebrand .cx-page-heading h1{font-size:30px}.cortex-rebrand .cx-page-heading p:not(.cx-eyebrow){font-size:13px}.cortex-rebrand .cx-start-grid{grid-template-columns:1fr;gap:14px;margin-bottom:28px}.cortex-rebrand .cx-create{min-height:290px;padding:24px}.cortex-rebrand .cx-create h2{font-size:29px;margin-top:20px}.cortex-rebrand .cx-paper-art{right:0;opacity:.45;width:130px;height:175px}.cortex-rebrand .cx-next{padding:22px;display:grid;grid-template-columns:52px 1fr;gap:10px 16px;align-items:center}.cortex-rebrand .cx-next>.cx-eyebrow{grid-column:1/-1}.cortex-rebrand .cx-orbit{width:48px;height:48px;grid-row:2/4;margin:0;font-size:21px}.cortex-rebrand .cx-next h2{font-size:18px;margin:6px 0 0}.cortex-rebrand .cx-next p{margin:0;font-size:13px}.cortex-rebrand .cx-next button{grid-column:1/-1;justify-content:space-between;margin-top:8px}.cortex-rebrand .cx-section-heading h2{font-size:20px}.cortex-rebrand .cx-section-heading p{font-size:12px}.cortex-rebrand .cx-text-button{font-size:12px;white-space:nowrap}.cortex-rebrand .cx-empty{padding:22px;gap:16px}.cortex-rebrand .cx-empty-symbol{display:none}.cortex-rebrand .cx-empty button{width:100%}.cortex-rebrand .cx-tools{grid-template-columns:1fr}.cortex-rebrand .cx-tool{padding:16px}.cortex-rebrand .cx-extra-tools{grid-template-columns:1fr}.cortex-rebrand .cx-deck-grid{grid-template-columns:1fr}.cortex-rebrand .cx-deck-cover{height:105px}.cortex-rebrand .cx-progress>summary{font-size:13px}.cortex-rebrand #home-root{padding-top:0!important}
 body.cortex-product.cortex-rebrand>nav{background:#16171cf5!important;border-top:1px solid var(--border)!important;border-radius:0!important;padding-bottom:env(safe-area-inset-bottom,0)!important;box-shadow:none!important}
 body.cortex-product.cortex-rebrand .nav-tab.active{color:var(--accent)!important;background:#292335!important}.cortex-rebrand #tab-config .label{display:none!important}
}
@media(prefers-reduced-motion:reduce){.cortex-rebrand *{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
body.cortex-product.cortex-rebrand .nav-tab[style*="display:none"],body.cortex-product.cortex-rebrand .nav-tab[style*="display: none"]{display:none!important}
@media(min-width:1001px){
 body.cortex-product.cortex-rebrand .nav-logo{width:auto!important;height:44px!important;min-height:44px!important;overflow:visible!important;justify-content:flex-start!important;flex-shrink:0!important;border-radius:0!important}
 .cortex-rebrand .nav-logo img{flex-shrink:0!important}.cortex-rebrand .cx-brand-name{white-space:nowrap;line-height:1.4}.cortex-rebrand .cx-brand-name small{font-size:7px;letter-spacing:.1em;margin-top:0}
 body.cortex-product.cortex-rebrand .nav-actions .nav-action-btn:not(.focus-trigger){width:100%!important;min-width:0!important;border-radius:9px!important}.cortex-rebrand #tab-config .label{white-space:nowrap!important;width:auto!important;overflow-wrap:normal!important}
 body.cortex-product.cortex-rebrand .notif-banner{left:calc(50% + 116px)!important;background:var(--surface)!important;border-color:var(--border)!important;box-shadow:0 8px 30px #0003!important}
}
body.cortex-product.cortex-rebrand .cortex-editor .section-header{text-align:left!important;margin:24px 0 30px!important}.cortex-rebrand .cortex-editor .section-header h2{margin:0 0 10px!important;font-size:32px!important}.cortex-rebrand .cortex-editor .section-header p{margin:0!important;font-size:14px!important}
.cortex-rebrand .cortex-editor .tech-back{padding:10px 14px!important;font-size:13px!important}
body.cortex-product.cortex-rebrand .cortex-editor [data-fn="saveAndGeneratePlan"]{background:var(--surface2)!important;border:1px solid var(--border)!important;border-radius:10px!important;color:var(--text)!important;box-shadow:none!important}
body.cortex-product.cortex-rebrand #onboarding-overlay>div{background:var(--surface)!important;border:1px solid var(--border)!important;border-radius:20px!important;box-shadow:none!important}
.cortex-rebrand .cx-library-empty{max-width:760px;margin:30px auto;padding:42px;border:1px solid var(--border);background:var(--surface);border-radius:20px;text-align:left}.cortex-rebrand .cx-library-empty h2{font-size:30px;margin:20px 0 12px}.cortex-rebrand .cx-library-empty>p{font-size:15px;color:var(--text-muted);max-width:48ch}.cortex-rebrand .cx-library-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:24px}.cortex-rebrand .cx-example-card{display:block;width:100%;margin:28px 0;padding:26px;text-align:left;background:#2d2739;border:1px solid #51445f;border-radius:14px;color:var(--text);cursor:pointer}.cortex-rebrand .cx-example-card strong{display:block;font-size:20px;margin:12px 0}.cortex-rebrand .cx-example-card small{display:block;color:var(--text-muted);font-size:12px}
.cortex-rebrand .cx-library-cover{display:flex;align-items:center;justify-content:space-between;padding:22px;background:color-mix(in srgb,var(--card-accent) 18%,#25252e);border-radius:10px;min-height:96px;margin-bottom:18px}.cortex-rebrand .cx-library-cover>span{font-size:38px;font-family:var(--cx-title);color:var(--text)}.cortex-rebrand .cx-library-cover small{font-size:10px;letter-spacing:.12em;color:var(--text-muted)}
@media(max-width:600px){
 body.cortex-product.cortex-rebrand .cx-next h2{font-size:18px!important}.cortex-rebrand .cx-paper-art{opacity:.18;right:-40px}.cortex-rebrand .cx-library-empty{margin:12px 0;padding:24px}.cortex-rebrand .cx-library-empty h2{font-size:25px!important}.cortex-rebrand .cx-library-actions>*{width:100%}.cortex-rebrand .cortex-editor{padding-inline:18px!important}.cortex-rebrand .cortex-editor .input-area{padding:20px!important}.cortex-rebrand .cortex-editor .section-header h2{font-size:27px!important}
}
body.cortex-product.cortex-rebrand #tolc-sim-overlay>div{background:var(--bg)!important;border:1px solid var(--border)!important;box-shadow:none!important;border-radius:20px!important}
body.cortex-product.cortex-rebrand .tolc-pick{background:var(--surface)!important;border-color:var(--border)!important;padding:20px!important;gap:7px!important}
body.cortex-product.cortex-rebrand .tolc-pick:hover{border-color:var(--accent)!important;background:var(--surface2)!important}
body.cortex-product.cortex-rebrand .tolc-pick>div:not(:first-child){color:var(--text-muted)!important;font-size:13px!important}
body.cortex-product.cortex-rebrand #tolc-close{color:var(--text)!important;background:var(--surface2)!important}
body.cortex-product.cortex-rebrand .settings-fullscreen{background:var(--bg)!important}.cortex-rebrand .settings-header{background:var(--bg)!important;border-bottom:1px solid var(--border)!important}.cortex-rebrand .settings-container{max-width:900px!important}.cortex-rebrand .settings-section{background:var(--surface)!important;border:1px solid var(--border)!important;border-radius:16px!important;padding:24px!important;box-shadow:none!important}.cortex-rebrand .settings-section-title{font-size:18px!important;letter-spacing:-.02em!important}.cortex-rebrand .settings-row-title{font-size:14px!important}.cortex-rebrand .settings-row-desc{font-size:13px!important;color:var(--text-muted)!important}
body.cortex-product.cortex-rebrand #cortex-demo{background:#16171cf5!important}body.cortex-product.cortex-rebrand #cortex-demo>div{background:var(--surface)!important;border-color:var(--border)!important;box-shadow:none!important}
@media(max-width:600px){body.cortex-product.cortex-rebrand .tolc-pick{padding:15px!important}.cortex-rebrand .settings-section{padding:18px!important}}
body.cortex-product.cortex-rebrand :is(#guest-save-modal,#guest-login-gate)>div{background:var(--surface)!important;border:1px solid var(--border)!important;box-shadow:none!important;border-radius:20px!important}
body.cortex-product.cortex-rebrand :is(#cortex-demo,#guest-save-modal,#guest-login-gate) button[style*="linear-gradient"]{background:var(--accent)!important;color:#21182e!important;border-radius:10px!important;box-shadow:none!important}

/* Local preview: reset compact navigation clipping on desktop. */
@media(min-width:1001px){
 body.cortex-product.cortex-rebrand .nav-tabs{border-radius:0!important;overflow:visible!important;flex-shrink:0!important}
 body.cortex-product.cortex-rebrand #trigger-focus .label{display:block!important;font-size:13px!important}
}
/* Keep the illustration clear of the copy in the narrower preview panel. */
@media(min-width:601px) and (max-width:1250px){
 .cortex-rebrand .cx-create{padding-bottom:130px}
 .cortex-rebrand .cx-paper-art{width:110px;height:125px;right:14px;bottom:-15px;opacity:.5}
 .cortex-rebrand .cx-paper-art>div{padding:12px}
}
@media(min-width:601px) and (max-width:1250px){
 .cortex-rebrand .cx-paper-art{width:170px;height:205px;right:30px;bottom:35px;transform:scale(.55);transform-origin:bottom right;opacity:.7}
 .cortex-rebrand .cx-paper-art>div{padding:20px}
}

/* Current home features retained inside the new visual system. */
.cortex-rebrand .cx-today>section,.cortex-rebrand .cx-home-extras .nebula-card{background:var(--surface)!important;border:1px solid var(--border)!important;border-radius:16px!important;box-shadow:none!important}
.cortex-rebrand .cx-today button,.cortex-rebrand .cx-home-extras button{background:var(--accent)!important;color:#21182e!important;box-shadow:none!important;border-radius:10px!important}
.cortex-rebrand .cx-home-extras{margin-top:24px}.cortex-rebrand .cx-home-extras:empty{display:none}
@media(max-width:600px){.cortex-rebrand .home-comparison>div[style*="grid-template-columns"]{grid-template-columns:1fr!important}}
