    :root{
      --bg0:#f7f8fc; --bg1:#eef2f8;
      --card: rgba(255,255,255,.82);
      --card2: rgba(255,255,255,.98);
      --panel: rgba(255,255,255,.98);
      --stroke: rgba(15,23,42,.11);
      --text:#172033;
      --muted: rgba(23,32,51,.69);
      --muted2: rgba(23,32,51,.52);
      --brand:#3157d5;
      --brand2:#6941c6;
      --good:#0b8f6a;
      --warn:#d97706;
      --bad:#dc3545;
      --shadow: 0 18px 50px rgba(30,41,59,.09);
      --shadow-soft: 0 8px 24px rgba(30,41,59,.07);
      --radius: 16px;
      --radius2: 22px;
      --ring: 0 0 0 4px rgba(49,87,213,.16);
      --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
      --t: 170ms cubic-bezier(.2,.8,.2,1);
    }
    [data-theme="dark"]{
      --bg0:#0d1424; --bg1:#121b2e;
      --card: rgba(255,255,255,.065);
      --card2: rgba(255,255,255,.10);
      --panel: rgba(17,25,43,.98);
      --stroke: rgba(255,255,255,.13);
      --text:#edf2fb;
      --muted: rgba(237,242,251,.72);
      --muted2: rgba(237,242,251,.55);
      --brand:#7794ff;
      --brand2:#a98bfa;
      --shadow: 0 18px 52px rgba(0,0,0,.30);
      --shadow-soft: 0 8px 28px rgba(0,0,0,.22);
      --ring: 0 0 0 4px rgba(119,148,255,.19);
    }

    *{box-sizing:border-box}
    html,body{height:100%; -webkit-text-size-adjust:100%}
    html{scrollbar-gutter:stable}
    body{
      margin:0;
      font-family:var(--sans);
      color:var(--text);
      background:
        radial-gradient(900px 560px at 8% -5%, rgba(49,87,213,.10), transparent 62%),
        radial-gradient(800px 520px at 100% 8%, rgba(105,65,198,.08), transparent 60%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
      overflow-x:hidden;
      min-width:0;
    }
    img,svg,canvas,video{max-width:100%}
    main,.page,.grid,.card,.hero,.item,.modalCard{min-width:0}
    a{color:inherit}
    button,input,select,textarea{font:inherit}
    button:disabled{cursor:not-allowed; opacity:.56; transform:none !important}
    .wrap{width:min(100%, 1240px); margin:0 auto; padding:20px 20px 72px;}
    .skipLink{
      position:fixed; left:16px; top:-80px; z-index:500;
      padding:10px 14px; border-radius:12px; color:white; background:var(--brand);
      text-decoration:none; font-weight:750; transition:top var(--t);
    }
    .skipLink:focus{top:12px}
    .topbar{
      position:sticky; top:0; z-index:50;
      backdrop-filter: blur(18px) saturate(150%);
      -webkit-backdrop-filter: blur(18px) saturate(150%);
      background: color-mix(in srgb, var(--bg0) 82%, transparent);
      border-bottom: 1px solid var(--stroke);
    }
    .topbar .wrap{
      padding:7px 20px;
    }
    [data-theme="dark"] .topbar{
      background: rgba(13,20,36,.84);
    }
    .nav{
      display:flex; align-items:center; justify-content:space-between;
      gap:18px; padding:0;
    }
    .brand{
      display:flex; align-items:center; gap:10px; text-decoration:none;
      padding:5px 0; border-radius: 12px;
    }
    .logo{
      width:36px; height:36px; border-radius: 12px;
      display:grid; place-items:center;
      background: linear-gradient(135deg, var(--brand), var(--brand2));
      box-shadow: 0 7px 18px rgba(49,87,213,.18);
      border: 1px solid rgba(255,255,255,.32);
    }
    .logo svg{width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round}
    .brand strong{font-size:14px; letter-spacing:-.1px}
    .brand span{display:block; font-size:11px; color:var(--muted)}
    .navlinks{display:flex; gap:7px; flex-wrap:wrap; align-items:center; justify-content:flex-end; min-width:0}
    .mobileActions{display:none}
    .pill{
      appearance:none; border:1px solid var(--stroke);
      background: color-mix(in srgb, var(--card) 70%, transparent);
      color: var(--text);
      border-radius: 999px;
      padding:8px 11px;
      cursor:pointer;
      transition: transform var(--t), background var(--t), border-color var(--t);
      display:flex; align-items:center; gap:8px;
      font-weight: 700;
      user-select:none;
      min-height:38px;
    }
    .pill:hover{transform: translateY(-1px); background: var(--card2); border-color:color-mix(in srgb, var(--brand) 28%, var(--stroke))}
    .pill:focus-visible{outline:none; box-shadow: var(--ring)}
    .pill[aria-current="page"]{
      color:white;
      border-color:transparent;
      background: linear-gradient(135deg, var(--brand), var(--brand2));
      box-shadow:0 8px 20px rgba(49,87,213,.18);
    }

    .grid{display:grid; gap:14px}
    .g2{grid-template-columns: repeat(2, minmax(0,1fr))}
    .g3{grid-template-columns: repeat(3, minmax(0,1fr))}
    .g4{grid-template-columns: repeat(4, minmax(0,1fr))}
    @media (max-width: 1180px){ .g4{grid-template-columns: repeat(2, minmax(0,1fr));} }
    @media (max-width: 980px){ .g4{grid-template-columns:1fr} .g3{grid-template-columns:1fr} .g2{grid-template-columns:1fr} }

    .card{
      border: 1px solid var(--stroke);
      background: var(--card);
      border-radius: var(--radius2);
      box-shadow: var(--shadow-soft);
      padding: 20px;
      overflow:hidden;
      position:relative;
    }
    .card.full{grid-column: 1 / -1;}
    .chartCard{min-width:0}
    [data-theme="dark"] .card{
      background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.04));
    }
    .hero{
      padding: 28px;
      border-radius: 26px;
      border: 1px solid var(--stroke);
      background:
        radial-gradient(700px 320px at 85% 0%, rgba(105,65,198,.13), transparent 58%),
        radial-gradient(620px 300px at 15% 0%, rgba(49,87,213,.12), transparent 60%),
        var(--card);
      box-shadow: var(--shadow-soft);
    }
    [data-theme="dark"] .hero{
      background:
        radial-gradient(700px 320px at 85% 0%, rgba(169,139,250,.16), transparent 58%),
        radial-gradient(620px 300px at 15% 0%, rgba(119,148,255,.14), transparent 60%),
        rgba(255,255,255,.055);
    }
    .hero h1{margin:4px 0 10px; font-size:clamp(26px,4vw,42px); line-height:1.08; letter-spacing:-1.1px; max-width:850px}
    .hero p{margin:0; color:var(--muted); line-height:1.65; max-width:820px}
    .homeHero{padding-block:clamp(30px,6vw,68px)}
    .homeHero h1{font-size:clamp(34px,6.2vw,68px); max-width:980px; letter-spacing:-2.5px}
    .homeHero p{font-size:clamp(15px,2vw,19px); max-width:760px}
    .eyebrow{margin-bottom:14px; color:var(--brand); font-size:12px; font-weight:850; letter-spacing:.12em; text-transform:uppercase}
    .featureCard{min-height:190px; transition:transform var(--t), box-shadow var(--t), border-color var(--t)}
    .featureCard:hover{transform:translateY(-3px); box-shadow:var(--shadow); border-color:color-mix(in srgb, var(--brand) 24%, var(--stroke))}
    .featureIcon{display:inline-grid; place-items:center; width:42px; height:42px; margin-bottom:26px; border-radius:13px; color:var(--brand); background:color-mix(in srgb, var(--brand) 10%, transparent); font-size:12px; font-weight:900}

    .betaBar{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:16px;
      margin-bottom:14px;
      padding:11px 14px;
      border:1px solid color-mix(in srgb, var(--brand) 24%, var(--stroke));
      border-radius:18px;
      background:linear-gradient(115deg, color-mix(in srgb, var(--brand) 8%, var(--card)), color-mix(in srgb, var(--brand2) 6%, var(--card)));
      box-shadow:var(--shadow-soft);
    }
    .betaBar[hidden]{display:none}
    .betaLead,.betaMetrics,.betaMetric{display:flex; align-items:center}
    .betaLead{gap:10px; min-width:0}
    .betaLead > span:last-child{display:flex; flex-direction:column; gap:2px}
    .betaLead strong{font-size:13px}
    .betaLead small,.betaMetric small{color:var(--muted2); font-size:10px}
    .betaBadge{
      padding:5px 7px;
      border-radius:8px;
      color:white;
      background:linear-gradient(135deg,var(--brand),var(--brand2));
      font-size:9px;
      font-weight:900;
      letter-spacing:.1em;
    }
    .betaMetrics{gap:6px}
    .betaMetric{
      gap:7px;
      min-width:105px;
      padding:6px 10px;
      border-left:1px solid var(--stroke);
    }
    .betaMetric > span{display:flex; flex-direction:column; gap:1px}
    .betaMetric strong{font-size:12px}
    .statusDot{width:8px; height:8px; border-radius:50%; background:var(--warn); box-shadow:0 0 0 4px color-mix(in srgb,var(--warn) 14%,transparent)}
    .statusDot.online{background:var(--good); box-shadow:0 0 0 4px color-mix(in srgb,var(--good) 14%,transparent)}
    .statusDot.offline{background:var(--bad); box-shadow:0 0 0 4px color-mix(in srgb,var(--bad) 14%,transparent)}
    .demoSnapshot{
      display:grid;
      grid-template-columns:repeat(3,minmax(0,1fr));
      gap:8px;
    }
    .demoSnapshot > span{
      display:grid;
      grid-template-columns:auto 1fr;
      align-items:center;
      column-gap:7px;
      padding:9px 10px;
      border:1px solid var(--stroke);
      border-radius:13px;
      background:color-mix(in srgb,var(--brand) 4%,var(--card));
    }
    .demoSnapshot .statusDot{grid-row:1 / 3}
    .demoSnapshot small{color:var(--muted2); font-size:10px}
    .demoSnapshot strong{font-size:13px}

    .row{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap}
    .row > *{min-width:0}
    .sep{height:1px; background: rgba(255,255,255,.08); margin: 12px 0}
    [data-theme="light"] .sep{background: rgba(0,0,0,.08)}
    .muted{color:var(--muted)}
    .muted2{color:var(--muted2)}
    .small{font-size:12px}

    .btn{
      appearance:none; border:1px solid var(--stroke);
      background: var(--card);
      color: var(--text);
      border-radius: 16px;
      padding: 10px 12px;
      cursor:pointer;
      transition: transform var(--t), background var(--t), border-color var(--t);
      display:inline-flex; align-items:center; gap:10px;
      font-weight: 750;
      user-select:none;
      justify-content:center;
      min-height:42px;
    }
    .btn:hover{transform: translateY(-1px); background: var(--card2)}
    .btn:focus-visible{outline:none; box-shadow: var(--ring)}
    .btn.primary{
      color:white;
      border-color:transparent;
      background: linear-gradient(135deg, var(--brand), var(--brand2));
      box-shadow:0 9px 22px rgba(49,87,213,.20);
    }
    .btn.good{
      border-color: rgba(16,185,129,.55);
      background: linear-gradient(135deg, rgba(16,185,129,.28), rgba(59,130,246,.10));
    }
    .btn.danger{
      border-color: rgba(239,68,68,.55);
      background: linear-gradient(135deg, rgba(239,68,68,.22), rgba(124,58,237,.10));
    }
    .btn.ghost{
      background: transparent;
    }
    .btn.sm{padding:6px 10px; font-size:12px; border-radius:12px}
    .tabPanel{display:none}
    .tabPanel.active{display:block}
    #offersTabs .btn.active{
      border-color: rgba(124,58,237,.6);
      background: linear-gradient(135deg, rgba(124,58,237,.22), rgba(16,185,129,.10));
    }

    .input, select, textarea{
      width:100%;
      padding: 10px 12px;
      border-radius: 14px;
      border: 1px solid var(--stroke);
      background: rgba(0,0,0,.14);
      color: var(--text);
      outline:none;
      transition: box-shadow var(--t), background var(--t), border-color var(--t);
      min-height:42px;
    }
    [data-theme="light"] .input, [data-theme="light"] select, [data-theme="light"] textarea{
      background: rgba(255,255,255,.85);
    }
    .input:focus, select:focus, textarea:focus{box-shadow: var(--ring); border-color:var(--brand)}
    textarea{min-height: 92px; resize: vertical}
    label{display:block}
    .hint{font-size:12px; color: var(--muted2); line-height:1.35; margin-top:6px}

    .list{display:flex; flex-direction:column; gap:10px}
    .scrollBox{max-height: 320px; overflow:auto; padding-right:4px}
    .scrollBox.compact{max-height: 200px}
    .item{
      padding: 12px;
      border-radius: 18px;
      border: 1px solid var(--stroke);
      background: rgba(255,255,255,.05);
      transition: transform var(--t), background var(--t);
      max-width:100%;
      min-width:0;
      overflow-wrap:anywhere;
      word-break:break-word;
    }
    .item.clickable{cursor:pointer}
    [data-theme="light"] .item{background: rgba(255,255,255,.7)}
    .item:hover{transform: translateY(-1px); background: rgba(255,255,255,.08)}
    [data-theme="light"] .item:hover{background: rgba(255,255,255,.85)}

    .tagrow{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
    .tag{
      font-size:12px; padding: 6px 10px;
      border:1px solid var(--stroke);
      border-radius: 999px;
      color: var(--muted);
      background: rgba(0,0,0,.12);
    }
    [data-theme="light"] .tag{background: rgba(255,255,255,.85)}
    .tag.toggle{cursor:pointer; transition: background var(--t), border-color var(--t), color var(--t)}
    .tag.active{
      color: var(--text);
      border-color: var(--brand);
      background: rgba(0,0,0,.26);
    }
    [data-theme="light"] .tag.active{background: rgba(226,232,240,.9)}

    .badge{
      display:inline-flex; align-items:center; gap:6px;
      font-size:12px; padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid var(--stroke);
      background: rgba(0,0,0,.12);
      color: var(--muted);
      user-select:none;
      max-width:100%;
      overflow-wrap:anywhere;
    }
    [data-theme="light"] .badge{background: rgba(255,255,255,.85)}
    .b{width:8px;height:8px;border-radius:99px;background:var(--brand)}
    .badge.good .b{background: var(--good)}
    .badge.warn .b{background: var(--warn)}
    .badge.bad .b{background: var(--bad)}

    .kbd{
      font-family: var(--mono);
      font-size: 11px;
      padding: 2px 6px;
      border-radius: 8px;
      border: 1px solid var(--stroke);
      background: rgba(0,0,0,.18);
      color: var(--muted);
    }
    [data-theme="light"] .kbd{background: rgba(255,255,255,.8)}

    .page{display:none; animation: fadeIn 180ms ease-out}
    .page.active{display:block}
    .roleOnly{display:none}
    .roleOnly.active{display:block}
    @keyframes fadeIn{from{opacity:.0; transform: translateY(6px)} to{opacity:1; transform:none}}

    .footer{
      margin-top: 20px;
      color: var(--muted2);
      font-size:12px;
      display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap;
    }

    .toastWrap{
      position: fixed;
      right: 14px;
      bottom: max(14px, env(safe-area-inset-bottom));
      display:flex;
      flex-direction:column;
      gap:10px;
      z-index: 200;
      width:min(390px, calc(100vw - 28px));
      pointer-events:none;
    }
    .toast{
      display:grid;
      grid-template-columns:auto minmax(0,1fr) auto;
      align-items:start;
      gap:10px;
      border:1px solid var(--stroke);
      background:var(--panel);
      border-radius:16px;
      padding:12px;
      box-shadow:0 18px 50px rgba(15,23,42,.22);
      opacity:0;
      transform:translateY(10px) scale(.98);
      transition:opacity 180ms ease, transform 180ms ease;
      pointer-events:auto;
      overflow:hidden;
    }
    .toast.show{opacity:1;transform:none}
    .toast.good{border-color:color-mix(in srgb,var(--good) 35%,var(--stroke))}
    .toast.bad{border-color:color-mix(in srgb,var(--bad) 35%,var(--stroke))}
    .toast.warn{border-color:color-mix(in srgb,var(--warn) 35%,var(--stroke))}
    .toastIcon{
      width:26px;height:26px;display:grid;place-items:center;border-radius:9px;
      color:white;background:var(--brand);font-size:13px;font-weight:900;
    }
    .toast.good .toastIcon{background:var(--good)}
    .toast.bad .toastIcon{background:var(--bad)}
    .toast.warn .toastIcon{background:var(--warn)}
    .toastContent{min-width:0}
    .toast strong{display:block; margin:1px 0 4px; font-size:14px}
    .toast .muted{font-size:12px;line-height:1.4;overflow-wrap:anywhere}
    .toastClose{
      appearance:none;border:0;background:transparent;color:var(--muted);
      width:26px;height:26px;border-radius:8px;font-size:20px;line-height:1;cursor:pointer;
    }
    .toastClose:hover{background:var(--card2);color:var(--text)}

    pre{
      margin:0;
      padding: 12px;
      border-radius: 18px;
      border: 1px solid var(--stroke);
      background: rgba(0,0,0,.18);
      overflow:auto;
      font-family: var(--mono);
      font-size: 12px;
      color: rgba(232,237,247,.88);
      line-height: 1.45;
    }
    [data-theme="light"] pre{
      background: rgba(255,255,255,.85);
      color: rgba(11,18,32,.88);
    }

    /* === Analytics layout fix (no more super-long page) === */
    .analyticsShell{
    display:grid;
    grid-template-columns: minmax(340px, 460px) minmax(0, 1fr);
    gap:14px;
    align-items:start;
    }
    @media (max-width: 980px){
    .analyticsShell{grid-template-columns: 1fr;}
    }

    /* sticky left panel on desktop */
    .analyticsLeft{
    position: sticky;
    top: 86px;               /* под высоту topbar */
    max-height: calc(100vh - 110px);
    overflow: auto;
    overscroll-behavior: contain;
    }

    /* right panel gets inner scroll so charts won't push whole page down */
    .analyticsRightInner{
    max-height: calc(100vh - 110px);
    overflow: auto;
    padding-right: 6px;      /* чтобы скроллбар не “съедал” контент */
    overscroll-behavior: contain;
    }

    /* KPI tiles */
    .kpis{
    display:grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap:10px;
    }
    @media (max-width: 980px){
    .kpis{grid-template-columns: repeat(2, minmax(0,1fr));}
    }
    .kpi{
    border: 1px solid var(--stroke);
    border-radius: 18px;
    background: rgba(255,255,255,.05);
    padding: 12px;
    min-width:0;
    overflow-wrap:anywhere;
    word-break:break-word;
    }
    [data-theme="light"] .kpi{background: rgba(255,255,255,.75);}
    .kpi .v{font-size: 18px; font-weight: 950; margin-top: 6px}
    .kpi .l{font-size: 12px; color: var(--muted)}

    /* Charts grid */
    .charts{
    display:grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap:14px;
    }
    @media (max-width: 980px){ .charts{grid-template-columns:1fr} }

    /* Dedicated size container for Chart.js (stable height) */
    .chartBox{
    position: relative;
    height: 220px;
    }
    .chartBox.tall{ height: 280px; } /* для bubble */
    .chartBox canvas{
    width:100% !important;
    height:100% !important;
    }


    @media (max-width: 980px){ .charts{grid-template-columns:1fr} .chartCard canvas{height: 240px;} }

    .dangerText{color: rgba(239,68,68,.95)}
    .okText{color: rgba(16,185,129,.95)}

    /* Modal for activity run */
    .modal{
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 160;
    }
    .modal.open{display:flex;}
    body.modalOpen{overflow:hidden}
    .modalBackdrop{
    position: absolute;
    inset: 0;
    background: rgba(6,10,20,.58);
    backdrop-filter: blur(8px);
    }
    .modalCard{
    position: relative;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: 22px;
    padding: 0;
    width: min(94vw, 880px);
    max-height: min(86vh, 760px);
    max-height: min(86dvh, 760px);
    overflow:auto;
    overscroll-behavior: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    outline:none;
    }
    .modalCard.lg{ width: min(96vw, 980px); }
    .modalCard > *{margin-inline:18px}
    .modalCard > .row:first-child{
      position:sticky;
      top:0;
      z-index:3;
      margin:0;
      padding:16px 18px;
      background:var(--panel);
      border-bottom:1px solid var(--stroke);
    }
    .modalCard > .row:last-child{
      position:sticky;
      bottom:0;
      z-index:3;
      margin:0;
      padding:12px 18px;
      background:var(--panel);
      border-top:1px solid var(--stroke);
    }
    .modalCard > .sep{margin-inline:18px}
    #competencyModalList{max-height:52vh;overflow:auto;padding-right:3px}
    .confirmCard{
      width:min(92vw,430px);
      padding:24px;
      text-align:center;
      overflow:visible;
    }
    .confirmCard > *{margin-inline:0}
    .confirmCard > .row:last-child{
      position:static;
      margin:18px 0 0;
      padding:0;
      border:0;
      background:transparent;
      justify-content:center;
    }
    .confirmCard h2{margin:12px 0 7px;font-size:21px}
    .confirmCard p{margin:0;line-height:1.5}
    .confirmIcon{
      width:46px;height:46px;display:grid;place-items:center;margin:0 auto;
      border-radius:15px;color:white;background:linear-gradient(135deg,var(--brand),var(--brand2));
      font-size:20px;font-weight:900;
    }
    .resultCard{width:min(92vw,500px);padding:26px;text-align:center;overflow:visible}
    .resultCard > *{margin-inline:0}
    .resultCard > .row:last-child{position:static;margin:20px 0 0;padding:0;border:0;background:transparent;justify-content:center}
    .resultCard h2{margin:14px 0 7px}
    .resultCard p{margin:0}
    .resultScore{
      width:92px;height:92px;display:grid;place-items:center;margin:0 auto;border-radius:50%;
      color:white;background:linear-gradient(135deg,var(--brand),var(--brand2));font-size:25px;font-weight:950;
      box-shadow:0 16px 38px color-mix(in srgb,var(--brand) 25%,transparent);
    }
    .resultStats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:18px}
    .resultStats span{padding:11px;border:1px solid var(--stroke);border-radius:13px;background:var(--card)}
    .resultStats small{display:block;color:var(--muted2);font-size:10px}
    .resultStats strong{display:block;margin-top:3px}
    .questionBlock{
    border: 1px solid var(--stroke);
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255,255,255,.04);
    }
    [data-theme="light"] .questionBlock{background: rgba(255,255,255,.8);}
    .optionRow{
    display:flex;
    align-items:center;
    gap:8px;
    padding: 6px 8px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    }
    .optionRow input{cursor:pointer;}
    .optionRow:hover{border-color: rgba(255,255,255,.12)}
    [data-theme="light"] .optionRow:hover{border-color: rgba(10,20,30,.1)}
    .timerBadge{
    font-variant-numeric: tabular-nums;
    letter-spacing: .5px;
    }

    .testPortalHead{
      display:flex;align-items:center;justify-content:space-between;gap:20px;
      padding:22px 24px;border:1px solid var(--stroke);border-radius:22px;
      background:var(--card);box-shadow:var(--shadow-soft);
    }
    .testPortalHead h1{margin:3px 0 7px;font-size:clamp(24px,4vw,38px);letter-spacing:-1px}
    .testPortalHead p{margin:0;color:var(--muted)}
    .testHeadActions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
    .testTimer{
      display:flex;align-items:center;gap:8px;min-width:112px;justify-content:center;
      padding:10px 13px;border-radius:14px;color:var(--brand);
      background:color-mix(in srgb,var(--brand) 9%,var(--card));font-size:17px;font-weight:900;
      font-variant-numeric:tabular-nums;
    }
    .testTimer svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
    .testTimer.danger{color:var(--bad);background:color-mix(in srgb,var(--bad) 9%,var(--card))}
    .testProgress{margin:12px 0 16px;padding:11px 14px;border:1px solid var(--stroke);border-radius:15px;background:var(--card)}
    .testProgressMeta{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px;font-size:12px;color:var(--muted)}
    .testProgressMeta strong{color:var(--text)}
    .testProgressTrack{height:7px;overflow:hidden;border-radius:99px;background:color-mix(in srgb,var(--text) 8%,transparent)}
    .testProgressTrack i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--brand),var(--brand2));transition:width 180ms ease}
    .testShell{display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px;align-items:start}
    .testSidebar,.testWorkspace{
      border:1px solid var(--stroke);border-radius:20px;background:var(--card);box-shadow:var(--shadow-soft);
    }
    .testSidebar{position:sticky;top:70px;padding:16px}
    .questionNav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;margin:15px 0}
    .questionNav button{
      appearance:none;aspect-ratio:1;border:1px solid var(--stroke);border-radius:9px;
      color:var(--muted);background:transparent;font-weight:800;cursor:pointer;
    }
    .questionNav button.answered{color:white;border-color:transparent;background:var(--brand)}
    .questionNav button.current{box-shadow:var(--ring)}
    .testLegend{display:flex;flex-direction:column;gap:7px;color:var(--muted);font-size:11px}
    .testLegend span{display:flex;align-items:center;gap:7px}
    .testLegend i{width:10px;height:10px;border:1px solid var(--stroke);border-radius:3px}
    .testLegend i.answered{border-color:var(--brand);background:var(--brand)}
    .testWorkspace{padding:20px}
    .testIntro{text-align:center;padding:28px 18px 32px}
    .testIntro h2{margin:14px 0 8px}
    .testIntro p{max-width:620px;margin:0 auto;line-height:1.6}
    .testIntroIcon{
      width:58px;height:58px;display:grid;place-items:center;margin:auto;border-radius:18px;
      color:white;background:linear-gradient(135deg,var(--brand),var(--brand2));font-size:15px;font-weight:900;
      box-shadow:0 12px 28px color-mix(in srgb,var(--brand) 24%,transparent);
    }
    .testWorkspace .questionBlock{padding:18px;margin-bottom:14px;background:color-mix(in srgb,var(--card2) 75%,transparent)}
    .questionTitle{display:flex;align-items:flex-start;gap:11px;margin-bottom:14px}
    .questionNumber{
      flex:0 0 auto;display:grid;place-items:center;width:29px;height:29px;border-radius:9px;
      color:var(--brand);background:color-mix(in srgb,var(--brand) 10%,transparent);font-size:12px;font-weight:900;
    }
    .questionText{font-size:16px;line-height:1.5;font-weight:780}
    .questionKind{display:block;margin-top:4px;color:var(--muted2);font-size:11px;font-weight:500}
    .testWorkspace .optionRow{min-height:48px;margin-top:7px;padding:10px 12px;border-color:var(--stroke);background:var(--card)}
    .testWorkspace .optionRow:has(input:checked){border-color:var(--brand);background:color-mix(in srgb,var(--brand) 8%,var(--card))}
    .testWorkspace .optionRow input{width:18px;height:18px;accent-color:var(--brand)}
    .testActions{
      position:sticky;bottom:-20px;z-index:4;display:flex;align-items:center;justify-content:space-between;gap:14px;
      margin:18px -20px -20px;padding:13px 20px;border-top:1px solid var(--stroke);border-radius:0 0 20px 20px;
      background:color-mix(in srgb,var(--panel) 94%,transparent);backdrop-filter:blur(14px);
    }
    .vacancyActions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}
    .vacancyApplied{color:var(--good);font-size:12px;font-weight:800}
    .completionBadge{display:inline-flex;align-items:center;gap:6px;color:var(--good);font-weight:800}

    .btn, .pill, .tag{
      max-width:100%;
    }
    .btn, .pill{
      white-space:normal;
      text-align:left;
    }
    strong, .muted, .muted2, .kpi .v, .kpi .l{
      overflow-wrap:anywhere;
      word-break:break-word;
    }

    /* Ministry pages */
    .filterBar.sticky{
      position: sticky;
      top: 86px;
      z-index: 12;
    }
    .packSelector{
      font-weight: 700;
    }
    .miniKpi{
      border: 1px solid var(--stroke);
      border-radius: 14px;
      background: rgba(255,255,255,.05);
      padding: 10px;
      min-width: 0;
    }
    [data-theme="light"] .miniKpi{
      background: rgba(255,255,255,.74);
    }
    .miniKpi .l{
      font-size: 12px;
      color: var(--muted);
    }
    .miniKpi .v{
      margin-top: 6px;
      font-size: 18px;
      font-weight: 900;
    }
    .miniGrid{
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    @media (max-width: 980px){
      .miniGrid{
        grid-template-columns: 1fr;
      }
    }
    .tabs{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
    }
    .tab{
      appearance:none;
      border:1px solid var(--stroke);
      background: var(--card);
      color: var(--text);
      border-radius: 999px;
      padding: 8px 12px;
      font-weight: 700;
      cursor: pointer;
    }
    .tab.active{
      border-color: rgba(124,58,237,.6);
      background: linear-gradient(135deg, rgba(124,58,237,.22), rgba(16,185,129,.10));
    }
    .compareBar{
      position: sticky;
      top: 188px;
      z-index: 11;
    }
    .compareDrawer{
      display: none;
    }
    .compareDrawer.active{
      display: block;
    }
    .mobileDock{
      display:none;
    }
    #page-app-ministry-overview .chartBox,
    #page-app-ministry-universities .chartBox,
    #page-app-ministry-university .chartBox,
    #page-app-ministry-program .chartBox{
      height: 210px;
    }
    #page-app-ministry-overview .scrollBox.compact,
    #page-app-ministry-university .scrollBox.compact,
    #page-app-ministry-program .scrollBox.compact{
      max-height: 180px;
    }

    /* ---------- Mobile adaptation ---------- */
    @media (max-width: 900px){
      body{
        background-attachment: scroll;
      }
      .wrap{
        padding: 14px 12px 112px;
      }
      .nav{
        align-items:flex-start;
        flex-wrap:wrap;
        padding:0;
      }
      .brand{
        flex: 1 1 auto;
        padding: 4px 0;
      }
      .brand span{
        display:none;
      }
      .navlinks{
        width:100%;
        justify-content:flex-start;
        flex-wrap:nowrap;
        overflow-x:auto;
        padding:0 2px 6px;
        scrollbar-width:none;
        -webkit-overflow-scrolling:touch;
        scroll-snap-type:x proximity;
      }
      .navlinks::-webkit-scrollbar{
        display:none;
      }
      .navlinks .pill{
        flex:0 0 auto;
        scroll-snap-align:start;
        white-space:nowrap;
        text-align:center;
      }
      .hero{
        padding: 20px 18px;
        border-radius: 22px;
      }
      .hero h1{
        font-size: 24px;
      }
      .card{
        border-radius: 20px;
        padding: 16px;
      }
      .item{
        border-radius: 16px;
      }
      .row{
        align-items:flex-start;
      }
      .analyticsLeft,
      .analyticsRightInner{
        position: static;
        top: auto;
        max-height: none;
        overflow: visible;
        padding-right: 0;
      }
      .filterBar.sticky,
      .compareBar{
        position: static;
        top: auto;
      }
      .compareDrawer{
        position: static;
      }
      .modal{
        padding: 10px;
        align-items:flex-end;
      }
      .modalCard{
        width: 100%;
        max-height: 88vh;
        max-height: 88dvh;
        border-radius: 22px 22px 0 0;
        padding:0;
      }
      .scrollBox{
        max-height: 260px;
      }
      #page-app-ministry-overview .chartBox,
      #page-app-ministry-universities .chartBox,
      #page-app-ministry-university .chartBox,
      #page-app-ministry-program .chartBox{
        height: 190px;
      }
      #navApp{
        display:none !important;
      }
      .mobileActions:not([hidden]){
        display:flex;
        align-items:center;
        gap:6px;
        margin-left:auto;
      }
      .mobileActions button{
        appearance:none;
        width:38px;
        height:38px;
        display:grid;
        place-items:center;
        border:1px solid var(--stroke);
        border-radius:13px;
        color:var(--text);
        background:var(--card);
      }
      .mobileActions svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
      .mobileDock:not([hidden]){
        position:fixed;
        display:flex;
        z-index:55;
        left:50%;
        bottom:max(10px, env(safe-area-inset-bottom));
        transform:translateX(-50%);
        width:min(calc(100% - 18px), 520px);
        padding:6px;
        gap:3px;
        border:1px solid var(--stroke);
        border-radius:24px;
        background:color-mix(in srgb, var(--panel) 94%, transparent);
        box-shadow:0 14px 42px rgba(15,23,42,.16), 0 2px 8px rgba(15,23,42,.08);
        backdrop-filter:blur(18px) saturate(150%);
        -webkit-backdrop-filter:blur(18px) saturate(150%);
      }
      .mobileDock .pill{
        flex:1 1 0;
        min-width:0;
        min-height:57px;
        padding:7px 4px 6px;
        gap:5px;
        border-color:transparent;
        border-radius:19px;
        background:transparent;
        box-shadow:none;
        flex-direction:column;
        justify-content:center;
        text-align:center;
        font-size:10px;
        font-weight:750;
        line-height:1.1;
      }
      .mobileDock .pill svg{
        width:21px;
        height:21px;
        fill:none;
        stroke:currentColor;
        stroke-width:1.8;
        stroke-linecap:round;
        stroke-linejoin:round;
      }
      .mobileDock .pill[aria-current="page"]{
        color:var(--brand);
        background:color-mix(in srgb, var(--brand) 10%, transparent);
        box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--brand) 12%, transparent);
      }
      .betaBar{align-items:flex-start; flex-direction:column; padding:11px 12px}
      .betaMetrics{width:100%; overflow-x:auto; scrollbar-width:none}
      .betaMetrics::-webkit-scrollbar{display:none}
      .betaMetric{flex:1 0 105px; padding-inline:8px}
      .demoSnapshot{grid-template-columns:1fr}
      .testPortalHead{align-items:flex-start;padding:17px;flex-direction:column}
      .testHeadActions{width:100%;justify-content:space-between}
      .testShell{grid-template-columns:1fr}
      .testSidebar{position:static;padding:13px}
      .questionNav{grid-template-columns:repeat(8,minmax(0,1fr))}
      .testLegend{display:none}
      .testWorkspace{padding:14px}
      .testActions{bottom:-14px;margin:16px -14px -14px;padding:12px 14px;align-items:stretch;flex-direction:column}
      .testActions .row{width:100%}
      .testActions .btn{flex:1}
    }

    @media (max-width: 640px){
      .wrap{
        padding: 10px 10px calc(104px + env(safe-area-inset-bottom));
      }
      .nav{
        gap:8px;
      }
      .logo{
        width:32px;
        height:32px;
      }
      .brand strong{
        font-size:13px;
      }
      .hero h1{
        font-size: 26px;
        letter-spacing:-.7px;
      }
      .hero p{
        font-size: 13px;
      }
      .btn, .pill{
        font-size: 13px;
        padding: 9px 10px;
        min-height:44px;
      }
      .navlinks{
        gap:8px;
        margin-inline:-10px;
        padding-inline:10px;
      }
      .navlinks .pill{
        flex:0 0 auto;
      }
      .row .btn,
      .row .pill{
        flex: 1 1 100%;
        justify-content: center;
      }
      .row .navlinks .pill,
      .navlinks .pill{
        flex:0 0 auto;
      }
      .tagrow{
        gap:6px;
      }
      .tag,
      .badge{
        font-size:11px;
        padding:6px 8px;
      }
      .list{
        gap:8px;
      }
      .tabs{
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
      }
      .tab{
        white-space: nowrap;
      }
      .kpis{
        grid-template-columns: 1fr;
      }
      .kpi .v{
        font-size: 16px;
      }
      .chartBox{
        height: 180px;
      }
      .chartBox.tall{
        height: 210px;
      }
      #page-app-ministry-overview .chartBox,
      #page-app-ministry-universities .chartBox,
      #page-app-ministry-university .chartBox,
      #page-app-ministry-program .chartBox{
        height: 170px;
      }
      .toastWrap{
        left: 10px;
        right: 10px;
        bottom:calc(84px + env(safe-area-inset-bottom));
        width:auto;
        max-width:none;
      }
      .toast{border-radius:15px}
      .input, select, textarea{
        font-size: 16px;
      }
      .homeHero{
        padding:28px 18px;
      }
      .homeHero h1{
        font-size:clamp(34px,11vw,48px);
        letter-spacing:-1.7px;
      }
      .featureCard{
        min-height:0;
      }
      .featureIcon{
        margin-bottom:18px;
      }
      .modalCard .row .btn{
        flex:0 1 auto;
      }
      .questionBlock{
        padding:14px 12px;
      }
      .optionRow{
        min-height:46px;
      }
      .questionNav{grid-template-columns:repeat(5,minmax(0,1fr))}
      .testTimer{min-width:106px}
      .testWorkspace .questionBlock{padding:14px 11px}
      .questionText{font-size:15px}
    }

    @media (prefers-reduced-motion: reduce){
      *, *::before, *::after{
        scroll-behavior:auto !important;
        animation-duration:.01ms !important;
        animation-iteration-count:1 !important;
        transition-duration:.01ms !important;
      }
    }
  
