/* v41: liquid settle, dark-mode contrast, question workspace, and bulk selection stability. */

/* --------------------------------------------------------------------------
   Liquid selectors: one visible moving glass surface, no duplicate fallback.
   -------------------------------------------------------------------------- */
.nav-scroll.v41-skin-ready .nav-chip.is-active,
.collection-tabs.v41-skin-ready .collection-tab.is-active,
.theme-choice.v41-skin-ready button.is-active,
.v32-question-segment.v41-skin-ready button.is-active{
  background:transparent!important;
  background-image:none!important;
  box-shadow:none!important;
  color:#fff!important;
}

.nav-scroll:not(.v41-skin-ready) .nav-chip.is-active,
.collection-tabs:not(.v41-skin-ready) .collection-tab.is-active,
.theme-choice:not(.v41-skin-ready) button.is-active,
.v32-question-segment:not(.v41-skin-ready) button.is-active{
  background:linear-gradient(180deg,rgba(94,149,239,.90),rgba(49,103,215,.90))!important;
  box-shadow:0 5px 13px rgba(39,86,181,.18),inset 0 1px 0 rgba(255,255,255,.28)!important;
  color:#fff!important;
}

.v37-liquid-skin{
  background:
    linear-gradient(180deg,rgba(255,255,255,.12) 0%,rgba(255,255,255,0) 30%),
    linear-gradient(180deg,rgba(95,151,244,.88) 0%,rgba(61,119,226,.88) 54%,rgba(44,93,200,.90) 100%)!important;
  box-shadow:
    0 5px 13px rgba(37,83,174,.18),
    inset 0 1px 0 rgba(255,255,255,.27),
    inset 0 -1px 0 rgba(19,57,139,.13)!important;
}
html[data-theme="dark"] .v37-liquid-skin{
  background:
    linear-gradient(180deg,rgba(255,255,255,.11) 0%,rgba(255,255,255,0) 30%),
    linear-gradient(180deg,rgba(89,148,245,.82) 0%,rgba(55,112,221,.82) 56%,rgba(41,87,190,.84) 100%)!important;
  box-shadow:
    0 5px 14px rgba(24,62,139,.24),
    inset 0 1px 0 rgba(255,255,255,.24),
    inset 0 -1px 0 rgba(5,30,86,.18)!important;
}

.nav-scroll>.nav-v33-indicator~.nav-v33-indicator,
.collection-tabs>.collection-v33-indicator~.collection-v33-indicator,
.theme-choice>.theme-v34-indicator~.theme-v34-indicator,
.v32-question-segment>.v36-question-indicator~.v36-question-indicator{
  display:none!important;
}

/* Dark top rail must still read as translucent glass instead of neutral grey. */
html[data-theme="dark"] .nav-scroll{
  background:
    linear-gradient(90deg,
      rgba(74,134,236,.15) 0%,
      rgba(74,134,236,.085) var(--v32-progress,0%),
      transparent var(--v32-progress,0%),
      transparent 100%) padding-box,
    linear-gradient(180deg,rgba(59,71,91,.54),rgba(22,27,35,.56)) padding-box,
    linear-gradient(125deg,rgba(255,255,255,.20),rgba(255,255,255,.055) 30%,rgba(92,135,196,.065) 56%,rgba(255,255,255,.13) 78%,rgba(255,255,255,.035)) border-box!important;
  -webkit-backdrop-filter:blur(24px) saturate(132%)!important;
  backdrop-filter:blur(24px) saturate(132%)!important;
}
html[data-theme="dark"] .nav-chip{
  background:transparent!important;
  box-shadow:none!important;
}

/* --------------------------------------------------------------------------
   Dark cards: stronger hierarchy and correctly centered number cells.
   -------------------------------------------------------------------------- */
html[data-theme="dark"] .flow-row{
  align-items:center!important;
  background:#18202a!important;
  border:1px solid rgba(255,255,255,.075)!important;
}
html[data-theme="dark"] .flow-row>i{
  display:grid!important;
  place-items:center!important;
  align-self:center!important;
  flex:0 0 46px!important;
  width:46px!important;
  height:46px!important;
  min-width:46px!important;
  min-height:46px!important;
  margin:0!important;
  padding:0!important;
  line-height:1!important;
  border-radius:14px!important;
  background:linear-gradient(180deg,#253247,#182338)!important;
  border:1px solid rgba(109,156,255,.24)!important;
  color:#a8c3ff!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08)!important;
  font-style:normal!important;
}
html[data-theme="dark"] .market-card__prices{
  gap:10px!important;
}
html[data-theme="dark"] .market-card__price{
  background:#121923!important;
  border:1px solid rgba(255,255,255,.085)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;
}
html[data-theme="dark"] .market-card__price span{color:#9fa9b7!important}
html[data-theme="dark"] .market-card__price b{color:#f4f6fa!important}

/* --------------------------------------------------------------------------
   Question composer: mobile proportions and spacing.
   -------------------------------------------------------------------------- */
#askWritePanel{
  width:100%!important;
  gap:0!important;
  min-width:0!important;
}
#askWritePanel .ask-sheet__quote{
  margin:0 0 12px!important;
  padding:13px 15px!important;
  min-height:54px!important;
  border-radius:16px!important;
  font-size:14px!important;
  line-height:1.5!important;
}
#askWritePanel .ask-sheet__label{
  margin:3px 0 8px!important;
  font-size:13px!important;
}
#askInput{
  width:100%!important;
  min-height:132px!important;
  max-height:240px!important;
  padding:14px 15px!important;
  border-radius:16px!important;
  font-size:16px!important;
  line-height:1.55!important;
  box-sizing:border-box!important;
}
html[data-theme="dark"] #askInput{
  background:#171c24!important;
  color:#f2f4f7!important;
  border-color:rgba(255,255,255,.10)!important;
}
#askWritePanel .ask-actions{
  margin-top:10px!important;
  gap:10px!important;
}
#askWritePanel .ask-actions button{
  min-height:48px!important;
  height:48px!important;
}
#askWritePanel .v34-question-actions{margin-top:10px!important}
#askWritePanel .v34-gpt-note,
#askWritePanel .ask-note{
  margin-top:10px!important;
  font-size:12px!important;
  line-height:1.5!important;
}

