  :root{ --panel:#111827; --panel2:#0c1422; --ink:#e7f0ff; --muted:#9fb3cc; }
  *{box-sizing:border-box}
  html,body{height:100%; overflow:hidden}
  body{margin:0; background:#000; color:var(--ink); font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif}
  body.lightBg{ background:#f1f4f8; }
  body.lightBg #gl{ background:#f1f4f8; }
  body.lightBg .axisLabel{
    color:#0b2a7a;
    text-shadow:none;
    background:rgba(255,255,255,.72);
    border:1px solid rgba(0,0,0,.14);
    backdrop-filter:blur(2px);
  }
  .app{display:grid; grid-template-columns:360px 1fr; grid-template-rows:100vh}
  aside{background:linear-gradient(180deg,var(--panel),var(--panel2)); padding:16px; border-right:1px solid #1e2735; overflow:auto}
  main{position:relative; overflow:hidden}
  h1{font-size:18px; margin:0 0 8px}
  fieldset{border:1px solid #1f2a3a; border-radius:12px; padding:12px 12px 6px; margin:0 0 12px}
  legend{padding:0 6px; color:#c7ddff; font-size:12px}
  label{display:block; font-size:12px; color:#c6d7ef; margin:6px 0 4px}
  select,input[type="range"],input[type="color"],button{width:100%; padding:10px 12px; border-radius:10px; border:1px solid #263245; background:#0e1420; color:var(--ink); outline:none}
  .row{display:grid; grid-template-columns:1fr 1fr; gap:8px}
  .row3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px}

  .colorRow > div{display:flex; flex-direction:column}
  .colorRow label{min-height:32px}
  .colorRow input[type="color"]{margin-top:auto}
  .small{font-size:11px; color:#9fb3cc}
  .btn{cursor:pointer; margin-top:8px; background:#122036; border-color:#21324b}
  .btn:hover{background:#142746}
  #gl,#angleOverlay{display:block; width:100%; height:100%}
  #gl{background:#000}
  #angleOverlay{position:absolute; inset:0; pointer-events:none; z-index:19}
  .hud{position:absolute; left:12px; bottom:12px; background:rgba(12,16,24,.45); border:1px solid rgba(36,48,68,.55); backdrop-filter:blur(6px); padding:8px 10px; border-radius:10px; font-size:12px; z-index:20}

  #miniAxesWrap{
    position:absolute;
    right:12px;
    bottom:12px;
    width:180px;
    height:180px;
    border-radius:14px;
    border:1px solid rgba(36,48,68,.55);
    background:rgba(12,16,24,.28);
    overflow:hidden;
    pointer-events:none;
    z-index:22;
  }
  #miniAxes{
    display:block;
    width:100%;
    height:100%;
  }
  body.lightBg #miniAxesWrap{
    background:rgba(255,255,255,.42);
    border-color:rgba(52,78,122,.18);
  }

  .viewerToggle{
    position:absolute;
    top:14px;
    left:14px;
    z-index:24;
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-radius:999px;
    background:rgba(8,12,20,.56);
    border:1px solid rgba(255,255,255,.10);
    backdrop-filter:blur(8px);
    color:#eef5ff;
    font-size:12px;
    line-height:1;
    user-select:none;
  }
  .viewerToggle input{
    width:auto;
    margin:0;
    accent-color:#8fb3ff;
  }
  body.lightBg .viewerToggle{
    background:rgba(255,255,255,.78);
    border-color:rgba(0,0,0,.12);
    color:#13325f;
  }
  .badge{display:inline-block; background:#0f2342; color:#d9ecff; padding:6px 10px; border-radius:999px; border:1px solid #19406f; font-size:12px}
  .badges{display:flex; gap:6px; flex-wrap:wrap}
  .axisLabel{
    position:absolute;
    transform:translate(-50%,-50%);
    font:700 14px/1 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;
    letter-spacing:.02em;
    text-shadow:0 0 10px rgba(0,0,0,.9), 0 1px 2px rgba(0,0,0,.95);
    pointer-events:none;
    user-select:none;
    padding:2px 5px;
    border-radius:999px;
    background:rgba(4,8,14,.18);
    border:1px solid rgba(255,255,255,.08);
    backdrop-filter:blur(2px);
    z-index:21;
  }
  @media (max-width: 980px){
    .app{grid-template-columns:1fr; grid-template-rows:auto 1fr}
    aside{border-right:0; border-bottom:1px solid #1e2735}
    main{min-height:60vh}
  }


  .angleLegendPanel{
    position:absolute;
    top:58px;
    left:14px;
    z-index:24;
    min-width:168px;
    max-width:220px;
    max-height:calc(100% - 84px);
    overflow:auto;
    padding:10px 10px 8px;
    border-radius:16px;
    background:rgba(8,12,20,.56);
    border:1px solid rgba(255,255,255,.10);
    backdrop-filter:blur(8px);
    color:#eef5ff;
    box-shadow:0 10px 34px rgba(0,0,0,.18);
  }
  .angleLegendTitle{
    margin:0 0 8px;
    font-size:11px;
    font-weight:800;
    letter-spacing:.04em;
    text-transform:uppercase;
    color:#bcd1ef;
  }
  .angleLegendList{display:grid; gap:6px}
  .angleLegendItem{
    display:flex;
    align-items:center;
    gap:8px;
    width:100%;
    padding:6px 8px;
    border-radius:12px;
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.04);
    font-size:12px;
    line-height:1.2;
    color:#eef5ff;
    user-select:none;
  }
  .angleLegendItem input{
    width:auto;
    margin:0;
    flex:0 0 auto;
  }
  .angleLegendSwatch{
    width:10px;
    height:10px;
    border-radius:999px;
    flex:0 0 auto;
    box-shadow:0 0 0 1px rgba(255,255,255,.16), 0 0 12px rgba(255,255,255,.12);
  }
  .angleLegendText{display:flex; flex-direction:column; gap:1px; min-width:0}
  .angleLegendValue{font-weight:800; color:#f5f9ff}
  .angleLegendMeta{font-size:10px; color:#a9bdd8}
  .angleLegendEmpty{font-size:11px; color:#a9bdd8}
  .angleLegendPanel.is-master-off{opacity:.74}
  body.lightBg .angleLegendPanel{
    background:rgba(255,255,255,.82);
    border-color:rgba(0,0,0,.12);
    color:#13325f;
    box-shadow:0 10px 30px rgba(40,70,120,.10);
  }
  body.lightBg .angleLegendTitle{color:#476999}
  body.lightBg .angleLegendItem{
    background:rgba(16,57,112,.04);
    border-color:rgba(16,57,112,.08);
    color:#14335f;
  }
  body.lightBg .angleLegendValue{color:#14335f}
  body.lightBg .angleLegendMeta,.lightBg .angleLegendEmpty{color:#5979a7}


.tutorialWrap{
  position:static;
  width:100%;
  margin-top:12px;
  z-index:auto;
  pointer-events:auto;
}
.tutorialCard{
  pointer-events:auto;
  background:rgba(8,13,22,.86);
  border:1px solid rgba(126,125,255,.26);
  border-radius:14px;
  padding:12px;
  transition:transform .35s ease, opacity .35s ease, box-shadow .35s ease;
}
.tutorialCard.stepPulse{box-shadow:0 0 0 1px rgba(116,157,255,.20)}
.tutorialCard.fadeStep{opacity:.35; transform:translateY(6px) scale(.992)}
.tutorialTop{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px}
.tutorialKicker{font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:#c7dcff; opacity:.95}
.tutorialStepTag{font-size:12px; color:#f0f5ff; background:rgba(122,125,255,.16); border:1px solid rgba(122,125,255,.34); padding:5px 9px; border-radius:999px}
.tutorialTitle{font-weight:800; font-size:16px; line-height:1.2; margin:0 0 8px}
.tutorialBody{font-size:14px; line-height:1.52; color:#e2eeff; min-height:74px; text-align:justify; text-justify:inter-word; hyphens:auto}
.tutorialBody b{color:#fff}
.tutorialNote{margin-top:8px; font-size:12px; color:#b8cdea; line-height:1.42; text-align:justify; text-justify:inter-word; hyphens:auto}
.tutorialExamples{margin-top:8px; font-size:12px; line-height:1.42; color:#dce9ff; text-align:justify; text-justify:inter-word; hyphens:auto; background:rgba(78,213,255,.06); border:1px solid rgba(78,213,255,.14); border-radius:10px; padding:8px 10px}
.tutorialExamples b{color:#fff}
.tutorialExamples .exHelp{margin-top:8px; color:#bcd1ef; font-size:11px; text-align:justify; text-justify:inter-word; hyphens:auto}
.tutorialExamples .exBtns{display:flex; flex-wrap:wrap; gap:6px; margin-top:6px}
.tutorialExamples .exBtn{appearance:none; border:none; cursor:pointer; width:auto; padding:6px 9px; border-radius:999px; font-size:11px; font-weight:700; line-height:1; color:#eaf3ff; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.10); transition:transform .12s ease, filter .18s ease, background .18s ease, border-color .18s ease}
.tutorialExamples .exBtn:hover{filter:brightness(1.08); background:rgba(122,125,255,.14); border-color:rgba(122,125,255,.34)}
.tutorialExamples .exBtn:active{transform:translateY(1px) scale(.99)}
.tutorialExamples .exBtn.active{background:linear-gradient(180deg, rgba(78,213,255,.18), rgba(122,125,255,.18)); border-color:rgba(78,213,255,.42); box-shadow:0 0 0 1px rgba(78,213,255,.12) inset}
.tutorialExamples .exInlineBtn{display:block; width:100%; text-align:justify; text-justify:inter-word; cursor:pointer; background:rgba(255,255,255,.02); color:#dce9ff; border:1px dashed rgba(78,213,255,.22); border-radius:10px; padding:8px 10px; margin:0 0 8px; line-height:1.42; transition:background .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease}
.tutorialExamples .exInlineBtn:hover{background:rgba(78,213,255,.08); border-color:rgba(78,213,255,.42); box-shadow:0 0 0 1px rgba(78,213,255,.10) inset}
.tutorialExamples .exInlineBtn:active{transform:translateY(1px)}
.tutorialExamples .exInlineBtn .hint{display:inline-block; margin-left:6px; font-size:11px; color:#bcd1ef; opacity:.95}

.tutorialExamples .legendDots{display:flex; gap:8px; flex-wrap:wrap; margin-top:8px}
.tutorialExamples .dotItem{display:inline-flex; align-items:center; gap:6px; font-size:11px; color:#cfe0ff}
.tutorialExamples .dot{width:9px; height:9px; border-radius:50%}
.tutorialExamples .exampleInfo{margin-top:8px; padding:9px 10px; border-radius:10px; border:1px solid rgba(255,255,255,.08); background:rgba(255,255,255,.03)}
.tutorialExamples .exampleInfo b{color:#fff}
.tutorialExamples .exampleInfo .meta{margin-top:4px; color:#b8cdea; font-size:11px}
.tutorialProgress{height:8px; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.06); border-radius:999px; overflow:hidden; margin:12px 0 12px}
.tutorialProgress > i{display:block; height:100%; width:0%; background:linear-gradient(90deg,#4ed5ff,#7a7dff); transition:width .35s ease}
.tutorialActions{display:flex; gap:8px; flex-wrap:wrap}
.tbtn{appearance:none; border:none; cursor:pointer; border-radius:12px; padding:10px 12px; font-weight:700; font-size:13px; pointer-events:auto; transition:transform .12s ease, filter .18s ease, opacity .18s ease}
.tbtn:hover{filter:brightness(1.08)}
.tbtn:active{transform:translateY(1px) scale(.99)}
.tbtn.ghost{background:rgba(255,255,255,.05); color:#dce9ff; border:1px solid rgba(255,255,255,.08)}
.tbtn.primary{background:linear-gradient(180deg,#4ed5ff,#7a7dff); color:#06101f; border:1px solid rgba(255,255,255,.22)}
.tbtn.subtle{background:rgba(16,24,39,.75); color:#b6cbeb; border:1px solid rgba(255,255,255,.06)}
.tbtn[disabled]{opacity:.45; cursor:not-allowed; filter:none}
.tutorialMini{display:flex; gap:6px; flex-wrap:wrap; margin-top:8px}
.pill{font-size:11px; color:#cfe0ff; background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.06); padding:4px 7px; border-radius:999px}
.tutorialZRot{margin-top:10px; padding:10px 10px; border:1px solid rgba(255,255,255,.12); border-radius:14px; background:rgba(255,255,255,.06)}
.tutorialZRot .zrHead{display:flex; align-items:center; justify-content:space-between; font-size:12px; letter-spacing:.2px}
.tutorialZRot .zrHead span{opacity:.92}
.tutorialZRot .zrHint{margin-top:6px; font-size:11px; opacity:.75; line-height:1.25}
.tutorialToggles{margin-top:10px; padding:10px 10px; border:1px solid rgba(255,255,255,.12); border-radius:14px; background:rgba(255,255,255,.06)}
.tutorialToggles label{display:flex; align-items:center; gap:10px; font-size:12px; letter-spacing:.2px; cursor:pointer}
.tutorialToggles input{transform:translateY(.5px)}
body.lightBG .tutorialToggles{border-color:rgba(0,0,0,.08); background:rgba(0,0,0,.03)}
.rotZControl, #tutorialZRotBox{display:none !important}
@media (max-width: 900px){
  .tutorialWrap{margin-top:10px}
}


.tutorialCardExamples{
  background:transparent;
  border:0;
  padding:0;
}
.tutorialTopExamples{
  margin-bottom:0;
}
.tutorialStructureNav{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:10px;
}
.tutorialStructureNav .structureBtn{
  appearance:none;
  border:none;
  cursor:pointer;
  width:auto;
  padding:7px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:700;
  line-height:1.15;
  color:#eaf3ff;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  transition:transform .12s ease, filter .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.tutorialStructureNav .structureBtn:hover{
  filter:brightness(1.08);
  background:rgba(122,125,255,.14);
  border-color:rgba(122,125,255,.34);
}
.tutorialStructureNav .structureBtn:active{
  transform:translateY(1px) scale(.99);
}
.tutorialStructureNav .structureBtn.active{
  background:linear-gradient(180deg, rgba(78,213,255,.18), rgba(122,125,255,.18));
  border-color:rgba(78,213,255,.42);
  box-shadow:0 0 0 1px rgba(78,213,255,.12) inset;
}
.tutorialExamplesOnly{
  margin-top:0;
  background:rgba(8,13,22,.86);
  border:1px solid rgba(78,213,255,.18);
  border-radius:12px;
  padding:10px;
}
.tutorialExamplesOnly .exBtnsOnly{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:0;
}
body.lightBg .tutorialStructureNav .structureBtn{
  color:#13325f;
  background:rgba(16,57,112,.04);
  border-color:rgba(16,57,112,.10);
}
body.lightBg .tutorialStructureNav .structureBtn:hover{
  background:rgba(122,125,255,.10);
  border-color:rgba(122,125,255,.24);
}
body.lightBg .tutorialExamplesOnly{
  background:rgba(8,13,22,.86);
  border-color:rgba(78,213,255,.18);
}
