/* Tera Math Scholar · Topologie Générale · Flagship Learning Layer v1.0.4
   Presentation only. Canonical deterministic mathematics remains in the protected course source. */
:root{--tms104-violet:#6d35df;--tms104-violet2:#8b5cf6;--tms104-ink:#10172a;--tms104-muted:#5d667a;--tms104-line:#dfe4ee;--tms104-gold:#c89a27;--tms104-teal:#078aa2;--tms104-green:#0c9b71;--tms104-soft:#f8f9fc;--tms104-shadow:0 22px 70px rgba(36,42,72,.11)}
body.page-chapter,.chapter-main,.chapter-body{font-size:18px!important;line-height:1.7!important}
.logo__name-primary,.logo__name-secondary,.header-nav a,.hdr-dd-trigger,.hdr-dd-menu a,.btn-ghost-sm,.ch-sidebar-heading,.ch-nav-list li a,.ch-nav-num,.ch-progress-label,.chapter-main .breadcrumb,.chapter-title-block__eyebrow,.chapter-title-block__purpose,.viz-section-heading,.viz-investigation__num,.viz-investigation__title,.viz-phase__label,.viz-phase__text,.viz-investigation__question-label,.viz-investigation__question p,.tool-panel__header,.tool-panel__body,.notation-table td,.math-block__title,.exercise-block__stmt,.exercise-block__evidence,.hint-content,.site-footer,.site-footer a,.site-footer p,[style*="font-size:17px"],[style*="font-size: 17px"]{font-size:18px!important}
.chapter-main p{font-size:19px!important;line-height:1.75!important}
.chapter-main{width:min(100% - 56px,1040px)!important;padding-top:2.2rem!important}
.site-header{min-height:76px!important;border-top:3px solid var(--tms104-violet);box-shadow:0 3px 22px rgba(22,27,45,.05)!important}
.logo__name-primary{font-weight:850!important}.logo__name-secondary{color:#a97b17!important}
.header-nav{gap:.45rem!important}.header-nav a,.hdr-dd-trigger{padding:.65rem .9rem!important}.header-right{gap:.65rem!important}

.chapter-sidebar{background:linear-gradient(180deg,#fbfbfe,#f6f7fb)!important;border-right:1px solid #e1e5ee!important}.ch-sidebar-heading{color:#5c36c9!important;font-weight:850!important;padding-top:.25rem!important}.ch-nav-list li a{padding:.62rem 1.25rem!important;color:#46516a!important;line-height:1.35!important;border-left-width:3px!important}.ch-nav-list li a.active{color:#5f2ed0!important;background:linear-gradient(90deg,rgba(109,53,223,.12),rgba(109,53,223,.035))!important;border-left-color:#7040e8!important;font-weight:800!important}.ch-nav-num{color:#8b94a6!important;font-size:18px!important;min-width:1.65rem!important}.ch-nav-list li a.active .ch-nav-num{color:#6d35df!important}
.chapter-title-block{margin-bottom:2.2rem!important}.chapter-title-block__eyebrow{color:#6536d5!important;letter-spacing:.12em!important}.chapter-title-block h1{font-size:clamp(42px,4.6vw,62px)!important;font-weight:600!important;color:var(--tms104-ink)!important;letter-spacing:-.025em!important}.chapter-title-block__purpose{font-size:21px!important;color:#5a6477!important;border-left:4px solid #9b73ff;padding-left:18px!important;max-width:860px!important}
#investigations{position:relative}#investigations .viz-section-heading{font-size:20px!important;color:#162448!important;letter-spacing:.17em!important;padding:16px 0!important;margin-bottom:20px!important;border-bottom:1px solid #d7ddea!important}
#viz1{position:relative;border:1px solid rgba(109,53,223,.24)!important;border-radius:24px!important;background:#fff!important;box-shadow:0 26px 80px rgba(64,51,116,.14)!important;overflow:hidden!important;margin:0 0 3rem!important}#viz1:before{content:"YOUR FIRST TOPOLOGY EXPERIMENT";display:block;padding:12px 22px;background:linear-gradient(90deg,#f2edff,#fbf9ff 56%,#fff7df);font:850 18px/1.3 var(--f-mono);letter-spacing:.13em;color:#6231ce;border-bottom:1px solid rgba(109,53,223,.13)}
#viz1 .viz-investigation__header{padding:20px 24px 16px!important;background:#fff!important;gap:14px!important}#viz1 .viz-investigation__num{color:#6d35df!important;font-weight:850!important}#viz1 .viz-investigation__title{font-size:28px!important;font-weight:650!important;color:#10172a!important}
#viz1 .viz-investigation__canvas-wrap{position:relative;padding:24px!important;min-height:300px!important;background-color:#fbfcff!important;background-image:linear-gradient(rgba(91,74,156,.055) 1px,transparent 1px),linear-gradient(90deg,rgba(91,74,156,.055) 1px,transparent 1px),radial-gradient(circle at 14% 20%,rgba(12,155,113,.08),transparent 26%),radial-gradient(circle at 86% 20%,rgba(109,53,223,.09),transparent 28%)!important;background-size:28px 28px,28px 28px,100% 100%,100% 100%!important}
#viz1 canvas{width:100%!important;height:auto!important;max-width:860px!important;filter:drop-shadow(0 10px 18px rgba(45,53,85,.07));transition:transform .2s ease!important}#viz1 .viz-investigation__canvas-wrap:hover canvas{transform:translateY(-2px) scale(1.008)}#viz1 .viz-investigation__phases{background:#fff!important}#viz1 .viz-phase{min-height:112px!important;padding:17px 18px!important;position:relative!important}#viz1 .viz-phase.active{background:linear-gradient(180deg,#f3efff,#faf8ff)!important;box-shadow:inset 0 3px 0 #6d35df!important}#viz1 .viz-phase__label{color:#5e31c7!important;font-weight:900!important;margin-bottom:6px!important}#viz1 .viz-phase__text{color:#4f5a70!important;line-height:1.45!important}#viz1 .viz-investigation__question{background:linear-gradient(90deg,#f8f5ff,#fff)!important;padding:18px 24px!important}#viz1 .viz-investigation__question-label{color:#6237c9!important;font-weight:900!important}#viz1 .viz-investigation__question p{font-size:19px!important;color:#343e53!important}#viz1 .viz-continue-btn{font-size:18px!important;font-weight:850!important;background:linear-gradient(90deg,#6d35df,#7c4cec)!important;color:#fff!important;padding:16px!important}
.tms104-viz-hook{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 22px;border-top:1px solid #ead99b;background:linear-gradient(90deg,#fffaf0,#ffffff 62%,#f7f2ff);color:#263148}.tms104-viz-hook strong,.tms104-viz-hook span,.tms104-viz-hook a{font-size:18px!important}.tms104-viz-hook strong{display:block;font-size:20px!important}.tms104-viz-hook span{color:#667085}.tms104-viz-hook a{flex:0 0 auto;text-decoration:none;border-radius:999px;padding:10px 16px;background:#fff;color:#72520b;border:1px solid #d8b63d;font-weight:900;box-shadow:0 6px 18px rgba(155,119,25,.10)}
.math-block,.exercise-block,.content-card{border-color:#e0e5ee!important;box-shadow:0 8px 26px rgba(22,31,55,.035)!important}
.tms104-profile{position:relative;display:flex;align-items:center;gap:10px;padding:6px 8px 6px 10px;border-left:1px solid #e2e5ed;min-width:205px}.tms104-profile-button{all:unset;cursor:pointer;display:flex;align-items:center;gap:10px;width:100%}.tms104-profile-copy{display:flex;flex-direction:column;line-height:1.15;min-width:0}.tms104-profile-copy strong{font:800 18px/1.15 var(--f-sans);color:#172035;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tms104-profile-copy span{font:600 18px/1.2 var(--f-sans);color:#6d7485;margin-top:4px;white-space:nowrap}.tms104-avatar{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;overflow:hidden;flex:0 0 46px;background:linear-gradient(145deg,#2d3551,#10172a);color:#fff;border:2px solid #fff;box-shadow:0 0 0 2px #e4c35b,0 7px 20px rgba(30,37,60,.16);font:850 18px var(--f-sans)}.tms104-avatar img{width:100%;height:100%;object-fit:cover}.tms104-profile-chevron{font-size:22px;color:#566078;margin-left:auto}.tms104-profile-menu{display:none;position:absolute;right:0;top:calc(100% + 10px);width:265px;background:#fff;border:1px solid #dfe4ed;border-radius:16px;box-shadow:0 20px 60px rgba(20,29,50,.16);padding:10px;z-index:100000}.tms104-profile.open .tms104-profile-menu{display:block}.tms104-profile-menu a,.tms104-profile-menu button{width:100%;display:flex;text-align:left;padding:11px 12px;border:0;background:transparent;border-radius:9px;color:#283247;text-decoration:none;font:750 18px var(--f-sans);cursor:pointer}.tms104-profile-menu a:hover,.tms104-profile-menu button:hover{background:#f4f1ff;color:#5b2fc5}.tms104-access-link{font:800 18px var(--f-sans)!important;padding:.55rem .85rem!important;border:1px solid rgba(200,154,39,.45)!important;border-radius:9px!important;color:#76530a!important;background:#fff9e8!important;text-decoration:none!important}
.ai-brainstorm-btn{right:28px!important;bottom:24px!important;padding:14px 21px!important;border-radius:999px!important;border:1px solid rgba(125,75,235,.32)!important;background:linear-gradient(120deg,#6a33d8,#8b5cf6)!important;color:#fff!important;font-size:18px!important;font-weight:850!important;box-shadow:0 15px 38px rgba(109,53,223,.32),0 0 0 6px rgba(139,92,246,.07)!important;z-index:100001!important}.ai-brainstorm-btn:hover{transform:translateY(-2px)!important;box-shadow:0 20px 45px rgba(109,53,223,.38),0 0 0 8px rgba(139,92,246,.09)!important}.ai-brainstorm-btn svg{width:20px!important;height:20px!important}
.tms104-ai-backdrop{position:fixed;inset:0;background:rgba(11,18,32,.28);backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:.22s ease;z-index:100002}.tms104-ai-backdrop.open{opacity:1;pointer-events:auto}.tms104-ai{position:fixed;right:18px;top:92px;bottom:20px;width:min(455px,calc(100vw - 36px));display:flex;flex-direction:column;background:rgba(255,255,255,.985);border:1px solid rgba(103,72,195,.22);border-radius:24px;box-shadow:0 28px 100px rgba(25,31,56,.25);transform:translateX(calc(100% + 40px));opacity:.5;transition:transform .26s cubic-bezier(.2,.8,.2,1),opacity .2s;z-index:100003;overflow:hidden}.tms104-ai.open{transform:none;opacity:1}.tms104-ai-head{padding:19px 20px 16px;border-bottom:1px solid #e7e9f0;background:linear-gradient(135deg,#fff,#faf8ff 65%,#fff9e8)}.tms104-ai-top{display:flex;align-items:center;gap:11px}.tms104-ai-mark{width:40px;height:40px;border-radius:13px;display:grid;place-items:center;background:linear-gradient(145deg,#efe9ff,#fff);color:#6d35df;font-size:22px;border:1px solid #ded3ff}.tms104-ai-title{flex:1}.tms104-ai-title strong{display:block;color:#161d31;font:850 20px/1.2 var(--f-sans)}.tms104-ai-title span{display:inline-flex;margin-top:4px;padding:3px 8px;border-radius:999px;background:#f0ecff;color:#6436cc;font:800 18px/1.2 var(--f-sans)}.tms104-ai-close{all:unset;cursor:pointer;width:36px;height:36px;display:grid;place-items:center;border-radius:10px;color:#596277;font-size:26px}.tms104-ai-close:hover{background:#f0f2f6}
.tms104-ai-doctrine{padding:18px 20px 16px}.tms104-ai-doctrine h3{font:650 28px/1.15 var(--f-serif);margin:0;color:#151b2d}.tms104-ai-doctrine h3 em{font-style:normal;color:#6d35df}.tms104-ai-doctrine p{margin:9px 0 0;font-size:18px!important;color:#5d6578;line-height:1.5}.tms104-ai-actions{display:grid;gap:8px;padding:0 16px 14px;overflow:auto}.tms104-ai-action{display:grid;grid-template-columns:38px 1fr 22px;align-items:center;gap:10px;padding:10px 11px;border:1px solid #e2e5ee;border-radius:13px;background:#fff;cursor:pointer;text-align:left;transition:.15s ease}.tms104-ai-action:hover{border-color:#cdbaff;background:#fbf9ff;transform:translateX(2px)}.tms104-ai-action-icon{width:36px;height:36px;border-radius:11px;display:grid;place-items:center;background:#f3efff;color:#6d35df;font-size:20px}.tms104-ai-action strong{display:block;font:800 18px/1.2 var(--f-sans);color:#252e43}.tms104-ai-action span{display:block;font:600 18px/1.25 var(--f-sans);color:#727b8d;margin-top:3px}.tms104-ai-action>span:last-child{font-size:24px!important;color:#8b94a5;margin:0}.tms104-ai-chat{display:none;flex:1;min-height:0;border-top:1px solid #e8eaf0;background:#fafbfe}.tms104-ai.chatting .tms104-ai-actions,.tms104-ai.chatting .tms104-ai-doctrine{display:none}.tms104-ai.chatting .tms104-ai-chat{display:flex;flex-direction:column}.tms104-ai-messages{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.tms104-msg{max-width:90%;padding:12px 14px;border-radius:15px;font-size:18px!important;line-height:1.55;white-space:pre-wrap}.tms104-msg.user{align-self:flex-end;background:#6d35df;color:#fff;border-bottom-right-radius:4px}.tms104-msg.assistant{align-self:flex-start;background:#fff;color:#293249;border:1px solid #e0e4ed;border-bottom-left-radius:4px}.tms104-msg.system{align-self:center;max-width:100%;background:#fff8e3;color:#6f5517;border:1px solid #ead59d}.tms104-ai-compose{padding:13px;border-top:1px solid #e1e5ee;background:#fff}.tms104-ai-compose textarea{width:100%;min-height:78px;max-height:150px;resize:vertical;border:1px solid #ccd3df;border-radius:13px;padding:12px 14px;font:18px/1.45 var(--f-sans);color:#20293d;background:#fff}.tms104-ai-compose-row{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:9px}.tms104-ai-back{all:unset;cursor:pointer;font:800 18px var(--f-sans);color:#6736d0}.tms104-ai-send{border:0;border-radius:999px;background:#6d35df;color:#fff;padding:10px 17px;font:850 18px var(--f-sans);cursor:pointer}.tms104-ai-send:disabled{opacity:.55;cursor:not-allowed}.tms104-ai-foot{padding:10px 17px 14px;font-size:18px!important;color:#737b8c;border-top:1px solid #ebedf2;background:#fff}.tms104-ai-foot strong{color:#30394e}.tms104-ai-status{font-weight:800;color:#6b35d2}.site-footer__inner,.site-footer__inner p,.site-footer__inner a,.site-footer__inner span{font-size:18px!important}
@media(max-width:1280px){.tms104-profile{min-width:auto}.tms104-profile-copy{display:none}.tms104-ai{top:82px}}@media(max-width:900px){.tms104-viz-hook{align-items:flex-start;flex-direction:column}.tms104-ai{right:10px;top:78px;bottom:10px;width:calc(100vw - 20px)}.ai-brainstorm-btn{right:16px!important;bottom:16px!important}.chapter-main{width:min(100% - 28px,1040px)!important}}@media(prefers-reduced-motion:reduce){.tms104-ai,.tms104-ai-backdrop,.ai-brainstorm-btn,#viz1 canvas{transition:none!important}}


/* v1.0.4 GOLDEN SCHOLARLY HEADER — no dark access banner. */
.site-header{min-height:auto!important;border:0!important;background:linear-gradient(120deg,#463610 0%,#7a611a 34%,#a9861f 66%,#c9a227 100%)!important;box-shadow:none!important;position:relative!important;z-index:10000!important}
.site-header__inner{max-width:none!important;width:100%!important;padding:0!important;display:grid!important;grid-template-columns:minmax(360px,1fr) auto!important;grid-template-areas:"brand account" "nav nav"!important;gap:0!important;background:transparent!important;align-items:center!important}
.site-header .logo{grid-area:brand!important;padding:13px 2.8vw!important;min-height:88px!important;color:#fff!important}
.site-header .logo__name-primary{color:#fff!important;font-family:var(--f-serif)!important;font-size:30px!important;font-weight:650!important}
.site-header .logo__name-secondary{color:rgba(255,250,235,.88)!important;font-size:18px!important;font-weight:650!important}
.site-header .header-right{grid-area:account!important;padding:13px 2.8vw 13px 1rem!important;min-height:88px!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:.8rem!important;color:#fff!important}
.site-header .header-nav{grid-area:nav!important;width:100%!important;max-width:none!important;margin:0!important;padding:10px 2.8vw!important;min-height:64px!important;background:#fff!important;border-top:2px solid #d7b53b!important;border-bottom:1px solid #e3e6ed!important;display:flex!important;justify-content:center!important;align-items:center!important;gap:1.2rem!important;box-shadow:0 5px 18px rgba(28,34,48,.035)!important}
.site-header .header-nav a,.site-header .hdr-dd-trigger{font-size:20px!important;color:#172035!important;font-weight:700!important;padding:.65rem .85rem!important}
.site-header .header-nav a:hover,.site-header .hdr-dd-trigger:hover{color:#7e5d0c!important;background:#fff8e6!important}
.site-header .header-nav a.active,.site-header .hdr-dd-trigger.active{color:#7a5710!important;background:#fff6df!important}
.site-header .lang-toggle{border:1px solid rgba(255,255,255,.72)!important;border-radius:7px!important;overflow:hidden!important;background:rgba(255,255,255,.08)!important}
.site-header .lang-btn{font-size:18px!important;color:#fff!important;background:transparent!important;padding:.45rem .72rem!important}
.site-header .lang-btn.active{background:#fff!important;color:#10223b!important}
.site-header .btn-ghost-sm{font-size:18px!important;color:#fff!important;border:1px solid rgba(255,255,255,.55)!important;background:rgba(255,255,255,.06)!important;border-radius:8px!important;padding:.55rem .8rem!important}
.site-header .btn-ghost-sm:hover{background:#fff!important;color:#71520b!important}
.tms104-access-link{font:800 18px var(--f-sans)!important;padding:.6rem .9rem!important;border:1px solid rgba(255,255,255,.75)!important;border-radius:9px!important;color:#65490b!important;background:#fff8df!important;text-decoration:none!important;box-shadow:0 4px 14px rgba(66,45,3,.09)}
.tms104-profile{border-left:1px solid rgba(255,255,255,.35)!important;min-width:220px!important}
.tms104-profile-copy strong{color:#fff!important}.tms104-profile-copy span{color:rgba(255,255,255,.82)!important}.tms104-profile-chevron{color:#fff!important}.tms104-avatar{background:linear-gradient(145deg,#173657,#091626)!important;border:2px solid #fff!important;box-shadow:0 0 0 2px #e8c958,0 7px 20px rgba(30,22,3,.22)!important}
.tms104-profile-menu{background:#fff!important}
/* Light course-state card lives in the left rail, not above the header. */
.tms104-course-state{margin:.9rem 1rem 1.2rem;padding:14px 14px 13px;border:1px solid #e7d18a;border-radius:12px;background:linear-gradient(145deg,#fffaf0,#fff);box-shadow:0 8px 22px rgba(91,68,14,.06);color:#39445a}
.tms104-course-state strong{display:block;font-size:18px!important;color:#76550b;margin-bottom:4px}.tms104-course-state span,.tms104-course-state a,.tms104-course-state button{font-size:18px!important}.tms104-course-state span{display:block;color:#697386;margin-bottom:10px}.tms104-course-state-actions{display:flex;gap:8px;flex-wrap:wrap}.tms104-course-state a,.tms104-course-state button{appearance:none;border:1px solid #d8c067;background:#fff;color:#6b500d;border-radius:8px;padding:8px 10px;text-decoration:none;font-weight:800;cursor:pointer}.tms104-course-state a:hover,.tms104-course-state button:hover{background:#fff6d8}
/* Keep all flagship overlays light. */
.tms104-ai-backdrop{background:rgba(42,35,67,.13)!important;backdrop-filter:blur(2px)!important}
/* 18 px is the actual floor for readable instructional UI. */
body.page-chapter .chapter-sidebar,body.page-chapter .chapter-sidebar *,body.page-chapter .site-header,body.page-chapter .site-header *{font-size:18px}
@media(max-width:1050px){.site-header__inner{grid-template-columns:1fr!important;grid-template-areas:"brand" "account" "nav"!important}.site-header .logo,.site-header .header-right{justify-content:center!important;padding:10px 4vw!important;min-height:auto!important}.site-header .header-nav{justify-content:flex-start!important;overflow-x:auto!important;flex-wrap:nowrap!important}.tms104-profile{border-left:0!important}.chapter-main{width:min(100% - 30px,1040px)!important}}
