/* RF-AVALON Market V61.0.113 FIX19
   Sidebar consistency + split trade summary + reliable character count presentation. */

/* One visual language for every right-column card and its category/header strip. */
.market-sidebar > .side-card{
  border:1px solid rgba(80,94,124,.40)!important;
  border-left-width:1px!important;
  border-radius:8px!important;
  overflow:hidden!important;
  background:linear-gradient(180deg,rgba(35,42,61,.98),rgba(31,38,55,.98))!important;
  box-shadow:0 10px 24px rgba(5,9,17,.14)!important;
}
.market-sidebar > .side-card > .side-title,
.market-sidebar > .side-card > .gradient-title,
.market-sidebar > .market-trade-summary-card > .market-trade-summary-title{
  position:relative;
  display:flex!important;
  align-items:center!important;
  gap:9px!important;
  min-height:44px!important;
  padding:0 13px!important;
  border:0!important;
  border-bottom:1px solid rgba(81,95,126,.38)!important;
  background:
    linear-gradient(90deg,rgba(255,165,0,.075),transparent 42%),
    linear-gradient(180deg,rgba(39,47,67,.98),rgba(33,40,58,.98))!important;
  color:#f2f5fb!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025)!important;
}
.market-sidebar > .side-card > .side-title::before,
.market-sidebar > .side-card > .gradient-title::before,
.market-sidebar > .market-trade-summary-card > .market-trade-summary-title::before{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  bottom:10px;
  width:2px;
  border-radius:0 2px 2px 0;
  background:linear-gradient(180deg,#ffb11b,#e77b13);
  box-shadow:0 0 8px rgba(255,160,20,.18);
}
.market-sidebar > .side-card > .side-title h2,
.market-sidebar > .side-card > .gradient-title h2,
.market-sidebar > .market-trade-summary-card > .market-trade-summary-title h2{
  margin:0!important;
  color:#eef2fa!important;
  font-size:12px!important;
  font-weight:800!important;
  letter-spacing:.02em!important;
  text-transform:uppercase!important;
}
.market-sidebar > .side-card > .side-title .side-icon,
.market-sidebar > .side-card > .gradient-title > span,
.market-sidebar > .market-trade-summary-card > .market-trade-summary-title .side-icon{
  color:#f0aa34!important;
  font-size:14px!important;
  line-height:1!important;
}

/* Both personal navigation actions use the same left-label/right-arrow construction. */
.side-card.account-card .secondary-action.market-sidebar-account-action,
.item-category-panel .market-history-side-button.market-sidebar-account-action{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  min-height:38px;
  padding:0 13px!important;
  text-align:left!important;
}
.side-card.account-card .secondary-action.market-sidebar-account-action span,
.item-category-panel .market-history-side-button.market-sidebar-account-action span{
  min-width:0;
  flex:1 1 auto;
  text-align:left!important;
  white-space:normal;
}
.side-card.account-card .secondary-action.market-sidebar-account-action b,
.item-category-panel .market-history-side-button.market-sidebar-account-action b{
  flex:0 0 auto;
  margin-left:auto;
  color:#ffb11b;
  font-size:15px;
  font-weight:800;
  line-height:1;
}

/* Split trade summary: character and item statistics never get mixed visually. */
.market-trade-summary-title{
  background:linear-gradient(90deg,rgba(255,165,0,.075),transparent 42%),linear-gradient(180deg,rgba(39,47,67,.98),rgba(33,40,58,.98))!important;
}
.market-trade-summary-body{
  padding:11px!important;
}
.market-trade-summary-groups{
  display:grid;
  gap:10px;
}
.market-trade-summary-section{
  min-width:0;
  overflow:hidden;
  border:1px solid rgba(84,99,131,.30);
  border-radius:7px;
  background:rgba(19,26,40,.35);
}
.market-trade-summary-section-title{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:34px;
  padding:0 10px;
  border-bottom:1px solid rgba(84,99,131,.24);
  background:linear-gradient(90deg,rgba(255,165,0,.045),transparent 75%);
}
.market-trade-summary-section-title span{
  color:#eaa234;
  font-size:11px;
}
.market-trade-summary-section-title strong{
  color:#dce4f2;
  font-size:10px;
  font-weight:800;
  letter-spacing:.045em;
  text-transform:uppercase;
}
.market-trade-summary-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  padding:8px;
}
.market-trade-summary-grid>div{
  min-width:0;
  min-height:50px;
  padding:8px 9px;
  border:1px solid rgba(91,106,137,.22);
  border-radius:5px;
  background:rgba(28,35,51,.48);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.014);
}
.market-trade-summary-grid small{
  display:block;
  overflow:hidden;
  color:#78869f;
  font-size:8px;
  font-weight:700;
  letter-spacing:.05em;
  text-overflow:ellipsis;
  text-transform:uppercase;
  white-space:nowrap;
}
.market-trade-summary-grid strong{
  display:block;
  margin-top:5px;
  color:#eef2fa;
  font-size:15px;
  font-weight:800;
  line-height:1.05;
  white-space:nowrap;
}
.market-trade-summary-grid .is-gp{
  border-color:rgba(219,151,35,.22);
  background:linear-gradient(180deg,rgba(58,45,23,.26),rgba(28,35,51,.48));
}
.market-trade-summary-grid .is-gp strong{color:#ffd070}
.market-trade-summary-grid strong i{
  color:#e6a72e;
  font-size:8px;
  font-style:normal;
  letter-spacing:.04em;
}
.market-trade-summary-note{
  margin:8px 2px 0!important;
  color:#65738a!important;
  font-size:8px!important;
  line-height:1.4!important;
}
.market-trade-summary-loading{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  min-height:82px;
  color:#8997ae;
}
.market-trade-summary-loading span{
  width:16px;
  height:16px;
  border:2px solid rgba(255,177,27,.18);
  border-top-color:#ffad16;
  border-radius:50%;
  animation:market-trade-summary-spin .8s linear infinite;
}
.market-trade-summary-loading b{font-size:10px;font-weight:650}
.market-trade-summary-error{
  display:flex;
  min-height:72px;
  flex-direction:column;
  justify-content:center;
  gap:4px;
  color:#8190a7;
  font-size:9px;
}
.market-trade-summary-error strong{color:#c6cfde;font-size:10px}
@keyframes market-trade-summary-spin{to{transform:rotate(360deg)}}

@media(max-width:900px) and (min-width:681px){
  /* When the sidebar becomes a two-column grid, each summary type stays readable. */
  .market-trade-summary-card{
    grid-column:1 / -1;
  }
  .market-trade-summary-groups{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:680px){
  .side-card.account-card .secondary-action.market-sidebar-account-action,
  .item-category-panel .market-history-side-button.market-sidebar-account-action{
    min-height:44px!important;
    padding:0 14px!important;
  }
  .market-sidebar > .side-card > .side-title,
  .market-sidebar > .side-card > .gradient-title,
  .market-sidebar > .market-trade-summary-card > .market-trade-summary-title{
    min-height:46px!important;
    padding:0 14px!important;
  }
  .market-trade-summary-body{padding:12px!important}
  .market-trade-summary-groups{gap:11px}
  .market-trade-summary-section-title{
    min-height:38px;
    padding:0 11px;
  }
  .market-trade-summary-section-title strong{font-size:11px}
  .market-trade-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding:9px;
  }
  .market-trade-summary-grid>div{
    min-height:60px;
    padding:10px 11px;
  }
  .market-trade-summary-grid small{font-size:9px}
  .market-trade-summary-grid strong{margin-top:6px;font-size:18px}
  .market-trade-summary-grid strong i{font-size:9px}
  .market-trade-summary-note{margin-top:10px!important;font-size:9px!important}
}
