/* ============================================================================
   V.2 LEFT SIDEBAR — CMU navigation skin
   ----------------------------------------------------------------------------
   Source (values copied verbatim, not re-invented):
     https://www.cmu.ac.th/Scripts/css/theme.css   (Porto 12 · Okler Themes)
     read from the live page's computed CSS on 2026-12-01:
       :root        --border-radius 4px · --grey-100 #f4f4f4 · --grey-200 #eaeaea
                    --grey #969696 · --default #777 · --primary #0088CC
                    --light #FFF · --dark #212529
       nav link     14px / weight 300 / uppercase / letter-spacing -.5px /
                    padding 10px 15px / font "Prompt, Arial, sans-serif"
       dropdown     background #FFF · border-radius 4px · margin-top 10px ·
                    padding 5px 0 · min-width 200px ·
                    transition "margin-left .2s ease-out, opacity .2s ease-out"
                    (+ theme.css shadow 0 10px 30px 10px rgba(0,0,0,.05))
       menu item    0.83em (13.28px) / weight 400 / colour #777 /
                    padding 6px 18px / border-bottom 1px solid #f4f4f4 /
                    transition all
   Only the navigation declarations are used and every selector is scoped to
   `html.v2` + our own class names, so nothing of the CMU theme (Bootstrap 4
   reboot, typography globals, owl carousel …) can leak into this site and
   fight Bootstrap 3.3.5, the Ken-Burns slider or the right icon rail.
   The purple rail surface is kept on purpose (the department logo is white);
   only the menu language follows CMU.
   Loaded ONLY when ?v2 is present.
   ========================================================================== */

html.v2 {
  --cmu-radius: 4px;          /* --border-radius */
  --cmu-grey-100: #f4f4f4;    /* --grey-100 */
  --cmu-grey-200: #eaeaea;    /* --grey-200 */
  --cmu-grey: #969696;        /* --grey */
  --cmu-default: #777;        /* --default */
  --cmu-primary: #0088cc;     /* --primary */
  --cmu-light: #fff;          /* --light */
  --cmu-dark: #212529;        /* --dark */
  --cmu-font: "Kanit", "Noto Sans Thai", "Segoe UI", Tahoma, Arial, sans-serif;
  --cmu-dropdown-shadow: 0 10px 30px 10px rgba(0, 0, 0, .05);
}

