/* =========================================================
   ANALYSIS WORKSPACE V2
   ========================================================= */

.analysis-page{
  padding-bottom:44px;
}

.analysis-page-head{
  margin-bottom:18px;
}

.analysis-page-head h1,
.analysis-tool-head h1{
  margin:4px 0 4px;
  font-size:24px;
  color:#1f2937;
}

.analysis-page-head p,
.analysis-tool-head p{
  margin:0;
  max-width:700px;
  font-size:11px;
  line-height:1.5;
  color:#718096;
}


/* =========================================================
   TILE HOME
   ========================================================= */

.analysis-tile-grid{
  display:grid;
  grid-template-columns:
    repeat(2,minmax(0,1fr));
  gap:14px;
  max-width:980px;
}

.analysis-tile{
  min-height:170px;
  padding:20px;
  border:1px solid #dfe6ee;
  border-radius:14px;
  background:#fff;
  font-family:inherit;
  text-align:left;
  cursor:pointer;

  display:grid;
  grid-template-columns:
    48px 1fr 26px;
  gap:15px;
  align-items:start;

  transition:
    border-color .15s ease,
    transform .15s ease,
    box-shadow .15s ease;
}

.analysis-tile:hover{
  border-color:#a9cfc9;
  transform:translateY(-1px);
  box-shadow:
    0 8px 22px
    rgba(15,23,42,.055);
}

.analysis-tile-icon{
  width:46px;
  height:46px;
  border-radius:11px;

  display:flex;
  align-items:center;
  justify-content:center;

  background:#eff7f5;
  color:#277a72;
  font-size:19px;
  font-weight:800;
}

.analysis-tile-icon.multi{
  background:#f1f5f9;
  color:#40546a;
}

.analysis-tile-copy{
  min-width:0;
}

.analysis-tile-copy>span{
  display:block;
  margin-bottom:6px;

  font-size:7px;
  font-weight:900;
  letter-spacing:.09em;
  color:#748397;
}

.analysis-tile-copy h2{
  margin:0 0 7px;
  font-size:15px;
  color:#25364a;
}

.analysis-tile-copy p{
  margin:0;
  max-width:440px;

  font-size:10px;
  line-height:1.55;
  color:#718096;
}

.analysis-tile-meta{
  margin-top:15px;
  font-size:8px;
  font-weight:700;
  color:#8b98a8;
}

.analysis-tile-arrow{
  align-self:center;
  justify-self:end;

  color:#7b8a9b;
  font-size:18px;
}


/* =========================================================
   TOOL WORKSPACE
   ========================================================= */

.analysis-back{
  margin:0 0 17px;
  padding:0;
  border:0;
  background:transparent;

  color:#328277;
  font-family:inherit;
  font-size:10px;
  font-weight:700;

  cursor:pointer;
}

.analysis-tool-head{
  margin-bottom:16px;
}

.analysis-toolbar-card{
  margin-bottom:16px;
  padding:14px 16px;

  border:1px solid #dfe6ee;
  border-radius:12px;
  background:#fff;

  display:grid;
  grid-template-columns:
    minmax(230px,1.3fr)
    auto
    minmax(230px,1fr);

  gap:18px;
  align-items:end;
}

.mtf-toolbar{
  grid-template-columns:
    minmax(190px,1fr)
    minmax(220px,1.2fr)
    auto
    auto;
}

.analysis-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.analysis-field label,
.analysis-range-group>label{
  font-size:7px;
  font-weight:900;
  letter-spacing:.08em;
  color:#748397;
}

.analysis-field select{
  height:38px;
  width:100%;
  padding:0 11px;

  border:1px solid #d9e2ea;
  border-radius:8px;
  background:#fff;

  color:#2f4155;
  font-family:inherit;
  font-size:10px;
  font-weight:700;
}

.analysis-toolbar-context{
  display:flex;
  gap:22px;
  min-width:210px;
}

