/* V344 — clean-price workstation interaction and readability corrections.
   Scope: /clean/ and /clean/item/ only. Server/API/chart data logic is unchanged. */

/* Detail page must use the browser page scroll. The common stylesheet fixes html/body
   to overflow:hidden for search pages, so restore a normal document flow explicitly. */
html.clean-detail-document-v344,
html.clean-detail-document-v344 body.clean-detail-body-v344 {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto !important;
}
html.clean-detail-document-v344 body.clean-detail-body-v344 {
  min-height: 100vh !important;
  min-height: 100dvh !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(216,255,31,.30) #080d14 !important;
}
html.clean-detail-document-v344 body.clean-detail-body-v344::-webkit-scrollbar {
  display: block !important;
  width: 10px !important;
  height: 10px !important;
}
html.clean-detail-document-v344 body.clean-detail-body-v344::-webkit-scrollbar-track {
  background: #080d14 !important;
}
html.clean-detail-document-v344 body.clean-detail-body-v344::-webkit-scrollbar-thumb {
  border: 2px solid #080d14;
  border-radius: 999px;
  background: rgba(216,255,31,.24) !important;
}

/* Let the right cards participate in the page height instead of trapping the wheel
   in a second full-height scroll container. */
html.clean-detail-document-v344 .clean-detail-right-v343 {
  position: relative !important;
  top: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
html.clean-detail-document-v344 .clean-detail-workstation-v343 {
  padding-bottom: 78px !important;
}

/* The right information column is meant to be read at a glance. */
html.clean-detail-document-v344 .clean-side-card-v343 > header {
  min-height: 58px;
  padding: 11px 13px 9px;
}
html.clean-detail-document-v344 .clean-side-card-v343 > header span {
  font-size: 9.5px;
}
html.clean-detail-document-v344 .clean-side-card-v343 > header h2 {
  font-size: 16px;
}
html.clean-detail-document-v344 .clean-side-card-v343 > header button {
  min-height: 29px;
  font-size: 10px;
}
html.clean-detail-document-v344 .clean-watchlist-v343 {
  max-height: 430px;
  padding: 7px;
}
html.clean-detail-document-v344 .clean-watchlist-item-v343 {
  min-height: 64px;
  padding: 7px 8px;
  grid-template-columns: 40px minmax(0,1fr) auto;
  gap: 8px;
}
html.clean-detail-document-v344 .clean-watchlist-icon-v343 {
  width: 38px;
  height: 38px;
}
html.clean-detail-document-v344 .clean-watchlist-icon-v343 img {
  max-width: 36px;
  max-height: 36px;
}
html.clean-detail-document-v344 .clean-watchlist-copy-v343 strong {
  font-size: 12.5px;
  line-height: 1.35;
}
html.clean-detail-document-v344 .clean-watchlist-copy-v343 small {
  margin-top: 3px;
  font-size: 10px;
}
html.clean-detail-document-v344 .clean-watchlist-quote-v343 {
  min-width: 74px;
  gap: 3px;
}
html.clean-detail-document-v344 .clean-watchlist-quote-v343 b {
  font-size: 11.5px;
}
html.clean-detail-document-v344 .clean-watchlist-quote-v343 em {
  font-size: 10px;
}
html.clean-detail-document-v344 .clean-watchlist-v343 > p,
html.clean-detail-document-v344 .clean-major-stats-v343 > p,
html.clean-detail-document-v344 .clean-period-changes-v343 > p {
  font-size: 11px;
}

html.clean-detail-document-v344 .clean-major-stats-v343 {
  padding: 9px;
  gap: 7px;
}
html.clean-detail-document-v344 .clean-major-stat-v343 {
  min-height: 76px;
  padding: 10px 9px;
}
html.clean-detail-document-v344 .clean-major-stat-v343 span {
  font-size: 10px;
}
html.clean-detail-document-v344 .clean-major-stat-v343 b {
  font-size: 13px;
}
html.clean-detail-document-v344 .clean-major-stat-v343 small {
  margin-top: 3px;
  font-size: 9px;
  line-height: 1.35;
}
html.clean-detail-document-v344 .clean-period-changes-v343 {
  padding: 7px 11px 11px;
}
html.clean-detail-document-v344 .clean-period-change-v343 {
  min-height: 48px;
  grid-template-columns: 52px minmax(0,1fr) auto;
  gap: 8px;
}
html.clean-detail-document-v344 .clean-period-change-v343 > span {
  font-size: 11px;
}
html.clean-detail-document-v344 .clean-period-change-v343 > small {
  font-size: 9.5px;
}
html.clean-detail-document-v344 .clean-period-change-v343 > b {
  font-size: 13px;
}

@media (min-width: 1181px) {
  html.clean-detail-document-v344 .clean-detail-workstation-v343 {
    grid-template-columns: 58px minmax(0,1fr) minmax(318px,350px);
  }
}
@media (min-width: 981px) and (max-width: 1180px) {
  html.clean-detail-document-v344 .clean-detail-workstation-v343 {
    grid-template-columns: 54px minmax(0,1fr) minmax(286px,316px);
  }
  html.clean-detail-document-v344 .clean-watchlist-item-v343 {
    grid-template-columns: 36px minmax(0,1fr);
  }
  html.clean-detail-document-v344 .clean-watchlist-quote-v343 {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Master terminal: category buttons wrap instead of being clipped. */
html.clean-terminal-document-v344 .clean-terminal-group-tabs-v341 {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0,1fr));
  align-items: stretch !important;
  gap: 5px !important;
  margin-top: 8px !important;
  padding-bottom: 0 !important;
  overflow: visible !important;
  overscroll-behavior: auto !important;
}
html.clean-terminal-document-v344 .clean-terminal-group-tabs-v341 button {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 0 4px;
  font-size: clamp(9.5px, .66vw, 10.5px);
}

/* Give the first screen a taller, denser item list without shrinking text. */
html.clean-terminal-document-v344 .clean-terminal-sidebar-head-v341 {
  padding: 9px 10px 7px;
}
html.clean-terminal-document-v344 .clean-terminal-list-hint-v341 {
  margin-top: 5px;
  font-size: 8.8px;
}
html.clean-terminal-document-v344 .clean-groups.clean-terminal-list-v341 {
  padding-top: 4px;
}
html.clean-terminal-document-v344 .clean-terminal-list-v341 .clean-group-card.clean-terminal-row-v341 {
  height: 64px !important;
  min-height: 64px !important;
}
@media (min-width: 901px) {
  html.clean-terminal-document-v344 .clean-terminal-sidebar-v341 {
    top: 66px !important;
    height: calc(100dvh - 34px) !important;
    min-height: 740px !important;
    max-height: 1040px !important;
  }
}

/* A narrow wheel-scroll gutter remains outside the interactive chart. */
html.clean-terminal-document-v344 .clean-terminal-chart-scroll-v341 {
  position: relative;
  padding-right: clamp(30px, 2vw, 40px) !important;
}

@media (max-width: 900px) {
  html.clean-terminal-document-v344 .clean-terminal-group-tabs-v341 {
    grid-template-columns: repeat(5, minmax(0,1fr));
  }
  html.clean-terminal-document-v344 .clean-terminal-sidebar-v341 {
    height: min(62vh, 610px) !important;
    min-height: 430px !important;
  }
  html.clean-terminal-document-v344 .clean-terminal-chart-scroll-v341 {
    padding-right: 10px !important;
  }
}
@media (max-width: 620px) {
  html.clean-terminal-document-v344 .clean-terminal-group-tabs-v341 {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
  html.clean-terminal-document-v344 .clean-terminal-list-v341 .clean-group-card.clean-terminal-row-v341 {
    height: 68px !important;
    min-height: 68px !important;
  }
  html.clean-detail-document-v344 .clean-watchlist-copy-v343 strong { font-size: 11.5px; }
  html.clean-detail-document-v344 .clean-major-stat-v343 b { font-size: 12px; }
}