/* --------------------------------------------------------------------------
   Collection tools: search + secondary question selector share one grid row
   owner. This prevents the extra selector from overlapping the first card.
   -------------------------------------------------------------------------- */
#collectionTools{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:10px!important;
  padding-bottom:12px!important;
}
#collectionTools .collection-search{
  order:1!important;
  margin:0!important;
}
#collectionFilters{
  order:2!important;
  margin:0!important;
}
#v40QuestionControls{
  order:2!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
  position:relative!important;
  z-index:3!important;
}
#v40QuestionControls[hidden]{display:none!important}
.v40-question-segment{
  position:relative!important;
  top:auto!important;
  z-index:1!important;
  width:100%!important;
  min-height:56px!important;
  height:56px!important;
  padding:5px!important;
  gap:5px!important;
  overflow:hidden!important;
  border-radius:999px!important;
}
.v40-question-segment button{
  position:relative!important;
  z-index:3!important;
  height:46px!important;
  min-height:46px!important;
  padding:0 14px!important;
  border-radius:999px!important;
  background:transparent!important;
  box-shadow:none!important;
}
.v40-question-segment .v36-question-indicator{
  top:0!important;
  left:0!important;
}

/* --------------------------------------------------------------------------
   Bulk selection: selection is an explicit column, remove buttons disappear
   while the bottom bulk action bar owns deletion. Rerenders keep card height.
   -------------------------------------------------------------------------- */
.collection-selectbox{display:none!important}
.collection-body.is-bulk-selecting .collection-selectbox{
  display:grid!important;
  place-items:center!important;
  position:static!important;
  inset:auto!important;
  transform:none!important;
  width:30px!important;
  height:30px!important;
  min-width:30px!important;
  min-height:30px!important;
  margin:0!important;
  align-self:center!important;
  justify-self:center!important;
}
.collection-body.is-bulk-selecting .collection-item{
  display:grid!important;
  grid-template-columns:32px 68px minmax(0,1fr)!important;
  align-items:center!important;
  column-gap:10px!important;
  min-height:92px!important;
  padding:10px 12px!important;
}
.collection-body.is-bulk-selecting .collection-item--question{
  grid-template-columns:32px 46px minmax(0,1fr)!important;
  min-height:88px!important;
}
.collection-body.is-bulk-selecting .collection-item .collection-item__remove{
  display:none!important;
}
.collection-body.is-bulk-selecting .collection-item:not(.collection-item--question) .collection-item__thumb{
  grid-column:2!important;
  grid-row:1!important;
  width:68px!important;
  height:68px!important;
  min-width:68px!important;
  margin:0!important;
  align-self:center!important;
  justify-self:stretch!important;
  overflow:hidden!important;
}
.collection-body.is-bulk-selecting .collection-item:not(.collection-item--question) .collection-item__main{
  grid-column:3!important;
  grid-row:1!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  align-self:center!important;
}
.collection-body.is-bulk-selecting .collection-item--question .collection-item__question-icon{
  grid-column:2!important;
  grid-row:1!important;
  width:46px!important;
  height:46px!important;
  margin:0!important;
  align-self:center!important;
  justify-self:center!important;
}
.collection-body.is-bulk-selecting .collection-item--question .collection-item__main{
  grid-column:3!important;
  grid-row:1!important;
  width:100%!important;
  min-width:0!important;
  margin:0!important;
  align-self:center!important;
}
.collection-body.is-bulk-selecting .collection-item__main strong,
.collection-body.is-bulk-selecting .collection-item__main p,
.collection-body.is-bulk-selecting .collection-item__main small{
  max-width:100%!important;
  min-width:0!important;
}

/* Bottom bulk controls should never cover an enlarged card caused by a rerender. */
.collection-bulkbar{
  z-index:8!important;
}

@media(max-width:430px){
  html[data-theme="dark"] .flow-row>i{
    flex-basis:44px!important;
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
  }
  #collectionTools{gap:9px!important}
  .v40-question-segment{height:54px!important;min-height:54px!important}
  .v40-question-segment button{height:44px!important;min-height:44px!important}
  .collection-body.is-bulk-selecting .collection-item{
    grid-template-columns:30px 64px minmax(0,1fr)!important;
    column-gap:8px!important;
    padding-inline:10px!important;
  }
  .collection-body.is-bulk-selecting .collection-item--question{
    grid-template-columns:30px 44px minmax(0,1fr)!important;
  }
  .collection-body.is-bulk-selecting .collection-item:not(.collection-item--question) .collection-item__thumb{
    width:64px!important;
    height:64px!important;
    min-width:64px!important;
  }
  .collection-body.is-bulk-selecting .collection-item--question .collection-item__question-icon{
    width:44px!important;
    height:44px!important;
  }
}