.analysis-toolbar-context>div{
  display:flex;
  flex-direction:column;
  gap:3px;
}

.analysis-toolbar-context span{
  font-size:7px;
  font-weight:900;
  letter-spacing:.07em;
  color:#8b98a8;
}

.analysis-toolbar-context b{
  font-size:11px;
  color:#35485d;
}

.analysis-toolbar-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
}

.analysis-cache-state{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:2px;
}

.analysis-cache-state span{
  font-size:7px;
  font-weight:900;
  letter-spacing:.05em;
  text-transform:uppercase;
  color:#506376;
}

.analysis-cache-state small{
  font-size:7px;
  color:#8b98a8;
}


/* =========================================================
   RANGE
   ========================================================= */

.analysis-range-group{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.analysis-range-toggle{
  height:38px;

  display:flex;
  align-items:center;

  border:1px solid #d9e2ea;
  border-radius:8px;
  background:#f8fafc;
  padding:3px;
}

.analysis-range-toggle button{
  min-width:44px;
  height:30px;

  border:0;
  border-radius:6px;
  background:transparent;

  font-family:inherit;
  font-size:9px;
  font-weight:800;
  color:#718096;

  cursor:pointer;
}

.analysis-range-toggle button.active{
  background:#fff;
  color:#287a71;
  box-shadow:
    0 1px 4px
    rgba(15,23,42,.09);
}


/* =========================================================
   EMPTY / LOADING
   ========================================================= */

.analysis-empty{
  min-height:280px;

  border:1px dashed #d7e0e9;
  border-radius:12px;
  background:#fff;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  text-align:center;
}

.analysis-empty-icon{
  width:42px;
  height:42px;
  margin-bottom:10px;

  border-radius:50%;
  background:#eef7f5;

  display:flex;
  align-items:center;
  justify-content:center;

  color:#287d74;
  font-size:17px;
}

.analysis-empty b{
  font-size:12px;
  color:#2e4155;
}

.analysis-empty p{
  max-width:350px;
  margin:5px 0 0;

  font-size:9px;
  line-height:1.5;
  color:#8190a1;
}

.analysis-loading{
  padding:34px;

  border:1px solid #e0e6ed;
  border-radius:12px;
  background:#fff;

  text-align:center;
  font-size:9px;
  color:#718096;
}

.analysis-loading-bar{
  width:100%;
  max-width:300px;
  height:3px;
  margin:0 auto 12px;

  overflow:hidden;
  border-radius:3px;
  background:#e8edf2;
}

.analysis-loading-bar:after{
  content:"";
  display:block;
  width:40%;
  height:100%;
  background:#4a968c;
  animation:analysis-loading 1s linear infinite;
}

@keyframes analysis-loading{
  from{transform:translateX(-110%)}
  to{transform:translateX(260%)}
}


/* =========================================================
   MTF CURRENT STATUS
   ========================================================= */

.mtf-current-strip{
  margin-bottom:12px;

  display:grid;
  grid-template-columns:
    1.4fr 1fr 1fr 1fr 1fr;

  border:1px solid #dfe6ee;
  border-radius:11px;
  background:#fff;
  overflow:hidden;
}

.mtf-current-strip>div{
  min-height:64px;
  padding:12px 14px;

  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:4px;

  border-right:1px solid #edf1f5;
}

.mtf-current-strip>div:last-child{
  border-right:0;
}

.mtf-current-strip span{
  font-size:7px;
  font-weight:900;
  letter-spacing:.07em;
  color:#8b98a8;
}

.mtf-current-strip b{
  font-size:12px;
  color:#2f4358;
}

.mtf-state{
  display:inline-flex;
  width:max-content;
  min-width:52px;
  justify-content:center;

  padding:4px 8px;
  border-radius:999px;

  font-size:9px !important;
}

.mtf-state.up{
  background:#e6f5ef;
  color:#23755e;
}

.mtf-state.down{
  background:#fbecee;
  color:#ad4852;
}

.mtf-state.neutral{
  background:#eef1f4;
  color:#64748b;
}


/* =========================================================
   MTF CHART
   ========================================================= */

.mtf-chart-card{
  border:1px solid #dfe6ee;
  border-radius:12px;
  background:#fff;
  overflow:hidden;
}

.mtf-chart-head{
  padding:16px 18px;

  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;

  border-bottom:1px solid #edf1f5;
}

.mtf-chart-head h2{
  margin:3px 0 3px;
  font-size:15px;
  color:#26394e;
}

.mtf-chart-head p{
  margin:0;
  font-size:9px;
  color:#8190a1;
}

.mtf-legend{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:13px;
}

.mtf-legend span{
  display:flex;
  align-items:center;
  gap:5px;

  font-size:8px;
  font-weight:700;
  color:#667789;
}

.mtf-legend i{
  width:10px;
  height:10px;
  border-radius:3px;
}

.mtf-legend i.price{
  width:18px;
  height:0;
  border-radius:0;
  border-top:2px solid #334155;
}

.mtf-legend i.up{
  background:#b7e1d2;
}

.mtf-legend i.down{
  background:#efbdc2;
}

.mtf-legend i.neutral{
  background:#e3e8ed;
}

.mtf-chart-wrap{
  position:relative;
  min-width:0;
  padding:10px 12px 2px;
}

#mtfChart{
  display:block;
  width:100%;
  height:430px;
}

