/* VELAEA Stats Guide: compact formula handbook */
:root{
  --vsg-bg:#06111f;
  --vsg-panel:#0a1625;
  --vsg-card:rgba(255,255,255,.045);
  --vsg-line:rgba(255,255,255,.10);
  --vsg-text:#f8fafc;
  --vsg-muted:#9fb0c3;
  --vsg-gold:#f2c76a;
  --vsg-blue:#64d7ff;
}
.vsg-lock{overflow:hidden}
.vsg-root{font-family:Inter,"Noto Sans Thai",system-ui,sans-serif}
.vsg-fab{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:99970;
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(242,199,106,.28);
  border-radius:999px;
  padding:9px 13px 9px 9px;
  color:#fff;
  background:linear-gradient(135deg,rgba(242,199,106,.28),rgba(10,22,37,.92));
  box-shadow:0 18px 45px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.10);
  cursor:pointer;
  font-weight:950;
  letter-spacing:.01em;
}
.vsg-fab span{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:999px;
  color:#08111f;
  background:linear-gradient(135deg,#fff2bc,#f2c76a);
  font-weight:1000;
}
.vsg-fab b{font-size:12px}
.vsg-fab:hover{transform:translateY(-1px);border-color:rgba(242,199,106,.45)}
.vsg-backdrop{
  position:fixed;
  inset:0;
  z-index:99980;
  background:rgba(2,8,20,.62);
  backdrop-filter:blur(8px);
}
.vsg-panel{
  position:fixed;
  z-index:99990;
  top:18px;
  right:18px;
  bottom:18px;
  width:min(760px,calc(100vw - 36px));
  overflow:hidden;
  display:flex;
  flex-direction:column;
  border:1px solid rgba(242,199,106,.18);
  border-radius:26px;
  background:
    radial-gradient(circle at 8% 0%,rgba(242,199,106,.16),transparent 32%),
    linear-gradient(180deg,rgba(10,22,37,.98),rgba(6,17,31,.98));
  box-shadow:0 34px 90px rgba(0,0,0,.48);
  color:var(--vsg-text);
  transform:translateX(calc(100% + 30px));
  opacity:0;
  pointer-events:none;
  transition:transform .28s ease,opacity .22s ease;
}
.vsg-root.is-open .vsg-panel{
  transform:translateX(0);
  opacity:1;
  pointer-events:auto;
}

.vsg-panel[aria-hidden="true"]{
  visibility:hidden;
}

.vsg-root.is-open .vsg-panel[aria-hidden="false"]{
  visibility:visible;
}
.vsg-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:20px 20px 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.vsg-panel-head p{
  margin:0 0 4px;
  color:var(--vsg-gold);
  font-size:11px;
  font-weight:1000;
  letter-spacing:.12em;
}
.vsg-panel-head h3{
  margin:0;
  font-size:24px;
  line-height:1.1;
  letter-spacing:-.035em;
}
.vsg-panel-head span{
  display:block;
  margin-top:7px;
  color:var(--vsg-muted);
  font-size:12.5px;
  font-weight:750;
  line-height:1.55;
}
.vsg-close{
  width:36px;
  height:36px;
  min-width:36px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  color:#fff;
  background:rgba(255,255,255,.06);
  cursor:pointer;
  font-size:22px;
  font-weight:800;
}
.vsg-search-row{padding:14px 20px 8px}
.vsg-search-row input{
  width:100%;
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:12px 14px;
  outline:none;
  color:#fff;
  background:rgba(255,255,255,.055);
  font-weight:800;
}
.vsg-search-row input:focus{border-color:rgba(242,199,106,.42);box-shadow:0 0 0 4px rgba(242,199,106,.10)}
.vsg-quick-row{
  display:flex;
  gap:7px;
  overflow-x:auto;
  padding:0 20px 10px;
}
.vsg-quick-row button{
  white-space:nowrap;
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  padding:7px 10px;
  color:#dce7f6;
  background:rgba(255,255,255,.055);
  font-size:11px;
  font-weight:900;
  cursor:pointer;
}
.vsg-quick-row button:hover{border-color:rgba(100,215,255,.28);color:#fff}
.vsg-note{
  margin:0 20px 12px;
  padding:11px 12px;
  border:1px solid rgba(100,215,255,.16);
  border-radius:16px;
  color:#cfe4f7;
  background:rgba(100,215,255,.065);
  font-size:12px;
  line-height:1.55;
}
.vsg-note strong{color:var(--vsg-blue)}
.vsg-content{
  overflow:auto;
  padding:0 20px 20px;
}
.vsg-section{
  margin:10px 0;
  border:1px solid rgba(255,255,255,.09);
  border-radius:18px;
  background:rgba(255,255,255,.035);
  overflow:hidden;
}
.vsg-section-head{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:0;
  padding:13px 14px;
  color:#fff;
  background:linear-gradient(90deg,rgba(255,255,255,.055),rgba(255,255,255,.02));
  cursor:pointer;
  text-align:left;
}
.vsg-section-head span{
  font-size:13px;
  font-weight:1000;
}
.vsg-section-head b{
  display:grid;
  place-items:center;
  min-width:24px;
  height:24px;
  border-radius:999px;
  color:#08111f;
  background:var(--vsg-gold);
  font-size:11px;
}
.vsg-section-body{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  padding:12px;
}
.vsg-section.is-collapsed .vsg-section-body{display:none}
.vsg-term-card{
  min-width:0;
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  padding:12px;
  background:rgba(255,255,255,.045);
}
.vsg-term-title h4{
  margin:0 0 4px;
  color:#fff;
  font-size:14px;
  line-height:1.25;
}
.vsg-term-title span{
  display:block;
  color:#c9d6e8;
  font-size:12px;
  font-weight:800;
  line-height:1.45;
}
.vsg-formula{
  margin:10px 0 8px;
  padding:9px;
  border:1px solid rgba(242,199,106,.13);
  border-radius:12px;
  background:rgba(242,199,106,.055);
}
.vsg-formula small{
  display:block;
  margin-bottom:4px;
  color:var(--vsg-gold);
  font-size:10px;
  font-weight:1000;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.vsg-formula code{
  display:block;
  white-space:normal;
  color:#f7e7bd;
  font-family:Inter,"Noto Sans Thai",system-ui,sans-serif;
  font-size:11.5px;
  font-weight:850;
  line-height:1.45;
}
.vsg-term-card p{
  margin:0;
  color:var(--vsg-muted);
  font-size:12px;
  font-weight:760;
  line-height:1.55;
}
.vsg-empty{
  margin:18px 0;
  padding:18px;
  border:1px dashed rgba(255,255,255,.16);
  border-radius:18px;
  color:var(--vsg-muted);
  text-align:center;
  font-weight:850;
}
html[data-theme="light"] .vsg-fab,
body.light .vsg-fab{
  color:#0f172a;
  background:linear-gradient(135deg,rgba(255,248,225,.96),rgba(255,255,255,.96));
  border-color:rgba(196,139,29,.24);
  box-shadow:0 18px 45px rgba(15,23,42,.12),inset 0 1px 0 rgba(255,255,255,.95);
}
html[data-theme="light"] .vsg-backdrop,
body.light .vsg-backdrop{
  background:rgba(15,23,42,.28);
}
html[data-theme="light"] .vsg-panel,
body.light .vsg-panel{
  --vsg-text:#0f172a;
  --vsg-muted:#64748b;
  background:
    radial-gradient(circle at 8% 0%,rgba(242,199,106,.20),transparent 35%),
    linear-gradient(180deg,#ffffff,#f8fafc);
  border-color:rgba(196,139,29,.18);
  box-shadow:0 34px 90px rgba(15,23,42,.22);
}
html[data-theme="light"] .vsg-panel-head,
body.light .vsg-panel-head,
html[data-theme="light"] .vsg-section,
body.light .vsg-section,
html[data-theme="light"] .vsg-term-card,
body.light .vsg-term-card{
  border-color:rgba(15,23,42,.08);
}
html[data-theme="light"] .vsg-close,
body.light .vsg-close,
html[data-theme="light"] .vsg-search-row input,
body.light .vsg-search-row input,
html[data-theme="light"] .vsg-quick-row button,
body.light .vsg-quick-row button,
html[data-theme="light"] .vsg-term-card,
body.light .vsg-term-card,
html[data-theme="light"] .vsg-section,
body.light .vsg-section{
  color:#0f172a;
  background:rgba(255,255,255,.78);
}
html[data-theme="light"] .vsg-section-head,
body.light .vsg-section-head{
  color:#0f172a;
  background:linear-gradient(90deg,rgba(242,199,106,.12),rgba(255,255,255,.78));
}
html[data-theme="light"] .vsg-term-title h4,
body.light .vsg-term-title h4{color:#0f172a}
html[data-theme="light"] .vsg-term-title span,
body.light .vsg-term-title span,
html[data-theme="light"] .vsg-term-card p,
body.light .vsg-term-card p{color:#64748b}
html[data-theme="light"] .vsg-formula code,
body.light .vsg-formula code{color:#6b4c10}
@media(max-width:720px){
  .vsg-panel{inset:10px;width:calc(100vw - 20px);border-radius:22px}
  .vsg-panel-head{padding:16px}
  .vsg-panel-head h3{font-size:20px}
  .vsg-section-body{grid-template-columns:1fr}
  .vsg-fab{right:12px;bottom:12px;padding:8px}
  .vsg-fab b{display:none}
}


/* Inline placement inside chart / performance panels */
.vsg-root.has-inline-trigger .vsg-fab{
  display:none!important;
}
.vsg-inline-host{
  gap:12px;
}
.vsg-inline-actions{
  margin-left:auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.vsg-inline-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:34px;
  border:1px solid rgba(242,199,106,.28);
  border-radius:999px;
  padding:7px 12px 7px 8px;
  color:#fff;
  background:
    radial-gradient(circle at 0 0,rgba(242,199,106,.28),transparent 36%),
    linear-gradient(135deg,rgba(242,199,106,.16),rgba(10,22,37,.72));
  box-shadow:0 10px 26px rgba(0,0,0,.20), inset 0 1px 0 rgba(255,255,255,.08);
  cursor:pointer;
  font-weight:950;
  letter-spacing:.01em;
  white-space:nowrap;
}
.vsg-inline-btn i{
  display:grid;
  place-items:center;
  width:22px;
  height:22px;
  border-radius:999px;
  color:#07111f;
  background:linear-gradient(135deg,#fff2bc,#f2c76a);
  font-style:normal;
  font-size:12px;
  font-weight:1000;
}
.vsg-inline-btn span{
  display:grid;
  gap:1px;
  text-align:left;
}
.vsg-inline-btn small{
  color:rgba(211,226,242,.78);
  font-size:9px;
  font-weight:1000;
  letter-spacing:.10em;
  text-transform:uppercase;
  line-height:1;
}
.vsg-inline-btn b{
  color:#fff;
  font-size:11px;
  line-height:1.05;
}
.vsg-inline-btn:hover{
  transform:translateY(-1px);
  border-color:rgba(242,199,106,.48);
  box-shadow:0 14px 32px rgba(242,199,106,.08), inset 0 1px 0 rgba(255,255,255,.10);
}
@media(max-width:720px){
  .vsg-inline-actions{
    width:100%;
    justify-content:flex-start;
    margin-left:0;
  }
  .vsg-inline-btn{
    width:100%;
    justify-content:center;
  }
}


/* Mobile-only fine tune when Stats Guide button is inside #mt5-performance */
@media(max-width:520px){
  #mt5-performance .vsg-inline-actions{
    width:100%!important;
    margin-left:0!important;
    justify-content:stretch!important;
  }
  #mt5-performance .vsg-inline-btn{
    width:100%!important;
    justify-content:flex-start!important;
    border-radius:14px!important;
  }
}
