.market-discovery-root{
  margin-top:18px;
}

.md-shell{
  border:1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at top left, rgba(34,197,94,.13), transparent 30%),
    radial-gradient(circle at top right, rgba(59,130,246,.13), transparent 30%),
    rgba(8,13,24,.72);
  border-radius:24px;
  padding:18px;
  box-shadow:0 18px 50px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04);
}

.md-hero{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}

.md-kicker{
  font-size:11px;
  letter-spacing:.16em;
  font-weight:900;
  color:#60a5fa;
  margin-bottom:6px;
}

.md-hero h2{
  margin:0;
  font-size:26px;
  line-height:1.1;
  letter-spacing:-.04em;
  color:#f8fafc;
}

.md-hero p{
  margin:8px 0 0;
  color:#94a3b8;
  font-size:13px;
  max-width:680px;
}

.md-pulse{
  white-space:nowrap;
  border:1px solid rgba(34,197,94,.30);
  background:rgba(34,197,94,.10);
  color:#86efac;
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:800;
}

.md-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}

.md-card{
  position:relative;
  border:1px solid rgba(255,255,255,.10);
  border-left-width:3px;
  background:
    radial-gradient(circle at 0% 0%, rgba(96,165,250,.055), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.058), rgba(255,255,255,.024));
  border-radius:18px;
  overflow:hidden;
  transition:transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.md-card:hover{
  transform:translateY(-3px);
  border-color:rgba(96,165,250,.36);
  box-shadow:0 18px 42px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.045);
}

.md-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 14px 10px;
}

.md-title{
  color:#f8fafc;
  font-weight:900;
  font-size:15px;
}

.md-sub{
  color:#94a3b8;
  font-size:12px;
  margin-top:3px;
}

.md-dot{
  width:9px;
  height:9px;
  border-radius:999px;
  background:#22c55e;
  box-shadow:0 0 20px rgba(34,197,94,.75);
}

.md-table{
  padding:0 10px 10px;
}

.md-row{
  display:grid;
  grid-template-columns:minmax(130px,1.6fr) 78px 68px minmax(120px,1fr) 100px;
  gap:10px;
  align-items:center;
  padding:10px 8px;
  border-top:1px solid rgba(255,255,255,.07);
}

.md-row:hover{
  background:
    linear-gradient(90deg, rgba(255,255,255,.060), rgba(255,255,255,.030));
  border-radius:12px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.050),
    inset 0 -1px 0 rgba(255,255,255,.035);
}

.md-row:hover .md-symbol{
  color:#ffffff;
  text-shadow:0 0 10px rgba(255,255,255,.12);
}

.md-row:hover .md-open{
  border-color:rgba(96,165,250,.56);
  background:rgba(37,99,235,.24);
  box-shadow:0 0 16px rgba(37,99,235,.16);
}

.md-symbol{
  color:#f8fafc;
  font-size:14px;
  font-weight:950;
}

.md-name{
  color:#94a3b8;
  font-size:12px;
  margin-top:2px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.md-price{
  color:#e5e7eb;
  font-size:13px;
  font-weight:800;
}

.md-change{
  font-size:13px;
  font-weight:900;
}

.md-change.pos{ color:#22e884; text-shadow:0 0 8px rgba(34,232,132,.25); }
.md-change.neg{ color:#ff4d4d; text-shadow:0 0 8px rgba(255,77,77,.25); }

.md-tags{
  display:flex;
  gap:5px;
  flex-wrap:wrap;
}

.md-tag{
  border:1px solid rgba(148,163,184,.18);
  background:rgba(15,23,42,.58);
  color:#cbd5e1;
  border-radius:999px;
  padding:3px 7px;
  font-size:10px;
  font-weight:800;
}

.md-open{
  border:1px solid rgba(96,165,250,.32);
  background:rgba(37,99,235,.14);
  color:#bfdbfe;
  border-radius:10px;
  padding:7px 9px;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
}

.md-open:hover{
  background:rgba(37,99,235,.24);
  color:#eff6ff;
}

@media (max-width: 980px){
  .md-grid{
    grid-template-columns:1fr;
  }
  .md-row{
    grid-template-columns:1.5fr 70px 62px;
  }
  .md-tags,
  .md-open{
    display:none;
  }
}

@media (max-width: 640px){
  .md-shell{
    padding:14px;
    border-radius:20px;
  }
  .md-hero{
    display:block;
  }
  .md-pulse{
    display:inline-block;
    margin-top:10px;
  }
  .md-hero h2{
    font-size:22px;
  }
}

/* Discovery sparklines */
.md-row{
  grid-template-columns:minmax(130px,1.35fr) 108px 78px 68px minmax(120px,1fr) 100px;
}

.md-spark-wrap{
  width:100px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:.95;
}

.md-spark{
  width:96px;
  height:28px;
  color:#22e884;
  filter:
    drop-shadow(0 0 4px rgba(22,224,162,.30))
    drop-shadow(0 0 8px rgba(22,224,162,.12));
}

.md-spark.neg{
  color:#ff4d4d;
  filter:
    drop-shadow(0 0 4px rgba(255,88,105,.28))
    drop-shadow(0 0 8px rgba(255,88,105,.10));
}

.md-spark.empty{
  width:88px;
  height:2px;
  border-radius:999px;
  background:rgba(148,163,184,.18);
}

@media (max-width: 980px){
  .md-row{
    grid-template-columns:1.5fr 88px 70px 62px;
  }
  .md-spark-wrap{
    width:86px;
  }
  .md-spark{
    width:82px;
  }
}

.mkt-title-regime-row{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}

.market-regime-inline #market-regime-bar,
.market-regime-inline{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

/* Discovery compact action */
.md-open{
  min-width:46px;
  padding:6px 8px;
  font-size:0;
}

.md-open::after{
  content:"→";
  font-size:14px;
  font-weight:950;
}

.md-row{
  grid-template-columns:minmax(130px,1.35fr) 108px 78px 68px minmax(120px,1fr) 52px;
}

/* Discovery phase-1 polish */
.market-discovery-root{
  margin-bottom:32px;
}

.md-card:nth-child(1){
  border-left-color:#22c55e;
  background:
    radial-gradient(circle at 0% 0%, rgba(34,197,94,.105), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.058), rgba(255,255,255,.024));
}

.md-card:nth-child(2){
  border-left-color:#fb7185;
  background:
    radial-gradient(circle at 0% 0%, rgba(251,113,133,.105), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.058), rgba(255,255,255,.024));
}

.md-card:nth-child(3){
  border-left-color:#60a5fa;
  background:
    radial-gradient(circle at 0% 0%, rgba(96,165,250,.105), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.058), rgba(255,255,255,.024));
}

.md-card:nth-child(4){
  border-left-color:#38bdf8;
  background:
    radial-gradient(circle at 0% 0%, rgba(56,189,248,.105), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.058), rgba(255,255,255,.024));
}