.mtf-grid-line{
  stroke:#edf1f5;
  stroke-width:1;
}

.mtf-price-path{
  fill:none;
  stroke:#334155;
  stroke-width:2.2;
  vector-effect:non-scaling-stroke;
}

.mtf-price-label{
  fill:#8b98a8;
  font-size:8px;
  font-weight:700;
}

.mtf-band-label{
  fill:#718096;
  font-size:8px;
  font-weight:900;
  letter-spacing:.04em;
}

.mtf-band-up{
  fill:#b9e2d3;
}

.mtf-band-down{
  fill:#efc0c4;
}

.mtf-band-neutral{
  fill:#e5e9ee;
}

.mtf-hover-line{
  stroke:#64748b;
  stroke-width:1;
  stroke-dasharray:3 3;
  vector-effect:non-scaling-stroke;
}

.mtf-axis{
  padding:0 18px 13px;

  display:flex;
  justify-content:space-between;

  color:#8b98a8;
  font-size:8px;
  font-weight:700;
}

.mtf-tooltip{
  position:absolute;
  z-index:5;

  min-width:220px;
  padding:11px;

  border:1px solid #d9e2ea;
  border-radius:9px;
  background:
    rgba(255,255,255,.97);

  box-shadow:
    0 8px 22px
    rgba(15,23,42,.10);

  pointer-events:none;
}

.mtf-tooltip-date{
  margin-bottom:8px;

  font-size:10px;
  font-weight:800;
  color:#314559;
}

.mtf-tooltip-price{
  margin-bottom:7px;
  padding-bottom:7px;

  display:flex;
  justify-content:space-between;

  border-bottom:1px solid #edf1f5;
}

.mtf-tooltip-price span{
  font-size:8px;
  color:#8492a3;
}

.mtf-tooltip-price b{
  font-size:10px;
  color:#26394e;
}

.mtf-tooltip-row{
  min-height:24px;

  display:grid;
  grid-template-columns:
    52px 56px 1fr;

  align-items:center;
  gap:6px;
}

.mtf-tooltip-row span{
  font-size:8px;
  color:#8492a3;
}

.mtf-tooltip-row b{
  font-size:8px;
}

.mtf-tooltip-row b.up{
  color:#23755e;
}

.mtf-tooltip-row b.down{
  color:#ad4852;
}

.mtf-tooltip-row b.neutral{
  color:#64748b;
}

.mtf-tooltip-row small{
  font-size:8px;
  color:#53677b;
}


