.official-selection-home,
.official-selection-history,
.official-selection-toolbar {
  box-sizing: border-box;
}

.official-selection-home {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  border: 1px solid #d8a900;
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(145deg, #071b2d, #0c2735);
  color: #f6f8fa;
  box-shadow: 0 16px 34px rgba(5, 24, 38, 0.16);
}

.official-selection-home-heading,
.official-selection-page-header,
.official-selection-toolbar-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.official-selection-home-heading .eyebrow,
.official-selection-page-header .eyebrow,
.official-selection-toolbar-heading .eyebrow {
  margin: 0 0 3px;
  color: #d8a900;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.official-selection-home-heading h2,
.official-selection-page-header h2,
.official-selection-toolbar-heading h2 {
  margin: 0;
}

.official-selection-home-heading h2 {
  color: #fff;
  font-size: clamp(21px, 3vw, 28px);
}

.official-selection-home-heading h2 span {
  color: #9fb1c1;
  font-size: 14px;
}

.official-selection-home-date {
  margin: 5px 0 0;
  color: #d7e1e9;
  font-size: 13px;
  font-weight: 850;
}

.official-selection-home button,
.official-selection-history button,
.official-selection-toolbar button {
  cursor: pointer;
}

.official-selection-home-heading > button,
.official-selection-page-header > button,
.official-selection-toolbar-heading > button {
  min-height: 40px;
  border: 1px solid rgba(216, 169, 0, 0.5);
  border-radius: 9px;
  padding: 7px 12px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.official-selection-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.official-selection-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
  min-height: 76px;
  border: 1px solid;
  border-radius: 11px;
  padding: 11px 13px;
  text-align: left;
}

.official-selection-summary > span {
  grid-row: 1 / 3;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  font-size: 25px;
  font-weight: 950;
}

.official-selection-summary > strong {
  align-self: end;
  font-size: 18px;
}

.official-selection-summary > small {
  align-self: start;
  color: #ccd6df;
  font-size: 12px;
  font-weight: 800;
}

.official-selection-summary > b {
  grid-column: 3;
  grid-row: 1 / 3;
  font-size: 22px;
}

.official-selection-summary.bullish {
  border-color: #a83232;
  background: linear-gradient(135deg, rgba(159, 32, 43, 0.72), rgba(90, 20, 31, 0.72));
  color: #fff;
}

.official-selection-summary.bullish > span {
  color: #ff5b5b;
  background: rgba(255, 255, 255, 0.09);
}

.official-selection-summary.bearish {
  border-color: #008d66;
  background: linear-gradient(135deg, rgba(0, 105, 77, 0.72), rgba(0, 66, 52, 0.76));
  color: #fff;
}

.official-selection-summary.bearish > span {
  color: #37e0a3;
  background: rgba(255, 255, 255, 0.08);
}

.official-selection-full-link {
  min-height: 42px;
  border: 1px solid #d8a900;
  border-radius: 9px;
  padding: 8px 12px;
  background: transparent;
  color: #f2c94c;
  font-size: 15px;
  font-weight: 900;
}

.official-selection-history {
  display: grid;
  gap: 16px;
  min-height: 420px;
}

.official-selection-history.hidden,
.official-selection-toolbar.hidden {
  display: none;
}

.official-selection-page-header {
  border-bottom: 1px solid #dce4e8;
  padding-bottom: 14px;
  justify-content: flex-start;
}

.official-selection-page-header > button,
.official-selection-toolbar-heading > button {
  border-color: #cbd6dc;
  color: #253746;
  background: #fff;
}

.official-selection-page-header h2,
.official-selection-toolbar-heading h2 {
  color: #17212b;
  font-size: clamp(22px, 3vw, 30px);
}

.official-selection-history-picker {
  display: grid;
  grid-template-columns: auto minmax(180px, 300px);
  gap: 12px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  color: #41505f;
  font-weight: 900;
}

.official-selection-history-picker select {
  min-height: 44px;
  border: 1px solid #b9c8d0;
  border-radius: 9px;
  padding: 8px 12px;
  background: #fff;
  color: #17212b;
  font-weight: 850;
}

.official-selection-mock-note {
  margin: 0;
  color: #7a8792;
  font-size: 13px;
  font-weight: 750;
}

.official-selection-toolbar {
  display: grid;
  gap: 11px;
  margin-bottom: 14px;
  border-bottom: 1px solid #dce4e8;
  padding-bottom: 14px;
}

.official-selection-date-stack {
  display: grid;
  justify-items: end;
  margin-left: auto;
  color: #607080;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.official-selection-date-stack small {
  color: #7b8994;
  font-size: 11px;
}

.official-selection-side-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #cbd6dc;
  border-radius: 10px;
  background: #f4f7f9;
}

.official-selection-side-tabs button {
  min-height: 44px;
  border: 0;
  border-right: 1px solid #cbd6dc;
  border-radius: 0;
  padding: 8px 12px;
  background: transparent;
  color: #41505f;
  font-weight: 900;
}

.official-selection-side-tabs button:last-child {
  border-right: 0;
}

.official-selection-side-tabs button[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, #c58b00, #e0ad18);
}

#listSection.is-official-selection-table .list-heading,
#listSection.is-official-selection-table > .sort-hint,
#listSection.is-official-selection-table > .star-note,
#listSection.is-official-selection-table > .list-color-depth-hint,
#listSection.is-official-selection-table > .touch-table-hint {
  display: none;
}