/* ---- level 1 · the 7 headers (CMU nav-link typography) ------------------ */
html.v2 .v2-group-toggle,
html.v2 .v2-group-link {
  font-family: var(--cmu-font);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: -.5px;
  text-transform: uppercase;
  padding: 10px 15px;
  line-height: 26px;
  color: #fff;
  transition: all .2s ease-out;
}
html.v2 .v2-group { border-top: 1px solid var(--cmu-grey-200); }
html.v2 .v2-group-link { display: flex; align-items: center; }
html.v2 .v2-group-toggle:hover,
html.v2 .v2-group-link:hover,
html.v2 .v2-group-link:focus-visible { color: #fff; }
html.v2 .v2-group.open > .v2-group-toggle,
html.v2 .v2-group-link.is-active { color: #fff; }

/* ---- the dropdown card (CMU .dropdown-menu) ---------------------------- */
html.v2 .v2-dd {
  background: var(--cmu-light);
  border: 0;
  border-radius: var(--cmu-radius);
  box-shadow: var(--cmu-dropdown-shadow);
  padding: 5px 0;
  margin-top: 10px;
  font-family: var(--cmu-font);
  /* theme.css: "transition: margin-left .2s ease-out, opacity .2s ease-out" */
  opacity: 0;
  transform: translateX(-6px);
  transition: margin-left .2s ease-out, opacity .2s ease-out, transform .2s ease-out;
}
html.v2 .v2-dd.open { opacity: 1; transform: translateX(0); }

/* ---- menu items (CMU .dropdown-menu li a) ------------------------------ */
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li > a {
  font-family: var(--cmu-font) !important;
  font-size: 13.3px !important;         /* CMU theme .83em of 16px */
  font-weight: 400 !important;
  color: var(--cmu-default) !important;
  padding: 6px 18px !important;
  border-bottom: 1px solid var(--cmu-grey-100) !important;
  border-radius: 0 !important;
  background: transparent !important;
  transition: all .2s ease-out;
}
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li.v2-dd-sub > a {
  font-size: 13.3px !important;
  font-weight: 400 !important;
  color: var(--cmu-grey) !important;
  padding: 6px 18px 6px 32px !important;
}
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li:last-child > a { border-bottom: 0; }
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li > a:hover,
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li > a:focus-visible {
  color: var(--cmu-primary) !important;
  background: var(--cmu-grey-100) !important;
}
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li > a.is-active {
  color: var(--cmu-primary);
  background: var(--cmu-grey-100);
  box-shadow: inset 3px 0 0 var(--cmu-primary);
}

/* ---- caret: CMU uses a thin chevron in the same grey -------------------- */
html.v2 .v2-caret {
  border-right-color: var(--cmu-grey);
  border-bottom-color: var(--cmu-grey);
  transform: rotate(-45deg);            /* ▶ pointing right when closed */
  transition: transform .2s ease-out, border-color .2s ease-out;
}
html.v2 .v2-group-toggle.open .v2-caret { transform: rotate(45deg); }   /* ▼ open */
html.v2 .v2-group-toggle.open .v2-caret { border-color: var(--cmu-primary); }

/* ---- drawer (tablet / mobile) keeps CMU's menu look on a light panel ---- */
@media (max-width: 1199px) {
  html.v2 .v2-group { border-top: 0; border-bottom: 1px solid var(--cmu-grey-200); }
  html.v2 .v2-group-toggle,
  html.v2 .v2-group-link {
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    padding: 12px 18px;
    color: var(--cmu-dark) !important;
  }
  html.v2 .v2-group-toggle:hover,
  html.v2 .v2-group-link:hover,
  html.v2 .v2-group.open > .v2-group-toggle,
  html.v2 .v2-group-link.is-active { color: var(--cmu-primary) !important; background: var(--cmu-grey-100); }
  html.v2 .v2-dd { margin-top: 0; box-shadow: none; border-top: 1px solid var(--cmu-grey-200); border-radius: 0; }
  html.v2 #navbar ul.nav.navbar-nav.v2-dd-list > li > a { font-size: 14px !important; padding: 11px 18px !important; }
  html.v2 #navbar ul.nav.navbar-nav.v2-dd-list > li.v2-dd-sub > a { font-size: 13.5px !important; padding: 11px 18px 11px 34px !important; }
}

@media (prefers-reduced-motion: reduce) {
  html.v2 .v2-dd, html.v2 .v2-caret, html.v2 .v2-group-toggle,
  html.v2 .v2-group-link, html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li > a { transition: none !important; }
}


/* ---- TH/EN at the bottom of the left sidebar (CMU pattern) -------------- */
html.v2 .v2-side-lang {
  position: fixed; left: 16px; bottom: 16px; z-index: 1041;
  display: flex; gap: 8px; align-items: center;
  padding: 6px; background: rgba(255,255,255,.12);
  border-radius: var(--cmu-radius);
}
html.v2 .v2-side-lang li { list-style: none !important; float: none !important; margin: 0 !important; }
html.v2 .v2-side-lang li br { display: none !important; }
html.v2 .v2-side-lang a {
  display: flex !important; align-items: center; justify-content: center;
  width: 34px; height: 26px; border-radius: 4px; background: rgba(255,255,255,.18);
  text-decoration: none !important; transition: all .2s ease-out;
}
html.v2 .v2-side-lang a:hover, html.v2 .v2-side-lang a:focus-visible { background: rgba(255,255,255,.32); }
html.v2 .v2-side-lang img { height: 16px !important; width: auto !important; max-width: 26px !important; }

@media (max-width: 1199px) {
  html.v2 .v2-side-lang {
    position: static; margin: 12px 15px 18px; padding: 0; background: none; gap: 10px;
  }
  html.v2 .v2-side-lang a { width: 44px; height: 32px; background: var(--cmu-grey-100); }
  html.v2 .v2-side-lang img { height: 18px !important; }
}


/* ---- section headings inside a dropdown (the two "#" parents) ----------- */
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li.v2-dd-head > a {
  font-weight: 600 !important;
  color: var(--cmu-dark) !important;
  background: var(--cmu-grey-100) !important;
  cursor: default;
  padding: 8px 18px !important;
}
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li.v2-dd-head + li.v2-dd-head > a { border-top: 1px solid var(--cmu-grey-200) !important; }


/* ============================================================================
   CMU LAYOUT MATCH — measured on https://www.cmu.ac.th/ @1440×900:
     sidebar 255px · container padding 0 35px (content 185px) · logo 151×214
     centred (x52) · nav block 185×329 vertically centred (gapTop 286 /
     gapBottom 285) · item 46px high, padding 10px 15px, label centred,
     14px / 300 / uppercase.
   Applied to the department's own 7 sections (same labels and URLs).
   ========================================================================== */
@media (min-width: 1200px) {
  html.v2 body .navbar.navbar-default.navbar-static-top > .container {
    display: flex !important; flex-direction: column;
    height: 100vh; padding: 0 35px !important;
  }
  /* logo block: 151px wide, centred, 41px from the top (CMU proportions) */
  html.v2 .navbar-header {
    order: 0 !important;                 /* logo first (desktop.css set order:1) */
    flex: 0 0 auto !important; padding: 41px 0 26px !important;
    border-bottom: 0; text-align: center; width: 100% !important;
  }
  html.v2 .navbar-header .v2-logo { max-width: 151px !important; margin: 0 auto; }

  /* the 7 entries are vertically centred in the remaining space */
  html.v2 body .navbar > .container > .navbar-collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse.in {
    order: 1 !important; flex: 1 1 auto !important;
    display: flex !important; flex-direction: column;
    justify-content: center !important; align-items: stretch !important;
    padding: 0 0 24px !important; margin: 0 !important;
    height: auto !important; min-height: 0 !important; overflow: visible !important;
  }
  html.v2 .v2-group { border-top: 0; }
  html.v2 .v2-group:first-child { border-top: 0; }

  /* item box: 46px high, label centred, caret pinned right */
  html.v2 .v2-group-toggle,
  html.v2 .v2-group-link {
    position: relative;
    min-height: 46px; padding: 10px 15px !important;
    justify-content: center !important; text-align: center;
    border-bottom: 1px solid rgba(255,255,255,.10);
  }
  html.v2 .v2-group-label { flex: 0 1 auto; }
  html.v2 .v2-caret { position: absolute; right: 14px; top: 50%; margin-top: -5px; }
  html.v2 .v2-group-toggle.open .v2-caret { margin-top: -2px; }

  /* fly-out follows the rail width (rail 255 + 8 gutter) */
  html.v2 .v2-dd { border-radius: var(--cmu-radius); }
}


/* ============================================================================
   SIDEBAR FOOTER (CMU pattern): search box + TH | EN text links, after the
   7 menu sections. Search submits to the department's own activity-search.php
   ========================================================================== */
html.v2 .v2-side-foot { margin-top: 22px; padding: 18px 0 0; border-top: 1px solid rgba(255,255,255,.16); }

html.v2 .v2-search { position: relative; display: flex; align-items: center; margin: 0; }
html.v2 .v2-search input[type="search"] {
  width: 100%; height: 38px; padding: 0 40px 0 14px;
  border: 0; border-radius: 19px; background: #FFFFFF; color: var(--cmu-dark);
  font-family: var(--cmu-font); font-size: 13px; line-height: 38px;
  outline: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
html.v2 .v2-search input::placeholder { color: var(--cmu-grey); }
html.v2 .v2-search input:focus { box-shadow: 0 0 0 2px var(--v2-gold); }
html.v2 .v2-search button {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: var(--cmu-gray-100, #f4f4f4); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
html.v2 .v2-search button:hover { background: #eaeaea; }
html.v2 .v2-search-ico {
  width: 12px; height: 12px; border: 2px solid #777; border-radius: 50%;
  position: relative; display: block;
}
html.v2 .v2-search-ico::after {
  content: ""; position: absolute; right: -4px; bottom: -3px; width: 6px; height: 2px;
  background: #777; transform: rotate(45deg); border-radius: 1px;
}

html.v2 .v2-langline {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; font-family: var(--cmu-font); font-size: 13px; letter-spacing: .04em;
}
html.v2 .v2-langline a { color: rgba(255,255,255,.72) !important; text-decoration: none !important; padding: 4px 6px; border-radius: 3px; transition: all .2s ease-out; }
html.v2 .v2-langline a:hover, html.v2 .v2-langline a:focus-visible { color: #FFF !important; background: rgba(255,255,255,.14); }
html.v2 .v2-langline a.on { color: var(--v2-gold) !important; font-weight: 600; }
html.v2 .v2-langline span { color: rgba(255,255,255,.35); }

/* the drawer (tablet/mobile) keeps the same block on a light panel */
@media (max-width: 1199px) {
  html.v2 .v2-side-foot { margin: 18px 15px 24px; padding-top: 16px; border-top: 1px solid var(--cmu-grey-200); }
  html.v2 .v2-search input[type="search"] { height: 40px; line-height: 40px; border: 1px solid var(--cmu-grey-200); }
  html.v2 .v2-langline { justify-content: flex-start; margin-top: 12px; }
  html.v2 .v2-langline a { color: var(--cmu-dark) !important; }
  html.v2 .v2-langline a:hover { color: var(--cmu-primary) !important; background: var(--cmu-grey-100); }
  html.v2 .v2-langline a.on { color: var(--cmu-primary) !important; }
  html.v2 .v2-langline span { color: var(--cmu-grey); }
}


/* ---- CMU alignment: logo pinned near the top, menu stack centred in the
   full viewport height (CMU: logo y41, nav 286..605 in 900 → 286/285) ------ */
@media (min-width: 1200px) {
  html.v2 body .navbar.navbar-default.navbar-static-top > .container { position: relative; padding-top: 0 !important; }
  html.v2 .navbar-header {
    position: absolute !important; top: 41px; left: 35px; right: 35px;
    padding: 0 !important; width: auto !important; z-index: 2;
  }
  html.v2 body .navbar > .container > .navbar-collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse.in {
    height: 100vh !important; padding: 0 !important; justify-content: center !important;
  }
  html.v2 .v2-side-foot { margin-top: 26px; }
}


/* ---- final centring: the whole stack (7 sections + footer) is centred in the
   viewport; the collapse box no longer stretches, so no 40px offset remains -- */
@media (min-width: 1200px) {
  html.v2 body .navbar.navbar-default.navbar-static-top > .container {
    justify-content: center !important; align-items: stretch !important;
  }
  html.v2 body .navbar > .container > .navbar-collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse.in {
    flex: 0 1 auto !important; height: auto !important;
    justify-content: center !important; overflow: visible !important;
  }
}


/* ---- deterministic centring (flex centring left a 20px offset): the menu
   stack is absolutely centred in the rail, logo stays pinned at 41px -------- */
@media (min-width: 1200px) {
  html.v2 body .navbar.navbar-default.navbar-static-top > .container { display: block !important; height: 100vh !important; }
  html.v2 body .navbar > .container > .navbar-collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse.in {
    position: absolute !important; top: 50% !important; transform: translateY(-50%) !important;
    left: 35px !important; right: 35px !important; width: auto !important;
    height: auto !important; margin: 0 !important; padding: 0 !important;
    display: flex !important; flex-direction: column; justify-content: center !important;
  }
}


/* ============================================================================
   LOGO / MENU SEPARATION — the logo is back in normal flow (not absolute), so
   the 7 sections + footer are centred in the space that is actually left
   BELOW it. No shrink of the logo, no pushing the menu off-screen: when the
   remaining space is too small the rail simply scrolls.
   ========================================================================== */
@media (min-width: 1200px) {
  html.v2 body .navbar.navbar-default.navbar-static-top > .container {
    display: flex !important; flex-direction: column !important;
    justify-content: flex-start !important; align-items: stretch !important;
    height: 100vh !important; padding: 0 35px !important;
  }
  html.v2 .navbar-header {
    position: static !important; top: auto !important; left: auto !important;
    right: auto !important; width: 100% !important;
    padding: 41px 0 26px !important; margin: 0 !important; flex: 0 0 auto !important;
  }
  html.v2 .navbar-header .v2-logo { max-width: 151px !important; margin: 0 auto !important; }

  html.v2 body .navbar > .container > .navbar-collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse,
  html.v2 body .navbar > .container > .navbar-collapse.collapse.in {
    position: static !important; top: auto !important; left: auto !important; right: auto !important;
    transform: none !important; margin: 0 !important;
    flex: 1 1 auto !important; height: auto !important; min-height: 0 !important;
    display: flex !important; flex-direction: column !important;
    justify-content: center !important; overflow: visible !important;
    padding: 0 0 24px !important;
  }
}


/* ============================================================================
   SIDEBAR COLOURS — measured from https://www.cmu.ac.th/ (1440×900, pixels +
   computed styles), not from memory:
     sidebar background        #61617D   (pixel sample, whole column)
     menu item background      transparent
     menu text                 #FFFFFF   (pixel sample of the label)
     divider between items     rgba(0,0,0,.05)  → renders #5C5C76 on that bg
     caret / arrow             #FFFFFF
     hover                     text stays #FFFFFF (measured); theme.css also
                               declares `li:hover > a{color:var(--primary)}`
     active / selected         theme.css `a.active{color:var(--primary)}`
     primary accent            #0088CC   (--primary)
     dropdown card background  #FCFCFC   (pixel sample)
     dropdown card border      #F4F4F4   (pixel sample)
     dropdown item text        #777777   (--default)
     dropdown item hover       bg #F4F4F4, text #0088CC
     sidebar shadow            rgba(0,0,0,.05) 0 0 30px
     dropdown shadow           0 10px 30px 10px rgba(0,0,0,.05), radius 0
   NOTE on hover/active text: CMU's own primary (#0088CC) on #61617D is only
   ≈2.4:1 (fails WCAG). Per the brief's contrast requirement the label stays
   #FFFFFF and the accent colour is used for the indicator bar + caret, so the
   palette is identical to the source while the text remains readable.
   Scope: the left sidebar only — content, right icon rail and V1 untouched.
   ========================================================================== */
:root {
  --side-bg: #61617D;
  --side-text: #FFFFFF;
  --side-accent: #0088CC;
  --side-divider: rgba(0, 0, 0, .05);
  --side-hover-bg: rgba(255, 255, 255, .10);
  --side-open-bg: rgba(255, 255, 255, .14);
  --dd-bg: #FCFCFC;
  --dd-border: #F4F4F4;
  --dd-text: #777777;
  --dd-hover-bg: #F4F4F4;
}

/* ---- desktop rail -------------------------------------------------------- */
@media (min-width: 1200px) {
  html.v2 .navbar.navbar-default.navbar-static-top { background: var(--side-bg) !important; }
  html.v2 .navbar-header { border-bottom: 0; }
  html.v2 .v2-group-toggle,
  html.v2 .v2-group-link { color: var(--side-text) !important; }
  html.v2 .v2-group-toggle:hover,
  html.v2 .v2-group-link:hover,
  html.v2 .v2-group-toggle:focus-visible,
  html.v2 .v2-group-link:focus-visible { background: var(--side-hover-bg) !important; color: var(--side-text) !important; }
  html.v2 .v2-group.open > .v2-group-toggle,
  html.v2 .v2-group-toggle.open { background: var(--side-open-bg) !important; color: var(--side-text) !important; }
  html.v2 .v2-group { border-top: 1px solid var(--side-divider); }
  html.v2 .v2-group-toggle,
  html.v2 .v2-group-link { border-bottom: 1px solid var(--side-divider); }
  html.v2 .v2-caret { border-right-color: var(--side-text); border-bottom-color: var(--side-text); }
  html.v2 .v2-group-toggle.open .v2-caret { border-color: var(--side-accent); }
  html.v2 .v2-group-link.is-active,
  html.v2 .navbar-collapse .navbar-disable a.is-active {
    background: rgba(255,255,255,.12) !important; color: var(--side-text) !important;
    box-shadow: inset 3px 0 0 var(--side-accent);
  }
  html.v2 .navbar.navbar-default.navbar-static-top { box-shadow: 0 0 30px rgba(0,0,0,.05) !important; }
}

/* ---- dropdown card (portaled to <body>, still scoped by html.v2) -------- */
html.v2 .v2-dd {
  background: var(--dd-bg) !important;
  border: 1px solid var(--dd-border) !important;
  border-radius: 0 !important;
  box-shadow: 0 10px 30px 10px rgba(0,0,0,.05) !important;
}
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li > a { color: var(--dd-text) !important; border-bottom: 1px solid var(--dd-border) !important; }
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li > a:hover,
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li > a:focus-visible {
  background: var(--dd-hover-bg) !important; color: var(--side-accent) !important;
}
html.v2 .v2-dd ul.nav.navbar-nav.v2-dd-list > li.v2-dd-head > a {
  background: var(--dd-border) !important; color: #212529 !important;
}

/* ---- search + language row ---------------------------------------------- */
html.v2 .v2-search input[type="search"] { background: #FFFFFF; color: #212529; }
html.v2 .v2-langline a { color: rgba(255,255,255,.85) !important; }
html.v2 .v2-langline a.on { color: var(--side-accent) !important; }

/* ---- tablet / mobile drawer (same measured palette) --------------------- */
@media (max-width: 1199px) {
  html.v2 .navbar.navbar-default.navbar-static-top,
  html.v2 .navbar-collapse { background: var(--side-bg) !important; }
  html.v2 .v2-group { border-top: 0; border-bottom: 1px solid var(--side-divider) !important; }
  html.v2 .v2-group-toggle,
  html.v2 .v2-group-link { color: var(--side-text) !important; background: transparent !important;
    border-bottom: 1px solid var(--side-divider) !important; }
  html.v2 .v2-group-toggle:hover,
  html.v2 .v2-group-link:hover,
  html.v2 .v2-group.open > .v2-group-toggle { background: var(--side-hover-bg) !important; color: var(--side-text) !important; }
  html.v2 .v2-caret { border-right-color: var(--side-text); border-bottom-color: var(--side-text); }
  html.v2 .v2-group-toggle.open .v2-caret { border-color: var(--side-accent); }
  html.v2 .v2-group-link.is-active,
  html.v2 .navbar-collapse .navbar-disable a.is-active {
    background: rgba(255,255,255,.12) !important; color: var(--side-text) !important;
    box-shadow: inset 3px 0 0 var(--side-accent);
  }
  html.v2 .v2-side-foot { border-top: 1px solid var(--side-divider); }
  html.v2 .v2-langline a { color: rgba(255,255,255,.9) !important; }
  html.v2 .v2-langline a.on { color: var(--side-accent) !important; }
  html.v2 .v2-langline span { color: rgba(255,255,255,.45); }
}


/* ============================================================================
   LOGO 2026 — source images/math_logo.jpg, ORIGINAL colours kept (navy #063770,
   blue #016CCF, pastel #94BDDF/#C5B2D5/#FBB528). Only the white border was
   trimmed; nothing is re-inked, so every letter/edge survives.
   The logo sits on a white plate so the navy artwork reads on the #61617D rail:
   soft rounded card (14px radius, 1px translucent edge, two-layer shadow) — it
   floats on the rail instead of looking like a hard white box.
   Aspect ratio is the source's 4.31:1; width is capped, height auto/contain,
   so the image is never stretched.
   ========================================================================== */
@media (min-width: 1200px) {
  html.v2 .navbar-header .v2-logo {
    display: block; margin: 0 auto; max-width: 210px !important; width: 100%;
    height: auto !important;
    background: #FFFFFF !important;
    padding: 13px 15px !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 1px rgba(0,0,0,.14), 0 8px 18px rgba(0,0,0,.18) !important;
    border: 1px solid rgba(255,255,255,.55) !important;
    box-sizing: border-box;
  }
}
@media (max-width: 1199px) {
  html.v2 .navbar-static-top .navbar-header > a > .m-logo {
    background-image: url('/images/v2/math-logo-2026-color-640.png?v=20261201d') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-color: #FFFFFF !important;
    background-origin: content-box !important;
    background-clip: padding-box !important;
    width: 126px !important; max-width: 126px !important;
    height: 40px !important; max-height: 40px !important;
    padding: 7px 9px !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 1px rgba(0,0,0,.14), 0 6px 14px rgba(0,0,0,.18) !important;
    box-sizing: border-box !important;
  }
  html.v2 .navbar-header .v2-logo { display: none !important; }
}