/* Existing Rotation panel */
#analysisRotationHost #rotationPanel{
  margin:0;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media(max-width:1000px){

  .analysis-tile-grid{
    grid-template-columns:1fr;
  }

  .analysis-toolbar-card,
  .mtf-toolbar{
    grid-template-columns:1fr 1fr;
  }

  .mtf-current-strip{
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }
}

@media(max-width:700px){

  .analysis-toolbar-card,
  .mtf-toolbar{
    grid-template-columns:1fr;
  }

  .analysis-toolbar-actions{
    justify-content:space-between;
  }

  .analysis-cache-state{
    align-items:flex-start;
  }

  .mtf-current-strip{
    grid-template-columns:1fr;
  }

  .mtf-chart-head{
    flex-direction:column;
  }

  #mtfChart{
    min-width:850px;
  }

  .mtf-chart-wrap{
    overflow-x:auto;
  }
}

/* ===== CUSTOM MTF DATE RANGE ===== */

.mtf-custom-range{
  display:grid;
  grid-template-columns:repeat(2,minmax(120px,1fr));
  gap:8px;
  align-items:end;
}

.mtf-custom-range.hidden{
  display:none;
}

.mtf-custom-range input{
  height:38px;
  width:100%;
  box-sizing:border-box;

  border:1px solid #d9e2ea;
  border-radius:8px;
  background:#fff;

  padding:0 10px;

  font-family:inherit;
  font-size:10px;
  color:#2f4155;
}

.analysis-range-toggle button{
  padding-left:10px;
  padding-right:10px;
}

@media(max-width:1000px){
  .mtf-custom-range{
    grid-column:1 / -1;
  }
}