.md-card:nth-child(5){
  border-left-color:#facc15;
  background:
    radial-gradient(circle at 0% 0%, rgba(250,204,21,.105), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.058), rgba(255,255,255,.024));
}

.md-card:nth-child(6){
  border-left-color:#a78bfa;
  background:
    radial-gradient(circle at 0% 0%, rgba(167,139,250,.105), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.058), rgba(255,255,255,.024));
}

.md-card:nth-child(1) .md-dot{
  background:#22c55e;
  box-shadow:0 0 18px rgba(34,197,94,.65);
}

.md-card:nth-child(2) .md-dot{
  background:#fb7185;
  box-shadow:0 0 18px rgba(251,113,133,.55);
}

.md-card:nth-child(3) .md-dot,
.md-card:nth-child(4) .md-dot{
  background:#60a5fa;
  box-shadow:0 0 18px rgba(96,165,250,.55);
}

.md-card:nth-child(5) .md-dot{
  background:#facc15;
  box-shadow:0 0 18px rgba(250,204,21,.50);
}

.md-card:nth-child(6) .md-dot{
  background:#a78bfa;
  box-shadow:0 0 18px rgba(167,139,250,.55);
}

.md-tag{
  opacity:.88;
}

.md-tag:has(+ .md-tag){
  opacity:.82;
}

.md-tag{
  max-width:110px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.md-row:hover .md-tag{
  opacity:1;
}

@media (max-width: 760px){
  .md-shell{
    margin-bottom:22px;
  }

  .md-card{
    border-radius:16px;
  }

  .md-table{
    padding-left:6px;
    padding-right:6px;
  }
}

/* Mobile discovery open-chart arrow */
@media (max-width: 760px){
  .md-row{
    position:relative;
    padding-right:52px;
  }

  .md-open{
    position:absolute;
    right:8px;
    top:50%;
    transform:translateY(-50%);
    width:34px;
    min-width:34px;
    height:30px;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:3;
  }

  .md-tags{
    display:none;
  }

  .md-price,
  .md-change{
    white-space:nowrap;
  }
}

/* Mobile discovery cleanup */
@media (max-width: 760px){
  .md-row{
    grid-template-columns:1fr 86px 68px 56px;
    padding-right:42px;
  }

  .md-spark-wrap{
    margin-left:-10px;
    width:82px;
  }

  .md-open{
    width:30px;
    min-width:30px;
    height:28px;
    right:6px;
    font-size:0 !important;
  }

  .md-open::after{
    content:"→";
    font-size:15px;
    line-height:1;
  }
}


/* mobile company names */
@media (max-width:768px){

  .md-sub{
      max-width:120px;
      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;
      font-size:12px;
      line-height:1.2;
  }

}

/* Mobile row company-name clamp */
@media (max-width:768px){
  .md-main{
    min-width:0;
    max-width:115px;
  }

  .md-name{
    display:block;
    max-width:115px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .md-symbol{
    white-space:nowrap;
  }
}

/* Mobile row company-name wider override */
@media (max-width:768px){
  .md-main{
    max-width:145px;
  }

  .md-name{
    max-width:145px;
  }
}

/* Mobile discovery spacing v2 */
@media (max-width:768px){

  .md-main{
      max-width:160px !important;
      min-width:0;
  }

  .md-name{
      max-width:160px !important;
  }

  /* sparkline biraz sağa */
  .md-spark{
      margin-left:12px;
  }

}

/* Mobile company names typography */
@media (max-width:768px){

  .md-main{
      max-width:175px !important;
  }

  .md-name{
      max-width:175px !important;

      font-size:11px;
      line-height:1.05;

      white-space:nowrap;
      overflow:hidden;
      text-overflow:ellipsis;

      opacity:.82;
      letter-spacing:-0.15px;
  }

  .md-spark{
      margin-left:14px;
  }

}

/* Mobile card subtitles should remain readable */
@media (max-width:768px){
  .md-card-subtitle,
  .md-card-sub,
  .md-desc{
    max-width:none !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    display:block !important;
    line-height:1.25;
  }
}

/* Card description should not be clamped like row company names */
@media (max-width:768px){
  .md-card-desc{
    max-width:none !important;
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    display:block !important;
    line-height:1.25 !important;
  }
}