#listSection.is-official-selection-table #listTableWrap {
  border-color: #d7e1e6;
}

#listSection.is-official-selection-table #listTableWrap table {
  width: 100%;
  table-layout: fixed;
}

#listSection.is-official-selection-table #listTableWrap col[data-list-column="stock"] { width: 16%; }
#listSection.is-official-selection-table #listTableWrap col[data-list-column="close"] { width: 8%; }
#listSection.is-official-selection-table #listTableWrap col[data-list-column="change"] { width: 9%; }
#listSection.is-official-selection-table #listTableWrap col[data-list-column="pb"] { width: 8%; }
#listSection.is-official-selection-table #listTableWrap col[data-list-column="tdcc-holders"] { width: 11%; }
#listSection.is-official-selection-table #listTableWrap col[data-list-column="tdcc-ratio"] { width: 11%; }
#listSection.is-official-selection-table #listTableWrap col[data-list-column="constitution"] { width: 10%; }
#listSection.is-official-selection-table #listTableWrap col[data-list-column="advantage"] { width: 9%; }
#listSection.is-official-selection-table #listTableWrap col[data-list-column="stars"] { width: 8%; }
#listSection.is-official-selection-table #listTableWrap col[data-list-column="detail"] { width: 10%; }

#listSection.is-official-selection-table #listTableWrap [data-list-column="close"],
#listSection.is-official-selection-table #listTableWrap [data-list-column="change"],
#listSection.is-official-selection-table #listTableWrap [data-list-column="pb"],
#listSection.is-official-selection-table #listTableWrap [data-list-column="tdcc-holders"],
#listSection.is-official-selection-table #listTableWrap [data-list-column="tdcc-ratio"],
#listSection.is-official-selection-table #listTableWrap [data-list-column="constitution"],
#listSection.is-official-selection-table #listTableWrap [data-list-column="advantage"] {
  text-align: right;
}