@media(max-width:700px){
  .mtf-custom-range{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   MTF ACTIONABLE SIGNALS
   ========================================================= */

.mtf-signal-marker{
  pointer-events:none;
}

.mtf-signal-buy{
  fill:#26816a;
  stroke:#fff;
  stroke-width:1;
  vector-effect:non-scaling-stroke;
}

.mtf-signal-sell{
  fill:#b84f59;
  stroke:#fff;
  stroke-width:1;
  vector-effect:non-scaling-stroke;
}

.mtf-signal-label{
  fill:#56697c;
  font-size:7px;
  font-weight:900;
  letter-spacing:.02em;
}


/* Tooltip */

.mtf-tooltip-state{
  padding:7px 0;
  border-top:1px solid #edf1f5;
}

.mtf-tooltip-state:first-of-type{
  border-top:0;
}

.mtf-tooltip-state-head{
  display:grid;
  grid-template-columns:52px 56px 1fr;
  align-items:center;
  gap:6px;
  margin-bottom:5px;
}

.mtf-tooltip-state-head>span{
  font-size:8px;
  color:#8492a3;
}

.mtf-tooltip-state-head>b{
  font-size:8px;
}

.mtf-tooltip-state-head>b.up{
  color:#23755e;
}

.mtf-tooltip-state-head>b.down{
  color:#ad4852;
}

.mtf-tooltip-state-head>b.neutral{
  color:#64748b;
}

.mtf-tooltip-signal{
  width:max-content;
  padding:2px 5px;
  border-radius:999px;

  font-size:7px;
  font-weight:900;
  letter-spacing:.04em;
}

.mtf-tooltip-signal.buy{
  background:#e4f4ee;
  color:#23755e;
}

.mtf-tooltip-signal.sell{
  background:#fbeaed;
  color:#ad4852;
}

.mtf-tooltip-detail{
  display:grid;
  grid-template-columns:58px 1fr;
  gap:6px;

  margin-top:3px;
}

.mtf-tooltip-detail span{
  font-size:7px;
  color:#98a4b2;
}

.mtf-tooltip-detail b{
  font-size:7px;
  font-weight:700;
  color:#53677b;
}


/* ===== ROTATION CONFIRMATION CLARITY ===== */

.mtf-confirmed-now,
.mtf-carried-state{
  width:max-content;
  padding:2px 5px;
  border-radius:999px;
  font-size:6px;
  font-weight:900;
  letter-spacing:.05em;
}

.mtf-confirmed-now{
  background:#eef7f5;
  color:#287b71;
}

.mtf-carried-state{
  background:#f1f4f7;
  color:#758496;
}

.mtf-tooltip-detail{
  grid-template-columns:78px 1fr;
}


/* Multi-Timeframe view: Price + Weekly + Monthly */
.mtf-current-strip{
  grid-template-columns:
    1.5fr 1fr 1fr 1fr;
}


/* Weekly + Monthly + Quarterly */
.mtf-current-strip{
  grid-template-columns:
    1.4fr 1fr 1fr 1fr 1fr;
}


/* =========================================================
   COMPACT MULTI-TIMEFRAME TOOLTIP
   ========================================================= */

.mtf-chart-tooltip{
  width:260px !important;
  max-width:260px !important;
  padding:10px 12px !important;
  pointer-events:none;
}

.mtf-tooltip-row{
  display:grid;
  grid-template-columns:58px 44px 1fr;
  align-items:center;
  gap:6px;

  padding:6px 0;
  border-top:1px solid #edf1f5;
}

.mtf-tooltip-row:first-of-type{
  border-top:0;
}

.mtf-tooltip-tf{
  font-size:8px;
  font-weight:700;
  color:#7c8b9c;
}

.mtf-tooltip-row>b{
  font-size:8px;
  font-weight:900;
}

.mtf-tooltip-row>b.up{
  color:#21806a;
}

.mtf-tooltip-row>b.down{
  color:#bc5059;
}

.mtf-tooltip-row>b.neutral{
  color:#8190a0;
}

.mtf-tooltip-move{
  font-size:8px;
  font-weight:700;
  color:#52667b;
  white-space:nowrap;
}

.mtf-tooltip-change{
  grid-column:1 / -1;

  margin-top:2px;
  padding:4px 6px;

  border-radius:5px;

  background:#f5f8fa;
  color:#718196;

  font-size:7px;
  line-height:1.35;
}


/* Date-only hover label */

.mtf-chart-tooltip{
  width:auto !important;
  max-width:none !important;
  padding:0 !important;
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  pointer-events:none;
}

.mtf-hover-date{
  padding:4px 7px;
  border-radius:5px;

  background:#23384f;
  color:#fff;

  font-size:8px;
  font-weight:800;
  white-space:nowrap;
  letter-spacing:.01em;
}


.mtf-hover-date{
  padding:3px 6px;
  border-radius:4px;

  background:#eef3f7;
  color:#516477;

  border:1px solid #d9e1e8;

  font-size:8px;
  font-weight:800;
  white-space:nowrap;
}



/* =========================================================
   Multi-Timeframe Rotation
   Weekly / Monthly / Quarterly / 6 Months / Yearly
   ========================================================= */

.mtf-current-strip{
  grid-template-columns:
    minmax(150px,1.25fr)
    minmax(125px,1fr)
    repeat(5,minmax(110px,1fr));
}

#mtfChart{
  height:522px;
}

.mtf-chart-wrap{
  min-height:522px;
}

@media(max-width:1100px){

  .mtf-current-strip{
    grid-template-columns:
      repeat(4,minmax(0,1fr));
  }
}

@media(max-width:760px){

  .mtf-current-strip{
    grid-template-columns:
      repeat(2,minmax(0,1fr));
  }
}

/* MTF vNext: Daily + Weekly + Monthly + Quarterly + 6M + Yearly */

.mtf-current-strip{
  grid-template-columns:
    minmax(145px,1.2fr)
    minmax(115px,.9fr)
    repeat(6,minmax(92px,.85fr));
}

#mtfChart{
  height:568px;
}

.mtf-chart-wrap{
  min-height:568px;
}
