/* ===== GIAO DIỆN #manChon Toán 1–5 THEO ẢNH MẪU (bản 2, 23/11) =====
   Nạp sau khối <style> của từng trang nên ghi đè được. Nền trời xanh tách riêng ở toan-nen-troi.css.
   Kích thước từ 961px trở lên tính theo vw, khớp ảnh mẫu ở bề ngang 1672px và co dần ở màn nhỏ hơn. */

/* ---------- Màu dùng chung mọi cỡ màn ---------- */
.t1-tab{border-color:rgba(255,255,255,.92);color:#12235e;font-family:"Baloo 2",sans-serif;font-weight:800;overflow:hidden;--may:rgba(255,255,255,.7)}
.t1-tab[data-tab="tat-ca"]{background:linear-gradient(180deg,#e6f4ff 0%,#d6ebfd 100%);--may:rgba(196,224,252,.75)}
.t1-tab[data-tab="da-hoc"]{background:linear-gradient(180deg,#ecfbf1 0%,#d9f5e3 100%);--may:rgba(190,236,206,.8)}
.t1-tab[data-tab="yeu-thich"]{background:linear-gradient(180deg,#fffae9 0%,#fdf0c9 100%);--may:rgba(251,228,160,.7)}
.t1-tab[data-tab="tien-do"]{background:linear-gradient(180deg,#f0ecff 0%,#e3dcfd 100%);--may:rgba(212,202,252,.8)}
.t1-tab[data-tab="thanh-tich"]{background:linear-gradient(180deg,#fff0f4 0%,#fddde8 100%);--may:rgba(251,206,222,.8)}
.t1-tab>span:not(.t1-tab-ic):not(.t1-tab-badge){position:relative;z-index:1}
.t1-tab-ic{position:relative;z-index:1}
.t1-tab::before{content:"";position:absolute;left:0;right:0;bottom:0;height:58%;pointer-events:none;z-index:0;
  background:radial-gradient(ellipse 20% 46% at 4% 100%,var(--may) 62%,transparent 64%),
    radial-gradient(ellipse 16% 34% at 17% 100%,var(--may) 62%,transparent 64%),
    radial-gradient(ellipse 18% 40% at 96% 100%,var(--may) 62%,transparent 64%),
    radial-gradient(ellipse 14% 30% at 83% 100%,var(--may) 62%,transparent 64%)}
.t1-tab.chon{border-color:rgba(147,197,253,.95);color:#0b2370;box-shadow:0 0 0 2px rgba(59,130,246,.18),0 10px 22px rgba(15,65,160,.16)}
.t1-tab.chon::after{background:#1d5fe0;z-index:1}
.t1-tab[data-tab="tat-ca"] .t1-tab-ic::before,.t1-tab[data-tab="tat-ca"] .t1-tab-ic::after{content:"✦";position:absolute;color:#facc15;
  line-height:1;text-shadow:0 0 6px rgba(250,204,21,.6)}
.t1-tab[data-tab="tat-ca"] .t1-tab-ic::before{top:-4px;right:-16px;font-size:15px}
.t1-tab[data-tab="tat-ca"] .t1-tab-ic::after{bottom:10px;left:-18px;font-size:12px}
.t1-tab-badge{z-index:2;background:linear-gradient(180deg,#3b8cff,#1556dc)}
.t1-tap-bar.tap1{background:linear-gradient(180deg,#3a91fa 0%,#1f76ee 45%,#1a68e2 100%);box-shadow:inset 0 1.5px 0 rgba(255,255,255,.4),0 6px 14px rgba(26,104,226,.25)}
.t1-tap-bar{font-family:"Baloo 2",sans-serif;font-weight:800}
.t1-tap-bar span{background:rgba(8,56,170,.35);border:1px solid rgba(255,255,255,.3)}
.t1-cd{background:rgba(255,255,255,.96);border:1px solid #dbe7f5;box-shadow:0 4px 12px rgba(20,70,150,.08)}
.t1-cd-ten{font-weight:800;color:#10265c}
.t1-cd-bar{background:#d3e4f8}
.t1-cd-bar i{background:linear-gradient(90deg,#22c55e,#16a34a)}
.t1-cd-dem{color:#3a4a66}
.t1-cd-go{font-family:"Baloo 2",sans-serif;background:linear-gradient(180deg,#3a97ff,#1468e6);box-shadow:0 4px 10px rgba(20,104,230,.32)}
.t1-cd-go.xong{background:linear-gradient(180deg,#e6fbec,#cdf6da);border:1.5px solid #8be4a5;color:#15803d;box-shadow:none}
.t1-cd-mui{color:#1e3a8a}

/* Thanh đầu trang: kính sáng, chữ xanh đậm cho cả hai theme */
#manChon .t1-head{background:linear-gradient(180deg,rgba(244,250,255,.92) 0%,rgba(219,237,254,.88) 100%);
  border:1.5px solid rgba(255,255,255,.95);box-shadow:0 10px 26px rgba(14,68,148,.14),inset 0 2px 0 #ffffff;color:#0b2a66}
#manChon .t1-head::before{background:radial-gradient(420px 150px at 14% 0%,rgba(255,255,255,.5),transparent 70%)}
#manChon .t1-head::after{display:none}
#manChon .t1-head-deco{display:none}
body #manChon .t1-head .t1-brand h1{color:#0b2a66;text-shadow:none}
#manChon .t1-head .t1-sgk-badge{background:#ffffff;color:#1a62c9;border:1.5px solid #9cc9f5;box-shadow:none}
body #manChon .t1-head .t1-sub{color:#1c3767!important;text-shadow:none}
#manChon .t1-menu-btn{border-color:#bfdcf9;background:#f0f7ff}
#manChon .t1-search{background:#fff;border:1px solid #d3e4f6;box-shadow:0 4px 12px rgba(30,90,180,.1)}
#manChon .t1-head-fire{background:linear-gradient(180deg,#fff1e6,#ffdcc6);border:1.5px solid #f8c4a1;color:#c2410c}
#manChon .t1-head-bst{background:linear-gradient(180deg,#fff7c2,#fde68a);border:1.5px solid #f3cf5a;color:#92400e}
#manChon .t1-tk-pill{background:#fff;border:1.5px solid #e0ecf9;color:#0b2a66}

/* Khung tổng quan và khung chương trình: kính trong để thấy trời phía sau */
#manChon .t1-dash{background:linear-gradient(180deg,rgba(240,248,255,.86),rgba(226,240,253,.82));border:1.5px solid rgba(255,255,255,.95)}
#manChon .t1-khung{background:linear-gradient(180deg,rgba(236,246,253,.84),rgba(228,238,251,.82));border:1.5px solid rgba(255,255,255,.95)}
#manChon .t1-prog-box{background:#fff;border:1px solid #e2ecf8;box-shadow:0 4px 12px rgba(20,70,150,.08)}
.t1-xem-toggle{background:#fff;border:1px solid #cfe0f5}

/* Linh vật góc dưới phải (thay nút tròn đổi giao diện; công tắc đã có ở sidebar) */
.t1-linh-vat{display:none}

/* ---------- Máy tính & máy tính bảng ngang (≥961px) ---------- */
@media (min-width:961px){
  #manChon{--t1-side-w:clamp(220px,15.7vw,268px)}
  /* Cột trái nền xanh đậm, sidebar là khung nổi bo tròn bên trong */
  #manChon::before{content:"";position:fixed;left:0;top:0;bottom:0;width:calc(var(--t1-side-w) - 4px);z-index:59;pointer-events:none;
    background:linear-gradient(180deg,#0742a6 0%,#1556bb 55%,#2866d5 100%)}
  .t1-side{top:18px;bottom:22px;left:12px;width:calc(var(--t1-side-w) - 14px);padding:0 11px;border-radius:28px;
    border:1.5px solid rgba(120,185,255,.6);
    background:linear-gradient(180deg,#1592ec 0px,#0d6fd6 90px,#0750c0 150px,#023f9c 210px,#013a92 55%,#073f98 100%);
    box-shadow:0 14px 34px rgba(1,20,70,.4),inset 0 1.5px 0 rgba(255,255,255,.35)}
  .t1-main{padding:24px 32px 72px 24px}

  /* Đầu sidebar: không còn khung riêng, vương miện đặt trong đĩa bầu dục */
  .t1-side-brand{background:none;border:0;border-bottom:1px solid rgba(255,255,255,.18);border-radius:0;box-shadow:none;
    padding:clamp(12px,1.1vw,18px) 6px clamp(10px,.9vw,15px);margin:0 0 clamp(8px,.6vw,10px)}
  .t1-side-brand::before,.t1-side-brand::after{display:none}
  .t1-brand-crest{width:clamp(58px,4.4vw,74px);height:clamp(36px,2.7vw,46px);border-radius:50%;margin-bottom:clamp(6px,.5vw,9px);
    background:radial-gradient(ellipse at 50% 30%,#8acbff 0%,#3d8ff2 60%,#2a74e0 100%);
    border:1.5px solid rgba(210,236,255,.85);box-shadow:0 4px 12px rgba(0,30,90,.4),inset 0 1.5px 0 rgba(255,255,255,.6)}
  .t1-brand-crest::after{content:none}
  .t1-side-crown{width:clamp(34px,2.6vw,44px);height:clamp(28px,2.15vw,36px)}
  .t1-side-brand .t1-sb-ten{font-size:clamp(21px,1.68vw,28px);text-shadow:0 2px 6px rgba(0,20,70,.45)}
  .t1-side-brand .t1-sb-lop{font-size:clamp(12px,.9vw,15px);padding:clamp(2px,.2vw,3px) clamp(14px,1.2vw,20px);margin-top:clamp(5px,.48vw,8px)}

  /* Menu: mục thường không nền, ô icon vuông bo; mục đang chọn là viên thuốc xanh sáng */
  .t1-side-nav{gap:clamp(3px,.24vw,4px)}
  .t1-side-nav button{font-size:clamp(14px,1.08vw,18px);font-weight:800;padding:clamp(4px,.48vw,8px) 9px;gap:clamp(9px,.9vw,15px);
    border:1.5px solid transparent;border-radius:16px;white-space:nowrap;color:#fff}
  .t1-side-nav button:hover{background:rgba(255,255,255,.1)}
  .t1-side-ic{width:clamp(30px,2.2vw,37px);height:clamp(30px,2.2vw,37px);border-radius:11px;
    background:rgba(96,150,235,.5);border:1px solid rgba(160,205,255,.35);color:#fff}
  .t1-side-ic svg{width:62%;height:62%}
  .t1-side-nav button.chon{background:linear-gradient(180deg,#5cb5ff 0%,#3393f7 100%);border-color:rgba(214,236,255,.92);
    box-shadow:0 0 16px rgba(80,170,255,.55),0 6px 14px rgba(3,40,120,.3),inset 0 1.5px 0 rgba(255,255,255,.5)}
  .t1-side-nav button.chon .t1-side-ic{background:rgba(255,255,255,.22);border-color:rgba(255,255,255,.4);color:#fff}
  .t1-side-dem{flex:none;font-size:clamp(11px,.8vw,13.5px);padding:2px clamp(6px,.54vw,9px);
    background:linear-gradient(180deg,#fff3c4,#fcd34d);color:#7c2d12;border:1px solid rgba(255,255,255,.7)}

  /* Thẻ danh hiệu và công tắc giao diện */
  .t1-side-foot{padding:10px 0 12px;gap:clamp(8px,.9vw,16px)}
  .t1-side-card,body.theme-robot .t1-side-card{border-radius:22px;padding:clamp(10px,1.08vw,18px) 10px clamp(10px,1.08vw,18px);border:1.5px solid rgba(150,200,255,.55);
    background:linear-gradient(180deg,rgba(84,150,238,.6) 0%,rgba(32,100,196,.62) 100%)}
  .t1-side-orb{width:clamp(72px,6.3vw,106px);height:clamp(72px,6.3vw,106px);margin-bottom:clamp(4px,.5vw,8px)}
  .t1-side-emblem{width:58%;height:58%}
  .t1-ring-bg{fill:rgba(6,30,86,.7)}
  .t1-side-rank-tag{color:#fff;font-size:clamp(10px,.78vw,13px);letter-spacing:.3px}
  .t1-side-rank-ten{font-size:clamp(15px,1.32vw,22px);color:#fde047}
  .t1-side-rank-sub{font-size:clamp(11px,.84vw,14px);color:#fff}
  .t1-side-bar{height:clamp(6px,.48vw,8px);margin-top:clamp(7px,.6vw,10px)}
  .t1-side-bar i{background:linear-gradient(90deg,#4ade80,#a3e635,#fde047);animation:none}
  .t1-side-theme{padding:clamp(7px,.6vw,10px) clamp(7px,.6vw,10px);gap:clamp(6px,.6vw,10px);border-radius:18px;
    background:rgba(1,24,74,.6);border:1px solid rgba(120,170,255,.35)}
  .t1-st-ic{width:clamp(30px,2.2vw,37px);height:clamp(30px,2.2vw,37px);border-radius:11px;background:rgba(80,140,235,.4)}
  .t1-st-ic svg{width:62%;height:62%}
  .t1-st-txt small{font-size:clamp(10px,.78vw,13px);color:#dbeafe}
  .t1-st-txt b{font-size:clamp(12px,.88vw,15px);letter-spacing:0;white-space:nowrap}
  .t1-st-sw{width:clamp(34px,2.7vw,46px);height:clamp(20px,1.56vw,26px);padding:3px}
  .t1-st-sw i{width:clamp(14px,1.2vw,20px);height:clamp(14px,1.2vw,20px)}
  .t1-side-theme.is-robot .t1-st-sw{background:#3b82f6}
  .t1-side-theme.is-robot .t1-st-sw i{transform:translateX(clamp(14px,1.2vw,20px))}

  /* Thanh đầu trang */
  #manChon .t1-head{padding:clamp(10px,1.08vw,18px) clamp(14px,1.32vw,22px);border-radius:26px;margin-bottom:clamp(14px,1.2vw,20px);gap:clamp(10px,.9vw,15px)}
  #manChon .t1-brand .bia{width:clamp(42px,3.35vw,56px);height:clamp(42px,3.35vw,56px)}
  #manChon .t1-brand{gap:clamp(8px,.72vw,12px)}
  #manChon .t1-brand h1{font-size:clamp(21px,1.86vw,31px)}
  #manChon .t1-sgk-badge{font-size:clamp(10px,.78vw,13px);padding:clamp(2px,.24vw,4px) clamp(8px,.72vw,12px)}
  #manChon .t1-sub{font-size:clamp(11.5px,.9vw,15px)!important;margin-top:clamp(2px,.24vw,4px)!important}
  #manChon .t1-head-mid{max-width:clamp(260px,23.2vw,390px)}
  #manChon .t1-search{height:clamp(38px,2.75vw,46px)}
  #manChon .t1-search-in{font-size:clamp(13px,.96vw,16px)}
  #manChon .t1-head-right{gap:clamp(6px,.6vw,10px)}
  #manChon .t1-head-chip{height:clamp(38px,2.75vw,46px);padding:0 clamp(10px,.9vw,15px) 0 clamp(8px,.72vw,12px);font-size:clamp(13px,.96vw,16px)}
  #manChon .t1-head-fire svg,#manChon .t1-head-bst svg{width:clamp(18px,1.44vw,24px);height:clamp(18px,1.44vw,24px)}
  #manChon .t1-tk-pill{height:clamp(38px,2.75vw,46px);font-size:clamp(13px,.96vw,16px);padding:0 clamp(10px,.84vw,14px) 0 6px}
  #manChon .t1-tk-avt{width:clamp(28px,2vw,34px);height:clamp(28px,2vw,34px)}

  /* Dải tổng quan */
  #manChon .t1-dash{padding:clamp(12px,.9vw,15px) clamp(14px,1.08vw,18px);border-radius:26px;margin-bottom:clamp(14px,1.08vw,18px)}
  .t1-dash-metrics{gap:clamp(10px,.84vw,14px)}
  #manChon .t1-prog-box,.t1-kpi-card{min-height:clamp(84px,6.2vw,104px);border-radius:18px}
  #manChon .t1-prog-box{padding:clamp(9px,.72vw,12px) clamp(14px,1.08vw,18px)}
  .t1-kpi-card{padding:clamp(8px,.6vw,10px) clamp(12px,.96vw,16px)}
  .t1-prog-ttl b{font-size:clamp(14px,1.08vw,18px)}
  .t1-prog-pct{font-size:clamp(12px,.9vw,15px)}
  .t1-bar-track{height:clamp(9px,.72vw,12px)}
  .t1-prog-foot{font-size:clamp(12px,.93vw,15.5px)}
  .t1-kpi-ic{width:clamp(42px,3.5vw,58px);height:clamp(42px,3.5vw,58px)}
  .t1-kpi-ic svg{width:100%;height:100%}
  .t1-kpi-val b{font-size:clamp(22px,1.92vw,32px)}
  .t1-kpi-val small{font-size:clamp(12px,.96vw,16px)}
  .t1-kpi-lbl{font-size:clamp(12px,.96vw,16px);color:#2a3550}
  .t1-cta{min-height:clamp(84px,6.1vw,102px);padding:8px clamp(12px,1.2vw,20px) 8px clamp(14px,1.32vw,22px);gap:clamp(10px,.84vw,14px)}
  .t1-cta-ic svg{width:42%;height:42%;margin-left:6%}
  .t1-cta-mui{flex:none}
  .t1-cta-ic{width:clamp(44px,3.6vw,60px);height:clamp(44px,3.6vw,60px)}
  .t1-cta-chinh{font-size:clamp(18px,1.56vw,26px)}
  .t1-cta small{font-size:clamp(11px,.84vw,14px);font-weight:600;letter-spacing:-.1px}

  /* 5 thẻ tab */
  .t1-tabs{grid-template-columns:1.08fr repeat(4,minmax(0,1fr));gap:clamp(10px,.84vw,14px);margin-bottom:clamp(14px,1.14vw,19px)}
  .t1-tab{min-height:clamp(104px,7.8vw,130px);padding:clamp(6px,.48vw,8px) 10px clamp(14px,1.08vw,18px);border-radius:22px;
    font-size:clamp(15px,1.2vw,20px);gap:clamp(0px,.12vw,2px);border-width:1.5px}
  .t1-tab-ic{width:clamp(54px,4.55vw,76px);height:clamp(54px,4.55vw,76px)}
  .t1-tab-ic svg{width:100%;height:100%}
  .t1-tab.chon::after{bottom:clamp(6px,.54vw,9px);width:clamp(44px,3.5vw,58px);height:5px}
  .t1-tab-badge{top:6px;right:8px;min-width:clamp(24px,1.8vw,30px);height:clamp(24px,1.8vw,30px);font-size:clamp(11px,.84vw,14px);border-width:2px}
  .t1-tab-badge.t1-tab-badge-gold{min-width:0;height:clamp(22px,1.6vw,26px);padding:0 clamp(6px,.54vw,9px);font-size:clamp(11px,.78vw,13px)}

  /* Khung chương trình học */
  #manChon .t1-khung{padding:clamp(14px,1.2vw,20px) clamp(16px,1.6vw,27px) clamp(16px,1.6vw,27px);border-radius:28px}
  .t1-khung-ttl svg{width:clamp(30px,2.4vw,40px);height:clamp(30px,2.4vw,40px)}
  .t1-khung-ttl h2{font-size:clamp(20px,1.8vw,30px)}
  .t1-xem-toggle{padding:3px}
  .t1-xem-toggle button{font-size:clamp(12.5px,.96vw,16px);padding:clamp(5px,.42vw,7px) clamp(12px,1.08vw,18px)}
  .t1-tap-bar{min-height:clamp(40px,2.87vw,48px);padding:6px clamp(14px,1.2vw,20px);font-size:clamp(15px,1.14vw,19px);border-radius:14px;margin-bottom:12px}
  .t1-tap-bar span{font-weight:800;font-size:clamp(12.5px,.96vw,16px);padding:clamp(3px,.24vw,4px) clamp(10px,.84vw,14px)}
  .t1-cd{border-radius:18px;margin-bottom:clamp(10px,.84vw,14px)}
  .t1-cd-head{min-height:clamp(60px,4.3vw,72px);padding:clamp(6px,.48vw,8px) clamp(14px,1.2vw,20px);gap:clamp(10px,.9vw,15px)}
  .t1-cd-ic{width:clamp(44px,3.35vw,56px);height:clamp(44px,3.35vw,56px)}
  .t1-cd-ic svg{width:100%;height:100%}
  .t1-cd-so{width:clamp(34px,2.5vw,42px);height:clamp(34px,2.5vw,42px);font-size:clamp(17px,1.32vw,22px)}
  .t1-cd-badge{font-size:clamp(11px,.84vw,14px);padding:clamp(2px,.18vw,3px) clamp(8px,.6vw,10px)}
  .t1-cd-ten{font-family:"Baloo 2",sans-serif;font-size:clamp(16px,1.26vw,21px);line-height:1.15}
  .t1-cd-tien{margin-top:clamp(5px,.48vw,8px);gap:clamp(12px,1.2vw,20px)}
  .t1-cd-bar{height:clamp(9px,.72vw,12px)}
  .t1-cd-dem{font-size:clamp(12.5px,.93vw,15.5px)}
  .t1-cd-go{height:clamp(32px,2.4vw,40px);padding:0 clamp(14px,1.32vw,22px);font-size:clamp(13.5px,1.02vw,17px)}
  .t1-cd-mui{width:clamp(28px,2vw,34px);height:clamp(28px,2vw,34px)}
  .t1-cd-mui svg{width:66%;height:66%;stroke-width:3}
}

@media (min-width:1080px){.t1-dash-metrics{grid-template-columns:1.52fr .73fr .76fr 1.28fr}}

/* Màn 961–1599px: thu gọn chi tiết để không xuống dòng, không tràn */
@media (min-width:961px) and (max-width:1599px){
  .t1-side-nav button{gap:clamp(8px,.72vw,12px)}
  .t1-side-dem{font-size:11px;padding:2px 6px}
  .t1-st-sw{width:32px;height:19px}
  .t1-st-sw i{width:13px;height:13px}
  .t1-side-theme.is-robot .t1-st-sw i{transform:translateX(13px)}
  .t1-st-txt b{font-size:12.5px}
  .t1-kpi-card{gap:8px;padding-left:10px;padding-right:10px}
  .t1-kpi-ic{width:clamp(36px,3vw,48px);height:clamp(36px,3vw,48px)}
  .t1-kpi-lbl{white-space:nowrap;font-size:clamp(11.5px,.9vw,14px)}
}

/* Linh vật: chỉ trên màn rộng, chồng nhẹ lên góc phải như ảnh mẫu, không chặn bấm */
@media (min-width:1600px){
  .t1-linh-vat{display:block;position:fixed;right:max(4px,env(safe-area-inset-right,0px));bottom:0;z-index:40;width:108px;height:132px;
    pointer-events:none;background:url("/toan-tienca.webp") center bottom / contain no-repeat;
    filter:drop-shadow(0 8px 14px rgba(8,40,110,.28))}
  body.theme-robot .t1-linh-vat{background-image:url("/toan-robot-lon.webp")}
  .t1-linh-vat::before{content:"★";position:absolute;left:-6px;top:24px;font-size:26px;color:#facc15;
    text-shadow:0 0 10px rgba(250,204,21,.7),0 2px 0 #d97706}
  body:has(#manChon:not(.hidden)) .nut-theme{display:none}
  body:has(#manChon:not(.hidden)) .bao-theme{right:24px}
}
@media (prefers-reduced-motion:reduce){.t1-linh-vat{filter:none}}

/* Màn thấp: sidebar cuộn thay vì bị ép méo */
.t1-side>*{flex-shrink:0}
@media (min-width:961px) and (max-height:820px){
  .t1-side-brand{padding-top:10px;padding-bottom:8px}
  .t1-side-orb{width:68px;height:68px}
  .t1-side-foot{gap:7px}
}
/* ===== HẾT GIAO DIỆN THEO ẢNH MẪU ===== */