@media (max-width: 720px) {
  #loginView > .market-verdict-hero { order: 1; }
  #loginView > .official-selection-home { order: 2; }
  #loginView > .brand-copy { order: 3; }
  #loginView > .hero-entry-card { order: 4; }
  #loginView > .full-selection-entry { order: 5; }
  #loginView > #trendRadarSection { order: 6; }
  #loginView > .market-explanation-section { order: 7; }
  #loginView > .live-market-strip { order: 8; }

  .official-selection-home {
    gap: 10px;
    margin-top: 0;
    padding: 13px;
  }

  .official-selection-home-grid {
    gap: 8px;
  }

  .official-selection-summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 72px;
    gap: 1px 7px;
    padding: 9px;
  }

  .official-selection-summary > span {
    width: 31px;
    height: 31px;
    font-size: 21px;
  }

  .official-selection-summary > strong {
    font-size: 16px;
  }

  .official-selection-summary > small {
    font-size: 11px;
  }

  body.official-selection-open .query-panel > .topbar,
  body.official-selection-open .query-panel > .mobile-category-nav,
  body.official-selection-history-open .query-panel > .topbar,
  body.official-selection-history-open .query-panel > .mobile-category-nav {
    display: none;
  }

  body.official-selection-open .query-panel,
  body.official-selection-history-open .query-panel {
    border: 0;
    border-radius: 0;
    padding: 12px 10px;
    box-shadow: none;
  }

  .official-selection-toolbar,
  .official-selection-history {
    min-width: 0;
  }

  .official-selection-toolbar-heading,
  .official-selection-page-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
  }

  .official-selection-toolbar-heading .eyebrow,
  .official-selection-page-header .eyebrow {
    display: none;
  }

  .official-selection-toolbar-heading h2,
  .official-selection-page-header h2 {
    font-size: 21px;
  }

  .official-selection-date-stack {
    font-size: 12px;
  }

  .official-selection-toolbar-heading > button,
  .official-selection-page-header > button {
    min-height: 38px;
    padding: 6px 9px;
    font-size: 13px;
  }

  .official-selection-side-tabs button {
    min-height: 42px;
  }

  .official-selection-history-picker {
    grid-template-columns: 1fr;
    width: 100%;
    gap: 6px;
  }

  .official-selection-history-picker select {
    width: 100%;
  }

  #listSection.is-official-selection-table #listTableWrap :is(th, td):nth-child(n + 8) {
    display: none;
  }

  #listSection.is-official-selection-table #listTableWrap table {
    min-width: 760px;
  }
}

@media (orientation: landscape) and (max-width: 932px) and (max-height: 600px) {
  body.official-selection-open:not(.mobile-chips-stock-detail-open) .official-selection-toolbar {
    position: fixed;
    top: var(--floating-vv-top-shift, 0px);
    left: var(--floating-vv-left, 0px);
    z-index: 1410;
    grid-template-columns: auto minmax(240px, 1fr) auto;
    width: var(--floating-vv-width, 100vw);
    height: 54px;
    margin: 0;
    border: 0;
    border-bottom: 1px solid #d7e1e6;
    padding: 6px max(10px, env(safe-area-inset-right, 0px)) 6px max(10px, env(safe-area-inset-left, 0px));
    background: #fff;
    box-shadow: 0 4px 14px rgba(31, 48, 59, 0.1);
  }

  body.official-selection-open .official-selection-toolbar-heading {
    display: flex;
  }

  body.official-selection-open .official-selection-toolbar-heading > div,
  body.official-selection-open .official-selection-toolbar .official-selection-mock-note {
    display: none;
  }

  body.official-selection-open .official-selection-date-stack {
    margin-left: 0;
  }

  body.official-selection-open .official-selection-side-tabs {
    min-width: 240px;
  }

  body.official-selection-open .official-selection-side-tabs button {
    min-height: 40px;
    padding: 5px 12px;
  }

  body.official-selection-open #listSection.is-official-selection-table #listTableWrap.is-table-focus {
    top: calc(var(--floating-vv-top-shift, 0px) + 54px) !important;
    height: calc(var(--floating-vv-height, 100dvh) - 54px) !important;
    max-height: calc(var(--floating-vv-height, 100dvh) - 54px) !important;
  }

  body.official-selection-open #listSection.is-official-selection-table #listTableWrap :is(th, td):nth-child(n + 8) {
    display: table-cell;
  }
}

@media (min-width: 721px) and (max-width: 1366px) {
  .official-selection-history,
  #listSection.is-official-selection-table {
    max-width: 1120px;
    margin-inline: auto;
  }

  #listSection.is-official-selection-table #listTableWrap table {
    min-width: 1040px;
  }
}

@media (min-width: 1100px) {
  .official-selection-history,
  #listSection.is-official-selection-table {
    max-width: 1180px;
    margin-inline: auto;
  }

  #listSection.is-official-selection-table #listTableWrap table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }
}

@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  body.official-selection-open .query-panel > .feature-overview {
    display: none;
  }
}
